mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-11 07:27:27 +00:00
Fixed missing "f" on float default values in C++/Java/C#
Bug: 28145201 Change-Id: I5a1818c40c2f4fbd00cfec3362040407976f7a39 Tested: on Linux.
This commit is contained in:
@@ -333,22 +333,31 @@ class Monster extends Table
|
||||
return $o != 0 ? $this->__vector_len($o) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getTestf()
|
||||
{
|
||||
$o = $this->__offset(54);
|
||||
return $o != 0 ? $this->bb->getFloat($o + $this->bb_pos) : 3.14159;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @return void
|
||||
*/
|
||||
public static function startMonster(FlatBufferBuilder $builder)
|
||||
{
|
||||
$builder->StartObject(25);
|
||||
$builder->StartObject(26);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @return Monster
|
||||
*/
|
||||
public static function createMonster(FlatBufferBuilder $builder, $pos, $mana, $hp, $name, $inventory, $color, $test_type, $test, $test4, $testarrayofstring, $testarrayoftables, $enemy, $testnestedflatbuffer, $testempty, $testbool, $testhashs32_fnv1, $testhashu32_fnv1, $testhashs64_fnv1, $testhashu64_fnv1, $testhashs32_fnv1a, $testhashu32_fnv1a, $testhashs64_fnv1a, $testhashu64_fnv1a, $testarrayofbools)
|
||||
public static function createMonster(FlatBufferBuilder $builder, $pos, $mana, $hp, $name, $inventory, $color, $test_type, $test, $test4, $testarrayofstring, $testarrayoftables, $enemy, $testnestedflatbuffer, $testempty, $testbool, $testhashs32_fnv1, $testhashu32_fnv1, $testhashs64_fnv1, $testhashu64_fnv1, $testhashs32_fnv1a, $testhashu32_fnv1a, $testhashs64_fnv1a, $testhashu64_fnv1a, $testarrayofbools, $testf)
|
||||
{
|
||||
$builder->startObject(25);
|
||||
$builder->startObject(26);
|
||||
self::addPos($builder, $pos);
|
||||
self::addMana($builder, $mana);
|
||||
self::addHp($builder, $hp);
|
||||
@@ -373,6 +382,7 @@ class Monster extends Table
|
||||
self::addTesthashs64Fnv1a($builder, $testhashs64_fnv1a);
|
||||
self::addTesthashu64Fnv1a($builder, $testhashu64_fnv1a);
|
||||
self::addTestarrayofbools($builder, $testarrayofbools);
|
||||
self::addTestf($builder, $testf);
|
||||
$o = $builder->endObject();
|
||||
$builder->required($o, 10); // name
|
||||
return $o;
|
||||
@@ -757,6 +767,16 @@ class Monster extends Table
|
||||
$builder->startVector(1, $numElems, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @param float
|
||||
* @return void
|
||||
*/
|
||||
public static function addTestf(FlatBufferBuilder $builder, $testf)
|
||||
{
|
||||
$builder->addFloatX(25, $testf, 3.14159);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FlatBufferBuilder $builder
|
||||
* @return int table offset
|
||||
|
||||
Reference in New Issue
Block a user