platform/upstream/flatbuffers.git
10 years agoFix vector of strings for Go
rw [Tue, 23 Sep 2014 20:55:05 +0000 (13:55 -0700)]
Fix vector of strings for Go

Mirrors Java patch 39d4b7e2bf

Change-Id: If8d0ab29f6eb508a156d468aeb0a9d5410149e53

10 years agoEnums in C++ are now strongly typed.
Wouter van Oortmerssen [Tue, 23 Sep 2014 18:55:42 +0000 (11:55 -0700)]
Enums in C++ are now strongly typed.

Accessors and constructors now take enum types rather than ints.

Bug: 16570507
Change-Id: I4b50fd64ad2e662ea2481bc0ccea784326fb31c0
Tested: on Linux and Windows.

10 years agoMade flatc error messages look like what other compilers output.
Wouter van Oortmerssen [Tue, 23 Sep 2014 00:17:13 +0000 (17:17 -0700)]
Made flatc error messages look like what other compilers output.

Looks like MSVC on Windows and like gcc everywhere else.
For enhanced IDE clickability.

Bug: 17208371
Change-Id: Ie3e02658fccd3edfd464b4bacf4bc68c613a8570
Tested: on Linux and Windows.

10 years agoAdded option to flatc to generate dependent header statements.
Wouter van Oortmerssen [Mon, 22 Sep 2014 22:49:43 +0000 (15:49 -0700)]
Added option to flatc to generate dependent header statements.

Bug: 17322776
Change-Id: I3a4d3cb4ccd40bc3200a87653aa0ab8ecb90ce60
Tested: on Linux.

10 years agoSupport for required fields.
Wouter van Oortmerssen [Fri, 19 Sep 2014 23:51:36 +0000 (16:51 -0700)]
Support for required fields.

Change-Id: I560c7ca11b3d665eecafb528f3737b7e139ca9b0
Tested: on Linux and Windows.

10 years agoGenerate headers from spec, add option for installing targets
Zbigniew Mandziejewicz [Mon, 15 Sep 2014 16:50:23 +0000 (00:50 +0800)]
Generate headers from spec, add option for installing targets

Change-Id: I16ddb06e887e618fa871e842054115909fbf235c

10 years agoAdd enum name lookup method to Java/C# enums
Gabriel Martinez [Thu, 18 Sep 2014 19:28:10 +0000 (12:28 -0700)]
Add enum name lookup method to Java/C# enums

Tested: on Linux for Java and C#

Bug: 15781151
Change-Id: I7cb97bcc01d986cac2b24aaf7cb29521ddaa2f6b

10 years agoAdded convenient create functions for Java/C#.
Wouter van Oortmerssen [Thu, 18 Sep 2014 23:05:41 +0000 (16:05 -0700)]
Added convenient create functions for Java/C#.

Bug: 15777857
Tested: on Linux and Windows.

Change-Id: I25db724349e2c801bb0e41137540507acd57cd03

10 years agoAdded general codegen to Xcode project.
Wouter van Oortmerssen [Thu, 18 Sep 2014 22:26:49 +0000 (15:26 -0700)]
Added general codegen to Xcode project.

Change-Id: I5e21a08fe4b93382e5fbc3b911de5634b7aa88b9
Tested: on OS X.

10 years agoRefactored the Java and C# code generators into one.
Wouter van Oortmerssen [Wed, 17 Sep 2014 00:37:17 +0000 (17:37 -0700)]
Refactored the Java and C# code generators into one.

Also made the C# implementation support unsigned types, and
made it more like the Java version.

Bug: 17359988
Change-Id: If5305c08cd5c97f35426639516ce05e53bbec36c
Tested: on Linux and Windows.

10 years agoAdded C# generator to Xcode project.
Wouter van Oortmerssen [Tue, 16 Sep 2014 23:40:30 +0000 (16:40 -0700)]
Added C# generator to Xcode project.

Change-Id: I54ce51f16043664d706a79d1b31f2569f3311b70
Tested: on OS X

10 years agoPrepended com.google to the Java namespace.
Wouter van Oortmerssen [Tue, 16 Sep 2014 00:45:15 +0000 (17:45 -0700)]
Prepended com.google to the Java namespace.

Bug: 16507831
Change-Id: I5beee18f63f174e425dc1ab395807b578d5f9477
Tested: on Linux.

10 years agoAdded missing assert.h to util.h.
Wouter van Oortmerssen [Mon, 15 Sep 2014 23:27:21 +0000 (16:27 -0700)]
Added missing assert.h to util.h.

This was only causing compiler errors on certain compiler configurations.

Change-Id: I110fb8c896f74aae7ef739e9a29c636393dbbde2
Tested: on Linux and Windows.

10 years agoThe parser and flatc now allow include directories to be specified.
Wouter van Oortmerssen [Fri, 12 Sep 2014 00:13:21 +0000 (17:13 -0700)]
The parser and flatc now allow include directories to be specified.

