diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2018-11-26 13:38:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-26 13:38:36 -0800 |
commit | 22be93286395b6e75e2ff3f1cc8280376c6c53ca (patch) | |
tree | 2b6bf5e8656b8c92dd38629e3c7d7c378a2f4290 /upbc/generator.cc | |
parent | cb113bc8ccbf4357d4a3a43c8d1592d9f40bd70d (diff) | |
parent | f6c33307c4a708a07994d7ee01ffa1794575861d (diff) |
Merge pull request #135 from vishalpowar/cast_correct
Explicit cast when creating a new struct
Diffstat (limited to 'upbc/generator.cc')
-rw-r--r-- | upbc/generator.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/upbc/generator.cc b/upbc/generator.cc index 56e6276..0f7d14d 100644 --- a/upbc/generator.cc +++ b/upbc/generator.cc @@ -292,7 +292,7 @@ void GenerateMessageInHeader(const protobuf::Descriptor* message, Output& output output( "extern const upb_msglayout $0_msginit;\n" "UPB_INLINE $0 *$0_new(upb_arena *arena) {\n" - " return upb_msg_new(&$0_msginit, arena);\n" + " return ($0 *)upb_msg_new(&$0_msginit, arena);\n" "}\n" "UPB_INLINE $0 *$0_parsenew(upb_stringview buf, upb_arena *arena) {\n" " $0 *ret = $0_new(arena);\n" |