platform/upstream/flatbuffers.git
5 years ago[Go] Change two more sites to use enum types (#5359)
David Reiss [Mon, 20 May 2019 21:46:36 +0000 (14:46 -0700)]
[Go] Change two more sites to use enum types (#5359)

Fixes #5357 (regression introduced by #5235)

5 years agoAdded a CPP UnPackSizePrefixed<struct_name> generated helper function (#5350)
David Cowan [Mon, 20 May 2019 21:01:44 +0000 (14:01 -0700)]
Added a CPP UnPackSizePrefixed<struct_name> generated helper function (#5350)

* Added a cpp  UnPackSizePrefixed<struct_name> generated helper function

Missing helper function added to the cpp API generator for unpacking size prefixed structures

* Added generated test files

5 years ago[Go] Make enums into real types, add String() (#5235)
David Reiss [Fri, 17 May 2019 19:41:39 +0000 (12:41 -0700)]
[Go] Make enums into real types, add String() (#5235)

* [Go] Make enums into real types, add String()

This changes the generated code for enums: instead of type aliases,
they're now distinct types, allowing for better type-checking. Some
client code may have to be changed to add casts.

Enum types now have a String() method, so they implement fmt.Stringer.

An EnumValues map is now generated, in addition to the existing
EnumNames map, to easily map strings to values.

Generated enum files are now gofmt-clean.

Fixes #5207

* use example.ColorGreen explicitly

* use valid enum value in mutation test, add new test for "invalid" enum

* add length check and comment

5 years agoAdd support for IAR compiler (#5347)
Siarhei Fiedartsou [Thu, 16 May 2019 18:56:22 +0000 (21:56 +0300)]
Add support for IAR compiler (#5347)

5 years agoFix reverse_iterator in Vector and tests (#5344)
mmoscicki2 [Thu, 16 May 2019 18:49:01 +0000 (20:49 +0200)]
Fix reverse_iterator in Vector and tests (#5344)

Before this commit tests for iterators passed, even if the code inside
the loop has not been executed.

5 years ago[JS/TS] Size prefix support (#5326)
Björn Harrtell [Thu, 16 May 2019 18:43:31 +0000 (20:43 +0200)]
[JS/TS] Size prefix support (#5326)

* WIP size prefix support

* Consider size prefix in overloaded variant

* Work on code gen

* Disabled helper functions in code gen

* Enabled helper functions in code gen

* Fix size prefixed test

* Fix bad function call

* Add SIZE_PREFIX_LENGTH

* Fix review comments

5 years ago[Go] Generate imports with fixed order (#5340)
iceboy [Mon, 13 May 2019 17:10:14 +0000 (01:10 +0800)]
[Go] Generate imports with fixed order (#5340)

* use fixed order for golang imports

* grumble

5 years agoAdd detection of strtoull_l function (#5333) (#5337)
Vladimir Glavnyy [Thu, 9 May 2019 17:15:29 +0000 (00:15 +0700)]
Add detection of strtoull_l function (#5333) (#5337)

5 years agoSet default CRTReportMode for the `flatc` target (#5336)
Vladimir Glavnyy [Thu, 9 May 2019 17:10:10 +0000 (00:10 +0700)]
Set default CRTReportMode for the `flatc` target (#5336)

* Set default CRTReportMode for the `flatc` target

* Add util.cpp to GRPC test target

* Fix path to util.h

5 years agoMake Monster's Color unsigned (#5318)
Vladimir Glavnyy [Thu, 9 May 2019 17:07:38 +0000 (00:07 +0700)]
Make Monster's Color unsigned (#5318)

- update C++ monster_test::Color to unsigned type
- update Go Color:ubyte in the go_test.go
- add workaround for unsigned enum in java test
- sync generate.bat and generate.sh

5 years agoFix out-of-range error (MSVC2010) in idl_gen_dart.cpp (#5335)
Vladimir Glavnyy [Thu, 9 May 2019 17:05:21 +0000 (00:05 +0700)]
Fix out-of-range error (MSVC2010) in idl_gen_dart.cpp (#5335)

-- MSVC2010 doesn't support indexed access to \0-terminator.

5 years ago[Python PyPI] Added classifiers and more links. Fixes typo and #5215 (#5272)
Will Stott [Wed, 8 May 2019 19:42:20 +0000 (20:42 +0100)]
[Python PyPI] Added classifiers and more links. Fixes typo and #5215 (#5272)

5 years agoUse a hash table to index existing vtables (#5314)
Malthe Borch [Mon, 6 May 2019 22:00:02 +0000 (22:00 +0000)]
Use a hash table to index existing vtables (#5314)

* Use a hash table to index existing vtables

This allows for quick deduplication even in situations where there
might be thousands of vtables due to 'combinatoric explosion'.

This fixes issue #5301.

* Refactor 0-offset trimming

* Improve deduplication benchmark

The routine now generates a set of realistic logical layouts and
uses a timer function that randomly picks a layout for each iteration.

The benchmark runs in batches of # of logical layouts = 1, 10, 100, 1000.

(Note that due to alignment, the actual number of vtables is usually slightly
higher.)

5 years agoAdd monster_extra files to Bazel cc_test section (#5321)
Vladimir Glavnyy [Mon, 6 May 2019 19:27:04 +0000 (02:27 +0700)]
Add monster_extra files to Bazel cc_test section (#5321)

- add monster_extra.fbs
- add monsterdata_extra.json

5 years agoFix typo in build_defs.bzl (#5320)
Lee Mracek [Mon, 6 May 2019 19:10:11 +0000 (15:10 -0400)]
Fix typo in build_defs.bzl (#5320)

5 years agoMake MonsterExtra table a root table (#5315)
Vladimir Glavnyy [Thu, 2 May 2019 22:12:58 +0000 (05:12 +0700)]
Make MonsterExtra table a root table (#5315)

- MonsterExtra table a root table
- add mosterdata_extra.json

5 years agoFix issues with uint64 enums (#5265)
Vladimir Glavnyy [Thu, 2 May 2019 20:57:58 +0000 (03:57 +0700)]
Fix issues with uint64 enums (#5265)

* Fix issues with uint64 enums

- hide the implementation of enums from code generators
- fix uint64 the issue in the cpp-generator
- fix #5108
- new tests
- enums with bit_flags attribute should be unsigned

* Refine objectives of EnumDef's FindByValue and ReverseLookup methods

- move EnumDef::ReverseLookup implementation to idl_parser.cpp
- fix typos

* Make the IsUInt64 method private

5 years ago[BUILD] Fix Bazel test target //:flatbuffers_test (#5311)
László Csomor [Mon, 29 Apr 2019 17:01:23 +0000 (19:01 +0200)]
[BUILD] Fix Bazel test target //:flatbuffers_test (#5311)

5 years agoAdded common rust traits to FlatBufferBuilder (#5307)
jean-airoldie [Sat, 27 Apr 2019 01:40:10 +0000 (21:40 -0400)]
Added common rust traits to FlatBufferBuilder (#5307)

* Added Clone, Debug and Default

5 years agoUpdate GRPC Java generated file.
Wouter van Oortmerssen [Wed, 24 Apr 2019 19:34:42 +0000 (12:34 -0700)]
Update GRPC Java generated file.

Change-Id: I57ccbe0b9ccbbec65ca04f9db3cbd62243480d92

5 years ago[maven-release-plugin] prepare for next development iteration
Wouter van Oortmerssen [Wed, 24 Apr 2019 19:09:50 +0000 (12:09 -0700)]
[maven-release-plugin] prepare for next development iteration

Change-Id: I402d857eef9f3e5f3765427c5d3b868ed5a3a22e

5 years ago[maven-release-plugin] prepare release 1.11.0 1.11.0
Wouter van Oortmerssen [Wed, 24 Apr 2019 19:09:44 +0000 (12:09 -0700)]
[maven-release-plugin] prepare release 1.11.0

Change-Id: I716f6b915adfa6682b5d864857abf7d491d788b5

5 years agoBumped version to 1.11.0 v1.11.0
Wouter van Oortmerssen [Wed, 24 Apr 2019 18:34:53 +0000 (11:34 -0700)]
Bumped version to 1.11.0

Change-Id: I0c87ad2cf8f8768cf40c5b7abea0add087a5518a

5 years agoDoc: use correct ref types for flatcc string creation. (#5305)
Clément Julliard [Wed, 24 Apr 2019 17:34:21 +0000 (10:34 -0700)]
Doc: use correct ref types for flatcc string creation. (#5305)

Some string definitions were typed as ns(Weapon_ref_t) while they should
be flatbuffers_string_ref_t. Note that the former was also compiling &
running correctly as both ref types boil down to the same underlying ref
type.

5 years agoDon't test on Ubuntu 14.04 (#5302)
Philipp Wollermann [Wed, 24 Apr 2019 17:28:35 +0000 (19:28 +0200)]
Don't test on Ubuntu 14.04 (#5302)

Ubuntu 14.04 is about to be end-of-life and Bazel CI will stop supporting it shortly afterwards.

Context: https://groups.google.com/d/msg/bazel-dev/_D6XzfNkQQE/8TNKiNmsCAAJ

5 years ago[Javascript] Remove newly introduced trailing whitespace in flatbuffer.js (#5300)
Damien Lespiau [Mon, 22 Apr 2019 17:10:02 +0000 (18:10 +0100)]
[Javascript] Remove newly introduced trailing whitespace in flatbuffer.js (#5300)

* Remove newly introduced trailing whitespace in flatbuffer.js

The newly introduced clear function has some trailing white space in an
otherwise whitespace clean file. Remove it.

* Remove spurious new line in the BytesBuffer construction

Another spurious white space introduced by the clear() PR.

5 years agoFixed file access test in the wrong location.
Wouter van Oortmerssen [Mon, 22 Apr 2019 16:57:01 +0000 (09:57 -0700)]
Fixed file access test in the wrong location.

Change-Id: I520339b442306204563d97743efe988eab459c08

5 years agodocs: Fix where to find the Typescript typings (#5298)
Damien Lespiau [Fri, 19 Apr 2019 20:09:26 +0000 (21:09 +0100)]
docs: Fix where to find the Typescript typings (#5298)

This is what currently rendered:

  /flatubffers

in https://google.github.io/flatbuffers/flatbuffers_guide_use_typescript.html

Besides the typo, @types is being swallowed, the hope is that puting it between
backticks will improve the situation.

5 years agoFix heap-buffer-overflow if there is a struct within a union
Wouter van Oortmerssen [Fri, 19 Apr 2019 18:49:49 +0000 (11:49 -0700)]
Fix heap-buffer-overflow if there is a struct within a union

The validator previously did not check if a struct within a union was
valid, causing a heap buffer overflow.  Add a check to make sure that
the struct is valid in this case.

Change-Id: I87d41b12fdfc2a99406789531ba92b841c063c76

5 years agoUpdate snap include path instruction (#5297)
Omer Akram [Thu, 18 Apr 2019 22:15:21 +0000 (03:15 +0500)]
Update snap include path instruction (#5297)

5 years agoUpdate snap to use "flatbuffers" as name
Wouter van Oortmerssen [Thu, 18 Apr 2019 20:50:04 +0000 (13:50 -0700)]
Update snap to use "flatbuffers" as name

5 years agoAdd Linux Snap Packaging (#5293)
Omer Akram [Thu, 18 Apr 2019 19:22:43 +0000 (00:22 +0500)]
Add Linux Snap Packaging (#5293)

* SNAP: cleanup

* Lets keep it in devel mode as it requires more testing

* add better description

5 years agofix check for Enum defaults (#5292)
Nils Berg [Mon, 15 Apr 2019 18:38:44 +0000 (20:38 +0200)]
fix check for Enum defaults (#5292)

fixes #5288

5 years agoStruct typetable (#5291)
Nils Berg [Mon, 15 Apr 2019 18:38:00 +0000 (20:38 +0200)]
Struct typetable (#5291)

* C++: Generate MiniReflectTypeTable for Structs as well as Tables

* Update generated code

* add test

5 years agoAdd logging of warnings from the flatc compiler (#5289)
Vladimir Glavnyy [Mon, 15 Apr 2019 18:34:09 +0000 (01:34 +0700)]
Add logging of warnings from the flatc compiler (#5289)

5 years agoFixed VS2010 build.
Wouter van Oortmerssen [Thu, 11 Apr 2019 23:14:38 +0000 (16:14 -0700)]
Fixed VS2010 build.

Change-Id: I3ee68c5f250d6baa02060ab2ecbc0f0fe254a9d8

5 years agoAllow Set() methods to handle reference types
Wouter van Oortmerssen [Thu, 11 Apr 2019 21:18:21 +0000 (14:18 -0700)]
Allow Set() methods to handle reference types

Change-Id: I487ded77d28490189dd5d38236cb04bffaf5f11a

5 years agoFix the proto-enum leaking issue (#5286)
Vladimir Glavnyy [Thu, 11 Apr 2019 20:52:01 +0000 (03:52 +0700)]
Fix the proto-enum leaking issue (#5286)

* Detect leak with sanitizer

* Fix proto-enum leak issue

5 years agoDetect leak with sanitizer (#5283)
Vladimir Glavnyy [Thu, 11 Apr 2019 17:15:11 +0000 (00:15 +0700)]
Detect leak with sanitizer (#5283)

5 years agoAdd basic test for enum defaults (#5280)
Vladimir Glavnyy [Mon, 8 Apr 2019 17:21:30 +0000 (00:21 +0700)]
Add basic test for enum defaults (#5280)

5 years agoPart of #5265, neutral changes (#5281)
Vladimir Glavnyy [Mon, 8 Apr 2019 17:05:50 +0000 (00:05 +0700)]
Part of #5265, neutral changes (#5281)

5 years agoEnable MSVC assert report box [Abort|Retry|Ignore] if a debugger is present (#5279)
Vladimir Glavnyy [Mon, 8 Apr 2019 17:01:41 +0000 (00:01 +0700)]
Enable MSVC assert report box [Abort|Retry|Ignore] if a debugger is present (#5279)

5 years agoAdd files generated by CMake to git ignore (#5278)
Henry Lee [Fri, 5 Apr 2019 19:35:40 +0000 (06:35 +1100)]
Add files generated by CMake to git ignore (#5278)

5 years ago[C++]Sync the sample monster.fbs file with the tutorial (#5277)
Henry Lee [Fri, 5 Apr 2019 19:34:53 +0000 (06:34 +1100)]
[C++]Sync the sample monster.fbs file with the tutorial (#5277)

* Fix the header file path in the tutorial doc

* Add the path field in sample/monster.fbs to match the tutorial

* Update the lobster sample file

* Update the binary sample file

5 years agoEnsure we don't subtract with underflow getting enum names (#5246)
Matt Mastracci [Fri, 5 Apr 2019 19:30:58 +0000 (13:30 -0600)]
Ensure we don't subtract with underflow getting enum names (#5246)

* Ensure we don't subtract with underflow getting enum names

* Yep - forgot to run this

5 years agoAdd method GenerateTextFromTable issue #5249 (#5266)
Anthony Liot [Fri, 5 Apr 2019 18:51:29 +0000 (11:51 -0700)]
Add method GenerateTextFromTable issue #5249 (#5266)

* Create a function GenerateGenerateTextFromTable in order to create a json from any Table

Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Update the test to failed if loadfile or parser return false

Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Fix snake_case name typo + space before &/*

Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* use auto

Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
* Use clang-format on the added code

Signed-off-by: Anthony Liot <anthony.liot@gmail.com>
5 years agoFix for build break in c# vector of unions (#5271)
Kamil Rojewski [Fri, 5 Apr 2019 18:49:12 +0000 (20:49 +0200)]
Fix for build break in c# vector of unions (#5271)

5 years agoFix typo in Go tutorial (#5274)
unexge [Thu, 4 Apr 2019 19:28:09 +0000 (22:28 +0300)]
Fix typo in Go tutorial (#5274)

5 years agoAdd compile-time checking of numerical limits in C++ code. (#5270)
Vladimir Glavnyy [Mon, 1 Apr 2019 19:03:51 +0000 (02:03 +0700)]
Add compile-time checking of numerical limits in C++ code. (#5270)

* Add checking of numerical_limits<T> in C++ code.

* Add integer suffixes (LL/ULL) to int64 values in the IntegerBoundaryTest

5 years agoUpdate grammar to reflect required type signature for enum declarations. (#5269)
tymcauley [Thu, 28 Mar 2019 17:48:40 +0000 (13:48 -0400)]
Update grammar to reflect required type signature for enum declarations. (#5269)

5 years agoAdd missing test data file to BUILD file (#5264)
Austin Schuh [Mon, 25 Mar 2019 23:17:18 +0000 (16:17 -0700)]
Add missing test data file to BUILD file (#5264)

$ cat
/home/austin/.cache/bazel/_bazel_austin/4b3182bfa237d7e256d9f18ffe58322f/execroot/com_github_google_flatbuffers/bazel-out/k8-opt/testlogs/flatbuffers_test/test.log
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //:flatbuffers_test
-----------------------------------------------------------------------------
VALUE: "0"
EXPECTED: "1"
TEST FAILED: tests/test.cpp:2029, flatbuffers::LoadFile( (test_data_path
+ "union_vector/union_vector.json").c_str(), false, &jsonfile) in
VALUE: "0"
EXPECTED: "1"
TEST FAILED: tests/test.cpp:2100, parser.Parse(jsonfile.c_str()) in
VALUE: "0"
EXPECTED: "1"
TEST FAILED: tests/test.cpp:2103, VerifyMovieBuffer(jverifier) in

5 years agoBazel CI: fix bad value in yml (#5262)
László Csomor [Mon, 25 Mar 2019 19:27:35 +0000 (20:27 +0100)]
Bazel CI: fix bad value in yml (#5262)

Use the "simple format" defined here:
https://github.com/bazelbuild/continuous-integration/blob/69cf7ec23d984dcbb41fffe946e07ebf5ab7e0f1/buildkite/bazelci.py#L1453

This will unbreak the "Bazel / FlatBuffers"
pipeline on Bazel CI, see
https://buildkite.com/bazel/flatbuffers

5 years agoFix a warning on compiling with clang (#5258)
Nikolay Kuznetsov [Mon, 25 Mar 2019 19:06:00 +0000 (22:06 +0300)]
Fix a warning on compiling with clang (#5258)

5 years agoAdd inequality operator (inspired from #263) (#5257)
LouisP [Mon, 25 Mar 2019 19:04:51 +0000 (20:04 +0100)]
Add inequality operator (inspired from #263) (#5257)

5 years ago[C++] Changes in the flathash program (#5255)
Henry Lee [Thu, 21 Mar 2019 23:23:32 +0000 (10:23 +1100)]
[C++] Changes in the flathash program (#5255)

* Correct the usage in the flathash program

As it is possible to have -- before the occurrence of the first
input STRING.

* Exit with 1 in the flathash program when an error occurs

5 years agoFixed tutorial markdown file (#5248)
Ashay Shirwadkar [Thu, 21 Mar 2019 22:51:51 +0000 (04:21 +0530)]
Fixed tutorial markdown file (#5248)

Path specified in tutorial file was pointing to invalid location.

5 years agoFurther fixes to make minireflect compatible with old behavior.
Wouter van Oortmerssen [Thu, 21 Mar 2019 22:07:24 +0000 (15:07 -0700)]
Further fixes to make minireflect compatible with old behavior.

Change-Id: I92c257ec4ab4a0cf4676bd98523b766ce25bf4f6

5 years agoUnify line ending rules in '.editorconfig' and '.gitattributes' (#5231)
Vladimir Glavnyy [Mon, 18 Mar 2019 19:47:07 +0000 (02:47 +0700)]
Unify line ending rules in '.editorconfig' and '.gitattributes' (#5231)

* Unify line ending rules in '.editorconfig' and '.gitattributes'

* Revert '.gitattributes'

- fix invalid comments in the check-source.py

5 years agoFixed vector_delimited excluding delimiter
Wouter van Oortmerssen [Mon, 18 Mar 2019 19:07:36 +0000 (12:07 -0700)]
Fixed vector_delimited excluding delimiter

Change-Id: I3e758d44b9845d6df91332bb609b4b7ad88659ac

5 years agoFixed shadowing warning in older gcc for vector_delimited
Wouter van Oortmerssen [Mon, 18 Mar 2019 17:03:43 +0000 (10:03 -0700)]
Fixed shadowing warning in older gcc for vector_delimited

Change-Id: Ia4d56a5eb086f86eb5d1ad6ddae64e4a51bf3aa3

5 years agoMade ToStringVisitor backwards compatible with older behavior.
Wouter van Oortmerssen [Thu, 14 Mar 2019 19:00:44 +0000 (12:00 -0700)]
Made ToStringVisitor backwards compatible with older behavior.

This to support code that relied on tables being multiline,
but not vectors.

This behavior was changed in:
https://github.com/google/flatbuffers/commit/b1a925dfc2ac78508aee89029e950057405f0a0a#diff-c45c8fbffbc64f7ff4aa2978612b10d8

Change-Id: I4c95471b643b2b3fab95e06b1294e19d686b492c

5 years agoMade JS enum declarations compatible with google closure
Wouter van Oortmerssen [Mon, 11 Mar 2019 21:33:07 +0000 (14:33 -0700)]
Made JS enum declarations compatible with google closure

Original change by: https://github.com/alexames

Change-Id: Ib65bd02156d1c3637ed278a8334a2307caacaa44

5 years agoDisabled constexpr for hashing functions.
Wouter van Oortmerssen [Mon, 11 Mar 2019 21:01:07 +0000 (14:01 -0700)]
Disabled constexpr for hashing functions.

This was incompatible with -Wc++98-c++11-compat on some platforms,
due to local variables in the function.

Change-Id: Idef510c2cefe944eef2e0656f5a219c2158063e6

5 years agoNarrows template ascii routines to prevent a possible signed overflow in generic...
Vladimir Glavnyy [Mon, 11 Mar 2019 17:26:28 +0000 (00:26 +0700)]
Narrows template ascii routines to prevent a possible signed overflow in generic code. (#5232)

5 years agoFix typo in dart documentation (#5230)
Randal Stevens [Mon, 11 Mar 2019 16:49:17 +0000 (09:49 -0700)]
Fix typo in dart documentation (#5230)

5 years ago[C++] Object API: document custom string type requirements,
Wouter van Oortmerssen [Mon, 11 Mar 2019 16:42:02 +0000 (09:42 -0700)]
[C++] Object API: document custom string type requirements,

implement better custom string type constructor alternative
for Unpack() and fix bug with vector of custom string types
in Pack().

Squashed commit of the following:

commit e9519c647ef949b22756ed660839dd3af854881c
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date:   Tue Mar 5 18:24:49 2019 +0100

    tests: regenerate code, reverts change to CreateVectorOfStrings().

commit 117e3b0679209f2aa55cbee18c4036e7da4bd4b3
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date:   Tue Mar 5 18:15:05 2019 +0100

    idl_gen_cpp.cpp: move clang-format on/off outside of declaration, so they are kept properly aligned automatically.

commit 4791923806965637d5b13f7003329bfbb2fdf18b
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date:   Tue Mar 5 18:11:40 2019 +0100

    idl_gen_cpp.cpp: full clang-format run with provided Google format file, enforce 80 lines width.

commit 2f0402f9ff43b1af0a29806932e08e6d64373345
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date:   Tue Mar 5 18:09:32 2019 +0100

    CppUsage: address requested changes.
    idl_gen_cpp.cpp: fix formatting, keep CreateVectorOfStrings for normal string cases.

commit 371d4e0b7972a59e5cff418c44e4043c016ce56a
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date:   Fri Mar 1 16:35:29 2019 +0100

    Fix compile error with a vector of non-std::strings. CreateVectorOfStrings() expects a vector of std::string types, but that's not always the case.

commit 92b90d7f0fbcfc837a94aa06bedccec0f7b4bb62
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date:   Fri Mar 1 16:15:36 2019 +0100

    Document requirement for custom string types to implement empty() and be constructible from std::string.
    Add new option --cpp-str-flex-ctor to construct custom string types not via std::string, but (char * + length).

commit 28cb2e92d5b7684b5df5184da3a3fad2d0cda733
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date:   Fri Mar 1 14:31:17 2019 +0100

    idl_gen_cpp.cpp: clang-format run, to better separate changes in content from formatting.

Change-Id: I4887ba2f2c632b9e7a8c938659b088cd95690870

5 years ago[Rust] Don't use inner attributes for `allow` (#5212)
bspeice [Sat, 9 Mar 2019 20:58:27 +0000 (14:58 -0600)]
[Rust] Don't use inner attributes for `allow` (#5212)

* Don't use inner attributes for `allow`
Messes with being able to easily include elsewhere

* Regenerate tests

* No-op to retrigger CI

* Add the rest of the `allow` attributes

5 years agoSmall usability tweaks to the rust codegen. (#5213)
Mathias Svensson [Fri, 8 Mar 2019 21:54:57 +0000 (22:54 +0100)]
Small usability tweaks to the rust codegen. (#5213)

5 years agoFix rust crate for big-endian targets (#5229)
tymcauley [Fri, 8 Mar 2019 09:06:25 +0000 (04:06 -0500)]
Fix rust crate for big-endian targets (#5229)

Thanks for tackling this, @tymcauley !

* big endian docker test -- wip

* tweaks

* tweaks

* tweaks

* docker tweaks

* fix conditional compilation issues

* reactivate other docker tests

* try some more cross-platform config (from tymcauley)

* Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1

Co-Authored-By: rw <rw@users.noreply.github.com>
* Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1

Co-Authored-By: rw <rw@users.noreply.github.com>
* Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1

Co-Authored-By: rw <rw@users.noreply.github.com>
* Resolved Rust warnings during big-endian builds.

* Unify Rust test suites for x86 and MIPS builds.

Note that I had to add four extra packages to the MIPS `Dockerfile`:
`libexpat1`, `libmagic1`, `libmpdec2`, and `libreadline7`. For a reason
I couldn't identify, even the simplest Rust MIPS binaries run with
`qemu-mips` would fail with a segfault when run through this
`Dockerfile`. After installing the `gdb-multiarch` package to attempt to
debug the issue, the binaries ran successfully. I pared down the
packages installed by `gdb-multiarch`, and these four packages are the
minimum subset necessary to get Rust MIPS binaries running under
`qemu-mips`.

* Changed Rust tests to use `Vector`s instead of direct-slice-access.

The direct-slice-access method is not available on big-endian targets,
but `flatbuffers::Vector`s provide an array interface that is available
on all platforms.

* Resolved FooStruct endianness issues using explicit struct constructor.

This more closely resembles how FlatBuffers structs are constructed in
generated Rust code.

* Added explanation of how `FooStruct` parallels generated struct code.

Also collected duplicate implementations of `FooStruct` into a common
location.

5 years agoRemoved -Wc++98-compat-extra-semi for compatibility with older clang.
Wouter van Oortmerssen [Thu, 7 Mar 2019 23:14:40 +0000 (15:14 -0800)]
Removed -Wc++98-compat-extra-semi for compatibility with older clang.

Change-Id: I6dfadb5289a4396ad2f3d16baf1bdb99c7534174

5 years agoBazel ci (#5228)
Austin Schuh [Thu, 7 Mar 2019 23:09:30 +0000 (15:09 -0800)]
Bazel ci (#5228)

* Stop building for Windows until the build passes

ERROR: D:/b/bk-windows-java8-bd0z/bazel/flatbuffers/BUILD:123:1: Couldn't build file _objs/flatbuffers_test/test.obj: undeclared inclusion(s) in rule '//:flatbuffers_test':
this rule is missing dependency declarations for the following files included by 'tests/test.cpp':
  'tests/monster_test_generated.h'
  'tests/monster_extra_generated.h'

The files in tests are being found instead of the generated files since
Windows doesn't have any sandboxing.  For now, let's disable the rules
and come back to it.

* Fix buildifier warnings

Clean up docstrings and add a module docstring.

5 years agoFixed vector of union JSON parsing.
Wouter van Oortmerssen [Mon, 4 Mar 2019 22:56:07 +0000 (14:56 -0800)]
Fixed vector of union JSON parsing.

This for some reason never had a test case, and was broken.

Change-Id: If832f5eb8b6c5ba8a75257464892634b38719c55

5 years ago[Rust] Fixed codegen documentation for Tables (#5227)
jean-airoldie [Wed, 6 Mar 2019 20:00:58 +0000 (15:00 -0500)]
[Rust] Fixed codegen documentation for Tables (#5227)

5 years ago[Go] Add mutation functions for vector elements (#5221)
David Reiss [Wed, 6 Mar 2019 05:16:26 +0000 (21:16 -0800)]
[Go] Add mutation functions for vector elements (#5221)

Fixes #5206

5 years agoClean-up nested_parser on all paths (#5179) (#5184)
ll-antn [Mon, 4 Mar 2019 19:35:10 +0000 (22:35 +0300)]
Clean-up nested_parser on all paths (#5179) (#5184)

* Clean-up nested_parser on all paths (#5179)

* Added test for parsing json with invalid nested flatbuffer

* Removed utf-8 BOM from test.cpp

5 years ago[Fix #5112] flatc generates constructors with memset for non-trivial types (#5222)
Laurent Stacul [Mon, 4 Mar 2019 19:10:18 +0000 (20:10 +0100)]
[Fix #5112] flatc generates constructors with memset for non-trivial types (#5222)

5 years ago[doc] fix typos in doc. (#5217)
csukuangfj [Thu, 28 Feb 2019 20:39:26 +0000 (04:39 +0800)]
[doc] fix typos in doc. (#5217)

5 years agoRust: Fix lifetime in union _as_ accessors (#5140)
naure [Wed, 27 Feb 2019 07:48:54 +0000 (08:48 +0100)]
Rust: Fix lifetime in union _as_ accessors (#5140)

* Fix lifetime in union _as_ accessors

In the accessors for union field, the return value is implicitly taking the lifetime of &self.
This is irrelevant and prevents usages of the returned value, because it is needlessly bound to the parent field lifetime.

This patch makes the return value inherit the lifetime of the data, like other methods do.

5 years agoJava: Calculation of vtable and vtable size moved to the __init method. (#5210)
Kulikov Alexey [Mon, 25 Feb 2019 22:45:29 +0000 (05:45 +0700)]
Java: Calculation of vtable and vtable size moved to the __init method. (#5210)

vtable and vtable size depends only on `Table#bb_pos` but calculated in
`Table#_offset` method on each field lookup.
Doing this with every call of `Table#__offset` is redundant.

These values can be read once with change of `Table#bb_pos` and reused
for any field lookup.

5 years agoJava: Removed unused duplicate of bytebuffer from "Table#__string" method. (#5211)
Kulikov Alexey [Mon, 25 Feb 2019 22:28:13 +0000 (05:28 +0700)]
Java: Removed unused duplicate of bytebuffer from "Table#__string" method. (#5211)

5 years agoLua library: fix vtable reuse. (#5214)
Искандаров Егор [Mon, 25 Feb 2019 22:27:42 +0000 (01:27 +0300)]
Lua library: fix vtable reuse. (#5214)

Fixed a bug that prevented vtable reuse during buffer construction in the lua library.

Also fixed a bug in vtable equality check that was revealed after the first fix.

5 years agoAttempting to make travis not kill the Android build.
Wouter van Oortmerssen [Mon, 25 Feb 2019 22:10:56 +0000 (14:10 -0800)]
Attempting to make travis not kill the Android build.

Change-Id: Icdff8a90338bd2ff79ff76fe1ebaa3481da8dea4

5 years agoIterateValue: Use ReadScalar instead of unportable reinterpret_casts (#5209)
Marcus Comstedt [Mon, 25 Feb 2019 20:45:11 +0000 (21:45 +0100)]
IterateValue: Use ReadScalar instead of unportable reinterpret_casts (#5209)

This fixes the testcase MiniReflectFlatBuffersTest.

5 years agoFix incorrect code generation on Solaris Sparc. (#5208)
Brian Wellington [Mon, 25 Feb 2019 20:41:31 +0000 (12:41 -0800)]
Fix incorrect code generation on Solaris Sparc. (#5208)

On Solaris Sparc, calling NumToString() with a char called the primary
version, not the signed char or unsigned char specializations, which
caused integer to string conversions to be missed.

5 years agoAdded -Wc++98-compat-extra-semi
Wouter van Oortmerssen [Mon, 25 Feb 2019 19:42:37 +0000 (11:42 -0800)]
Added -Wc++98-compat-extra-semi

And fixed 2 more extra semi-colons.

Change-Id: I1ee08e5b2f67cd0c886847c05cd4d63cfcafec3e

5 years agoAdded -Wextra-semi to Clang build.
Wouter van Oortmerssen [Mon, 25 Feb 2019 17:14:06 +0000 (09:14 -0800)]
Added -Wextra-semi to Clang build.

Also fixed warnings this generated.

Change-Id: If3607907b2dd609f854b7b81225d9cf66af75a60

5 years agoFix big-endian build. (#5205)
Brian Wellington [Fri, 22 Feb 2019 00:50:05 +0000 (16:50 -0800)]
Fix big-endian build. (#5205)

For some reason, Offset<T> is being considered a scalar, which
causes EndianSwap to be passed an Offset<T>.  This doesn't work,
as it does not support types with non-trivial constructors.  This
change adds an overload to WriteScalar(), which works around this.

5 years agoRemove byte* property in ByteBufferAllocator (#5191)
Eric Erhardt [Thu, 21 Feb 2019 22:36:55 +0000 (16:36 -0600)]
Remove byte* property in ByteBufferAllocator (#5191)

* Remove byte* property in ByteBufferAllocator.

This allows consumers to read/write into native memory, but without
having to always pin the managed `byte[]` when working with managed
memory. This allows for users to not need to Dispose() ByteBuffers
when they are using the default ByteArrayAllocator class.

Instead, we use `Span<byte> GetSpan()` methods to get access to the
underlying memory buffer.

Fix #5181

* Add a set of benchmark tests.

* Add ReadOnly spans.

This allows consumers to use ReadOnlyMemory<byte> as the backing storage
for ByteBuffers, which is useful in read-only scenarios.

* Run tests using ENABLE_SPAN_T in appveyor.

* Fix FlatBuffers.Test.csproj to work on older MSBuild versions.

* Change the test script to test UNSAFE_BYTEBUFFER

* Address PR feedback.

Remove IDisposable from ByteBuffer.

* Respond to PR feedback.

5 years agoImprove endian detection. (#5204)
bwelling [Thu, 21 Feb 2019 21:45:11 +0000 (13:45 -0800)]
Improve endian detection. (#5204)

Add support for using __BYTE_ORDER__, to support platforms where g++
doesn't explicitly define __BIG_ENDIAN__, like Solaris Sparc.

5 years agoAdd RPM packaging support (#5177)
Marc Butler [Thu, 21 Feb 2019 19:06:04 +0000 (06:06 +1100)]
Add RPM packaging support (#5177)

* Add RPM packaging support

Using the existing PackageDebian as template add support for
generating an rpm with the package target.

* Restore debian package target

Also add an option to advertise the fact.

* Update package description

C-n-p from README.md

* Update rpm package maintainer

5 years agoFixed vector of unions crash in java (#5190)
Kamil Rojewski [Thu, 21 Feb 2019 18:50:13 +0000 (19:50 +0100)]
Fixed vector of unions crash in java (#5190)

* Fixed vector of unions crash in java

* Regenerated test code

* Fixed windows tests

5 years agoAdded .net core project (#5187)
Efe Burak [Thu, 21 Feb 2019 18:47:19 +0000 (13:47 -0500)]
Added .net core project (#5187)

5 years agoFix an error in cpp code. (#5189)
csukuangfj [Tue, 19 Feb 2019 19:23:10 +0000 (03:23 +0800)]
Fix an error in cpp code. (#5189)

Change monster_generate.h to monster_generated.h

5 years agoUtility for checking the encoding and line ending of source files (#5188)
Vladimir Glavnyy [Tue, 19 Feb 2019 19:22:25 +0000 (02:22 +0700)]
Utility for checking the encoding and line ending of source files (#5188)

* Add utility for checking the encoding of source files

- accept source files with ASCII or UTF-8 without BOM
- accept only CRLF line ending

* Fix non-ascii symbol in idl_parcer.cpp

* Remove BOM from test.cpp

5 years agoFixed use of WIN32 needs to be _WIN32.
Wouter van Oortmerssen [Tue, 19 Feb 2019 18:49:23 +0000 (10:49 -0800)]
Fixed use of WIN32 needs to be _WIN32.

Change-Id: Ie1f88ac5613cc09ed1074608dd6517ae20c7973d

5 years agoAdd presubmit.yml for bazel CI configuration (#5193)
Austin Schuh [Tue, 19 Feb 2019 01:55:50 +0000 (17:55 -0800)]
Add presubmit.yml for bazel CI configuration (#5193)

https://github.com/bazelbuild/continuous-integration/tree/master/buildkite#configuring-a-pipeline

5 years agoFix AppVeyor script not including CMake dir
Wouter van Oortmerssen [Fri, 15 Feb 2019 00:20:27 +0000 (16:20 -0800)]
Fix AppVeyor script not including CMake dir

Change-Id: I737a74dd4d31ca6d1559958f4c76e61e1f0a2c64

5 years agoChanged the JavaScript generation to emit createX helper functions just like the...
Christopher Cifra [Fri, 15 Feb 2019 00:00:33 +0000 (18:00 -0600)]
Changed the JavaScript generation to emit createX helper functions just like the TypeScript code generation. I also added code so that the create methods have documentation in both JavaScript and TypeScript. (#5168)

5 years ago[C#] Fix FlatBuffers.Tests when ENABLE_SPAN_T is defined (#5182)
Eric Erhardt [Thu, 14 Feb 2019 23:53:36 +0000 (17:53 -0600)]
[C#] Fix FlatBuffers.Tests when ENABLE_SPAN_T is defined (#5182)

There is a test code error that causes the CanReadCppGeneratedWireFile test to fail when ENABLE_SPAN_T is defined. When TestarrayofboolsLength is not 0, then the GetTestarrayofboolsBytes() should have a length.

5 years agoInstall flatc as requested (#5180)
Aleix Pol [Thu, 14 Feb 2019 21:19:36 +0000 (22:19 +0100)]
Install flatc as requested (#5180)

If FLATBUFFERS_BUILD_FLATC and FLATBUFFERS_INSTALL are set, flatc should
be installed regardless of the configuration.