Make Monster's Color unsigned (#5318)

- update C++ monster_test::Color to unsigned type
- update Go Color:ubyte in the go_test.go
- add workaround for unsigned enum in java test
- sync generate.bat and generate.sh
This commit is contained in:
Vladimir Glavnyy
2019-05-10 00:07:38 +07:00
committed by Wouter van Oortmerssen
parent b701c7d56e
commit f9ebfcb9c4
37 changed files with 177 additions and 159 deletions

View File

@@ -69,7 +69,7 @@ end
function Monster_mt:Color()
local o = self.view:Offset(16)
if o ~= 0 then
return self.view:Get(flatbuffers.N.Int8, o + self.view.pos)
return self.view:Get(flatbuffers.N.Uint8, o + self.view.pos)
end
return 8
end
@@ -511,7 +511,7 @@ function Monster_mt:VectorOfEnums(j)
local o = self.view:Offset(98)
if o ~= 0 then
local a = self.view:Vector(o)
return self.view:Get(flatbuffers.N.Int8, a + ((j-1) * 1))
return self.view:Get(flatbuffers.N.Uint8, a + ((j-1) * 1))
end
return 0
end
@@ -529,7 +529,7 @@ function Monster.AddHp(builder, hp) builder:PrependInt16Slot(2, hp, 100) end
function Monster.AddName(builder, name) builder:PrependUOffsetTRelativeSlot(3, name, 0) end
function Monster.AddInventory(builder, inventory) builder:PrependUOffsetTRelativeSlot(5, inventory, 0) end
function Monster.StartInventoryVector(builder, numElems) return builder:StartVector(1, numElems, 1) end
function Monster.AddColor(builder, color) builder:PrependInt8Slot(6, color, 8) end
function Monster.AddColor(builder, color) builder:PrependUint8Slot(6, color, 8) end
function Monster.AddTestType(builder, testType) builder:PrependUint8Slot(7, testType, 0) end
function Monster.AddTest(builder, test) builder:PrependUOffsetTRelativeSlot(8, test, 0) end
function Monster.AddTest4(builder, test4) builder:PrependUOffsetTRelativeSlot(9, test4, 0) end