From 3fc5387db79612981b41b86cd89f315269d54f3f Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Mon, 30 Nov 2015 13:54:24 -0800 Subject: Made C++ generated code use "bool" instead of uint8_t wire type. Change-Id: I5756d15a758429ca67456264842017063d1f755e Tested: on Linux. --- tests/monster_test_generated.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/monster_test_generated.h b/tests/monster_test_generated.h index 9ef76597..8a78de53 100644 --- a/tests/monster_test_generated.h +++ b/tests/monster_test_generated.h @@ -202,8 +202,8 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { const MyGame::Example::Monster *testnestedflatbuffer_nested_root() const { return flatbuffers::GetRoot(testnestedflatbuffer()->Data()); } const Stat *testempty() const { return GetPointer(32); } Stat *mutable_testempty() { return GetPointer(32); } - uint8_t testbool() const { return GetField(34, 0); } - bool mutate_testbool(uint8_t _testbool) { return SetField(34, _testbool); } + bool testbool() const { return static_cast(GetField(34, 0)); } + bool mutate_testbool(bool _testbool) { return SetField(34, static_cast(_testbool)); } int32_t testhashs32_fnv1() const { return GetField(36, 0); } bool mutate_testhashs32_fnv1(int32_t _testhashs32_fnv1) { return SetField(36, _testhashs32_fnv1); } uint32_t testhashu32_fnv1() const { return GetField(38, 0); } @@ -281,7 +281,7 @@ struct MonsterBuilder { void add_enemy(flatbuffers::Offset enemy) { fbb_.AddOffset(28, enemy); } void add_testnestedflatbuffer(flatbuffers::Offset> testnestedflatbuffer) { fbb_.AddOffset(30, testnestedflatbuffer); } void add_testempty(flatbuffers::Offset testempty) { fbb_.AddOffset(32, testempty); } - void add_testbool(uint8_t testbool) { fbb_.AddElement(34, testbool, 0); } + void add_testbool(bool testbool) { fbb_.AddElement(34, static_cast(testbool), 0); } void add_testhashs32_fnv1(int32_t testhashs32_fnv1) { fbb_.AddElement(36, testhashs32_fnv1, 0); } void add_testhashu32_fnv1(uint32_t testhashu32_fnv1) { fbb_.AddElement(38, testhashu32_fnv1, 0); } void add_testhashs64_fnv1(int64_t testhashs64_fnv1) { fbb_.AddElement(40, testhashs64_fnv1, 0); } @@ -315,7 +315,7 @@ inline flatbuffers::Offset CreateMonster(flatbuffers::FlatBufferBuilder flatbuffers::Offset enemy = 0, flatbuffers::Offset> testnestedflatbuffer = 0, flatbuffers::Offset testempty = 0, - uint8_t testbool = 0, + bool testbool = false, int32_t testhashs32_fnv1 = 0, uint32_t testhashu32_fnv1 = 0, int64_t testhashs64_fnv1 = 0, -- cgit v1.2.3