From 8a4c1663e32133cd0e1f275c32f4dd1ba701a61d Mon Sep 17 00:00:00 2001 From: Date: Thu, 29 Dec 2011 12:40:48 +0000 Subject: [PATCH] Make public headers "warnings clean" in the sense of -Wall -Wextra -Wshadow -Werror. Fixes issue 98. git-svn-id: https://google-glog.googlecode.com/svn/trunk@100 eb4d4688-79bd-11dd-afb4-1d65580434c0 --- src/glog/logging.h.in | 6 +++--- src/glog/raw_logging.h.in | 2 +- src/windows/glog/logging.h | 22 +++++++++++----------- src/windows/glog/raw_logging.h | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in index 4356552..57e4a7d 100644 --- a/src/glog/logging.h.in +++ b/src/glog/logging.h.in @@ -1015,14 +1015,14 @@ public: # pragma warning(default: 4275) #endif public: - LogStream(char *buf, int len, int ctr) + LogStream(char *buf, int len, int ctr_in) : ostrstream(buf, len), - ctr_(ctr) { + ctr_(ctr_in) { self_ = this; } int ctr() const { return ctr_; } - void set_ctr(int ctr) { ctr_ = ctr; } + void set_ctr(int ctr_in) { ctr_ = ctr_in; } LogStream* self() const { return self_; } private: diff --git a/src/glog/raw_logging.h.in b/src/glog/raw_logging.h.in index 5378cd4..702b646 100644 --- a/src/glog/raw_logging.h.in +++ b/src/glog/raw_logging.h.in @@ -162,7 +162,7 @@ // Stub log function used to work around for unused variable warnings when // building with STRIP_LOG > 0. -static inline void RawLogStub__(int ignored, ...) { +static inline void RawLogStub__(int /* ignored */, ...) { } // Helper function to implement RAW_LOG and RAW_VLOG diff --git a/src/windows/glog/logging.h b/src/windows/glog/logging.h index 7a6df74..74c332a 100755 --- a/src/windows/glog/logging.h +++ b/src/windows/glog/logging.h @@ -156,21 +156,21 @@ typedef unsigned __int64 uint64; // You can also do occasional logging (log every n'th occurrence of an // event): // -// LOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie"; +// LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; // // The above will cause log messages to be output on the 1st, 11th, 21st, ... -// times it is executed. Note that the special COUNTER value is used to -// identify which repetition is happening. +// times it is executed. Note that the special google::COUNTER value is used +// to identify which repetition is happening. // // You can also do occasional conditional logging (log every n'th // occurrence of an event, when condition is satisfied): // -// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << COUNTER +// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER // << "th big cookie"; // // You can log messages the first N times your code executes a line. E.g. // -// LOG_FIRST_N(INFO, 20) << "Got the " << COUNTER << "th cookie"; +// LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie"; // // Outputs log messages for the first 20 times it is executed. // @@ -187,7 +187,7 @@ typedef unsigned __int64 uint64; // // DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; // -// DLOG_EVERY_N(INFO, 10) << "Got the " << COUNTER << "th cookie"; +// DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; // // All "debug mode" logging is compiled away to nothing for non-debug mode // compiles. @@ -231,11 +231,11 @@ typedef unsigned __int64 uint64; // "program with --v=1 or more"; // VLOG_EVERY_N(1, 10) // << "I'm printed every 10th occurrence, and when you run the program " -// "with --v=1 or more. Present occurence is " << COUNTER; +// "with --v=1 or more. Present occurence is " << google::COUNTER; // VLOG_IF_EVERY_N(1, (size > 1024), 10) // << "I'm printed on every 10th occurence of case when size is more " // " than 1024, when you run the program with --v=1 or more. "; -// "Present occurence is " << COUNTER; +// "Present occurence is " << google::COUNTER; // // The supported severity levels for macros that allow you to specify one // are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL. @@ -1019,14 +1019,14 @@ public: # pragma warning(default: 4275) #endif public: - LogStream(char *buf, int len, int ctr) + LogStream(char *buf, int len, int ctr_in) : ostrstream(buf, len), - ctr_(ctr) { + ctr_(ctr_in) { self_ = this; } int ctr() const { return ctr_; } - void set_ctr(int ctr) { ctr_ = ctr; } + void set_ctr(int ctr_in) { ctr_ = ctr_in; } LogStream* self() const { return self_; } private: diff --git a/src/windows/glog/raw_logging.h b/src/windows/glog/raw_logging.h index c81e67b..e14fb41 100755 --- a/src/windows/glog/raw_logging.h +++ b/src/windows/glog/raw_logging.h @@ -166,7 +166,7 @@ namespace google { // Stub log function used to work around for unused variable warnings when // building with STRIP_LOG > 0. -static inline void RawLogStub__(int ignored, ...) { +static inline void RawLogStub__(int /* ignored */, ...) { } // Helper function to implement RAW_LOG and RAW_VLOG -- 2.7.4