Bug: 17139854
Change-Id: I0eac65d054951e00a8811ad1d80ba8c37012dbf0
Tested: on Linux.

10 years agoAdded convenient vector from array construction for Java.
Wouter van Oortmerssen [Thu, 11 Sep 2014 21:36:33 +0000 (14:36 -0700)]
Added convenient vector from array construction for Java.

Change-Id: Ib3fd576cf9fa4b4058a9fd1bbe24a0859bc3917a
Tested: on Linux.

10 years agoAdded accessor in Java to get vectors as ByteBuffers.
Wouter van Oortmerssen [Wed, 10 Sep 2014 23:38:37 +0000 (16:38 -0700)]
Added accessor in Java to get vectors as ByteBuffers.

Also cleaned up ByteBuffer usage in general: ByteBuffer.position
now universally indicates the start of a ByteBuffer.

Change-Id: Ic4bfb98f9df9501b8fc82de2c45db7d7311135ac
Tested: on Linux.

10 years agoFixed test that was incompatible with 64bit offsets.
Wouter van Oortmerssen [Wed, 10 Sep 2014 23:00:01 +0000 (16:00 -0700)]
Fixed test that was incompatible with 64bit offsets.

Change-Id: I35984d0ab3e849bec6cdaa364a39f66f2c37b4d0
Tested: on Linux.

10 years agoRemoved the use of b.array() to support DirectBuffers.
bml13 [Tue, 9 Sep 2014 09:30:09 +0000 (10:30 +0100)]
Removed the use of b.array() to support DirectBuffers.

Also removed Table extend Constants.

Change-Id: I1770b613c58094fa572a3b26a31f01bd5fb8fdbf

10 years agoInitial commit of .NET port of FlatBuffers
evolutional [Tue, 9 Sep 2014 18:46:13 +0000 (11:46 -0700)]
Initial commit of .NET port of FlatBuffers

Include C# codegen in flatc and .NET FlatBuffer access via the
FlatBufferBuilder class

Tested: on Windows.

Change-Id: If5228a8df60a10e0751b245c6c64530264ea2d8a

10 years agoAdded option to disable build of tests and samples.
Stewart Miles [Wed, 10 Sep 2014 23:01:13 +0000 (16:01 -0700)]
Added option to disable build of tests and samples.

Added FLATBUFFERS_BUILD_TESTS option which can be used to disable
the build of flatbuffers tests and samples.

Tested:
Verified tests and samples are no longer built on Linux when
FLATBUFFERS_BUILD_TESTS=OFF.

Change-Id: Ic23ab827849ba2c4481de9ca86adc1ab8e6b828c

10 years agoMade FlatBufferBuilder.java require ByteBuffers that have an array.
Wouter van Oortmerssen [Fri, 5 Sep 2014 20:48:02 +0000 (13:48 -0700)]
Made FlatBufferBuilder.java require ByteBuffers that have an array.

Readonly ByteBuffers and Direct ByteBuffers don't have a backing
array, and thus can't be used for writing FlatBuffers (though
they are fine for reading).

Change-Id: I4d7b9cc222b96161d0f8e92f34588bd3e0e38034
Tested: on Linux.

10 years agoNon-alpha-numeric characters are filtered out of include guards
Wouter van Oortmerssen [Fri, 5 Sep 2014 18:19:51 +0000 (11:19 -0700)]
Non-alpha-numeric characters are filtered out of include guards

Since part of it is based on the filename, which may contain
characters that are not legal identifiers.

Change-Id: I62b8fe228a434a2040fd4ce47d220fc4d3398b41
Tested: on Linux.

10 years agoA generated C++ function was missing "inline".
Wouter van Oortmerssen [Fri, 5 Sep 2014 17:56:16 +0000 (10:56 -0700)]
A generated C++ function was missing "inline".

This would cause double definition linker errors when included in
multiple compilation units.

Change-Id: Ie6fd4af018055a099343182a92a7776f2fea4725
Tested: on Linux.

10 years agoFixed JSON text output not finding symbolic names for enum value 1.
Wouter van Oortmerssen [Fri, 5 Sep 2014 00:25:33 +0000 (17:25 -0700)]
Fixed JSON text output not finding symbolic names for enum value 1.

Change-Id: If3a062926dd86b95fa68ed64fc7ee2de7bc0d930
Tested: on Linux

10 years agoImplemented the file identifier functionality for Java.
Wouter van Oortmerssen [Thu, 4 Sep 2014 23:31:44 +0000 (16:31 -0700)]
Implemented the file identifier functionality for Java.

Also fixed flatc not outputting these identifiers for files
compiled on the command-line.

Bug: 16983987
Change-Id: I8b714cfea3a8e144fa52133f62b2f7eda6eb044a
Tested: on Linux

10 years agoMade Vector have a size() function, to make it more STL-alike.
Wouter van Oortmerssen [Thu, 4 Sep 2014 19:22:11 +0000 (12:22 -0700)]
Made Vector have a size() function, to make it more STL-alike.

