From 151ebc8a2925bca5210ac447156a6a783f1d9337 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Fri, 19 Apr 2019 16:19:57 -0700 Subject: Fixed oneof case accessor to cast to enum for C++. --- upbc/generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'upbc') 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))); -- cgit v1.2.3