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

@@ -29,20 +29,20 @@ func (rcv *TestSimpleTableWithEnum) Table() flatbuffers.Table {
func (rcv *TestSimpleTableWithEnum) Color() Color {
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
if o != 0 {
return rcv._tab.GetInt8(o + rcv._tab.Pos)
return rcv._tab.GetByte(o + rcv._tab.Pos)
}
return 2
}
func (rcv *TestSimpleTableWithEnum) MutateColor(n Color) bool {
return rcv._tab.MutateInt8Slot(4, n)
return rcv._tab.MutateByteSlot(4, n)
}
func TestSimpleTableWithEnumStart(builder *flatbuffers.Builder) {
builder.StartObject(1)
}
func TestSimpleTableWithEnumAddColor(builder *flatbuffers.Builder, color int8) {
builder.PrependInt8Slot(0, color, 2)
func TestSimpleTableWithEnumAddColor(builder *flatbuffers.Builder, color byte) {
builder.PrependByteSlot(0, color, 2)
}
func TestSimpleTableWithEnumEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
return builder.EndObject()