Bug: 17316346
Change-Id: I52377b7fa51adccadc4e867d45666e683bc2c1ae
Tested: on Linux.

10 years agoChanged hard-coded constant in JavaTest to enum value.
Wouter van Oortmerssen [Thu, 4 Sep 2014 19:13:18 +0000 (12:13 -0700)]
Changed hard-coded constant in JavaTest to enum value.

Change-Id: I7d2eac7fed6c36c966670a3e58f4dae7dff25029
Tested: on Linux.

10 years agoFixed possible alignment issue in Go
rw [Thu, 4 Sep 2014 06:26:06 +0000 (23:26 -0700)]
Fixed possible alignment issue in Go

Java patch with same purpose:
cdb0dca39d683d577caa7fde21a1b6db9aa64734

Change-Id: I57d268cc0064843779eb7812a9e69326d9ab2498
Tested: on Darwin

10 years agoMade "field set more than once" check in JSON parser faster.
Wouter van Oortmerssen [Thu, 4 Sep 2014 18:57:09 +0000 (11:57 -0700)]
Made "field set more than once" check in JSON parser faster.

Change-Id: I3ecc1aa610526c270faa56cc5266f14cd81db247
Tested: on Linux.

10 years agoFixed missing <functional> header (VS). v1.0.2
Wouter van Oortmerssen [Wed, 3 Sep 2014 23:39:22 +0000 (16:39 -0700)]
Fixed missing <functional> header (VS).

Change-Id: I89d0f9b18bfe4d27be325c7f7205dee14bc7e1be
Tested: on Windows.

10 years agoMade sure GetRootAs..() functions are generated for all Java tables.
Wouter van Oortmerssen [Wed, 3 Sep 2014 22:34:40 +0000 (15:34 -0700)]
Made sure GetRootAs..() functions are generated for all Java tables.

Previously they were only generated for the root_type, making it
impossible to use the other types in the file as the root of a buffer.

Bug: 17206174
Change-Id: Ie71bed42ac3b22dcceae6385cbd5846c37e5f1b8
Tested: on Linux

10 years agoSetting a field twice in a JSON object now gives error.
Wouter van Oortmerssen [Wed, 3 Sep 2014 21:48:37 +0000 (14:48 -0700)]
Setting a field twice in a JSON object now gives error.

Before, it would crash in FlatBufferBuilder.

Bug: 17357164
Change-Id: I6e6dbada5261745220345379eb53eb3eb113e8f8
Tested: on Linux.

10 years agoFixed flatc silently accepting non-scalars as default values.
Wouter van Oortmerssen [Wed, 3 Sep 2014 19:23:15 +0000 (12:23 -0700)]
Fixed flatc silently accepting non-scalars as default values.

Bug: 17304016
Change-Id: I4873f8ef32fbb2657f15fc53a2c8f767e10f2d96
Tested: on Linux

10 years agoFixed C++ codegen ignoring multiple padding scalars per field.
Wouter van Oortmerssen [Wed, 3 Sep 2014 18:30:35 +0000 (11:30 -0700)]
Fixed C++ codegen ignoring multiple padding scalars per field.

Bug: 1737325117221979
Change-Id: Ib8b77835f0acd3290f0a5e7d0f683d9fdcbf7230
Tested: on Linux

10 years agoMade reading read-only ByteBuffers work.
Wouter van Oortmerssen [Wed, 3 Sep 2014 01:35:20 +0000 (18:35 -0700)]
Made reading read-only ByteBuffers work.

Also added new constructor that allows ByteBuffer reuse.

Change-Id: I9c20ea96c67533066461f4e23b0d03b9b47cd068
Tested: on OS X.

10 years agoFixed compiler warning for int to char conversion.
Wouter van Oortmerssen [Wed, 3 Sep 2014 00:32:12 +0000 (17:32 -0700)]
Fixed compiler warning for int to char conversion.

Change-Id: Idc6c152ebf9e733ac72c01f3888b69e3b5f33aa9
Tested: on Linux.

10 years agoFixed compile errors in VS / gcc for recent commits.
Wouter van Oortmerssen [Mon, 25 Aug 2014 17:42:38 +0000 (10:42 -0700)]
Fixed compile errors in VS / gcc for recent commits.

Tested: on Windows & Linux.

Change-Id: I90e18c448fc2fafeb83a6cdc3776174479874562

10 years agoImproved the verifier to be even more resilient.
Wouter van Oortmerssen [Fri, 22 Aug 2014 00:00:54 +0000 (17:00 -0700)]
Improved the verifier to be even more resilient.

Theoretically, an attacker could construct a FlatBuffer with the
sole purpose of making verification really expensive, essentially
DOS-ing a server that uses verification on FlatBuffers. This adds
a max table depth and max table amount at which point the
verifier declares the buffer malformed.

