THRIFT-916: Commit THRIFT-916_fix_no-overflow.patch -- remove overflow coming from a few constants.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1039885 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/protocol/TCompactProtocol.h b/lib/cpp/src/protocol/TCompactProtocol.h
index 19a0160..c4d1f08 100644
--- a/lib/cpp/src/protocol/TCompactProtocol.h
+++ b/lib/cpp/src/protocol/TCompactProtocol.h
@@ -35,10 +35,10 @@
: public TVirtualProtocol< TCompactProtocolT<Transport_> > {
protected:
- static const int8_t PROTOCOL_ID = 0x82;
+ static const int8_t PROTOCOL_ID = (int8_t)0x82;
static const int8_t VERSION_N = 1;
static const int8_t VERSION_MASK = 0x1f; // 0001 1111
- static const int8_t TYPE_MASK = 0xE0; // 1110 0000
+ static const int8_t TYPE_MASK = (int8_t)0xE0; // 1110 0000
static const int32_t TYPE_SHIFT_AMOUNT = 5;
Transport_* trans_;
diff --git a/lib/cpp/test/Benchmark.cpp b/lib/cpp/test/Benchmark.cpp
index a9859d8..f4cd392 100644
--- a/lib/cpp/test/Benchmark.cpp
+++ b/lib/cpp/test/Benchmark.cpp
@@ -56,7 +56,7 @@
OneOfEach ooe;
ooe.im_true = true;
ooe.im_false = false;
- ooe.a_bite = 0xd6;
+ ooe.a_bite = 0x7f;
ooe.integer16 = 27000;
ooe.integer32 = 1<<24;
ooe.integer64 = (uint64_t)6000 * 1000 * 1000;
diff --git a/lib/cpp/test/DebugProtoTest.cpp b/lib/cpp/test/DebugProtoTest.cpp
index ed23d1a..4f456f3 100644
--- a/lib/cpp/test/DebugProtoTest.cpp
+++ b/lib/cpp/test/DebugProtoTest.cpp
@@ -31,7 +31,7 @@
OneOfEach ooe;
ooe.im_true = true;
ooe.im_false = false;
- ooe.a_bite = 0xd6;
+ ooe.a_bite = 0x7f;
ooe.integer16 = 27000;
ooe.integer32 = 1<<24;
ooe.integer64 = (uint64_t)6000 * 1000 * 1000;
diff --git a/lib/cpp/test/JSONProtoTest.cpp b/lib/cpp/test/JSONProtoTest.cpp
index 2479638..a9268a2 100644
--- a/lib/cpp/test/JSONProtoTest.cpp
+++ b/lib/cpp/test/JSONProtoTest.cpp
@@ -33,7 +33,7 @@
OneOfEach ooe;
ooe.im_true = true;
ooe.im_false = false;
- ooe.a_bite = 0xd6;
+ ooe.a_bite = 0x7f;
ooe.integer16 = 27000;
ooe.integer32 = 1<<24;
ooe.integer64 = (uint64_t)6000 * 1000 * 1000;
@@ -123,7 +123,7 @@
assert(hm == hm2);
- hm2.big[0].a_bite = 0xFF;
+ hm2.big[0].a_bite = 0x00;
assert(hm != hm2);
diff --git a/lib/cpp/test/SpecializationTest.cpp b/lib/cpp/test/SpecializationTest.cpp
index 954585a..fae1d32 100644
--- a/lib/cpp/test/SpecializationTest.cpp
+++ b/lib/cpp/test/SpecializationTest.cpp
@@ -18,7 +18,7 @@
OneOfEach ooe;
ooe.im_true = true;
ooe.im_false = false;
- ooe.a_bite = 0xd6;
+ ooe.a_bite = 0x7f;
ooe.integer16 = 27000;
ooe.integer32 = 1<<24;
ooe.integer64 = (uint64_t)6000 * 1000 * 1000;
@@ -100,7 +100,7 @@
assert(hm == hm2);
- hm2.big[0].a_bite = 0xFF;
+ hm2.big[0].a_bite = 0x00;
assert(hm != hm2);