mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-06 13:37:25 +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
@@ -107,12 +107,12 @@ class Monster extends Table
|
||||
}
|
||||
|
||||
/**
|
||||
* @return sbyte
|
||||
* @return byte
|
||||
*/
|
||||
public function getColor()
|
||||
{
|
||||
$o = $this->__offset(16);
|
||||
return $o != 0 ? $this->bb->getSbyte($o + $this->bb_pos) : \MyGame\Example\Color::Blue;
|
||||
return $o != 0 ? $this->bb->getByte($o + $this->bb_pos) : \MyGame\Example\Color::Blue;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -649,12 +649,12 @@ class Monster extends Table
|
||||
|
||||
/**
|
||||
* @param int offset
|
||||
* @return sbyte
|
||||
* @return byte
|
||||
*/
|
||||
public function getVectorOfEnums($j)
|
||||
{
|
||||
$o = $this->__offset(98);
|
||||
return $o != 0 ? $this->bb->getSbyte($this->__vector($o) + $j * 1) : 0;
|
||||
return $o != 0 ? $this->bb->getByte($this->__vector($o) + $j * 1) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -666,6 +666,14 @@ class Monster extends Table
|
||||
return $o != 0 ? $this->__vector_len($o) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getVectorOfEnumsBytes()
|
||||
{
|
||||
return $this->__vector_as_bytes(98);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @return void
|
||||
@@ -810,12 +818,12 @@ class Monster extends Table
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param sbyte
|
||||
* @param byte
|
||||
* @return void
|
||||
*/
|
||||
public static function addColor(FlatBufferBuilder $builder, $color)
|
||||
{
|
||||
$builder->addSbyteX(6, $color, 8);
|
||||
$builder->addByteX(6, $color, 8);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1606,7 +1614,7 @@ class Monster extends Table
|
||||
{
|
||||
$builder->startVector(1, count($data), 1);
|
||||
for ($i = count($data) - 1; $i >= 0; $i--) {
|
||||
$builder->putSbyte($data[$i]);
|
||||
$builder->putByte($data[$i]);
|
||||
}
|
||||
return $builder->endVector();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user