Bug: 16301336
Change-Id: I6b098c31d030d24c19e852b33609110658e66aa9
Tested: on OS X

10 years agoPrefixing of enum value identifiers in C++ is now optional.
Wouter van Oortmerssen [Thu, 21 Aug 2014 23:11:18 +0000 (16:11 -0700)]
Prefixing of enum value identifiers in C++ is now optional.

See -P option to flatc.

Bug: 16814856
Change-Id: I855973df6afa27e0efa27cf9c4b4aee8a1fcdd22
Tested: on OS X.

10 years agoflatc now outputs the filename with error messages.
Wouter van Oortmerssen [Thu, 21 Aug 2014 22:44:51 +0000 (15:44 -0700)]
flatc now outputs the filename with error messages.

Bug: 16683956
Change-Id: Id8435e868899ca0bbf0add84852a54bfaea63b4a
Tested: on OS X.

10 years agoThe list of enum values is now allowed to end in a comma.
Wouter van Oortmerssen [Thu, 21 Aug 2014 22:17:45 +0000 (15:17 -0700)]
The list of enum values is now allowed to end in a comma.

Bug: 16490424
Change-Id: Ic3dd5f06efb5cf2dc4aefbd3f2db64c7b59b6b93
Tested: on OS X.

10 years agoChecking for clashes between field names and generated field names.
Wouter van Oortmerssen [Thu, 21 Aug 2014 22:02:15 +0000 (15:02 -0700)]
Checking for clashes between field names and generated field names.

This happens when the schema is parsed, to avoid compile time errors
later, which would be harder to understand.

Bug: 16325216
Change-Id: I24cabf1adaf1700796b91e3a9641bca43a68bfbd
Tested: on OS X.

10 years agoflatc now creates the output directory if it doesn't exist yet.
Wouter van Oortmerssen [Thu, 21 Aug 2014 19:08:10 +0000 (12:08 -0700)]
flatc now creates the output directory if it doesn't exist yet.

Also cleaned up the general mkdir functionality.

Tested: on OS X.

