aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Adam Cozzette <acozzette@gmail.com>2016-12-09 13:45:18 -0800
committerGravatar GitHub <noreply@github.com>2016-12-09 13:45:18 -0800
commit84948462a470c5433addc0494e6854be47ab5e4f (patch)
treeb09a498138d166c81b2858c592750c7a3d26a943
parentdc119405683c578fd38129cbef3a66e1fd60938c (diff)
parente19f3b5e3a32642073cd075e6b9ddabd7c0eedf5 (diff)
Merge pull request #2476 from acozzette/generated-message-reflection-fix
Use uint32 in GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET macro
-rw-r--r--src/google/protobuf/generated_message_reflection.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h
index ea97a7c8..2633ab62 100644
--- a/src/google/protobuf/generated_message_reflection.h
+++ b/src/google/protobuf/generated_message_reflection.h
@@ -660,14 +660,14 @@ class LIBPROTOBUF_EXPORT GeneratedMessageReflection PROTOBUF_FINAL : public Refl
// choose 16 rather than some other number just in case the compiler would
// be confused by an unaligned pointer.
#define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD) \
- static_cast<int>( \
- reinterpret_cast<const char*>( \
- &reinterpret_cast<const TYPE*>(16)->FIELD) - \
+ static_cast< ::google::protobuf::uint32>( \
+ reinterpret_cast<const char*>( \
+ &reinterpret_cast<const TYPE*>(16)->FIELD) - \
reinterpret_cast<const char*>(16))
#endif
#define PROTO2_GENERATED_DEFAULT_ONEOF_FIELD_OFFSET(ONEOF, FIELD) \
- static_cast< ::google::protobuf::uint32>( \
+ static_cast< ::google::protobuf::uint32>( \
reinterpret_cast<const char*>(&(ONEOF->FIELD)) \
- reinterpret_cast<const char*>(ONEOF))