platform/upstream/flatbuffers.git
6 years agoMisc fixes from internal integration / clang tidy.
Wouter van Oortmerssen [Thu, 8 Feb 2018 22:56:16 +0000 (14:56 -0800)]
Misc fixes from internal integration / clang tidy.

Change-Id: Ic5e8f6a423b426abb9f8b90d39db0f85f28b94be
Tested: on Linux.

6 years agoFix compiler errors in parser (#4612)
Sergey Avseyev [Mon, 5 Feb 2018 20:04:55 +0000 (23:04 +0300)]
Fix compiler errors in parser (#4612)

src/idl_parser.cpp: In member function 'flatbuffers::CheckedError flatbuffers::Parser::ParseHexNum(int, uint64_t*)':
src/idl_parser.cpp:220:62: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
     if (!isxdigit(static_cast<const unsigned char>(cursor_[i])))
                                                              ^
src/idl_parser.cpp: In member function 'flatbuffers::CheckedError flatbuffers::Parser::Next()':
src/idl_parser.cpp:260:62: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
         if(!isdigit(static_cast<const unsigned char>(*cursor_))) return NoError();
                                                              ^
cc1plus: all warnings being treated as errors

6 years agoAdd initial Bazel WORKSPACE and BUILD (#4608)
Joe Schafer [Mon, 5 Feb 2018 18:23:15 +0000 (10:23 -0800)]
Add initial Bazel WORKSPACE and BUILD (#4608)

For #4574.

To test:

    bazel test --verbose_failures //:flatbuffers_test

6 years agoCleaned up & fixed buffer alignment handling.
Wouter van Oortmerssen [Mon, 29 Jan 2018 19:46:30 +0000 (11:46 -0800)]
Cleaned up & fixed buffer alignment handling.

- Fixed ForceVectorAlignment (and possibly other call-sites) not
  setting minalign_.
- Fixed flipped alignment parameters in CopyTable (reflection).
- Made aligment for FlatBufferBuilder internal buffer configurable
  (useful when reading a constructed buffer directly).
- Ensured Alignment rounding is always up.

Change-Id: I33ca4887d92a09cb11a369c14a109f4b07ae707a
Tested: on Linux.

6 years agoMade doubles output with higher precision in JSON and elsewhere.
Wouter van Oortmerssen [Mon, 22 Jan 2018 18:11:51 +0000 (10:11 -0800)]
Made doubles output with higher precision in JSON and elsewhere.

Change-Id: I5dd8f3a7c315c40b86a67aba5c2cca4d36363523
Tested: on Linux.

6 years agoRemoved truncating of enum vals to int in ReverseLookup.
Wouter van Oortmerssen [Mon, 22 Jan 2018 17:49:06 +0000 (09:49 -0800)]
Removed truncating of enum vals to int in ReverseLookup.

Some implementations (e.g. C++98) won't support 64-bit enum values,
but there is no reason to silently truncate them.

Change-Id: I8629563523a96e887068f9c0efcd53741f60e0d6
Tested: on Linux.

6 years agoFix the spell mistake (#4599)
Li-Deng [Mon, 22 Jan 2018 17:08:13 +0000 (01:08 +0800)]
Fix the spell mistake (#4599)

6 years agoFixed native_include not requiring a ; terminator.
Wouter van Oortmerssen [Mon, 22 Jan 2018 17:06:13 +0000 (09:06 -0800)]
Fixed native_include not requiring a ; terminator.

Change-Id: Ic4f49e94c67ba23f07e5ba7e87ca94e8db5d5906
Tested: on Linux.

6 years agoNew error: declaring an enum field without a default in range of the enum.
Wouter van Oortmerssen [Thu, 18 Jan 2018 20:06:01 +0000 (12:06 -0800)]
New error: declaring an enum field without a default in range of the enum.

Change-Id: I4db7f032440c00d31c7434975b8a3f17c29d74b9
Tested: on Linux.

6 years agoDisallow defaults on structs.
Wouter van Oortmerssen [Thu, 18 Jan 2018 19:41:43 +0000 (11:41 -0800)]
Disallow defaults on structs.

Change-Id: Ia098126c92ea6f8abe94561bd9c09b29ac8f61f5
Context: https://github.com/google/flatbuffers/issues/4591
Tested: on Linux.

6 years agoRemoved date/time from generated code, causing commit polution.
Wouter van Oortmerssen [Thu, 18 Jan 2018 19:21:10 +0000 (11:21 -0800)]
Removed date/time from generated code, causing commit polution.

Change-Id: I79724416110a3d2241d7eeecf0e12aa6d5b760a0

6 years agoAdded missing generated code.
Wouter van Oortmerssen [Thu, 18 Jan 2018 19:20:58 +0000 (11:20 -0800)]
Added missing generated code.

Change-Id: I9420bf01d2bdb6ccfe3703c835297be73457c0d7

6 years agoRemoved internal variable with name "data" inside a generated method _nested_root...
vglavnyy [Thu, 18 Jan 2018 19:15:31 +0000 (02:15 +0700)]
Removed internal variable with name "data" inside a generated method _nested_root(). Local variable with name "data" violates [-Werror=shadow]. (#4587)

6 years agoUse CreateVectorOfStructs when creating a vector of structs.
Wouter van Oortmerssen [Thu, 18 Jan 2018 19:06:38 +0000 (11:06 -0800)]
Use CreateVectorOfStructs when creating a vector of structs.

(mirrored from cl/180944741)

Change-Id: Ib9f1613ccc355528c5c495fd953a9b3944ecb4ce

6 years agoAuthor: Daniel Lin <danielin@umich.edi> (#4595)
Daniel Lin [Thu, 18 Jan 2018 16:51:57 +0000 (08:51 -0800)]
Author: Daniel Lin <danielin@umich.edi> (#4595)

Date:   Mon Jan 15 11:38:20 2018 -0200

Compilation failure with grpc.h

If cmake run with flag FLATBUFFERS_BUILD_GRPCTEST=ON
compilation fails.

Fix :
-Fix argument list for overriden function in grpc.
-Fix member function name called by FlatBufferBuilder from
buf() to scratch_data()

6 years agoCleaned up FlatBufferBuilder clearing.
Wouter van Oortmerssen [Tue, 16 Jan 2018 17:39:35 +0000 (09:39 -0800)]
Cleaned up FlatBufferBuilder clearing.

Change-Id: I81cf4d268670bdd11d1d56ca9f2de78c120df842
Tested: on Linux.

6 years ago#4522 Conan package support (#4590)
Uilian Ries [Fri, 12 Jan 2018 16:18:20 +0000 (14:18 -0200)]
#4522 Conan package support (#4590)

- Added Conan recipe to build Flatbuffers
- Added Travis job to create Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
6 years agoReduced FlatBufferBuilder from 3 buffers to 1
Wouter van Oortmerssen [Thu, 28 Dec 2017 22:38:04 +0000 (14:38 -0800)]
Reduced FlatBufferBuilder from 3 buffers to 1

Previously, FlatBufferBuilder used 3 resizable buffers:
- serialization (vector_downward)
- field offsets (std::vector)
- vtable offsets (std::vector)

Since the serialization buffer grows downwards, the bottom part of
it can be used as a "scratchpad" storage for the other two. Since
field offsets are only accumulated during table construction, and
vtable offsets only after table construction, the two can trivially
share the same storage.

Not only does this reduce the amount of allocation, it also removes
the bulk of std::vector usage from FlatBufferBuilder which was
the #1 cause of slow-down in debug mode, see e.g.:
https://stackoverflow.com/questions/36085285/any-way-to-improve-flatbuffer-performance-in-debug-c-msvc

Change-Id: I0224cf2f2a863d2d7ef762bc9163b52fdc149522
Tested: on Linux.

6 years agoAdd char * overload for FlatBufferBuilder::CreateString() (#4583)
Andrew Gunnerson [Mon, 8 Jan 2018 16:26:19 +0000 (11:26 -0500)]
Add char * overload for FlatBufferBuilder::CreateString() (#4583)

Without this change, the compiler tries to select the following overload
when CreateString is passed a `char *`:

    template<typename T>
    Offset<String> CreateString(const T &str) {
      return CreateString(str.c_str(), str.length());
    }

which is not valid since char pointers don't have methods.

(Fixes #4579)

Signed-off-by: Andrew Gunnerson <chenxiaolong@cxl.epac.to>
6 years agoPortable range check for *cursor_ value. (#4582)
brianhall77 [Fri, 5 Jan 2018 00:03:03 +0000 (16:03 -0800)]
Portable range check for *cursor_ value. (#4582)

Avoids the following compile error when char is unsigned:

error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-unsigned-zero-compare]

6 years agoGenerateText generate a text string for default identifier of enum and float scalar...
vglavnyy [Thu, 4 Jan 2018 18:12:18 +0000 (01:12 +0700)]
GenerateText generate a text string for default identifier of enum and float scalar. An enum identifier printed as the strictly quoted string. (#4527)

6 years agoRemove unused declarations (#4578)
Andrei Polushin [Thu, 4 Jan 2018 18:01:41 +0000 (01:01 +0700)]
Remove unused declarations (#4578)

6 years agoUpdate URL (#4576)
Darío Hereñú [Thu, 4 Jan 2018 17:10:03 +0000 (14:10 -0300)]
Update URL (#4576)

6 years agoFix error in ConCatPathFileName (#4575)
Bastien Brunnenstein [Thu, 4 Jan 2018 17:09:09 +0000 (18:09 +0100)]
Fix error in ConCatPathFileName (#4575)

6 years agonew maven jar called flatbuffers-java-grpc which contains utility … (#4558)
Yuri Finkelstein [Thu, 28 Dec 2017 23:26:29 +0000 (15:26 -0800)]
new maven jar called flatbuffers-java-grpc which contains utility … (#4558)

* new maven jar called flatbuffers-java-grpc which contains utility class supporting generated code for grpc over flatbuffers; grpc java unit test based on maven and junit (maven is used only for simplicity of testing); removed straneous namespace_test/NamespaceA/TableInC.java which is not longer used in the test and no longer generated but contains complilation errors if java compiler picks it up

* moved java grpc tests files according to review request

* Added missing generated code for Java gRPC.

Change-Id: Iada090fe2e99b80a4b7c2f8e39c838a992a1feae

* added missing name and url

6 years agoAdded missing nullptr check in vector of union verifiers.
Wouter van Oortmerssen [Thu, 28 Dec 2017 18:09:48 +0000 (10:09 -0800)]
Added missing nullptr check in vector of union verifiers.

Change-Id: Iec720991e68ad27580537135bfd8eb4159333921
Tested: on Linux.

6 years agoDisabled python in travis.yml pending fix.
Wouter van Oortmerssen [Thu, 28 Dec 2017 17:56:57 +0000 (09:56 -0800)]
Disabled python in travis.yml pending fix.

Change-Id: I6d2a9cc8b32c531d4a1e272ddf29974a0a1a2ee3

6 years agoVarious build fixes; update checked-in codegen. (#4572)
Josh Ventura [Thu, 28 Dec 2017 17:10:55 +0000 (12:10 -0500)]
Various build fixes; update checked-in codegen. (#4572)

6 years ago fixed java codegen bug documented in #4563 (#4565)
Yuri Finkelstein [Thu, 21 Dec 2017 21:32:34 +0000 (11:32 -1000)]
 fixed java codegen bug documented in #4563 (#4565)

* grpc bindings generator for Java and a few minor supporting changes in improvements

* restored formatting before my previous changes for ease of review

* Fixed grpc java code generation bug resulting in duplicate extractor declarations in case the same is used in more than a single RPC method

* fixed previous merge issue

* removed extra space

* restored extra space

* restored extra space

* fixed java codegen bug documented in https://github.com/google/flatbuffers/issues/4563

6 years agoMade all C++ files clang-formatted.
Wouter van Oortmerssen [Thu, 21 Dec 2017 18:54:28 +0000 (10:54 -0800)]
Made all C++ files clang-formatted.

Also added missing generated files.

Change-Id: Ifd22a643a08e3f2edfce92812ed57b87fc0e1875

6 years agoadded config files for popular formatting tools (#4554)
Yuri Finkelstein [Thu, 21 Dec 2017 18:18:20 +0000 (08:18 -1000)]
added config files for popular formatting tools (#4554)

* added config files for popular formatting tools

* edited and moved formatting files to root per review suggestion

6 years agogrpc bindings generator for Java and a few minor supporting changes i… (#4553)
Yuri Finkelstein [Thu, 21 Dec 2017 17:55:57 +0000 (07:55 -1000)]
grpc bindings generator for Java and a few minor supporting changes i… (#4553)

* grpc bindings generator for Java and a few minor supporting changes in improvements

* restored formatting before my previous changes for ease of review

* Fixed grpc java code generation bug resulting in duplicate extractor declarations in case the same is used in more than a single RPC method

6 years agosynchronized grpc cpp_generator with latest version as of today: grpc-1.8.1. (#4556)
Yuri Finkelstein [Thu, 21 Dec 2017 16:49:00 +0000 (06:49 -1000)]
synchronized grpc cpp_generator with latest version as of today: grpc-1.8.1.  (#4556)

* updateed cpp_generator.cc to be compatible with the latest grpc version

* preserved the original license

* synchronized grpc cpp_generator with latest version as of today: GRPC 1.8.1. Regenerated test/monster_test.grpc.fb.* files and verified that grpctest is nicely passing

* fixed merge glitch

6 years agoupdated cpp_generator.cc to be compatible with the latest grpc version (#4551)
Yuri Finkelstein [Mon, 18 Dec 2017 22:17:59 +0000 (12:17 -1000)]
updated cpp_generator.cc to be compatible with the latest grpc version (#4551)

* updateed cpp_generator.cc to be compatible with the latest grpc version

* preserved the original license

6 years agoupdate mutation status in doc (#4549)
xgdgsc [Mon, 18 Dec 2017 17:14:15 +0000 (01:14 +0800)]
update mutation status in doc (#4549)

6 years agoMerge pull request #4516 from mikeholler/travis
Robert [Thu, 14 Dec 2017 21:20:18 +0000 (13:20 -0800)]
Merge pull request #4516 from mikeholler/travis

Add support for Python lib continuous deployment.

6 years agoFix for strictPropertyInitialization for TS (#4540)
Kamil Rojewski [Thu, 14 Dec 2017 16:30:02 +0000 (17:30 +0100)]
Fix for strictPropertyInitialization for TS (#4540)

* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes

* Generating the most strict TS code possible

* Not returning null when creating vectors

* Not returning null from struct contructors

* Vector of unions for ts/js

* Sanity check for languages

* Indentation fix + output test files

* Vectors of unions for php

* Fixes to union vector handling + tests

* Fix for strictPropertyInitialization

6 years agoChange mikeholler to PYPI_USERNAME
Mike Holler [Wed, 13 Dec 2017 21:14:01 +0000 (15:14 -0600)]
Change mikeholler to PYPI_USERNAME

6 years agoFixed CreateStruct not testing for nesting.
Wouter van Oortmerssen [Thu, 7 Dec 2017 19:15:37 +0000 (11:15 -0800)]
Fixed CreateStruct not testing for nesting.

Change-Id: I16bf46682ad68c62b778ed1514b6b706c8cb8f6f
Tested: on Linux.

6 years agoReplace the non standard M_PI with a constant (#4528)
Bastien Brunnenstein [Mon, 4 Dec 2017 23:06:13 +0000 (00:06 +0100)]
Replace the non standard M_PI with a constant (#4528)

6 years agopublish additional js/flatbuffers.mjs to npm to support ESModules in node (#4504)
Paul Taylor [Fri, 1 Dec 2017 22:18:43 +0000 (14:18 -0800)]
publish additional js/flatbuffers.mjs to npm to support ESModules in node (#4504)

6 years agothis is allow custom allocator for obj-api structs/tables. (#4520)
rmawatson [Fri, 1 Dec 2017 17:15:41 +0000 (18:15 +0100)]
this is allow custom allocator for obj-api structs/tables. (#4520)

added "native_custom_alloc" attribute to tables/structs, eg.

table parent_table( native_custom_alloc:"custom_alloc_name" ) {
...
}

with a custom allocator defined as

template <typename T> class custom_alloc_name : public std::allocator<T> {
public:

 typedef T*       pointer;

 template <class U>
 struct rebind {
  typedef custom_alloc_name<U> other;
 };

 pointer allocate(const std::size_t n) {
      return ....;
 }

 void deallocate(T* ptr, std::size_t n) {
    ...
 }

 custom_alloc_name() throw() {}
 template <class U> custom_alloc_name(const custom_alloc_name<U>&) throw() {}
};
};

6 years agoAdd include directory to CMake install targets (#4510)
Bastien Brunnenstein [Thu, 30 Nov 2017 16:45:58 +0000 (17:45 +0100)]
Add include directory to CMake install targets (#4510)

6 years agoFixed prod PyPI URL and deploy block list.
Mike Holler [Mon, 27 Nov 2017 22:05:45 +0000 (16:05 -0600)]
Fixed prod PyPI URL and deploy block list.

6 years agoAdded all_branches to tags: true block
Mike Holler [Mon, 27 Nov 2017 19:59:01 +0000 (13:59 -0600)]
Added all_branches to tags: true block

6 years agoAdd support for Python lib continuous deployment.
Michael Holler [Wed, 22 Nov 2017 22:46:00 +0000 (16:46 -0600)]
Add support for Python lib continuous deployment.

Use a combination of travis and twine to publish to PyPI. New
publications will be made:

* When `master` is updated. This will trigger the publication of a
  the Python artifact versioned an iso-compliant build datetime. In this
  way, the cutting edge version will always be available via PyPI.
* When a new git tag is pushed. Tag pushes trigger the publication of
  a python artifact with the same version as the git tag, with the
  leading `v` stripped if present (`v1.2.3` becomes `1.2.3`).

Publications rely on Travis having a PYPI_PASSWORD environment set in
the project settings. See the Travis CI documentation for information on
[setting environment variables which containing sensitive data][1]. Make
extra sure the "Display value in build log" switch is OFF.

In addition to setting the previously mentioned `PYPI_PASSWORD`
environment variable, the owner of the PyPI `flatbuffers` repository
should, after merging this commit into master, add his own commit to
change `mikeholler` in `.travis/deploy-python.sh` to his username. It's
also recommended that the owner of `flatbuffers` use a separate account
in the unlikely event that the environment variable somehow becomes
compromised. Again, this is very unlikely, since the environment
variable is only set for "safe" builds approved by maintainers (not on
random pull requests).

[1]: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings

6 years agoUpdated version numbers to 1.8.0 v1.8.0
Wouter van Oortmerssen [Mon, 20 Nov 2017 17:46:03 +0000 (09:46 -0800)]
Updated version numbers to 1.8.0

Change-Id: I9cf9fe1e2572d3f9c4066624a87249ca1e62a297

6 years agoMissing generated code files.
Wouter van Oortmerssen [Mon, 20 Nov 2017 17:19:35 +0000 (09:19 -0800)]
Missing generated code files.

Change-Id: I8808b0b419981ba7d0699da4a1effb0b660a21cb

6 years agoDocument type aliases (#4499)
MikkelFJ [Fri, 17 Nov 2017 16:57:01 +0000 (17:57 +0100)]
Document type aliases (#4499)

6 years agofix typo (#4495)
Dan Douglas [Fri, 17 Nov 2017 00:03:16 +0000 (16:03 -0800)]
fix typo (#4495)

`Equipment` is a union, not an enum.

6 years agoFixed potential strict-aliasing violation in big-endian code.
Wouter van Oortmerssen [Thu, 16 Nov 2017 22:19:31 +0000 (14:19 -0800)]
Fixed potential strict-aliasing violation in big-endian code.

Also added a test.

Tested on: Linux.

Change-Id: I7b3230f8f6043eec139d5e3e8c9cb45814124274

6 years agoAdd exports for all targets (#4491)
red1939 [Thu, 16 Nov 2017 20:51:25 +0000 (21:51 +0100)]
Add exports for all targets (#4491)

Each target that will be installed will also generate a target that will be
included by CMake config file.

6 years agoc++ Tutorial fix (#4494)
Hong Wu [Thu, 16 Nov 2017 18:09:48 +0000 (12:09 -0600)]
c++ Tutorial fix (#4494)

6 years agoRemove copy constructor to make flatbuffers struct trivially copyable… (#4476)
Louis-Paul CORDIER [Thu, 16 Nov 2017 18:08:41 +0000 (19:08 +0100)]
Remove copy constructor to make flatbuffers struct trivially copyable… (#4476)

* Remove copy constructor to make flatbuffers struct trivially copyable + add tests.

* Add support non c++11 compliant compilers.

* Fix std::trivially_copyiable test for non-C++11 compliant compilers.

* Fix trivially_copyable not part of glibc < 5 even with c++11 switch enabled.

6 years agotutorial docs (#4492)
David Komer [Thu, 16 Nov 2017 16:51:35 +0000 (18:51 +0200)]
tutorial docs (#4492)

6 years agoFix valid params limit exceeded for generated table constructor (#4490)
Angela Sheu [Mon, 13 Nov 2017 21:39:49 +0000 (13:39 -0800)]
Fix valid params limit exceeded for generated table constructor (#4490)

6 years agoMade stl_emulation.h usable by itself.
Wouter van Oortmerssen [Thu, 9 Nov 2017 23:47:44 +0000 (15:47 -0800)]
Made stl_emulation.h usable by itself.

Change-Id: I1d9d301412fe0a036f12eb2cc82a3fbee5bb838d

6 years agoSpecify ABI version for shared library (#4479)
Sergey Avseyev [Thu, 9 Nov 2017 22:39:32 +0000 (01:39 +0300)]
Specify ABI version for shared library (#4479)

6 years agoUse CMake install directories instead of hardcoded (#4481)
Sergey Avseyev [Mon, 6 Nov 2017 18:38:53 +0000 (21:38 +0300)]
Use CMake install directories instead of hardcoded (#4481)

6 years agoText files should not have executable bit set (#4480)
Sergey Avseyev [Mon, 6 Nov 2017 18:20:22 +0000 (21:20 +0300)]
Text files should not have executable bit set (#4480)

6 years agoLink grpctest with libgrpc_unsecure explicitly (#4474)
Lawrence Chan [Mon, 6 Nov 2017 16:43:22 +0000 (10:43 -0600)]
Link grpctest with libgrpc_unsecure explicitly (#4474)

6 years agoUpdated pom.xml to be able to deploy to Maven central.
Wouter van Oortmerssen [Thu, 26 Oct 2017 23:13:04 +0000 (16:13 -0700)]
Updated pom.xml to be able to deploy to Maven central.

Change-Id: Ie28dda5e1854eeff3e254e975925ff846c137008

6 years agoAdded missing EndTable() call to VerifyObject() (#4468)
stefan301 [Mon, 23 Oct 2017 16:15:18 +0000 (18:15 +0200)]
Added missing EndTable() call to VerifyObject() (#4468)

VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables.

https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg

6 years agoChanged how vector_data works. (#4467)
Alex Ames [Fri, 20 Oct 2017 23:49:15 +0000 (16:49 -0700)]
Changed how vector_data works. (#4467)

In some debug environments using vector[i] does bounds checking even
though the standard specifies that it should not. Using
*(vector.begin()) sidesteps this though, giving the same result without
the bounds checking.

6 years agoFixed CMake build issue when building with Clang. (#4465)
Alex Ames [Fri, 20 Oct 2017 23:29:51 +0000 (16:29 -0700)]
Fixed CMake build issue when building with Clang. (#4465)

6 years agoNullable java (#4455)
Yonggang Li [Mon, 16 Oct 2017 16:24:11 +0000 (09:24 -0700)]
Nullable java (#4455)

* add _Nullable Support for C++ interface

* generate @Nullable for Java generated code

6 years agoMerge pull request #4459 from stewartmiles/master
Stewart Miles [Sat, 14 Oct 2017 00:55:51 +0000 (17:55 -0700)]
Merge pull request #4459 from stewartmiles/master

Report a build failure when any Android build fails.

6 years agoReport a build failure when any Android build fails.
Stewart Miles [Fri, 13 Oct 2017 23:56:28 +0000 (16:56 -0700)]
Report a build failure when any Android build fails.

The travis script was only failing if the last Android build fails.
This changes the script to report a failure if any of the Android
projects fail to build.

6 years agoFixed Android build failure caused by use of C++11 limits.
Stewart Miles [Sat, 14 Oct 2017 00:33:12 +0000 (17:33 -0700)]
Fixed Android build failure caused by use of C++11 limits.

f2b3705c2c62c40afdef96f73f0aeaf32b4c8e0e caused Android builds
to fail.  This switches limit constants to use limits templates in
stl_emulation.h.

6 years agoMerge pull request #4458 from a-maurice/master
Stewart Miles [Fri, 13 Oct 2017 23:44:02 +0000 (16:44 -0700)]
Merge pull request #4458 from a-maurice/master

Use flatbuffer unique_ptr instead of std's.

6 years agoUse flatbuffer unique_ptr instead of std's.
Anthony [Fri, 13 Oct 2017 23:21:34 +0000 (16:21 -0700)]
Use flatbuffer unique_ptr instead of std's.

Stlport does not have std unique_ptr, so using the one provided by
flatbuffers.
Also fixing a problem with the flatbuffer unique_ptr, and a test.

6 years agoAdd new flatbuffer_go_library to generate Go library for flatbuffers
Wouter van Oortmerssen [Mon, 9 Oct 2017 16:27:30 +0000 (09:27 -0700)]
Add new flatbuffer_go_library to generate Go library for flatbuffers

This CL also introduces the following changes to allow the generation of the
Go library for flatbuffers:

- add support for --gen-onefile for Go to simplify the build rule (mapping each
  input .fbs to a single separate .go file)

- add a new --go-import flag to override the default import line (currently
  github.com/google/flatbuffers/go)

- add new go_library in BUILD for flatbuffer (for files in flatbuffers/go)

(mirrored from cr/171126159)

Change-Id: I83e705a9a9d9544837af0baf9366ec37757799aa

6 years agoSpelling error in C# and Java documentation (#4454)
Brian Chavez [Mon, 9 Oct 2017 15:42:34 +0000 (08:42 -0700)]
Spelling error in C# and Java documentation (#4454)

6 years ago_Nullable cpp interface (#4451)
Yonggang Li [Mon, 9 Oct 2017 15:40:17 +0000 (08:40 -0700)]
_Nullable cpp interface (#4451)

* add _Nullable Support for C++ interface

* add _Nullable Support for C++ interface

6 years agoImproved .proto conversion.
Wouter van Oortmerssen [Mon, 2 Oct 2017 22:41:34 +0000 (15:41 -0700)]
Improved .proto conversion.

- Allowed enums to be declared before use.
- Generalized parsing of `required`.
- Reworked escaping of namespaces.
- Escaping field names that are C++ keywords.
- Many smaller fixes.

Change-Id: Ie580de7b70dc208f676f4f71bb0d061808648b8d
Tested: on Linux.

6 years ago[C++] Add explicit keyword on generated constructors for Builder structs (#4452)
Aaron [Fri, 6 Oct 2017 15:50:24 +0000 (08:50 -0700)]
[C++] Add explicit keyword on generated constructors for Builder structs (#4452)

* Add explicit keyword on C++ generated constructors for Builder structs

* Add missing generated code for review

6 years agoPython: CreateByteVector function in builder. (#4453)
Robert [Fri, 6 Oct 2017 15:34:07 +0000 (08:34 -0700)]
Python: CreateByteVector function in builder. (#4453)

6 years agoFix issue #4389, if field is ommitted the return type is the same for… (#4444)
Dariusz Ostolski [Thu, 5 Oct 2017 21:07:42 +0000 (23:07 +0200)]
Fix issue #4389, if field is ommitted the return type is the same for… (#4444)

* Fix issue #4389, if field is ommitted the return type is the same for python generator

* Fix issue #4389, bytes is returned when field is omitted

* Fix issue #4389, added generated python code after generator modification

6 years agoAdd template version for As method. (#4443)
Louis-Paul CORDIER [Mon, 2 Oct 2017 21:38:38 +0000 (06:38 +0900)]
Add template version for As method. (#4443)

* Add template version for As method.

* Fix compilation error on Linux.

* Fix linux issue (2).

* Linux fix (3)

* Add few tests.

6 years agoFixed TypeTable function not being inline.
Wouter van Oortmerssen [Mon, 25 Sep 2017 18:44:58 +0000 (11:44 -0700)]
Fixed TypeTable function not being inline.

Change-Id: Id335980daf909e885ed26a21b64623b78d01fb49
Tested: on OS X.

6 years agoMade the parser not have any hard-coded keywords.
Wouter van Oortmerssen [Fri, 22 Sep 2017 21:32:07 +0000 (14:32 -0700)]
Made the parser not have any hard-coded keywords.

This prevented any keywords showing up as JSON field names, for example.

Change-Id: Ie9d0cada96778e06016ca02ca96d052410a37038
Tested: on Linux.

6 years agoAdded support for mini-reflection tables.
Wouter van Oortmerssen [Fri, 25 Aug 2017 00:44:03 +0000 (17:44 -0700)]
Added support for mini-reflection tables.

Change-Id: I83453d074685fa57bbf1c7c87b1d9392ce972085
Tested: on Linux.

6 years agoAdd constant accessors to C++ unions (#4433)
endorph-soft [Thu, 21 Sep 2017 21:06:20 +0000 (06:36 +0930)]
Add constant accessors to C++ unions (#4433)

* Add constant accessors to C++ unions

* Remove redundant const pointer return type

* Update generate_code.bat to reflect generate_code.sh

* Add updated generated files

* Remove extra space from generated code

* Update generated files

* Change directory back to tests after generating code

6 years agoFix build with clang on big-endian targets (#4440)
Khem Raj [Thu, 21 Sep 2017 15:51:08 +0000 (08:51 -0700)]
Fix build with clang on big-endian targets (#4440)

* flatbuffers: Move EndianSwap template to flatbuffers/base.h

Clang complains
call to function 'EndianSwap' that is neither visible in the template definition nor found by argument-dependent lookup
     return EndianSwap(t);

This seems to be due to limitation of two-phase lookup of dependent names in template definitions

Its not being found using associated namespaces therefore
it has to be made visible at the template definition site as well

Signed-off-by: Khem Raj <raj.khem@gmail.com>
* use __builtin_bswap16 when building with clang

clang pretends to be gcc 4.2.0 and therefore the code does
not use __builtin_bswap16 but tries to synthesize it

Signed-off-by: Khem Raj <raj.khem@gmail.com>
6 years agoidl_gen_json_schema.cpp: Fixed detection of enum types (#4438)
schoetbi [Thu, 14 Sep 2017 16:25:43 +0000 (18:25 +0200)]
idl_gen_json_schema.cpp: Fixed detection of enum types (#4438)

6 years ago[C++] Fix DetachedBuffer move assignment lifetime (#4437)
Lukas Bergdoll [Thu, 14 Sep 2017 16:22:55 +0000 (18:22 +0200)]
[C++] Fix DetachedBuffer move assignment lifetime (#4437)

* Fix DetachedBuffer move assignment lifetime

DetachedBuffer move assignment now destroys it's own content,
rather than waiting for the destructor of other.
See more under #4435

Add missing function return type

* Rename empty_assign to reset

Reset after destroy
reset() now operates on itself

6 years agoFixed .proto not being accepted as schema file.
Wouter van Oortmerssen [Tue, 12 Sep 2017 18:36:38 +0000 (11:36 -0700)]
Fixed .proto not being accepted as schema file.

Change-Id: I1ccd52a847930fa636d24f9490d57577b8775d08

6 years agoForgot to bump flatc version to 1.7.1
Wouter van Oortmerssen [Thu, 7 Sep 2017 21:35:26 +0000 (14:35 -0700)]
Forgot to bump flatc version to 1.7.1

Change-Id: I480a08f445858bce3d0336c2b22da30d64f90012

6 years agoUpdate doc (#4427)
rouzier [Thu, 7 Sep 2017 18:52:58 +0000 (14:52 -0400)]
Update doc (#4427)

6 years agoEvery type gets additionalProperties set to "false" (#4424)
schoetbi [Thu, 31 Aug 2017 15:56:04 +0000 (17:56 +0200)]
Every type gets additionalProperties set to "false" (#4424)

#4423

6 years agoC++ Customise prefix/suffix of object API [Issue #4419] (#4422)
endorph-soft [Thu, 31 Aug 2017 15:54:03 +0000 (01:24 +0930)]
C++ Customise prefix/suffix of object API [Issue #4419] (#4422)

* Allow prefix/suffix of C++ Object API classes to be customised

* Address review comments

6 years agoUpdated C# test project.
Wouter van Oortmerssen [Fri, 25 Aug 2017 18:47:19 +0000 (11:47 -0700)]
Updated C# test project.

6 years agoFixed VS memory tracking leaking into user code
Wouter van Oortmerssen [Fri, 25 Aug 2017 18:29:58 +0000 (11:29 -0700)]
Fixed VS memory tracking leaking into user code

6 years agoDisabled numpy test in appveyor due to timeout.
Wouter van Oortmerssen [Thu, 24 Aug 2017 20:46:46 +0000 (13:46 -0700)]
Disabled numpy test in appveyor due to timeout.

It pulls in a LOT of dependencies, this will need to be done better.

Change-Id: Ib27effead194f6836facca01e9454a6037ad837a

6 years agoCleaned up namespace handling.
Wouter van Oortmerssen [Thu, 24 Aug 2017 19:55:35 +0000 (12:55 -0700)]
Cleaned up namespace handling.

A Namespace object is now guaranteed unique.
This cleaned up some old workarounds and latent bugs.

Change-Id: Ic3f12d89947871b03b2c449ba51b3186f953adde
Tested: on Linux.
Bug: 21336857

6 years agoTrimmed vtables of trailing zeroes.
Wouter van Oortmerssen [Mon, 21 Aug 2017 20:44:23 +0000 (13:44 -0700)]
Trimmed vtables of trailing zeroes.

This is something the format supports, but none of the builders
were doing. Can save 10-20% on FlatBuffer binary size!

Also fixed the Go tests.

Change-Id: I616c56ce9bbcfcaee23aa24f0532fcb60b6a8c75
Tested: on Linux.

7 years agoFix use of min and max when Windows.h is imported (#4411)
Younguk Kim [Thu, 17 Aug 2017 16:35:50 +0000 (01:35 +0900)]
Fix use of min and max when Windows.h is imported (#4411)

7 years agoNoted that benchmarks are for C++
Wouter van Oortmerssen [Mon, 14 Aug 2017 23:36:42 +0000 (16:36 -0700)]
Noted that benchmarks are for C++

Change-Id: I12fbba7ffd2db47502a05eb06cedab49fd99c366

7 years agoExplained GetRoot<Monster> vs GetMonster.
Wouter van Oortmerssen [Mon, 14 Aug 2017 22:34:15 +0000 (15:34 -0700)]
Explained GetRoot<Monster> vs GetMonster.

Change-Id: Ic302096c07551b5c1aff0b261a329c46964cf337

7 years agoFixed .proto -> .fbs translating type bytes incorrectly.
Wouter van Oortmerssen [Mon, 14 Aug 2017 21:45:29 +0000 (14:45 -0700)]
Fixed .proto -> .fbs translating type bytes incorrectly.

Change-Id: Idb607360123d12c73dd1e045305007120b12131b
Tested: on Linux.