mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 23:17:27 +00:00
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:
committed by
Wouter van Oortmerssen
parent
b701c7d56e
commit
f9ebfcb9c4
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user