Browse Source

Fix offset type to match the tables it is used in

Alex Merry 8 years ago
parent
commit
e82d81a884
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/google/protobuf/generated_message_util.h

+ 1 - 1
src/google/protobuf/generated_message_util.h

@@ -100,7 +100,7 @@ namespace internal {
 // choose 16 rather than some other number just in case the compiler would
 // choose 16 rather than some other number just in case the compiler would
 // be confused by an unaligned pointer.
 // be confused by an unaligned pointer.
 #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD)  \
 #define GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TYPE, FIELD)  \
-  static_cast<int>(                                                  \
+  static_cast<::google::protobuf::uint32>(                           \
       reinterpret_cast<const char*>(                                 \
       reinterpret_cast<const char*>(                                 \
           &reinterpret_cast<const TYPE*>(16)->FIELD) -               \
           &reinterpret_cast<const TYPE*>(16)->FIELD) -               \
       reinterpret_cast<const char*>(16))
       reinterpret_cast<const char*>(16))