platform/upstream/flatbuffers.git
5 years agoAdd support for fixed-size arrays (#5313)
svenk177 [Mon, 17 Jun 2019 22:15:13 +0000 (00:15 +0200)]
Add support for fixed-size arrays (#5313)

5 years agoAdd FLATBUFFERS_COMPATIBILITY string (#5381)
Vladimir Glavnyy [Mon, 17 Jun 2019 17:16:21 +0000 (00:16 +0700)]
Add FLATBUFFERS_COMPATIBILITY string (#5381)

* Add FLATBUFFERS_COMPATIBILITY string

- Add a new __reset method NET/JAVA which hides internal state

* Resolve PR notes

* Use operator new() to __init of Struct and Table

* Restrict visibility of C# Table/Struct to internal level

5 years ago[C#, Java, C++] Fixes issue #5399 by always including namespaces (#5404)
John Luxford [Fri, 14 Jun 2019 15:47:08 +0000 (10:47 -0500)]
[C#, Java, C++] Fixes issue #5399 by always including namespaces (#5404)

* [C#] Fixes issue #5399 by always including namespaces

* Updated tests for code generator changes

* Fixed 'As' method names

5 years ago[Go] Fix namespaces on enums (#5406)
John Luxford [Fri, 14 Jun 2019 03:25:03 +0000 (22:25 -0500)]
[Go] Fix namespaces on enums (#5406)

5 years agoExcluded crtdbg.h from non-MSVC compilation (#5401)
Tiger Caldwell [Thu, 13 Jun 2019 09:58:40 +0000 (02:58 -0700)]
Excluded crtdbg.h from non-MSVC compilation (#5401)

5 years ago[flatc][docs] Document rounding behavior of floats in JSON output (#5397)
Michael Seifert [Wed, 12 Jun 2019 10:35:39 +0000 (12:35 +0200)]
[flatc][docs] Document rounding behavior of floats in JSON output (#5397)

* [docs] Added an example on how to convert a FlatBuffer binary to JSON
Slightly adjusted section on "Using flatc as a conversion tool".

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
* [docs] Updated obsolete JSON data in example showing how to convert JSON to FlatBuffer binaries.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
5 years agoRemove out-dated -S option from the flatc syntax. (#5398)
Will Stott [Sun, 9 Jun 2019 19:30:10 +0000 (20:30 +0100)]
Remove out-dated -S option from the flatc syntax. (#5398)

Looks like it's an older syntax for --strict-json which was long-ago removed in https://github.com/google/flatbuffers/commit/d38b9af243d8dcfc53ab69c79e0ce404759240d4

5 years ago[rust] Use read_scalar_at where possible (#5385)
jean-airoldie [Fri, 7 Jun 2019 21:06:21 +0000 (17:06 -0400)]
[rust] Use read_scalar_at where possible (#5385)

This slightly improves readability.

5 years ago[rust] Derive Eq + PartialEq on FieldLoc and FlatBufferBuilder (#5394)
jean-airoldie [Thu, 6 Jun 2019 21:09:58 +0000 (17:09 -0400)]
[rust] Derive Eq + PartialEq on FieldLoc and FlatBufferBuilder (#5394)

5 years agofix typo (#5384)
Ashwin Ramaswami [Wed, 5 Jun 2019 18:24:29 +0000 (11:24 -0700)]
fix typo (#5384)

* fix typo

* fix typo

5 years ago[bfbs] fix deserializing nested struct (#5383)
mugisoba [Sun, 2 Jun 2019 19:49:27 +0000 (04:49 +0900)]
[bfbs] fix deserializing nested struct (#5383)

5 years agoFix multi-line comments for cpp enums (#5345) (#5346)
Vladimir Glavnyy [Sun, 2 Jun 2019 19:36:49 +0000 (02:36 +0700)]
Fix multi-line comments for cpp enums (#5345) (#5346)

- fix CSharp comments generation
- fix Python comments generation
- fix Lua comments generation
- fix PHP comments generation
- fix Dart comments generation
- add brief description of Color enum
- add multi-line comments to the Monster:Color

5 years agoc++: Add command line option to add extra includes to gen files (#5360)
Alexander Gallego [Fri, 31 May 2019 20:43:30 +0000 (13:43 -0700)]
c++: Add command line option to add extra includes to gen files (#5360)

* c++: Add command line option to add extra includes to gen files

Fixes #5351
We have an ability to pass custom types for strings, allocators, etc
but have no way to tell the generator to include the classes in gen code

* c++: remove std::strtok for std::string methods. passes msvc compile

* generate_code.sh: add --cpp-includes to the test gen script

* tests:generate.bat: update code gen scripts w/ --cpp-includes

* cpp: use command line parsing for extra includes

s/--cpp-includes/--cpp-include/g
Simplify command line parsing of includes by using a std::vector.

* cpp: idl.h: move std::vector for cpp_includes as the last member

msvc does not understand initalization list on our CI server

* cpp:msvc: CI fails on for-range loops

* cpp:codegen: fix error reporting on flatcc

* as per code review: remove unwated --cpp-include in the
tests/generate_code.{sh,bat}

5 years agoBreak internal Java/C# APIs
Wouter van Oortmerssen [Fri, 31 May 2019 20:00:55 +0000 (13:00 -0700)]
Break internal Java/C# APIs

This is done on purpose, to avoid API version mismatches that
can cause bad decoding results, see:
https://github.com/google/flatbuffers/issues/5368

Change-Id: I2c857438377e080caad0e2d8bcc758c9b19bd6ec

5 years agoEnforce matching version in Java and C#.
Wouter van Oortmerssen [Fri, 31 May 2019 18:29:09 +0000 (11:29 -0700)]
Enforce matching version in Java and C#.

Change-Id: I7f1f12f2f97e5227e0dabc2965ce66a6d41c229c

5 years agoDereference of null pointer #5353 (#5376)
360 CodeSafe [Fri, 31 May 2019 00:50:21 +0000 (08:50 +0800)]
Dereference of null pointer #5353 (#5376)

add an assert to make sure that `key_field` is not a null pointer.

5 years ago[C#] add FlatBuffersBuilder.CreateSharedString (#5372)
mugisoba [Thu, 30 May 2019 23:15:50 +0000 (08:15 +0900)]
[C#] add FlatBuffersBuilder.CreateSharedString (#5372)

5 years ago[C++] Fix Undefined behavior for zero length vectors (#5355)
emkornfield [Thu, 30 May 2019 23:13:34 +0000 (16:13 -0700)]
[C++] Fix Undefined behavior for zero length vectors (#5355)

* Fix Undefined behavior for zero length vectors

* Change fix for UBSan

5 years agoRename AnyUniqueAliases.T to AnyUniqueAliases.TS to avoid naming conflict (#5362)
iceboy [Thu, 30 May 2019 23:02:57 +0000 (16:02 -0700)]
Rename AnyUniqueAliases.T to AnyUniqueAliases.TS to avoid naming conflict (#5362)

5 years agoGenerate FlagsAttribute for Csharp (#5370)
Marc Butler [Thu, 30 May 2019 22:57:41 +0000 (08:57 +1000)]
Generate FlagsAttribute for Csharp (#5370)

For schema enums with the bit_flags attribute, generate the
corresponding System.FlagsAttribute in generated Csharp code.

5 years agoLobster: added builder API for tables
aardappel [Thu, 23 May 2019 02:42:13 +0000 (19:42 -0700)]
Lobster: added builder API for tables

5 years agoLobster documentation fixes
aardappel [Wed, 22 May 2019 23:01:51 +0000 (16:01 -0700)]
Lobster documentation fixes

5 years agoMade Lobster builder offsets strongly typed
aardappel [Wed, 22 May 2019 22:55:28 +0000 (15:55 -0700)]
Made Lobster builder offsets strongly typed

5 years agoMade Lobster API use strongly typed enums
aardappel [Wed, 22 May 2019 22:28:16 +0000 (15:28 -0700)]
Made Lobster API use strongly typed enums

5 years agoFixed Lobster implementation to work with latest language features
aardappel [Wed, 22 May 2019 18:48:10 +0000 (11:48 -0700)]
Fixed Lobster implementation to work with latest language features

5 years agoFixed warnings in idl_gen_go.cpp
aardappel [Wed, 22 May 2019 01:54:26 +0000 (18:54 -0700)]
Fixed warnings in idl_gen_go.cpp

5 years ago[Go] Public visibility for gazelle default target (#5361)
Siddhartha Bagaria [Tue, 21 May 2019 21:48:51 +0000 (14:48 -0700)]
[Go] Public visibility for gazelle default target (#5361)

5 years agoChange usage of std::string's .at() to more widely-compatible []. (#5365)
jonsimantov [Tue, 21 May 2019 21:40:33 +0000 (14:40 -0700)]
Change usage of std::string's .at() to more widely-compatible []. (#5365)

5 years agoGo bazel default target for gazelle (#5358)
Siddhartha Bagaria [Tue, 21 May 2019 00:16:48 +0000 (17:16 -0700)]
Go bazel default target for gazelle (#5358)

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.