From bf3e5a80ae4e32ee7f6f4ca32f355f071b7fdc1e Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Thu, 15 Oct 2020 13:32:47 -0600 Subject: [PATCH] Change counter type to uint64 --- src/glog/logging.h.in | 12 ++++++------ src/logging.cc | 4 ++-- src/windows/glog/logging.h | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in index 5a7fc4b..c944354 100644 --- a/src/glog/logging.h.in +++ b/src/glog/logging.h.in @@ -1309,7 +1309,7 @@ GLOG_MSVC_PUSH_DISABLE_WARNING(4275) class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream { GLOG_MSVC_POP_WARNING() public: - LogStream(char *buf, int len, int ctr) + LogStream(char *buf, int len, uint64 ctr) : std::ostream(NULL), streambuf_(buf, len), ctr_(ctr), @@ -1317,8 +1317,8 @@ GLOG_MSVC_POP_WARNING() rdbuf(&streambuf_); } - int ctr() const { return ctr_; } - void set_ctr(int ctr) { ctr_ = ctr; } + uint64 ctr() const { return ctr_; } + void set_ctr(uint64 ctr) { ctr_ = ctr; } LogStream* self() const { return self_; } // Legacy std::streambuf methods. @@ -1330,7 +1330,7 @@ GLOG_MSVC_POP_WARNING() LogStream(const LogStream&); LogStream& operator=(const LogStream&); 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 }; @@ -1338,7 +1338,7 @@ public: // icc 8 requires this typedef to avoid an internal compiler error. 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); // 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 { 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)()); // Postpends ": strerror(errno) [errno]". diff --git a/src/logging.cc b/src/logging.cc index 7bfc4dd..4774a04 100644 --- a/src/logging.cc +++ b/src/logging.cc @@ -1480,7 +1480,7 @@ LogMessage::LogMessageData::LogMessageData() } LogMessage::LogMessage(const char* file, int line, LogSeverity severity, - int ctr, void (LogMessage::*send_method)()) + uint64 ctr, void (LogMessage::*send_method)()) : allocated_(NULL) { Init(file, line, severity, send_method); data_->stream_.set_ctr(ctr); @@ -1978,7 +1978,7 @@ ostream& operator<<(ostream &os, const PRIVATE_Counter&) { } ErrnoLogMessage::ErrnoLogMessage(const char* file, int line, - LogSeverity severity, int ctr, + LogSeverity severity, uint64 ctr, void (LogMessage::*send_method)()) : LogMessage(file, line, severity, ctr, send_method) { } diff --git a/src/windows/glog/logging.h b/src/windows/glog/logging.h index 0b4241b..b8704c1 100755 --- a/src/windows/glog/logging.h +++ b/src/windows/glog/logging.h @@ -1173,7 +1173,7 @@ GLOG_MSVC_PUSH_DISABLE_WARNING(4275) class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream { GLOG_MSVC_POP_WARNING() public: - LogStream(char *buf, int len, int ctr) + LogStream(char *buf, int len, uint64 ctr) : std::ostream(NULL), streambuf_(buf, len), ctr_(ctr), @@ -1181,8 +1181,8 @@ GLOG_MSVC_POP_WARNING() rdbuf(&streambuf_); } - int ctr() const { return ctr_; } - void set_ctr(int ctr) { ctr_ = ctr; } + uint64 ctr() const { return ctr_; } + void set_ctr(uint64 ctr) { ctr_ = ctr; } LogStream* self() const { return self_; } // Legacy std::streambuf methods. @@ -1194,7 +1194,7 @@ GLOG_MSVC_POP_WARNING() LogStream(const LogStream&); LogStream& operator=(const LogStream&); 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 }; @@ -1202,7 +1202,7 @@ public: // icc 8 requires this typedef to avoid an internal compiler error. 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); // 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 { 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)()); // Postpends ": strerror(errno) [errno]".