Tested that a command line like: ./flatc -j -o foo/bar/baz tests/monster_test.fbs
generates files in foo/bar/baz/MyGame/Example/*.java which previously didn't exist.

Windows code was previously tested but has been moved, so needs to be tested again.

Change-Id: Iee943121b3be4f92961a3ec94c2cb578165f114a

10 years agoSupport all JSON escape codes (including \u) for parsing & text gen.
Wouter van Oortmerssen [Wed, 20 Aug 2014 20:22:16 +0000 (13:22 -0700)]
Support all JSON escape codes (including \u) for parsing & text gen.

Bug: 16624362
Change-Id: Ia09ea404c0c11dd1dc6993a8cbd155bf8152b65f
Tested: on Windows & Linux.

10 years agoFixed warnings for unused variables in Visual Studio.
Wouter van Oortmerssen [Wed, 20 Aug 2014 18:25:58 +0000 (11:25 -0700)]
Fixed warnings for unused variables in Visual Studio.

Change-Id: I51eeed20c3e0a4914280bf33585ca03b9a9952aa
Tested: on Windows.

10 years agoReferring to types from other namespaces in C++ now works correctly.
Wouter van Oortmerssen [Tue, 19 Aug 2014 23:37:46 +0000 (16:37 -0700)]
Referring to types from other namespaces in C++ now works correctly.

Previously, it would ignore the fact that the type comes from a
different namespace. Now they are pre-declared in their own namespace,
and referenced with a qualified name if necessary.

Bug: 16851682
Change-Id: I5cb625b86d28e7436b9e93c70a0fa16a600d9884
Tested: on Linux

10 years agoSchemas now support include files.
Wouter van Oortmerssen [Tue, 19 Aug 2014 21:20:05 +0000 (14:20 -0700)]
Schemas now support include files.

Bug: 15521443
Change-Id: I2e1ef97e7225a1a0ecf2ca65e31d49d443003747
Tested: on Linux.

10 years agoFixed "unused private field" warning for clang.
Wouter van Oortmerssen [Mon, 18 Aug 2014 22:44:06 +0000 (15:44 -0700)]
Fixed "unused private field" warning for clang.

Bug: 17095037
Change-Id: Iedbe56f6ddc0ba7876896b0bb7ed9da8e6a85f7e
Tested: on Linux & OS X.

10 years agoClarified a documentation statement about circular references.
Wouter van Oortmerssen [Mon, 18 Aug 2014 20:49:00 +0000 (13:49 -0700)]
Clarified a documentation statement about circular references.

Change-Id: I8f3c50085f89037995ab9f26b28d3c83667e9d6f

10 years agoFixed possible alignment issue in Java v1.0.1
Wouter van Oortmerssen [Wed, 13 Aug 2014 18:43:15 +0000 (11:43 -0700)]
Fixed possible alignment issue in Java

Tested: on Linux

Change-Id: Ie80aa19ed13ac4fa15cd3fd768f1a35526bdc607

10 years agoMade the assert in the verifier optional
Wouter van Oortmerssen [Tue, 12 Aug 2014 23:49:37 +0000 (16:49 -0700)]
Made the assert in the verifier optional

Change-Id: Ie6b0a8e137a0743bbf18531f29712cf5f11bf34f
Tested: on Linux

10 years agoParser now allows empty tables in JSON
Wouter van Oortmerssen [Tue, 12 Aug 2014 23:20:13 +0000 (16:20 -0700)]
Parser now allows empty tables in JSON

Bug: 16870719
Change-Id: Ia5fdce49a67b1aa621ab1e37a815e2a3293257b6
Tested: on Linux

10 years agoFixed compile warning related to file identification feature.
Wouter van Oortmerssen [Tue, 12 Aug 2014 22:46:27 +0000 (15:46 -0700)]
Fixed compile warning related to file identification feature.

Change-Id: Id33cf778caa818c7d3988edee82058e63bfecbf0
Tested: on Linux

10 years agoFix vector of strings for Java
Bob Potter [Sat, 9 Aug 2014 02:59:28 +0000 (21:59 -0500)]
Fix vector of strings for Java

Change-Id: If032b450230b15224b2661836c8a740398d207c5

10 years agoFile identifier feature.
Wouter van Oortmerssen [Thu, 31 Jul 2014 22:11:03 +0000 (15:11 -0700)]
File identifier feature.

Allows you to add, and test for the presence of a magic 4-char
string in a FlatBuffer.

Tested: on OS X.

Change-Id: I090692a9e4fb53bed3543279a28563e67132cba0

10 years agoFixed bugs that could cause struct values not to be stored or misaligned
Wouter van Oortmerssen [Tue, 12 Aug 2014 00:38:54 +0000 (17:38 -0700)]
Fixed bugs that could cause struct values not to be stored or misaligned

Change-Id: Ie36fe581c000fa4571c96fafd39a9e12fa29e1ca
Tested: on Linux

10 years agoA few document clarifications for Java & Internals.
Wouter van Oortmerssen [Thu, 31 Jul 2014 18:39:40 +0000 (11:39 -0700)]
A few document clarifications for Java & Internals.

Change-Id: I770b53cf7d82c860422c1fe6193fb597d9c9495c

10 years agoMade FlatBuffers compile correctly with -pedantic
Wouter van Oortmerssen [Tue, 29 Jul 2014 17:29:38 +0000 (10:29 -0700)]
Made FlatBuffers compile correctly with -pedantic

Change-Id: I88b5993219e10e2dfb60ff98d6594d19871988fc
Tested: on Linux

10 years agoEnum definitions are generated without a trailing comma (-pedantic).
Wouter van Oortmerssen [Tue, 29 Jul 2014 00:03:08 +0000 (17:03 -0700)]
Enum definitions are generated without a trailing comma (-pedantic).

Change-Id: I07cd28e5915a0526614db85f894f27a5bd27f3bb
Tested: on Windows.

10 years agoAdd CMake finder for downstream projects
Stefan Eilemann [Wed, 16 Jul 2014 14:55:27 +0000 (16:55 +0200)]
Add CMake finder for downstream projects

Change-Id: Ife37f7ead18ee28f8f4fd5e29caeee5e825defd4

10 years agoFix OS X build
Stefan Eilemann [Sat, 26 Jul 2014 11:12:56 +0000 (13:12 +0200)]
Fix OS X build

Change-Id: If0465b73843ad1a489fa66318a689801def3f0f0

10 years agoAdd install step
Daniel Nachbaur [Tue, 15 Jul 2014 13:09:36 +0000 (15:09 +0200)]
Add install step

Change-Id: Ie863ddcf73653d1404a1e84109ebdf66af5dff26

10 years agoTweak Go test.
rw [Tue, 22 Jul 2014 03:12:50 +0000 (20:12 -0700)]
Tweak Go test.

Add more comments explaining the tests. Remove the extraneous 'superFuzz'
functionality. By default, do not compare to generated Java files.

Change-Id: Icb0aa8262e10035958639f9a88ca666694a2ce73

10 years agoExtended symbolic enum parsing in JSON for integers and OR-ing.
Wouter van Oortmerssen [Fri, 25 Jul 2014 22:04:35 +0000 (15:04 -0700)]
Extended symbolic enum parsing in JSON for integers and OR-ing.

Change-Id: Iedbd9914a1ca3897776fb92aa9a1fdfc4603da3c
Tested: on Windows and Linux

10 years agoFixed possible compile error in CreateVector* functions.
Wouter van Oortmerssen [Thu, 24 Jul 2014 23:58:30 +0000 (16:58 -0700)]
Fixed possible compile error in CreateVector* functions.

Change-Id: I3b1fca2ea536349240b7bee35eff360f3acbb539
Tested: on Windows and Linux.

10 years agoMerge "Terminate the output directory argument of flatc." into ub-games-master
Stewart Miles [Tue, 22 Jul 2014 18:22:20 +0000 (18:22 +0000)]
Merge "Terminate the output directory argument of flatc." into ub-games-master

10 years agoTerminate the output directory argument of flatc.
Stewart Miles [Tue, 22 Jul 2014 00:56:53 +0000 (17:56 -0700)]
Terminate the output directory argument of flatc.

Given the command

flatc -o . -c test.fbs

it would generate header file

.test_generated.h

rather than

./test_generated.h

This fixes this issue.

Tested:
Manually verified that flatc generates the correct output files given output
paths ending with and without '/' on Linux and Windows.

Bug: 16464827
Change-Id: I854cb881286f22690f1885f942cf3fd2fc59ca8d

10 years agoCorrected the order of the comments on namespace close parens
Alex Ames [Mon, 21 Jul 2014 23:27:58 +0000 (16:27 -0700)]
Corrected the order of the comments on namespace close parens

Also removed the semicolon on the bracket. It makes -pedanic unhappy.

Bug: 16399323
Change-Id: I16ec0d67af13c3ca0bc6285741f5a95658d262bd

10 years agoUpdated benchmark chart with stats for pugixml.
Wouter van Oortmerssen [Fri, 18 Jul 2014 23:15:10 +0000 (16:15 -0700)]
Updated benchmark chart with stats for pugixml.

Change-Id: I23d7db5b62ca52fee49e1bedcf7d7d8d74957cf8
Tested: on Windows.

10 years agoAdded a `bit_flags` attribute to enum declarations that 1<<N every value.
Wouter van Oortmerssen [Thu, 17 Jul 2014 22:12:37 +0000 (15:12 -0700)]
Added a `bit_flags` attribute to enum declarations that 1<<N every value.

Change-Id: Ib9ec0cb3ddec60b1ca124eaf815fb1ae0cc53e1c
Tested: on Windows and Linux
Bug: 16186562

10 years agoMade sure tests.cpp is testing the new vector iterator functionality.
Wouter van Oortmerssen [Wed, 16 Jul 2014 19:07:24 +0000 (12:07 -0700)]
Made sure tests.cpp is testing the new vector iterator functionality.

Also fixes a potential big-endian bug, and makes iterators work
correctly with pointer types.

Change-Id: Ib7f88fe9e6053d1a9afa7895fba0695627c158b1
Tested: on Windows and Linux

10 years agoA feature that officially supports nested FlatBuffers.
Wouter van Oortmerssen [Wed, 16 Jul 2014 00:50:22 +0000 (17:50 -0700)]
A feature that officially supports nested FlatBuffers.

Generates convenient accessors for the nested root.

Change-Id: Ic0b1531de7ace475ff2a7b1f430d27f41c838430
Tested: on Windows.

10 years agoSmall fixes to the core C++ FlatBuffers implementation.
Wouter van Oortmerssen [Tue, 15 Jul 2014 23:27:44 +0000 (16:27 -0700)]
Small fixes to the core C++ FlatBuffers implementation.

- Ensured weak linkage with the version string is not used on Windows,
  especially cygwin (which throws a linker error).
- Avoided a VS debug error for taking the address of the first element
  of an empty vector.
- Made copy/assignment constructors for downward_vector and
  FlatBufferBuilder private, to avoid people unintentionally making
  expensive copies.
- Using the more correct _WIN32 instead of WIN32

Change-Id: I801b5c8b159e3721af6d1ef0978a3247ba168bab
Tested: on Windows (VS + Cygwin) and Linux.

10 years agoPort FlatBuffers to Go.
rw [Fri, 11 Jul 2014 23:12:35 +0000 (16:12 -0700)]
Port FlatBuffers to Go.

Implement code generation and runtime library for Go, derived from the
Java implementation. Additionally, the test suite verifies:

 - the exact bytes in the Builder buffer during object construction,
 - vtable deduplication, and
 - table construction, via a fuzzer derived from the C++ implementation.

Change-Id: Ib95a019c684891def2b50281e570b4843fea7baa

10 years agoJSON parsing & text generation is now enum-identifier aware.
Wouter van Oortmerssen [Tue, 15 Jul 2014 00:49:04 +0000 (17:49 -0700)]
JSON parsing & text generation is now enum-identifier aware.

When Parsing JSON, it will read enums either as int values, identifiers
specific to the enum type, or strings containing those identifiers.

When generating text, it will output enum identifiers by default
(this can be turned off in favor of integers, like before).

Change-Id: If28b0a1f8f27de79aff3e626f40c0c0b271c325a
Tested: on Windows and Linux
Bug: 16214968

10 years agoAdded an iterator to Vector so you can use range based for loops on them.
Bas Zalmstra [Mon, 30 Jun 2014 14:56:34 +0000 (16:56 +0200)]
Added an iterator to Vector so you can use range based for loops on them.

Change-Id: I6310edd554fba494a76e47b03d3c2bc07b90795d

10 years agoAdd support for the Xbox360 platform (PPC+msvc)
Matthew Endsley [Fri, 11 Jul 2014 23:41:47 +0000 (23:41 +0000)]
Add support for the Xbox360 platform (PPC+msvc)

This includes generic big endian support for msvc by mapping the
Microsoft byte swap instrinsics _bytes_swap_* to the gcc counterpart
names.

10 years agoflatc can now convert flatbuffer binary files into json.
Wouter van Oortmerssen [Fri, 11 Jul 2014 21:01:55 +0000 (14:01 -0700)]
flatc can now convert flatbuffer binary files into json.

Also removed it appending _wire to filenames, renamed the json golden
file to .golden to not clash with generated files.

Bug: 15781201
Change-Id: I8322861e50d1e5b6a5ab5e4b5e5d8ae13c356eb2
Tested: on Windows and Linux

10 years agoMade Java argument names help remind the user when something is an offset.
Wouter van Oortmerssen [Fri, 11 Jul 2014 00:46:45 +0000 (17:46 -0700)]
Made Java argument names help remind the user when something is an offset.

Bug: 15856217
Change-Id: I9163d13ca26c2d53064f5289c993692be711685f
Tested: on Windows

10 years agoThe generated CreateX() calls now come with default values for args.
Wouter van Oortmerssen [Thu, 10 Jul 2014 22:55:11 +0000 (15:55 -0700)]
The generated CreateX() calls now come with default values for args.

bug: 15777627
Change-Id: I9389de46ea883ab0ef1beab9370e5c8e96b4d0b5
Tested: on Windows and Linux

10 years agoChanged the tracking token implementation to be more robust.
Wouter van Oortmerssen [Thu, 10 Jul 2014 21:20:05 +0000 (14:20 -0700)]
Changed the tracking token implementation to be more robust.

The previous version only was included for users of FlatBufferBuilder,
this one should also work for programs that only ever read
FlatBuffers.

Bug: 15762139
Change-Id: Ifceb337ffc1dd9dd09d77c3848cad8707e5c3726
Tested: on Linux.

10 years agoParser now correctly reads floats in scientific notation.
Wouter van Oortmerssen [Thu, 10 Jul 2014 20:40:55 +0000 (13:40 -0700)]
Parser now correctly reads floats in scientific notation.

Change-Id: I7abb14a4b6c596674d6aff2b9de6e63603c0d2dc
Tested: on Windows and Linux.

10 years agoFixed namespace declaration not being cleared between files.
Wouter van Oortmerssen [Wed, 9 Jul 2014 21:21:11 +0000 (14:21 -0700)]
Fixed namespace declaration not being cleared between files.

Change-Id: Ie9fedf894d82a403d0b6b4848d221d6bbee58984
Tested: on OS X.

10 years agoFixed incorrect verifier code for nested tables.
Wouter van Oortmerssen [Wed, 9 Jul 2014 18:44:26 +0000 (11:44 -0700)]
Fixed incorrect verifier code for nested tables.

It was outputting the type instead of the field name, and didn't deal
with NULL fields. Added test case.

Also fixed token enums having the wrong value, resulting in
unreadable error messages.

Change-Id: Icd9b4d22f417bfad5824c0f58e067ce3f2e2dc6f
Tested: on Windows and Linux.

10 years agoFixed vectors reserving wrong amount of space in Java.
Wouter van Oortmerssen [Wed, 9 Jul 2014 00:14:02 +0000 (17:14 -0700)]
Fixed vectors reserving wrong amount of space in Java.

In the generated code, the type of the vector was used for
the element size, instead of the vector element type.

Change-Id: Ie16d5221a61474365292c948fd3af99e2a7716c7
Tested: on Windows.

10 years agoAdded a "strict JSON" mode to the text generator and compiler
Wouter van Oortmerssen [Tue, 8 Jul 2014 23:35:14 +0000 (16:35 -0700)]
Added a "strict JSON" mode to the text generator and compiler

This will add quotes around field names, as required by the official
standard. By default it will leave quotes out, as it is more readable,
more compact, and is accepted by almost all JSON parsers.
The -S switch to flatc turns on strict mode.

As per rfc 7159.

Change-Id: Ibabe9c8162c47339d00ec581d18721a2ba40c6d0
Tested: on Windows.

10 years agoAdded functionality to assign field ids manually in a schema
Wouter van Oortmerssen [Tue, 8 Jul 2014 00:34:23 +0000 (17:34 -0700)]
Added functionality to assign field ids manually in a schema

New attribute:

-   `id: n` (on a table field): manually set the field identifier to `n`.
    If you use this attribute, you must use it on ALL fields of this table,
    and the numbers must be a contiguous range from 0 onwards.
    Additionally, since a union type effectively adds two fields, its
    id must be that of the second field (the first field is the type
    field and not explicitly declared in the schema).
    For example, if the last field before the union field had id 6,
    the union field should have id 8, and the unions type field will
    implicitly be 7.
    IDs allow the fields to be placed in any order in the schema.
    When a new field is added to the schema is must use the next available ID.

Change-Id: I8690f105f3a2d31fdcb75a4fab4130692b12c62f
Tested: on Windows

10 years agoMade declaring the underlying type of an enum mandatory.
Wouter van Oortmerssen [Wed, 2 Jul 2014 19:01:21 +0000 (12:01 -0700)]
Made declaring the underlying type of an enum mandatory.

This is a breaking change, anyone having schema files with enums
that do not specify a type will get a specialized error:

must specify the underlying integer type for this
enum (e.g. ': short', which was the default).

All of the samples and docs already had a type specified,
so hopefully this will affect very few people.

Bug: 15777205
Change-Id: I9b8d7c0827867f7efb6c217346db7e402695eff0
Tested: on Windows

10 years agoFixed helper function CreateVectorOfStructs calling wrong variant.
Wouter van Oortmerssen [Wed, 2 Jul 2014 18:19:02 +0000 (11:19 -0700)]
Fixed helper function CreateVectorOfStructs calling wrong variant.

Change-Id: I4fd2a309276590227921ede467503f56b65ac689
Tested: on Windows and Linux

10 years agoFixed flatc not stripping the path from the base filename.
Wouter van Oortmerssen [Wed, 2 Jul 2014 17:32:32 +0000 (10:32 -0700)]
Fixed flatc not stripping the path from the base filename.

This caused two bugs when used with a path: not being able to save
the generated files, and preprocessor defines with / characters in
them.

Bug: 15676771

Tested: on Windows

Change-Id: I62a3c45d22e2545fdaad83728d83a42a6efa37f9

10 years agoFixed a bugs in the Java runtime that could cause an index out of bounds exception.
Wouter van Oortmerssen [Wed, 2 Jul 2014 00:56:12 +0000 (17:56 -0700)]
Fixed a bugs in the Java runtime that could cause an index out of bounds exception.

Tested: on Windows.

Change-Id: I0d4cdafc21690eb9a509ba31f21e80dacfb602ff

10 years agoSwitched VS build to -W4, and fixed all resulting warnings.
Wouter van Oortmerssen [Mon, 30 Jun 2014 22:56:31 +0000 (15:56 -0700)]
Switched VS build to -W4, and fixed all resulting warnings.

Change-Id: I654217cbd01a3a449503d95753e19b672ec7ec23
Tested: on Windows, Linux

10 years agoAdd buffer verification functionality to FlatBuffers
Wouter van Oortmerssen [Fri, 27 Jun 2014 23:44:53 +0000 (16:44 -0700)]
Add buffer verification functionality to FlatBuffers

Bug: 15732628
Change-Id: I0b7cb65982d6b8957d5a899cca7d2b5d2ef53206
Tested: On Windows, OS X and Linux

10 years agoGenerated C++ headers now have include guards.
Wouter van Oortmerssen [Mon, 23 Jun 2014 23:42:04 +0000 (16:42 -0700)]
Generated C++ headers now have include guards.

Bug: 15700355
Change-Id: Iceccb5b344e394e399092ffaa81f9cad2f0418ab
Tested: on Windows

10 years agoMerge "license is a comment, not an echo" into ub-games-master
Wouter van Oortmerssen [Mon, 23 Jun 2014 23:13:20 +0000 (23:13 +0000)]
Merge "license is a comment, not an echo" into ub-games-master

10 years agoMerge "show absolute path to user when aborting" into ub-games-master
Wouter van Oortmerssen [Mon, 23 Jun 2014 23:13:09 +0000 (23:13 +0000)]
Merge "show absolute path to user when aborting" into ub-games-master

10 years agoMerge "sh script for JavaTest" into ub-games-master
Wouter van Oortmerssen [Mon, 23 Jun 2014 23:12:57 +0000 (23:12 +0000)]
Merge "sh script for JavaTest" into ub-games-master

10 years agoJSON text output now optionally doesn't output linefeeds either.
Wouter van Oortmerssen [Mon, 23 Jun 2014 21:14:31 +0000 (14:14 -0700)]
JSON text output now optionally doesn't output linefeeds either.

Change-Id: Iedac80ee00b27a97c21c7b4ac7c9792e5bafbcc8
Tested: On Windows

10 years agoDoc clarifications (Java vectors, test working dir, benchmark fix).
Wouter van Oortmerssen [Mon, 23 Jun 2014 20:33:34 +0000 (13:33 -0700)]
Doc clarifications (Java vectors, test working dir, benchmark fix).

Change-Id: If8cc05669d82df892e1d4e11f7fbbd68b2dc05bf

10 years agolicense is a comment, not an echo
rw [Mon, 23 Jun 2014 20:37:32 +0000 (13:37 -0700)]
license is a comment, not an echo