From ebbf2fe4d5a47142e01f9e48d30bd77329ed5ea4 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 19 Dec 2023 02:57:05 -0500 Subject: [PATCH] Run ./scripts/generate_code.py --- python/flatbuffers/reflection/Enum.py | 6 +-- python/flatbuffers/reflection/EnumVal.py | 4 +- python/flatbuffers/reflection/Field.py | 4 +- python/flatbuffers/reflection/Object.py | 6 +-- python/flatbuffers/reflection/RPCCall.py | 4 +- python/flatbuffers/reflection/Schema.py | 8 ++-- python/flatbuffers/reflection/SchemaFile.py | 2 +- python/flatbuffers/reflection/Service.py | 6 +-- tests/MyGame/Example/Monster.php | 6 +-- tests/MyGame/Example/Monster.py | 40 ++++++++--------- tests/MyGame/Example/TypeAliases.py | 4 +- .../monster_test_generated.swift | 44 +++++++++---------- .../test_no_include_generated.swift | 6 +-- .../MutatingBool_generated.swift | 4 +- .../monster_test_generated.swift | 44 +++++++++---------- tests/type_field_collision/Collision.cs | 16 +++---- tests/union_vector/Movie.php | 2 +- 17 files changed, 103 insertions(+), 103 deletions(-) diff --git a/python/flatbuffers/reflection/Enum.py b/python/flatbuffers/reflection/Enum.py index 2c366d1cba6..2d484c0b10f 100644 --- a/python/flatbuffers/reflection/Enum.py +++ b/python/flatbuffers/reflection/Enum.py @@ -152,7 +152,7 @@ def AddValues(builder, values): def EnumStartValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartValuesVector(builder, numElems): +def StartValuesVector(builder, numElems: int) -> int: return EnumStartValuesVector(builder, numElems) def EnumAddIsUnion(builder, isUnion): @@ -176,7 +176,7 @@ def AddAttributes(builder, attributes): def EnumStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartAttributesVector(builder, numElems): +def StartAttributesVector(builder, numElems: int) -> int: return EnumStartAttributesVector(builder, numElems) def EnumAddDocumentation(builder, documentation): @@ -188,7 +188,7 @@ def AddDocumentation(builder, documentation): def EnumStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartDocumentationVector(builder, numElems): +def StartDocumentationVector(builder, numElems: int) -> int: return EnumStartDocumentationVector(builder, numElems) def EnumAddDeclarationFile(builder, declarationFile): diff --git a/python/flatbuffers/reflection/EnumVal.py b/python/flatbuffers/reflection/EnumVal.py index 3789a16e4c2..3da936b4ac8 100644 --- a/python/flatbuffers/reflection/EnumVal.py +++ b/python/flatbuffers/reflection/EnumVal.py @@ -131,7 +131,7 @@ def AddDocumentation(builder, documentation): def EnumValStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartDocumentationVector(builder, numElems): +def StartDocumentationVector(builder, numElems: int) -> int: return EnumValStartDocumentationVector(builder, numElems) def EnumValAddAttributes(builder, attributes): @@ -143,7 +143,7 @@ def AddAttributes(builder, attributes): def EnumValStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartAttributesVector(builder, numElems): +def StartAttributesVector(builder, numElems: int) -> int: return EnumValStartAttributesVector(builder, numElems) def EnumValEnd(builder): diff --git a/python/flatbuffers/reflection/Field.py b/python/flatbuffers/reflection/Field.py index 2cce39203bc..eb70891ace1 100644 --- a/python/flatbuffers/reflection/Field.py +++ b/python/flatbuffers/reflection/Field.py @@ -232,7 +232,7 @@ def AddAttributes(builder, attributes): def FieldStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartAttributesVector(builder, numElems): +def StartAttributesVector(builder, numElems: int) -> int: return FieldStartAttributesVector(builder, numElems) def FieldAddDocumentation(builder, documentation): @@ -244,7 +244,7 @@ def AddDocumentation(builder, documentation): def FieldStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartDocumentationVector(builder, numElems): +def StartDocumentationVector(builder, numElems: int) -> int: return FieldStartDocumentationVector(builder, numElems) def FieldAddOptional(builder, optional): diff --git a/python/flatbuffers/reflection/Object.py b/python/flatbuffers/reflection/Object.py index 41fbc09aba6..33b05733650 100644 --- a/python/flatbuffers/reflection/Object.py +++ b/python/flatbuffers/reflection/Object.py @@ -155,7 +155,7 @@ def AddFields(builder, fields): def ObjectStartFieldsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartFieldsVector(builder, numElems): +def StartFieldsVector(builder, numElems: int) -> int: return ObjectStartFieldsVector(builder, numElems) def ObjectAddIsStruct(builder, isStruct): @@ -185,7 +185,7 @@ def AddAttributes(builder, attributes): def ObjectStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartAttributesVector(builder, numElems): +def StartAttributesVector(builder, numElems: int) -> int: return ObjectStartAttributesVector(builder, numElems) def ObjectAddDocumentation(builder, documentation): @@ -197,7 +197,7 @@ def AddDocumentation(builder, documentation): def ObjectStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartDocumentationVector(builder, numElems): +def StartDocumentationVector(builder, numElems: int) -> int: return ObjectStartDocumentationVector(builder, numElems) def ObjectAddDeclarationFile(builder, declarationFile): diff --git a/python/flatbuffers/reflection/RPCCall.py b/python/flatbuffers/reflection/RPCCall.py index b88c64b776e..3fd7ff8465f 100644 --- a/python/flatbuffers/reflection/RPCCall.py +++ b/python/flatbuffers/reflection/RPCCall.py @@ -135,7 +135,7 @@ def AddAttributes(builder, attributes): def RPCCallStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartAttributesVector(builder, numElems): +def StartAttributesVector(builder, numElems: int) -> int: return RPCCallStartAttributesVector(builder, numElems) def RPCCallAddDocumentation(builder, documentation): @@ -147,7 +147,7 @@ def AddDocumentation(builder, documentation): def RPCCallStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartDocumentationVector(builder, numElems): +def StartDocumentationVector(builder, numElems: int) -> int: return RPCCallStartDocumentationVector(builder, numElems) def RPCCallEnd(builder): diff --git a/python/flatbuffers/reflection/Schema.py b/python/flatbuffers/reflection/Schema.py index 357e6ea0e02..61ebb196e5e 100644 --- a/python/flatbuffers/reflection/Schema.py +++ b/python/flatbuffers/reflection/Schema.py @@ -177,7 +177,7 @@ def AddObjects(builder, objects): def SchemaStartObjectsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartObjectsVector(builder, numElems): +def StartObjectsVector(builder, numElems: int) -> int: return SchemaStartObjectsVector(builder, numElems) def SchemaAddEnums(builder, enums): @@ -189,7 +189,7 @@ def AddEnums(builder, enums): def SchemaStartEnumsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartEnumsVector(builder, numElems): +def StartEnumsVector(builder, numElems: int) -> int: return SchemaStartEnumsVector(builder, numElems) def SchemaAddFileIdent(builder, fileIdent): @@ -219,7 +219,7 @@ def AddServices(builder, services): def SchemaStartServicesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartServicesVector(builder, numElems): +def StartServicesVector(builder, numElems: int) -> int: return SchemaStartServicesVector(builder, numElems) def SchemaAddAdvancedFeatures(builder, advancedFeatures): @@ -237,7 +237,7 @@ def AddFbsFiles(builder, fbsFiles): def SchemaStartFbsFilesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartFbsFilesVector(builder, numElems): +def StartFbsFilesVector(builder, numElems: int) -> int: return SchemaStartFbsFilesVector(builder, numElems) def SchemaEnd(builder): diff --git a/python/flatbuffers/reflection/SchemaFile.py b/python/flatbuffers/reflection/SchemaFile.py index db4e47f1a1a..a81bcd5dbf9 100644 --- a/python/flatbuffers/reflection/SchemaFile.py +++ b/python/flatbuffers/reflection/SchemaFile.py @@ -81,7 +81,7 @@ def AddIncludedFilenames(builder, includedFilenames): def SchemaFileStartIncludedFilenamesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartIncludedFilenamesVector(builder, numElems): +def StartIncludedFilenamesVector(builder, numElems: int) -> int: return SchemaFileStartIncludedFilenamesVector(builder, numElems) def SchemaFileEnd(builder): diff --git a/python/flatbuffers/reflection/Service.py b/python/flatbuffers/reflection/Service.py index cbd1b699250..e69e531f551 100644 --- a/python/flatbuffers/reflection/Service.py +++ b/python/flatbuffers/reflection/Service.py @@ -134,7 +134,7 @@ def AddCalls(builder, calls): def ServiceStartCallsVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartCallsVector(builder, numElems): +def StartCallsVector(builder, numElems: int) -> int: return ServiceStartCallsVector(builder, numElems) def ServiceAddAttributes(builder, attributes): @@ -146,7 +146,7 @@ def AddAttributes(builder, attributes): def ServiceStartAttributesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartAttributesVector(builder, numElems): +def StartAttributesVector(builder, numElems: int) -> int: return ServiceStartAttributesVector(builder, numElems) def ServiceAddDocumentation(builder, documentation): @@ -158,7 +158,7 @@ def AddDocumentation(builder, documentation): def ServiceStartDocumentationVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartDocumentationVector(builder, numElems): +def StartDocumentationVector(builder, numElems: int) -> int: return ServiceStartDocumentationVector(builder, numElems) def ServiceAddDeclarationFile(builder, declarationFile): diff --git a/tests/MyGame/Example/Monster.php b/tests/MyGame/Example/Monster.php index 2b02d8a505b..446494030af 100644 --- a/tests/MyGame/Example/Monster.php +++ b/tests/MyGame/Example/Monster.php @@ -125,7 +125,7 @@ public function getTestType() } /** - * @return int + * @returnint */ public function getTest($obj) { @@ -621,7 +621,7 @@ public function getAnyUniqueType() } /** - * @return int + * @returnint */ public function getAnyUnique($obj) { @@ -639,7 +639,7 @@ public function getAnyAmbiguousType() } /** - * @return int + * @returnint */ public function getAnyAmbiguous($obj) { diff --git a/tests/MyGame/Example/Monster.py b/tests/MyGame/Example/Monster.py index 9fb81446efc..1503011fc29 100644 --- a/tests/MyGame/Example/Monster.py +++ b/tests/MyGame/Example/Monster.py @@ -911,7 +911,7 @@ def AddInventory(builder, inventory): def MonsterStartInventoryVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def StartInventoryVector(builder, numElems): +def StartInventoryVector(builder, numElems: int) -> int: return MonsterStartInventoryVector(builder, numElems) def MonsterAddColor(builder, color): @@ -941,7 +941,7 @@ def AddTest4(builder, test4): def MonsterStartTest4Vector(builder, numElems): return builder.StartVector(4, numElems, 2) -def StartTest4Vector(builder, numElems): +def StartTest4Vector(builder, numElems: int) -> int: return MonsterStartTest4Vector(builder, numElems) def MonsterAddTestarrayofstring(builder, testarrayofstring): @@ -953,7 +953,7 @@ def AddTestarrayofstring(builder, testarrayofstring): def MonsterStartTestarrayofstringVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartTestarrayofstringVector(builder, numElems): +def StartTestarrayofstringVector(builder, numElems: int) -> int: return MonsterStartTestarrayofstringVector(builder, numElems) def MonsterAddTestarrayoftables(builder, testarrayoftables): @@ -965,7 +965,7 @@ def AddTestarrayoftables(builder, testarrayoftables): def MonsterStartTestarrayoftablesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartTestarrayoftablesVector(builder, numElems): +def StartTestarrayoftablesVector(builder, numElems: int) -> int: return MonsterStartTestarrayoftablesVector(builder, numElems) def MonsterAddEnemy(builder, enemy): @@ -983,7 +983,7 @@ def AddTestnestedflatbuffer(builder, testnestedflatbuffer): def MonsterStartTestnestedflatbufferVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def StartTestnestedflatbufferVector(builder, numElems): +def StartTestnestedflatbufferVector(builder, numElems: int) -> int: return MonsterStartTestnestedflatbufferVector(builder, numElems) def MonsterMakeTestnestedflatbufferVectorFromBytes(builder, bytes): @@ -1062,7 +1062,7 @@ def AddTestarrayofbools(builder, testarrayofbools): def MonsterStartTestarrayofboolsVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def StartTestarrayofboolsVector(builder, numElems): +def StartTestarrayofboolsVector(builder, numElems: int) -> int: return MonsterStartTestarrayofboolsVector(builder, numElems) def MonsterAddTestf(builder, testf): @@ -1092,7 +1092,7 @@ def AddTestarrayofstring2(builder, testarrayofstring2): def MonsterStartTestarrayofstring2Vector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartTestarrayofstring2Vector(builder, numElems): +def StartTestarrayofstring2Vector(builder, numElems: int) -> int: return MonsterStartTestarrayofstring2Vector(builder, numElems) def MonsterAddTestarrayofsortedstruct(builder, testarrayofsortedstruct): @@ -1104,7 +1104,7 @@ def AddTestarrayofsortedstruct(builder, testarrayofsortedstruct): def MonsterStartTestarrayofsortedstructVector(builder, numElems): return builder.StartVector(8, numElems, 4) -def StartTestarrayofsortedstructVector(builder, numElems): +def StartTestarrayofsortedstructVector(builder, numElems: int) -> int: return MonsterStartTestarrayofsortedstructVector(builder, numElems) def MonsterAddFlex(builder, flex): @@ -1116,7 +1116,7 @@ def AddFlex(builder, flex): def MonsterStartFlexVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def StartFlexVector(builder, numElems): +def StartFlexVector(builder, numElems: int) -> int: return MonsterStartFlexVector(builder, numElems) def MonsterAddTest5(builder, test5): @@ -1128,7 +1128,7 @@ def AddTest5(builder, test5): def MonsterStartTest5Vector(builder, numElems): return builder.StartVector(4, numElems, 2) -def StartTest5Vector(builder, numElems): +def StartTest5Vector(builder, numElems: int) -> int: return MonsterStartTest5Vector(builder, numElems) def MonsterAddVectorOfLongs(builder, vectorOfLongs): @@ -1140,7 +1140,7 @@ def AddVectorOfLongs(builder, vectorOfLongs): def MonsterStartVectorOfLongsVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def StartVectorOfLongsVector(builder, numElems): +def StartVectorOfLongsVector(builder, numElems: int) -> int: return MonsterStartVectorOfLongsVector(builder, numElems) def MonsterAddVectorOfDoubles(builder, vectorOfDoubles): @@ -1152,7 +1152,7 @@ def AddVectorOfDoubles(builder, vectorOfDoubles): def MonsterStartVectorOfDoublesVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def StartVectorOfDoublesVector(builder, numElems): +def StartVectorOfDoublesVector(builder, numElems: int) -> int: return MonsterStartVectorOfDoublesVector(builder, numElems) def MonsterAddParentNamespaceTest(builder, parentNamespaceTest): @@ -1170,7 +1170,7 @@ def AddVectorOfReferrables(builder, vectorOfReferrables): def MonsterStartVectorOfReferrablesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartVectorOfReferrablesVector(builder, numElems): +def StartVectorOfReferrablesVector(builder, numElems: int) -> int: return MonsterStartVectorOfReferrablesVector(builder, numElems) def MonsterAddSingleWeakReference(builder, singleWeakReference): @@ -1188,7 +1188,7 @@ def AddVectorOfWeakReferences(builder, vectorOfWeakReferences): def MonsterStartVectorOfWeakReferencesVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def StartVectorOfWeakReferencesVector(builder, numElems): +def StartVectorOfWeakReferencesVector(builder, numElems: int) -> int: return MonsterStartVectorOfWeakReferencesVector(builder, numElems) def MonsterAddVectorOfStrongReferrables(builder, vectorOfStrongReferrables): @@ -1200,7 +1200,7 @@ def AddVectorOfStrongReferrables(builder, vectorOfStrongReferrables): def MonsterStartVectorOfStrongReferrablesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartVectorOfStrongReferrablesVector(builder, numElems): +def StartVectorOfStrongReferrablesVector(builder, numElems: int) -> int: return MonsterStartVectorOfStrongReferrablesVector(builder, numElems) def MonsterAddCoOwningReference(builder, coOwningReference): @@ -1218,7 +1218,7 @@ def AddVectorOfCoOwningReferences(builder, vectorOfCoOwningReferences): def MonsterStartVectorOfCoOwningReferencesVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def StartVectorOfCoOwningReferencesVector(builder, numElems): +def StartVectorOfCoOwningReferencesVector(builder, numElems: int) -> int: return MonsterStartVectorOfCoOwningReferencesVector(builder, numElems) def MonsterAddNonOwningReference(builder, nonOwningReference): @@ -1236,7 +1236,7 @@ def AddVectorOfNonOwningReferences(builder, vectorOfNonOwningReferences): def MonsterStartVectorOfNonOwningReferencesVector(builder, numElems): return builder.StartVector(8, numElems, 8) -def StartVectorOfNonOwningReferencesVector(builder, numElems): +def StartVectorOfNonOwningReferencesVector(builder, numElems: int) -> int: return MonsterStartVectorOfNonOwningReferencesVector(builder, numElems) def MonsterAddAnyUniqueType(builder, anyUniqueType): @@ -1272,7 +1272,7 @@ def AddVectorOfEnums(builder, vectorOfEnums): def MonsterStartVectorOfEnumsVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def StartVectorOfEnumsVector(builder, numElems): +def StartVectorOfEnumsVector(builder, numElems: int) -> int: return MonsterStartVectorOfEnumsVector(builder, numElems) def MonsterAddSignedEnum(builder, signedEnum): @@ -1290,7 +1290,7 @@ def AddTestrequirednestedflatbuffer(builder, testrequirednestedflatbuffer): def MonsterStartTestrequirednestedflatbufferVector(builder, numElems): return builder.StartVector(1, numElems, 1) -def StartTestrequirednestedflatbufferVector(builder, numElems): +def StartTestrequirednestedflatbufferVector(builder, numElems: int) -> int: return MonsterStartTestrequirednestedflatbufferVector(builder, numElems) def MonsterMakeTestrequirednestedflatbufferVectorFromBytes(builder, bytes): @@ -1309,7 +1309,7 @@ def AddScalarKeySortedTables(builder, scalarKeySortedTables): def MonsterStartScalarKeySortedTablesVector(builder, numElems): return builder.StartVector(4, numElems, 4) -def StartScalarKeySortedTablesVector(builder, numElems): +def StartScalarKeySortedTablesVector(builder, numElems: int) -> int: return MonsterStartScalarKeySortedTablesVector(builder, numElems) def MonsterAddNativeInline(builder, nativeInline): diff --git a/tests/MyGame/Example/TypeAliases.py b/tests/MyGame/Example/TypeAliases.py index b9cf4552ec9..00f90ed5b9c 100644 --- a/tests/MyGame/Example/TypeAliases.py +++ b/tests/MyGame/Example/TypeAliases.py @@ -227,7 +227,7 @@ def AddV8(builder, v8): def TypeAliasesStartV8Vector(builder, numElems): return builder.StartVector(1, numElems, 1) -def StartV8Vector(builder, numElems): +def StartV8Vector(builder, numElems: int) -> int: return TypeAliasesStartV8Vector(builder, numElems) def TypeAliasesAddVf64(builder, vf64): @@ -239,7 +239,7 @@ def AddVf64(builder, vf64): def TypeAliasesStartVf64Vector(builder, numElems): return builder.StartVector(8, numElems, 8) -def StartVf64Vector(builder, numElems): +def StartVf64Vector(builder, numElems: int) -> int: return TypeAliasesStartVf64Vector(builder, numElems) def TypeAliasesEnd(builder): diff --git a/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift b/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift index a93ad025e3b..87081773834 100644 --- a/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift +++ b/tests/swift/Wasm.tests/Tests/FlatBuffers.Test.Swift.WasmTests/monster_test_generated.swift @@ -301,7 +301,7 @@ public struct MyGame_Example_Test_Mutable: FlatBufferObject { @discardableResult public func mutate(a: Int16) -> Bool { return _accessor.mutate(a, index: 0) } public var b: Int8 { return _accessor.readBuffer(of: Int8.self, at: 2) } @discardableResult public func mutate(b: Int8) -> Bool { return _accessor.mutate(b, index: 2) } - + public mutating func unpack() -> MyGame_Example_Test { return MyGame_Example_Test(&self) @@ -430,7 +430,7 @@ public struct MyGame_Example_Vec3_Mutable: FlatBufferObject { public var test2: MyGame_Example_Color { return MyGame_Example_Color(rawValue: _accessor.readBuffer(of: UInt8.self, at: 24)) ?? .red } @discardableResult public func mutate(test2: MyGame_Example_Color) -> Bool { return _accessor.mutate(test2.rawValue, index: 24) } public var test3: MyGame_Example_Test_Mutable { return MyGame_Example_Test_Mutable(_accessor.bb, o: _accessor.position + 26) } - + public mutating func unpack() -> MyGame_Example_Vec3 { return MyGame_Example_Vec3(&self) @@ -510,7 +510,7 @@ public struct MyGame_Example_Ability_Mutable: FlatBufferObject { @discardableResult public func mutate(id: UInt32) -> Bool { return _accessor.mutate(id, index: 0) } public var distance: UInt32 { return _accessor.readBuffer(of: UInt32.self, at: 4) } @discardableResult public func mutate(distance: UInt32) -> Bool { return _accessor.mutate(distance, index: 4) } - + public mutating func unpack() -> MyGame_Example_Ability { return MyGame_Example_Ability(&self) @@ -596,7 +596,7 @@ public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject { public var a: MyGame_Example_Ability_Mutable { return MyGame_Example_Ability_Mutable(_accessor.bb, o: _accessor.position + 0) } public var b: MyGame_Example_Test_Mutable { return MyGame_Example_Test_Mutable(_accessor.bb, o: _accessor.position + 8) } public var c: MyGame_Example_Ability_Mutable { return MyGame_Example_Ability_Mutable(_accessor.bb, o: _accessor.position + 12) } - + public mutating func unpack() -> MyGame_Example_StructOfStructs { return MyGame_Example_StructOfStructs(&self) @@ -662,7 +662,7 @@ public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject public init(_ bb: ByteBuffer, o: Int32) { _accessor = Struct(bb: bb, position: o) } public var a: MyGame_Example_StructOfStructs_Mutable { return MyGame_Example_StructOfStructs_Mutable(_accessor.bb, o: _accessor.position + 0) } - + public mutating func unpack() -> MyGame_Example_StructOfStructsOfStructs { return MyGame_Example_StructOfStructsOfStructs(&self) @@ -683,14 +683,14 @@ public struct MyGame_InParentNamespace: FlatBufferObject, Verifiable, ObjectAPIP public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_InParentNamespace.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } public static func startInParentNamespace(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 0) } public static func endInParentNamespace(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end } - + public mutating func unpack() -> MyGame_InParentNamespaceT { return MyGame_InParentNamespaceT(&self) @@ -735,14 +735,14 @@ public struct MyGame_Example2_Monster: FlatBufferObject, Verifiable, ObjectAPIPa public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example2_Monster.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } public static func startMonster(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 0) } public static func endMonster(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end } - + public mutating func unpack() -> MyGame_Example2_MonsterT { return MyGame_Example2_MonsterT(&self) @@ -787,7 +787,7 @@ internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifi internal var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - internal static var id: String { "MONS" } + internal static var id: String { "MONS" } internal static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_TestSimpleTableWithEnum.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } internal init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -811,7 +811,7 @@ internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifi MyGame_Example_TestSimpleTableWithEnum.add(color: color, &fbb) return MyGame_Example_TestSimpleTableWithEnum.endTestSimpleTableWithEnum(&fbb, start: __start) } - + internal mutating func unpack() -> MyGame_Example_TestSimpleTableWithEnumT { return MyGame_Example_TestSimpleTableWithEnumT(&self) @@ -868,7 +868,7 @@ public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Stat.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -906,7 +906,7 @@ public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker } public static func sortVectorOfStat(offsets:[Offset], _ fbb: inout FlatBufferBuilder) -> Offset { var off = offsets - off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 8, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 8, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } + off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 8, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 8, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } return fbb.createVector(ofOffsets: off) } fileprivate static func lookupByKey(vector: Int32, key: UInt16, fbb: ByteBuffer) -> MyGame_Example_Stat? { @@ -928,7 +928,7 @@ public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker } return nil } - + public mutating func unpack() -> MyGame_Example_StatT { return MyGame_Example_StatT(&self) @@ -1007,7 +1007,7 @@ public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPI public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Referrable.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -1033,7 +1033,7 @@ public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPI } public static func sortVectorOfReferrable(offsets:[Offset], _ fbb: inout FlatBufferBuilder) -> Offset { var off = offsets - off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 4, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 4, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } + off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 4, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 4, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } return fbb.createVector(ofOffsets: off) } fileprivate static func lookupByKey(vector: Int32, key: UInt64, fbb: ByteBuffer) -> MyGame_Example_Referrable? { @@ -1055,7 +1055,7 @@ public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPI } return nil } - + public mutating func unpack() -> MyGame_Example_ReferrableT { return MyGame_Example_ReferrableT(&self) @@ -1113,7 +1113,7 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Monster.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -1549,7 +1549,7 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac } public static func sortVectorOfMonster(offsets:[Offset], _ fbb: inout FlatBufferBuilder) -> Offset { var off = offsets - off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 10, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 10, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } + off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 10, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 10, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } return fbb.createVector(ofOffsets: off) } fileprivate static func lookupByKey(vector: Int32, key: String, fbb: ByteBuffer) -> MyGame_Example_Monster? { @@ -1572,7 +1572,7 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac } return nil } - + public mutating func unpack() -> MyGame_Example_MonsterT { return MyGame_Example_MonsterT(&self) @@ -2409,7 +2409,7 @@ public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAP public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_TypeAliases.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -2505,7 +2505,7 @@ public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAP MyGame_Example_TypeAliases.addVectorOf(vf64: vf64, &fbb) return MyGame_Example_TypeAliases.endTypeAliases(&fbb, start: __start) } - + public mutating func unpack() -> MyGame_Example_TypeAliasesT { return MyGame_Example_TypeAliasesT(&self) diff --git a/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift b/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift index 7174e9c4b14..3404016c259 100644 --- a/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift +++ b/tests/swift/tests/CodeGenerationTests/test_no_include_generated.swift @@ -55,7 +55,7 @@ public struct BytesCount_Mutable: FlatBufferObject { public var x: Int64 { return _accessor.readBuffer(of: Int64.self, at: 0) } @discardableResult public func mutate(x: Int64) -> Bool { return _accessor.mutate(x, index: 0) } - + public mutating func unpack() -> BytesCount { return BytesCount(&self) @@ -98,7 +98,7 @@ public struct InternalMessage: FlatBufferObject, Verifiable, ObjectAPIPacker { InternalMessage.add(str: str, &fbb) return InternalMessage.endInternalMessage(&fbb, start: __start) } - + public mutating func unpack() -> InternalMessageT { return InternalMessageT(&self) @@ -192,7 +192,7 @@ public struct Message: FlatBufferObject, Verifiable, ObjectAPIPacker { Message.add(pointer: pointer, &fbb) return Message.endMessage(&fbb, start: __start) } - + public mutating func unpack() -> MessageT { return MessageT(&self) diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift index 5499d25c68d..ce865606390 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/MutatingBool_generated.swift @@ -57,7 +57,7 @@ public struct Property_Mutable: FlatBufferObject { public var property: Bool { return _accessor.readBuffer(of: Bool.self, at: 0) } @discardableResult public func mutate(property: Bool) -> Bool { return _accessor.mutate(property, index: 0) } - + public mutating func unpack() -> Property { return Property(&self) @@ -100,7 +100,7 @@ public struct TestMutatingBool: FlatBufferObject, Verifiable, ObjectAPIPacker { TestMutatingBool.add(b: b, &fbb) return TestMutatingBool.endTestMutatingBool(&fbb, start: __start) } - + public mutating func unpack() -> TestMutatingBoolT { return TestMutatingBoolT(&self) diff --git a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift index a93ad025e3b..87081773834 100644 --- a/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift +++ b/tests/swift/tests/Tests/FlatBuffers.Test.SwiftTests/monster_test_generated.swift @@ -301,7 +301,7 @@ public struct MyGame_Example_Test_Mutable: FlatBufferObject { @discardableResult public func mutate(a: Int16) -> Bool { return _accessor.mutate(a, index: 0) } public var b: Int8 { return _accessor.readBuffer(of: Int8.self, at: 2) } @discardableResult public func mutate(b: Int8) -> Bool { return _accessor.mutate(b, index: 2) } - + public mutating func unpack() -> MyGame_Example_Test { return MyGame_Example_Test(&self) @@ -430,7 +430,7 @@ public struct MyGame_Example_Vec3_Mutable: FlatBufferObject { public var test2: MyGame_Example_Color { return MyGame_Example_Color(rawValue: _accessor.readBuffer(of: UInt8.self, at: 24)) ?? .red } @discardableResult public func mutate(test2: MyGame_Example_Color) -> Bool { return _accessor.mutate(test2.rawValue, index: 24) } public var test3: MyGame_Example_Test_Mutable { return MyGame_Example_Test_Mutable(_accessor.bb, o: _accessor.position + 26) } - + public mutating func unpack() -> MyGame_Example_Vec3 { return MyGame_Example_Vec3(&self) @@ -510,7 +510,7 @@ public struct MyGame_Example_Ability_Mutable: FlatBufferObject { @discardableResult public func mutate(id: UInt32) -> Bool { return _accessor.mutate(id, index: 0) } public var distance: UInt32 { return _accessor.readBuffer(of: UInt32.self, at: 4) } @discardableResult public func mutate(distance: UInt32) -> Bool { return _accessor.mutate(distance, index: 4) } - + public mutating func unpack() -> MyGame_Example_Ability { return MyGame_Example_Ability(&self) @@ -596,7 +596,7 @@ public struct MyGame_Example_StructOfStructs_Mutable: FlatBufferObject { public var a: MyGame_Example_Ability_Mutable { return MyGame_Example_Ability_Mutable(_accessor.bb, o: _accessor.position + 0) } public var b: MyGame_Example_Test_Mutable { return MyGame_Example_Test_Mutable(_accessor.bb, o: _accessor.position + 8) } public var c: MyGame_Example_Ability_Mutable { return MyGame_Example_Ability_Mutable(_accessor.bb, o: _accessor.position + 12) } - + public mutating func unpack() -> MyGame_Example_StructOfStructs { return MyGame_Example_StructOfStructs(&self) @@ -662,7 +662,7 @@ public struct MyGame_Example_StructOfStructsOfStructs_Mutable: FlatBufferObject public init(_ bb: ByteBuffer, o: Int32) { _accessor = Struct(bb: bb, position: o) } public var a: MyGame_Example_StructOfStructs_Mutable { return MyGame_Example_StructOfStructs_Mutable(_accessor.bb, o: _accessor.position + 0) } - + public mutating func unpack() -> MyGame_Example_StructOfStructsOfStructs { return MyGame_Example_StructOfStructsOfStructs(&self) @@ -683,14 +683,14 @@ public struct MyGame_InParentNamespace: FlatBufferObject, Verifiable, ObjectAPIP public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_InParentNamespace.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } public static func startInParentNamespace(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 0) } public static func endInParentNamespace(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end } - + public mutating func unpack() -> MyGame_InParentNamespaceT { return MyGame_InParentNamespaceT(&self) @@ -735,14 +735,14 @@ public struct MyGame_Example2_Monster: FlatBufferObject, Verifiable, ObjectAPIPa public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example2_Monster.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } public static func startMonster(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 0) } public static func endMonster(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); return end } - + public mutating func unpack() -> MyGame_Example2_MonsterT { return MyGame_Example2_MonsterT(&self) @@ -787,7 +787,7 @@ internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifi internal var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - internal static var id: String { "MONS" } + internal static var id: String { "MONS" } internal static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_TestSimpleTableWithEnum.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } internal init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -811,7 +811,7 @@ internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifi MyGame_Example_TestSimpleTableWithEnum.add(color: color, &fbb) return MyGame_Example_TestSimpleTableWithEnum.endTestSimpleTableWithEnum(&fbb, start: __start) } - + internal mutating func unpack() -> MyGame_Example_TestSimpleTableWithEnumT { return MyGame_Example_TestSimpleTableWithEnumT(&self) @@ -868,7 +868,7 @@ public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Stat.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -906,7 +906,7 @@ public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker } public static func sortVectorOfStat(offsets:[Offset], _ fbb: inout FlatBufferBuilder) -> Offset { var off = offsets - off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 8, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 8, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } + off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 8, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 8, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } return fbb.createVector(ofOffsets: off) } fileprivate static func lookupByKey(vector: Int32, key: UInt16, fbb: ByteBuffer) -> MyGame_Example_Stat? { @@ -928,7 +928,7 @@ public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker } return nil } - + public mutating func unpack() -> MyGame_Example_StatT { return MyGame_Example_StatT(&self) @@ -1007,7 +1007,7 @@ public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPI public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Referrable.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -1033,7 +1033,7 @@ public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPI } public static func sortVectorOfReferrable(offsets:[Offset], _ fbb: inout FlatBufferBuilder) -> Offset { var off = offsets - off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 4, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 4, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } + off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 4, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 4, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } return fbb.createVector(ofOffsets: off) } fileprivate static func lookupByKey(vector: Int32, key: UInt64, fbb: ByteBuffer) -> MyGame_Example_Referrable? { @@ -1055,7 +1055,7 @@ public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPI } return nil } - + public mutating func unpack() -> MyGame_Example_ReferrableT { return MyGame_Example_ReferrableT(&self) @@ -1113,7 +1113,7 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Monster.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -1549,7 +1549,7 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac } public static func sortVectorOfMonster(offsets:[Offset], _ fbb: inout FlatBufferBuilder) -> Offset { var off = offsets - off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 10, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 10, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } + off.sort { Table.compare(Table.offset(Int32($1.o), vOffset: 10, fbb: fbb.buffer), Table.offset(Int32($0.o), vOffset: 10, fbb: fbb.buffer), fbb: fbb.buffer) < 0 } return fbb.createVector(ofOffsets: off) } fileprivate static func lookupByKey(vector: Int32, key: String, fbb: ByteBuffer) -> MyGame_Example_Monster? { @@ -1572,7 +1572,7 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac } return nil } - + public mutating func unpack() -> MyGame_Example_MonsterT { return MyGame_Example_MonsterT(&self) @@ -2409,7 +2409,7 @@ public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAP public var __buffer: ByteBuffer! { return _accessor.bb } private var _accessor: Table - public static var id: String { "MONS" } + public static var id: String { "MONS" } public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_TypeAliases.id, addPrefix: prefix) } private init(_ t: Table) { _accessor = t } public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) } @@ -2505,7 +2505,7 @@ public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAP MyGame_Example_TypeAliases.addVectorOf(vf64: vf64, &fbb) return MyGame_Example_TypeAliases.endTypeAliases(&fbb, start: __start) } - + public mutating func unpack() -> MyGame_Example_TypeAliasesT { return MyGame_Example_TypeAliasesT(&self) diff --git a/tests/type_field_collision/Collision.cs b/tests/type_field_collision/Collision.cs index a33b39d3fbe..864fc2f0b0b 100644 --- a/tests/type_field_collision/Collision.cs +++ b/tests/type_field_collision/Collision.cs @@ -2,7 +2,7 @@ // automatically generated by the FlatBuffers compiler, do not modify // -namespace type_field_collsion +namespace type_field_collision { using global::System; @@ -22,7 +22,7 @@ public struct Collision : IFlatbufferObject public int Collision_ { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } - public static Offset CreateCollision(FlatBufferBuilder builder, + public static Offset CreateCollision(FlatBufferBuilder builder, int collision = 0) { builder.StartTable(1); Collision.AddCollision(builder, collision); @@ -31,12 +31,12 @@ public struct Collision : IFlatbufferObject public static void StartCollision(FlatBufferBuilder builder) { builder.StartTable(1); } public static void AddCollision(FlatBufferBuilder builder, int collision) { builder.AddInt(0, collision, 0); } - public static Offset EndCollision(FlatBufferBuilder builder) { + public static Offset EndCollision(FlatBufferBuilder builder) { int o = builder.EndTable(); - return new Offset(o); + return new Offset(o); } - public static void FinishCollisionBuffer(FlatBufferBuilder builder, Offset offset) { builder.Finish(offset.Value); } - public static void FinishSizePrefixedCollisionBuffer(FlatBufferBuilder builder, Offset offset) { builder.FinishSizePrefixed(offset.Value); } + public static void FinishCollisionBuffer(FlatBufferBuilder builder, Offset offset) { builder.Finish(offset.Value); } + public static void FinishSizePrefixedCollisionBuffer(FlatBufferBuilder builder, Offset offset) { builder.FinishSizePrefixed(offset.Value); } public CollisionT UnPack() { var _o = new CollisionT(); this.UnPackTo(_o); @@ -45,8 +45,8 @@ public CollisionT UnPack() { public void UnPackTo(CollisionT _o) { _o.Collision_ = this.Collision_; } - public static Offset Pack(FlatBufferBuilder builder, CollisionT _o) { - if (_o == null) return default(Offset); + public static Offset Pack(FlatBufferBuilder builder, CollisionT _o) { + if (_o == null) return default(Offset); return CreateCollision( builder, _o.Collision_); diff --git a/tests/union_vector/Movie.php b/tests/union_vector/Movie.php index c2461fa0d00..216cd288b29 100644 --- a/tests/union_vector/Movie.php +++ b/tests/union_vector/Movie.php @@ -50,7 +50,7 @@ public function getMainCharacterType() } /** - * @return int + * @returnint */ public function getMainCharacter($obj) {