THRIFT-225. java/cpp: Handle non-i32 integer constants properly
authorDavid Reiss <dreiss@apache.org>
Tue, 16 Dec 2008 20:28:13 +0000 (20:28 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 16 Dec 2008 20:28:13 +0000 (20:28 +0000)
commita8efac862a847ea4c2c2983704ef875a12f92080
tree275f2565fca3c99d4f691ee54ac921ae8ac45b2f
parent083c07a26579e685bd62b085471f8720ef0aa822
THRIFT-225. java/cpp: Handle non-i32 integer constants properly

Java generates a warning when converting from an integer constant
to a byte or short without an explicit cast.  This change adds a
cast to byte and short literals in Java.

Both Java and C++ fail to compile integer literals larger than 2^31
unless they are decorated with "L" (for Java) or "LL" (for g++).
This change adds the appropriate decorations.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@727130 13f79535-47bb-0310-9956-ffa450edef68
compiler/cpp/src/generate/t_cpp_generator.cc
compiler/cpp/src/generate/t_java_generator.cc
test/DebugProtoTest.thrift