Merge pull request #595 from r-barnes/richard/ctr_type_fix

Change counter type to uint64
This commit is contained in:
Sergiu Deitsch 2021-03-31 09:43:14 +02:00 committed by GitHub
commit 7f8a48b3bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {
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]".

View File

@ -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) {
}

View File

@ -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]".