summaryrefslogtreecommitdiff
path: root/upbc
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-04-19 16:19:57 -0700
committerJoshua Haberman <jhaberman@gmail.com>2019-04-19 16:19:57 -0700
commit151ebc8a2925bca5210ac447156a6a783f1d9337 (patch)
tree15ff3f0b9d15dc18cd56ffd637f9d177e887a60d /upbc
parentcf35baa1ad70f0dca734f93bcc2b54d8d059bcdd (diff)
Fixed oneof case accessor to cast to enum for C++.
Diffstat (limited to 'upbc')
-rw-r--r--upbc/generator.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/upbc/generator.cc b/upbc/generator.cc
index 2760069..5843597 100644
--- a/upbc/generator.cc
+++ b/upbc/generator.cc
@@ -362,7 +362,7 @@ void GenerateMessageInHeader(const protobuf::Descriptor* message, Output& output
fullname);
output(
"UPB_INLINE $0_oneofcases $1_$2_case(const $1* msg) { "
- "return UPB_FIELD_AT(msg, int, $3); }\n"
+ "return ($0_oneofcases)UPB_FIELD_AT(msg, int32_t, $3); }\n"
"\n",
fullname, msgname, oneof->name(),
GetSizeInit(layout.GetOneofCaseOffset(oneof)));
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback