Wouter van Oortmerssen [Wed, 18 Nov 2015 17:28:00 +0000 (09:28 -0800)]
Merge pull request #312 from chobie/unity-fix
C# Unity (.NET 3.5) can't cast enum default value.
Shuhei Tanuma [Thu, 5 Nov 2015 22:47:39 +0000 (07:47 +0900)]
C# Unity can't cast integer represented enum value.
```
namespace MyGame;
enum CommandType : byte {
None = 0,
}
table Command {
id:int;
type:CommandType;
}
```
then generate c# files. it'll output compile error like these.
```
Assets/MyGame/Command.cs(18,39): error CS1041: Identifier expected
Assets/MyGame/Command.cs(18,39): error CS1737: Optional parameter cannot precede required parameters
16: public static Offset<Command> CreateCommand(FlatBufferBuilder builder,
17: int id = 0,
18: CommandType type = (CommandType)0) {
```
Wouter van Oortmerssen [Mon, 16 Nov 2015 22:10:16 +0000 (14:10 -0800)]
Merge branch 'master' of https://github.com/google/flatbuffers
Robert [Mon, 16 Nov 2015 20:18:30 +0000 (12:18 -0800)]
Merge pull request #343 from rw/go-builder-ergonomics
Go: Improve Builder user interface.
Wouter van Oortmerssen [Mon, 16 Nov 2015 17:07:31 +0000 (09:07 -0800)]
Merge pull request #344 from rw/py-builder-ergonomics
Python: Improve Builder user interface.
Jon Simantov [Sat, 14 Nov 2015 02:04:41 +0000 (18:04 -0800)]
Store the dirs you pass into build_flatbuffers as properties.
This allows you to query the generated target for those properties
later, so dependent modules can refer to the directories to, for example,
add them to the include_directories.
Change-Id: I7a6bd34c5c1d08e2ea69b5ad845223297cad1159
Jon Simantov [Thu, 12 Nov 2015 00:29:26 +0000 (16:29 -0800)]
Added build_flatbuffers function to CMake.
This function is designed to be called by projects that use FlatBuffers.
It takes a list of FlatBuffers schemas and a list of schema include
directories, and generates build rules to create generated headers
and/or binary schemas for those files, as well as optionally copying
all of the text schemas into a directory for your use (for example if
you need to parse text schemas within your app).
See function comments for more details.
Change-Id: I181684b916e91d965e14849d8f83ec2c83e9a4a4
Stewart Miles [Fri, 13 Nov 2015 05:12:18 +0000 (21:12 -0800)]
Expand local file path to allow users to fix ndk-build
local-source-file-path does not expand to correct file paths in
some circumstances so some users override it. Therefore
flatbuffers_header_build_rules has been modified to generate rules
that expand LOCAL_SRC_FILES values with flatbuffers_header_build_rules.
Also, this overrides local-source-file-path to allow nest projects
to build when NDK_OUT is set.
Tested:
Verified a dependent project continues to build.
Bug:
25673744
Change-Id: Ic90186fe96d6e4533f9f3b7ca9ef78084de08a7e
Stewart Miles [Fri, 13 Nov 2015 02:16:45 +0000 (18:16 -0800)]
Pass job server arguments (-jX) to make.
When $(MAKE) is expanded via a macro "make" doesn't know whether
$(MAKE) refers to an instance of the make app and therefore doesn't
pass job server arguments down. This change adds the + prefix to the
command in the receipe in order to indicate $(MAKE) is another instance of
make.
Tested:
Verified flatc builds in parallel from Android builds.
Change-Id: I9f2f4f9680b818fdda7420a75a8bfa995b4644db
rw [Thu, 12 Nov 2015 03:43:53 +0000 (19:43 -0800)]
Python: Improve Builder user interface.
+ Add state to the Builder object to track if we are inside a table,
and if we are finished building the buffer.
+ Use this data to check that a buffer is being built correctly.
+ Raise an exception if a buffer is not being built correctly.
+ Test that the exceptions happen as expected.
Based on d236dea.
rw [Thu, 12 Nov 2015 01:08:16 +0000 (17:08 -0800)]
Improve Builder user interface.
+ Add state to the Builder object to track if we are inside a table,
and if we are finished building the buffer.
+ Use this data to check that a buffer is being built correctly.
+ Panic if a buffer is not being built correctly.
+ Test that the panics happen as expected.
Based on
d236dea13d2fdb9ad596679868eb4204c1562151.
Wouter van Oortmerssen [Wed, 11 Nov 2015 18:07:51 +0000 (10:07 -0800)]
Merge pull request #339 from chobie/net-add-bytebuffer-property-to-table
(C#) Add ByteBuffer property to Table
Shuhei Taunma [Tue, 10 Nov 2015 05:20:16 +0000 (14:20 +0900)]
(C#) Add ByteBuffer property to Table
Wouter van Oortmerssen [Tue, 10 Nov 2015 01:23:32 +0000 (17:23 -0800)]
Updated supported languages in the docs.
Change-Id: I607f5f33b609c47fe32342f5e9d066f61f5546cd
Wouter van Oortmerssen [Mon, 9 Nov 2015 17:22:30 +0000 (09:22 -0800)]
Merge pull request #311 from chobie/dont-hide-function-parameter-vs2015
Don't hide function parameter
Shuhei Tanuma [Thu, 5 Nov 2015 22:14:21 +0000 (07:14 +0900)]
Don't hide function parameter
Wouter van Oortmerssen [Fri, 6 Nov 2015 17:51:19 +0000 (09:51 -0800)]
Added new documentation links.
Change-Id: Ib5234a97a863be08c3bb0f9329204bc3a7effccb
Wouter van Oortmerssen [Mon, 28 Sep 2015 22:02:41 +0000 (15:02 -0700)]
Allow structs to be parsed in JSON with out of order fields.
Also simplified the code and made it faster.
Change-Id: I1d83b1165a4a9a4380d1bfb5538769c012d2d367
Tested: on Linux.
Wouter van Oortmerssen [Thu, 29 Oct 2015 00:40:33 +0000 (17:40 -0700)]
Fixed assert in flatc converting to text.
Change-Id: Idac375b22aa9beaba162084cc3396f5536a4e721
Tested: on Linux.
Wouter van Oortmerssen [Wed, 28 Oct 2015 19:07:28 +0000 (12:07 -0700)]
Updated Xcode project for v7
Wouter van Oortmerssen [Wed, 28 Oct 2015 18:54:55 +0000 (11:54 -0700)]
Improved C++ asserts for nesting and not finishing buffers.
Change-Id: I82a392bd262b13e978df748bc54b7ac43aec1e15
Tested: on Linux.
Stewart Miles [Thu, 22 Oct 2015 18:51:33 +0000 (11:51 -0700)]
Improved build rule generation for Android flatbuffer headers.
* Added the ability to create a build target for generated headers.
* Made it possible for generated header targets to depend upon each
other or arbitrary build targets.
Tested:
Verified some pretty complex libraries with numerous flatbuffer schema
dependencies build using this macro on Linux with the NDK.
Bug:
25188384
Change-Id: I846855a50808e58c34cdf7086e93e7ea0df69e0d
Robert [Tue, 20 Oct 2015 20:25:53 +0000 (13:25 -0700)]
Merge pull request #204 from layzerar/fix_struct_comment
fix comment generation of struct
Wouter van Oortmerssen [Tue, 20 Oct 2015 16:36:35 +0000 (09:36 -0700)]
Added assert for referring to 0 offsets.
Change-Id: I7c04d934bfacd4aeaa2ba476b934dd3a62d4fc0e
Tested: on Linux.
Wouter van Oortmerssen [Tue, 20 Oct 2015 00:03:14 +0000 (17:03 -0700)]
Added -M flatc flag to the documentation.
Change-Id: Ie19af91ec5bf0b65297cba58c124bceaa58fd73e
Wouter van Oortmerssen [Mon, 19 Oct 2015 23:05:39 +0000 (16:05 -0700)]
Fixes for JS generator in Xcode
Wouter van Oortmerssen [Mon, 19 Oct 2015 22:55:28 +0000 (15:55 -0700)]
Fixes for JS generator in VS
Wouter van Oortmerssen [Mon, 19 Oct 2015 21:06:46 +0000 (14:06 -0700)]
Vector of structs were not being verified correctly.
Because they are represented as `const T *` in the Vector template,
the sizeof(const T *) was accidentally used instead of sizeof(T).
Change-Id: Ib4dc73e1d21396ba2e30c84e5e229c4147204bb1
Tested: on Linux.
Wouter van Oortmerssen [Mon, 19 Oct 2015 19:49:16 +0000 (12:49 -0700)]
Merge pull request #257 from evanw/javascript
Add support for JavaScript code generation with Google Closure Compiler type annotations
Wouter van Oortmerssen [Mon, 19 Oct 2015 18:11:05 +0000 (11:11 -0700)]
Merge pull request #298 from evolutional/master
Ported some of the python fuzz tests to C#
Wouter van Oortmerssen [Mon, 19 Oct 2015 17:40:16 +0000 (10:40 -0700)]
Merge pull request #296 from prideout/master
Fix minor typos in the Python documentation.
evolutional [Sun, 18 Oct 2015 21:08:39 +0000 (17:08 -0400)]
Ported some of the python fuzz tests to C#
* Refactored the test runner to use attribute based test discovery
* Ported value and vtable/object fuzzing tests from python to C#
Philip Rideout [Sun, 18 Oct 2015 00:48:06 +0000 (17:48 -0700)]
Fix minor typos in the Python documentation.
Evan Wallace [Thu, 15 Oct 2015 06:07:40 +0000 (23:07 -0700)]
Add UTF-8 support to the JavaScript API
This adds an optional argument to generated getters for string fields to
specify the encoding type and overloads the createString() function. It's
now possible to use either JavaScript UTF-16 string objects or C-style
UTF-8 byte arrays (Uint8Array) for string data.
Evan Wallace [Thu, 15 Oct 2015 04:25:16 +0000 (21:25 -0700)]
Update monster_test_generated.js baseline after rebase
Evan Wallace [Wed, 14 Oct 2015 07:29:01 +0000 (00:29 -0700)]
change DataView to bit twiddling for JavaScript
Evan Wallace [Wed, 14 Oct 2015 06:45:38 +0000 (23:45 -0700)]
remove unnecessary return
Evan Wallace [Thu, 20 Aug 2015 16:21:31 +0000 (09:21 -0700)]
Add low-level fuzzer, fix 64-bit issue it found
Evan Wallace [Thu, 20 Aug 2015 06:53:55 +0000 (23:53 -0700)]
Add a test for JavaScript UTF-8 <=> UTF-16 conversion
JavaScript uses UTF-16 but FlatBuffers uses UTF-8. This commit tests the code
that does the conversion between the two encodings. The last entry in the array
is tricky because each code point actually requires two UTF-16 code units,
unlike the other examples. The current JSON output of flatc actually handles
this case incorrectly (it generates invalid JSON with UTF-8 code units). The
generated JavaScript code passes these tests fine, however.
Evan Wallace [Mon, 17 Aug 2015 07:56:54 +0000 (00:56 -0700)]
Add support for JavaScript code generation
This adds a JavaScript language target. The generated JavaScript uses Google
Closure Compiler type annotations and can be compiled using the advanced
compilation mode, which performs type checking and optimizations such as
inlining and dead code elimination. The generated JavaScript also exports all
generated symbols for use with Node.js and RequireJS. This export behavior
can be turned off with the --no-js-exports flag for use with Google Closure
Compiler.
Wouter van Oortmerssen [Tue, 6 Oct 2015 00:39:08 +0000 (17:39 -0700)]
Added support for imports and many other .proto features.
Change-Id: I6600021b7ec8c486794349511232c3e604421c5b
Tested: on Linux.
Robert [Thu, 8 Oct 2015 07:23:26 +0000 (00:23 -0700)]
Merge pull request #286 from tguo-aa/fix-278
Add self.assertNotNested() in CreateString
tguo-aa [Tue, 29 Sep 2015 00:30:37 +0000 (08:30 +0800)]
Add self.assertNotNested() in CreateString
And also add a test case.
If you try to nest CreateString you will get a clear exception.
Wouter van Oortmerssen [Mon, 28 Sep 2015 22:31:03 +0000 (15:31 -0700)]
Fixed LoadFile on Windows
Wouter van Oortmerssen [Mon, 28 Sep 2015 17:49:01 +0000 (10:49 -0700)]
Improved documentation with links to videos, articles and who uses it.
Change-Id: I62de6b7008e397a5043d47f014a7acd83ee64740
Wouter van Oortmerssen [Mon, 28 Sep 2015 16:42:45 +0000 (09:42 -0700)]
Made .proto parsing understand nested declarations.
Bug:
24401812
Change-Id: I196a03b8c5ef0bcd3c26178239c764e40ca1950d
Tested: on Linux.
Wouter van Oortmerssen [Fri, 25 Sep 2015 21:54:50 +0000 (14:54 -0700)]
Merge pull request #282 from google/fix-277
Fix 32bit-system integer overflow (test only)
Robert [Fri, 25 Sep 2015 20:57:17 +0000 (13:57 -0700)]
Fix 32bit-system integer overflow (test only)
For #277
Wouter van Oortmerssen [Fri, 25 Sep 2015 17:38:50 +0000 (10:38 -0700)]
Merge pull request #280 from alexames/master
Removed call to pop_back on std::string.
Wouter van Oortmerssen [Fri, 25 Sep 2015 16:21:31 +0000 (09:21 -0700)]
Fixed .proto translation making scalars into required fields.
Change-Id: If414d156b4e9bc7fead5f131823b2c419cdc4e2c
Tested: on Linux.
Alex Ames [Thu, 24 Sep 2015 21:19:32 +0000 (14:19 -0700)]
Removed call to pop_back on std::string.
The pop_back function was added to strings in C++11 and it appears not
all compilers we target support it. The call to pop_back has been
replaced with a call to erase.
Tested on Linux. All unit tests pass.
Wouter van Oortmerssen [Wed, 23 Sep 2015 19:37:45 +0000 (12:37 -0700)]
Merge pull request #274 from cogumbreiro/master
Fix an out-of bounds read when the element is bigger than the buffer.
Robert [Mon, 21 Sep 2015 22:13:24 +0000 (15:13 -0700)]
Merge pull request #275 from brunoqc/patch-1
Remove duplicate Go test
Bruno Bigras [Mon, 21 Sep 2015 21:51:16 +0000 (17:51 -0400)]
Remove duplicate Go test
Tiago Cogumbreiro [Sat, 19 Sep 2015 01:38:47 +0000 (20:38 -0500)]
Fix an out-of bounds read when the element is bigger than the buffer.
Ensure the size of the buffer being checked is bigger than the element
of the buffer being checked. The buffer can be triggered when, for
example, the buffer is of length zero and we are checking for:
Verify<uoffset_t>(buf_)
The condition above should fail.
Björn Reimer [Tue, 8 Sep 2015 09:00:35 +0000 (11:00 +0200)]
serialize boolean in JSON to "true/false" instead of "0/1"
Change-Id: I90cf519c00eaf9ccd9fcab8035a91b9205587c3b
Wouter van Oortmerssen [Wed, 16 Sep 2015 17:14:49 +0000 (10:14 -0700)]
Merge pull request #271 from vijairaj/scoped-enums
Implemented option --scoped-enum for C++ generator
vijairaj [Tue, 15 Sep 2015 08:11:29 +0000 (13:41 +0530)]
Implemented option --scoped-enum for C++ generator
This generates C++11 style scoped and strongly typed enums.
Enabling this option also implies --no-prefix.
Wouter van Oortmerssen [Tue, 15 Sep 2015 00:50:29 +0000 (17:50 -0700)]
Merge pull request #266 from kadirahq/fix-travis-osx
Fix before_install step on .travis.yml file for osx
Wouter van Oortmerssen [Mon, 14 Sep 2015 18:00:12 +0000 (11:00 -0700)]
Clarified use of unions in C++.
Change-Id: I9654e0c6a45457c8e150f07dd5f7b39539266f9e
Jason Sanmiya [Fri, 11 Sep 2015 20:40:59 +0000 (13:40 -0700)]
Fix Visual Studio 2012 build warning.
Also, remove execute permissions on several source files.
Tested: Builds on Visual Studio 2012, and Linux.
Change-Id: Idaacb2ae8eba98ce2974218c2ab840e97a1d67e9
Wouter van Oortmerssen [Fri, 11 Sep 2015 21:23:53 +0000 (14:23 -0700)]
Merge pull request #269 from teemuandersen/master
Add @SuppressWarnings("all") to generated Java classes
Teemu Andersén [Thu, 10 Sep 2015 16:56:50 +0000 (19:56 +0300)]
Add @SuppressWarnings("unused") to generated Java classes
Usually generators add @SuppressWarnings("all") to generated Java
classes to prevent IDEs from complaining about unused imports, etc.
Solving used imports seems pretty hard with current generator logic so
IMO this is the next best thing.
Yes, it’s appended to import block but that is the block that gives
these warnings in the first place.
Muhammed Thanish [Thu, 10 Sep 2015 04:21:35 +0000 (09:51 +0530)]
Fix OSX related errors on travis
- Install g++ and cmake only on Linux.
- Use biicode only on Linux machines.
Wouter van Oortmerssen [Wed, 9 Sep 2015 19:56:23 +0000 (12:56 -0700)]
Improved the speed of LoadFile() in debug mode.
Apparently, istreambuf_iterator has a lot of overhead.
Change-Id: I804f4e8f2b380b05e939edefe0e1e88cd10e920c
Tested: on Linux.
Wouter van Oortmerssen [Fri, 28 Aug 2015 19:06:41 +0000 (12:06 -0700)]
Fixed Android builds on Windows (generated schema rules).
include.mk causes absolute paths to be generated, which doesn't
work on Windows (make doesn't like : in paths).
Change-Id: Ib06c9581620bde1e8452e0dd887d3986d517c4f5
Tested: on Windows, Linux.
Melvi Ts [Fri, 28 Aug 2015 15:48:28 +0000 (23:48 +0800)]
Python: Fix potential code generation issue of documentation comment.
Wouter van Oortmerssen [Wed, 26 Aug 2015 23:47:59 +0000 (16:47 -0700)]
Fixed a clang warning about signed shifts.
Change-Id: I7c2bf87972ee0ba6811d6ed42e13300bff90e36f
Björn Reimer [Wed, 26 Aug 2015 15:30:07 +0000 (17:30 +0200)]
Fix conversion of floats when generating json
Change-Id: I01def42eda9b70308046c048099d85db8f889ede
Maxim Zaks [Sun, 16 Aug 2015 07:34:56 +0000 (09:34 +0200)]
fixed code generator for array of bools
Change-Id: I3cdd801b641bf180222203a37634598350d340e3
Robert [Wed, 19 Aug 2015 21:22:20 +0000 (23:22 +0200)]
Merge pull request #235 from FrankStain/master
2Gb buffer size checks fixed for Python Builder
Wouter van Oortmerssen [Wed, 19 Aug 2015 18:43:22 +0000 (11:43 -0700)]
Merge pull request #248 from aeneid/master
Added Java and C# mutators
Maor Itzkovitch [Wed, 19 Aug 2015 18:32:08 +0000 (21:32 +0300)]
rebase
Wouter van Oortmerssen [Wed, 19 Aug 2015 18:06:38 +0000 (11:06 -0700)]
Clarified choice of types in Java/C# codegen.
Change-Id: I1f094f350145d13b12cbe367bae7c623cfbbd8d3
Maor Itzkovitch [Sat, 15 Aug 2015 11:48:59 +0000 (14:48 +0300)]
Merge remote-tracking branch 'upstream/master'
Maor Itzkovitch [Sat, 15 Aug 2015 11:48:47 +0000 (14:48 +0300)]
added vector mutators
Wouter van Oortmerssen [Fri, 14 Aug 2015 21:07:54 +0000 (14:07 -0700)]
Added authors to support.md
Change-Id: I8f12e60d29a1c587d991bf64011bdf4a4b0d7e5b
Frank Stein [Thu, 13 Aug 2015 21:50:39 +0000 (00:50 +0300)]
Incorrect buffer size check fixed.
Wouter van Oortmerssen [Wed, 12 Aug 2015 19:05:55 +0000 (12:05 -0700)]
Added a platform / language / feature support matrix to docs.
This is just a start, will need to be extended.
Change-Id: I5a9ad671911942dcb83fdd2bae537deed751cbfd
Wouter van Oortmerssen [Wed, 12 Aug 2015 17:17:10 +0000 (10:17 -0700)]
Add missing Python files from type cast commit.
Change-Id: I800119d8fe19f4c3e95772aba629ef8b2deb9e4b
Wouter van Oortmerssen [Wed, 12 Aug 2015 16:21:21 +0000 (09:21 -0700)]
Merge pull request #253 from mormegil-cz/issue-252
[Issue 252] Add type cast for default enum values in C#
Mormegil [Tue, 11 Aug 2015 16:01:43 +0000 (18:01 +0200)]
[Issue 252] Add type cast for default enum values in C#
When creating a \93CreateXxx(...)\94 method for a \93simple table\94 type,
enum-type fields with a non-zero default must have an explicit
cast for the respective argument default value, because in C#,
there is an implicit cast from int to an enum only for 0.
Also, added an example of such type into the example monster_test
type, so that we test this feature.
Frank Stein [Fri, 7 Aug 2015 18:19:02 +0000 (21:19 +0300)]
MaxBufferSize() changed to MAX_BUFFER_SIZE. Also buffer will never grow more MAX_BUFFER_SIZE.
Maor Itzkovitch [Fri, 7 Aug 2015 15:59:59 +0000 (18:59 +0300)]
rebased fork
Maor Itzkovitch [Fri, 7 Aug 2015 15:35:28 +0000 (18:35 +0300)]
added comments
Maor Itzkovitch [Fri, 7 Aug 2015 15:12:19 +0000 (18:12 +0300)]
added a successful test run console print
Maor Itzkovitch [Fri, 7 Aug 2015 07:57:37 +0000 (10:57 +0300)]
removed console print from code
Maor Itzkovitch [Fri, 7 Aug 2015 07:51:15 +0000 (10:51 +0300)]
fixed C# bytebuffer put methods
Maor Itzkovitch [Fri, 7 Aug 2015 06:05:08 +0000 (09:05 +0300)]
begin to correct C# bytebuffer behavior
Wouter van Oortmerssen [Thu, 6 Aug 2015 00:32:14 +0000 (17:32 -0700)]
Added a link to other FPL libraries to the main page.
Change-Id: I45362806df6d4eff0b0b7521b7caf42c2ec0515c
Jon Simantov [Wed, 5 Aug 2015 22:45:02 +0000 (15:45 -0700)]
Fix missing break statement in SetAnyValueS case.
Causing SetAnyValueS to treat all scalars as integers.
Change-Id: Ib467b255e7f32a1478180a91e65def31676399eb
Wouter van Oortmerssen [Wed, 5 Aug 2015 20:58:17 +0000 (13:58 -0700)]
Merge pull request #247 from stewartmiles/master
Clarified the use of the deprecated flatc --gen-includes flag.
Wouter van Oortmerssen [Wed, 5 Aug 2015 20:56:31 +0000 (13:56 -0700)]
Changed maximum force_align to match the C++ code generator.
Change-Id: I7df2b0172f5de6f7bdbd8778361794004cd06062
Tested: on Linux.
Stewart Miles [Tue, 4 Aug 2015 18:40:45 +0000 (11:40 -0700)]
Clarified the use of the deprecated flatc --gen-includes flag.
Also, removed the flag from the Android makefile.
Tested:
Verified flatc builds successfully on Linux and regenerated the docs.
Change-Id: I7140daa10b7cb9a29b5ffd63c6b20489e72a5899
Wouter van Oortmerssen [Tue, 4 Aug 2015 00:56:09 +0000 (17:56 -0700)]
Fixed VS project file.
Tested: on Windows.
Wouter van Oortmerssen [Tue, 4 Aug 2015 00:39:47 +0000 (17:39 -0700)]
Fixed AddFlatBuffer using wrong buffer length.
Also made the Xcode project link.
Tested: on OS X.
Wouter van Oortmerssen [Fri, 31 Jul 2015 20:55:53 +0000 (13:55 -0700)]
Reworked reflection.h to be more general.
e.g. support generic reading/writing from structs/vectors etc.
Change-Id: I2eb6e24db088a72da444d5c8df7e506e53d5bc2d
Tested: on Linux.
Bug:
22660837
Maor Itzkovitch [Sat, 1 Aug 2015 16:28:22 +0000 (19:28 +0300)]
small refactor to GenSetter method
Maor Itzkovitch [Sat, 1 Aug 2015 16:14:12 +0000 (19:14 +0300)]
extend java tests
Maor Itzkovitch [Sat, 1 Aug 2015 16:07:10 +0000 (19:07 +0300)]
extended scalar mutator support