Fixed compiler warnings for cast to bool in generated code.

Change-Id: I7727aeb478feb23d8ef66fd1ba9499b142b3ea7d
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2015-12-09 12:56:24 -08:00
parent 42b48bd55f
commit 6fba6b6e71
2 changed files with 11 additions and 6 deletions

View File

@@ -236,7 +236,7 @@ struct Monster FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
const MyGame::Example::Monster *testnestedflatbuffer_nested_root() const { return flatbuffers::GetRoot<MyGame::Example::Monster>(testnestedflatbuffer()->Data()); }
const Stat *testempty() const { return GetPointer<const Stat *>(VT_TESTEMPTY); }
Stat *mutable_testempty() { return GetPointer<Stat *>(VT_TESTEMPTY); }
bool testbool() const { return static_cast<bool>(GetField<uint8_t>(VT_TESTBOOL, 0)); }
bool testbool() const { return GetField<uint8_t>(VT_TESTBOOL, 0) != 0; }
bool mutate_testbool(bool _testbool) { return SetField(VT_TESTBOOL, static_cast<uint8_t>(_testbool)); }
int32_t testhashs32_fnv1() const { return GetField<int32_t>(VT_TESTHASHS32_FNV1, 0); }
bool mutate_testhashs32_fnv1(int32_t _testhashs32_fnv1) { return SetField(VT_TESTHASHS32_FNV1, _testhashs32_fnv1); }