Change counter type to uint64

This commit is contained in:
Richard Barnes 2020-10-15 13:32:47 -06:00 committed by Sergiu Deitsch
parent 7a6e743eb6
commit bf3e5a80ae
3 changed files with 14 additions and 14 deletions

View File

@ -1309,7 +1309,7 @@ GLOG_MSVC_PUSH_DISABLE_WARNING(4275)
class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream { class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream {
GLOG_MSVC_POP_WARNING() GLOG_MSVC_POP_WARNING()
public: public:
LogStream(char *buf, int len, int ctr) LogStream(char *buf, int len, uint64 ctr)
: std::ostream(NULL), : std::ostream(NULL),
streambuf_(buf, len), streambuf_(buf, len),
ctr_(ctr), ctr_(ctr),
@ -1317,8 +1317,8 @@ GLOG_MSVC_POP_WARNING()
rdbuf(&streambuf_); rdbuf(&streambuf_);
} }
int ctr() const { return ctr_; } uint64 ctr() const { return ctr_; }
void set_ctr(int ctr) { ctr_ = ctr; } void set_ctr(uint64 ctr) { ctr_ = ctr; }
LogStream* self() const { return self_; } LogStream* self() const { return self_; }
// Legacy std::streambuf methods. // Legacy std::streambuf methods.
@ -1330,7 +1330,7 @@ GLOG_MSVC_POP_WARNING()
LogStream(const LogStream&); LogStream(const LogStream&);
LogStream& operator=(const LogStream&); LogStream& operator=(const LogStream&);
base_logging::LogStreamBuf streambuf_; base_logging::LogStreamBuf streambuf_;
int ctr_; // Counter hack (for the LOG_EVERY_X() macro) uint64 ctr_; // Counter hack (for the LOG_EVERY_X() macro)
LogStream *self_; // Consistency check hack LogStream *self_; // Consistency check hack
}; };
@ -1338,7 +1338,7 @@ public:
// icc 8 requires this typedef to avoid an internal compiler error. // icc 8 requires this typedef to avoid an internal compiler error.
typedef void (LogMessage::*SendMethod)(); typedef void (LogMessage::*SendMethod)();
LogMessage(const char* file, int line, LogSeverity severity, int ctr, LogMessage(const char* file, int line, LogSeverity severity, uint64 ctr,
SendMethod send_method); SendMethod send_method);
// Two special constructors that generate reduced amounts of code at // Two special constructors that generate reduced amounts of code at
@ -1509,7 +1509,7 @@ GOOGLE_GLOG_DLL_DECL std::ostream& operator<<(std::ostream &os,
class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage { class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage {
public: public:
ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr, ErrnoLogMessage(const char* file, int line, LogSeverity severity, uint64 ctr,
void (LogMessage::*send_method)()); void (LogMessage::*send_method)());
// Postpends ": strerror(errno) [errno]". // Postpends ": strerror(errno) [errno]".

View File

@ -1480,7 +1480,7 @@ LogMessage::LogMessageData::LogMessageData()
} }
LogMessage::LogMessage(const char* file, int line, LogSeverity severity, LogMessage::LogMessage(const char* file, int line, LogSeverity severity,
int ctr, void (LogMessage::*send_method)()) uint64 ctr, void (LogMessage::*send_method)())
: allocated_(NULL) { : allocated_(NULL) {
Init(file, line, severity, send_method); Init(file, line, severity, send_method);
data_->stream_.set_ctr(ctr); data_->stream_.set_ctr(ctr);
@ -1978,7 +1978,7 @@ ostream& operator<<(ostream &os, const PRIVATE_Counter&) {
} }
ErrnoLogMessage::ErrnoLogMessage(const char* file, int line, ErrnoLogMessage::ErrnoLogMessage(const char* file, int line,
LogSeverity severity, int ctr, LogSeverity severity, uint64 ctr,
void (LogMessage::*send_method)()) void (LogMessage::*send_method)())
: LogMessage(file, line, severity, ctr, send_method) { : LogMessage(file, line, severity, ctr, send_method) {
} }

View File

@ -1173,7 +1173,7 @@ GLOG_MSVC_PUSH_DISABLE_WARNING(4275)
class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream { class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream {
GLOG_MSVC_POP_WARNING() GLOG_MSVC_POP_WARNING()
public: public:
LogStream(char *buf, int len, int ctr) LogStream(char *buf, int len, uint64 ctr)
: std::ostream(NULL), : std::ostream(NULL),
streambuf_(buf, len), streambuf_(buf, len),
ctr_(ctr), ctr_(ctr),
@ -1181,8 +1181,8 @@ GLOG_MSVC_POP_WARNING()
rdbuf(&streambuf_); rdbuf(&streambuf_);
} }
int ctr() const { return ctr_; } uint64 ctr() const { return ctr_; }
void set_ctr(int ctr) { ctr_ = ctr; } void set_ctr(uint64 ctr) { ctr_ = ctr; }
LogStream* self() const { return self_; } LogStream* self() const { return self_; }
// Legacy std::streambuf methods. // Legacy std::streambuf methods.
@ -1194,7 +1194,7 @@ GLOG_MSVC_POP_WARNING()
LogStream(const LogStream&); LogStream(const LogStream&);
LogStream& operator=(const LogStream&); LogStream& operator=(const LogStream&);
base_logging::LogStreamBuf streambuf_; base_logging::LogStreamBuf streambuf_;
int ctr_; // Counter hack (for the LOG_EVERY_X() macro) uint64 ctr_; // Counter hack (for the LOG_EVERY_X() macro)
LogStream *self_; // Consistency check hack LogStream *self_; // Consistency check hack
}; };
@ -1202,7 +1202,7 @@ public:
// icc 8 requires this typedef to avoid an internal compiler error. // icc 8 requires this typedef to avoid an internal compiler error.
typedef void (LogMessage::*SendMethod)(); typedef void (LogMessage::*SendMethod)();
LogMessage(const char* file, int line, LogSeverity severity, int ctr, LogMessage(const char* file, int line, LogSeverity severity, uint64 ctr,
SendMethod send_method); SendMethod send_method);
// Two special constructors that generate reduced amounts of code at // Two special constructors that generate reduced amounts of code at
@ -1373,7 +1373,7 @@ GOOGLE_GLOG_DLL_DECL std::ostream& operator<<(std::ostream &os,
class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage { class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage {
public: public:
ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr, ErrnoLogMessage(const char* file, int line, LogSeverity severity, uint64 ctr,
void (LogMessage::*send_method)()); void (LogMessage::*send_method)());
// Postpends ": strerror(errno) [errno]". // Postpends ": strerror(errno) [errno]".