From e6726e2150d027f1cf4000f264adc8c7ec045f00 Mon Sep 17 00:00:00 2001 From: "jieluo@google.com" Date: Wed, 23 Jul 2014 23:37:26 +0000 Subject: use decimal constants to avoid casting error with visual c /W4 "unary minus operator applied to unsigned type, result still unsigned" --- src/google/protobuf/compiler/cpp/cpp_helpers.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/google/protobuf/compiler/cpp/cpp_helpers.cc') diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/src/google/protobuf/compiler/cpp/cpp_helpers.cc index 2c94b3a9..9ee8b6ed 100644 --- a/src/google/protobuf/compiler/cpp/cpp_helpers.cc +++ b/src/google/protobuf/compiler/cpp/cpp_helpers.cc @@ -270,9 +270,9 @@ string Int64ToString(int64 number) { // gcc rejects the decimal form of kint64min if (number == kint64min) { // Make sure we are in a 2's complement system. - GOOGLE_COMPILE_ASSERT(kint64min == GOOGLE_LONGLONG(-0x8000000000000000), + GOOGLE_COMPILE_ASSERT(kint64min == GOOGLE_LONGLONG(~0x7fffffffffffffff), kint64min_value_error); - return "GOOGLE_LONGLONG(-0x8000000000000000)"; + return "GOOGLE_LONGLONG(~0x7fffffffffffffff)"; } return "GOOGLE_LONGLONG(" + SimpleItoa(number) + ")"; } -- cgit v1.2.3