aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google
diff options
context:
space:
mode:
authorGravatar xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-12-04 00:59:40 +0000
committerGravatar xiaofeng@google.com <xiaofeng@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2012-12-04 00:59:40 +0000
commiteaaef0b39b6710574db25a264cc4980e40f678ea (patch)
tree772fcdbbe6c323dcb6c424bd5274783182fb6181 /src/google
parentef9acc464db9c897e617e3d7b35f99bcb321b21a (diff)
Fix issues: 342, 424, 428, 430, 436
Diffstat (limited to 'src/google')
-rw-r--r--src/google/protobuf/stubs/common.cc2
-rw-r--r--src/google/protobuf/stubs/common_unittest.cc6
-rw-r--r--src/google/protobuf/wire_format.h3
3 files changed, 7 insertions, 4 deletions
diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc
index 16d78528..f4bb92dc 100644
--- a/src/google/protobuf/stubs/common.cc
+++ b/src/google/protobuf/stubs/common.cc
@@ -110,7 +110,7 @@ void DefaultLogHandler(LogLevel level, const char* filename, int line,
// We use fprintf() instead of cerr because we want this to work at static
// initialization time.
- fprintf(stderr, "libprotobuf %s %s:%d] %s\n",
+ fprintf(stderr, "[libprotobuf %s %s:%d] %s\n",
level_names[level], filename, line, message.c_str());
fflush(stderr); // Needed on MSVC.
}
diff --git a/src/google/protobuf/stubs/common_unittest.cc b/src/google/protobuf/stubs/common_unittest.cc
index 4109a52c..43cd6d01 100644
--- a/src/google/protobuf/stubs/common_unittest.cc
+++ b/src/google/protobuf/stubs/common_unittest.cc
@@ -94,9 +94,9 @@ TEST(LoggingTest, DefaultLogging) {
string text = GetCapturedTestStderr();
EXPECT_EQ(
- "libprotobuf INFO "__FILE__":" + SimpleItoa(line + 1) + "] A message.\n"
- "libprotobuf WARNING "__FILE__":" + SimpleItoa(line + 2) + "] A warning.\n"
- "libprotobuf ERROR "__FILE__":" + SimpleItoa(line + 3) + "] An error.\n",
+ "[libprotobuf INFO "__FILE__":" + SimpleItoa(line + 1) + "] A message.\n"
+ "[libprotobuf WARNING "__FILE__":" + SimpleItoa(line + 2) + "] A warning.\n"
+ "[libprotobuf ERROR "__FILE__":" + SimpleItoa(line + 3) + "] An error.\n",
text);
}
diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h
index 6c3f44a4..6cc90029 100644
--- a/src/google/protobuf/wire_format.h
+++ b/src/google/protobuf/wire_format.h
@@ -294,6 +294,9 @@ inline void WireFormat::VerifyUTF8String(const char* data, int size,
WireFormat::Operation op) {
#ifdef GOOGLE_PROTOBUF_UTF8_VALIDATION_ENABLED
WireFormat::VerifyUTF8StringFallback(data, size, op);
+#else
+ // Avoid the compiler warning about unsued variables.
+ (void)data; (void)size; (void)op;
#endif
}