platform/upstream/flatbuffers.git
4 years ago[go]add Name() for ForceCodec interface (#5486)
Tsingson [Mon, 19 Aug 2019 22:32:04 +0000 (06:32 +0800)]
[go]add Name() for ForceCodec  interface (#5486)

* add Name() for ForceCodec  interface

// ForceCodec returns a CallOption that will set the given Codec to be
// used for all request and response messages for a call. The result of calling
// String() will be used as the content-subtype in a case-insensitive manner.
//

* Update grpc.go

4 years agoreflection: check for valid union enum value during object verification (#5475)
Mark Nauwelaerts [Mon, 19 Aug 2019 19:48:25 +0000 (21:48 +0200)]
reflection: check for valid union enum value during object verification (#5475)

... to avoid assertion failure or invalid access due to invalid vector index

4 years agohas_method support for primitive fields in java runtime. Changed: idl.h, FlatBufferBu...
Edward [Mon, 19 Aug 2019 19:46:48 +0000 (12:46 -0700)]
has_method support for primitive fields in java runtime. Changed: idl.h, FlatBufferBuilder.java ,  idl_gen_general.cpp, idl_parser.cpp, flatc.cpp (#5468)

* has_method support for primitive fields in java runtime

* adding the new flag to flatc

* addressing the review comments

5 years agoFix compilation error in tests. (#5472)
Max Burke [Mon, 5 Aug 2019 18:57:54 +0000 (11:57 -0700)]
Fix compilation error in tests. (#5472)

Local variables were shadowing member fields, causing errors.

5 years ago[C++] remove static_cast expression (#5440)
Alexey Geraskin [Thu, 1 Aug 2019 21:31:48 +0000 (00:31 +0300)]
[C++] remove static_cast expression (#5440)

* [C++] remove static_cast expression

* [C++] Add unit test for native_type usage

* [C++] Add flatc compilation for native_type_test.fbs

* [C++] update CMakeLists to compile native_type_test.fbs properly

* Update BUILD file for bazel

* [C++] Add generated native_type_test_generated.h and fix arguments for flatc according to CMakeList

* [C++] remove "= default" from constructor to support old compilers

* Update BUILD file for bazel, attempt 2

* [C++] Workaround for MSVC 2010 for the issue with std::vector and explicitly aligned custom data types

* Update BUILD file for bazel, attempt 3

* Update BUILD file for bazel, attempt 4

* Update BUILD file for bazel, attempt 5

* Update BUILD file for bazel, attempt 6

* [C++] Workaround for MSVC 2010 for the issue with std::vector and explicitly aligned custom data types Part 2

* [C++] Keep only one optional parameter to compile_flatbuffers_schema_to_cpp_opt

* native_type_test.fbs style corrected

* [C++] Code style modifications

* [C++] Fix flatc arguments in CMakeLists

* [C++] Remove --gen-compare from default parameters for flatc in CMakeLists

* [C++] Change Vector3D fields from double to float, to have alignment eq. 4 (to support MSVC 2010), plus minor review fix

* [C++] Remove one more #if !defined

* [C++] Restore version with correct static_cast, add the same fix for SortedStructs

* Revert "[C++] Restore version with correct static_cast, add the same fix for SortedStructs"

This reverts commit d61f4d6628cfce530c8b9a4c9e7af368d599f99f.

* [C++] Fix Android.mk

5 years ago[C++ ] Correctly serialize bit_flags enums to JSON with output_enum_identifiers optio...
ll-antn [Thu, 1 Aug 2019 21:16:44 +0000 (00:16 +0300)]
[C++ ] Correctly serialize bit_flags enums to JSON with output_enum_identifiers option (#5454)

* Support output_enum_identifiers for enums with multiple bit values

* Cast bit_flag enum val to uint64_t instead of int64_t

5 years agoFix for Boolean types (#5379) (#5466)
Derek Bailey [Thu, 1 Aug 2019 17:28:54 +0000 (10:28 -0700)]
Fix for Boolean types (#5379) (#5466)

The packing/unpacking steps for Boolean values was failing because the
code expected numerical values. I overrode the functions for the Boolean
metatable to account for this. I also had to exclude the Boolean
metatable from the GenerateTypes helper function, as that was overriding
the Pack/Unpack functions defined in its metatable.

Added Linux bash script to run Lua tests from the command line.

Bug: google/flatbuffers#5379

Tested: Added Lua tests that were failing and are now fixed with the
code changes.

5 years agoRenamed stale label from "wontfix" to "stale".
Wouter van Oortmerssen [Mon, 29 Jul 2019 18:43:28 +0000 (11:43 -0700)]
Renamed stale label from "wontfix" to "stale".

Change-Id: Iea88624d9d90e029a64cab9edf4e7c1cfc005e4a

5 years agoReplace '--cpp-include' brackets to quotes (#5438) (#5464)
Vladimir Glavnyy [Mon, 29 Jul 2019 18:38:52 +0000 (01:38 +0700)]
Replace '--cpp-include' brackets to quotes (#5438) (#5464)

5 years agoMade stale.yml friendlier.
Wouter van Oortmerssen [Sat, 27 Jul 2019 01:56:56 +0000 (18:56 -0700)]
Made stale.yml friendlier.

5 years agoExtend the error message if base type of parsed scalar not resolved (#5456)
Vladimir Glavnyy [Sat, 27 Jul 2019 00:56:41 +0000 (07:56 +0700)]
Extend the error message if base type of parsed scalar not resolved (#5456)

* Extend the error message if base type of parsed scalar not resolved #5447

* Resolve PR notes

5 years agoAdd .github/stale.yml to auto close stale issues and PRs.
Wouter van Oortmerssen [Sat, 27 Jul 2019 00:48:21 +0000 (17:48 -0700)]
Add .github/stale.yml to auto close stale issues and PRs.

See https://probot.github.io/apps/stale/

Change-Id: I8176eeb21dbcd516f1d6f7b1e8c28602cdd9332a

5 years agoPython: Added support for file_identifiers (#5123)
Joseph Pyott [Fri, 26 Jul 2019 18:06:25 +0000 (14:06 -0400)]
Python: Added support for file_identifiers (#5123)

* Python: Added support for file_identifiers

* Added tests. Fixed file_identifier code.

* Python: Fixed excessive padding of file_identifier. Repaired tests.

* Python: Made code compatible with python2.7

* Python: Typo fix in @endcond

* whitespace normaalization

* Stylistic change from if(not X is None) to if(X is not None). Added comment to type string.

* Python: Added support for automatic code generation of file_identifiers. Added tests for said code generation.

* converted sprintf to snprintf

* Bugfix, added snprint deffinition for MSVC

* changed snprint deffinition for MSVC to sprint_s

* changed scanf to IntToStringHex. Renamed HasFileIdentifier to GenHasFileIdentifier.

* Added updated genereated code to commit

* Python bugix: flatc no longer produces HasFileIdentfier for shcemas with no file identifier

* Added tests to verify `MonsterBufferHasIdentifier` returns false on no Identifier

* Python: added tests for GetBufferIdentifier and BufferHasIdentifier
Python: removed unessasary parenethesis in if statements
Minor format changes.

* Python : correceted instances of keyword arguments being called as positional arguments

* fixed typos and grammer in comments

* Minor style fixes

* Indentation fix

* Equals style changes

* Python: Fixed Alignment Issues. Changed test code to test against atual output

* Ran make(forgot to run make last commit)

* Python: Style changes

* Style changes

* indentation and style

* readded CONTRIBUTING.md

* Formatting tweak

Mostly to make CI run again

* More formatting fixes

* More formatting fixes

* More formatting fixes

* More formatting fixes

* Formatting fix

* More formatting fixes

* Formatting

* ran generate_code.sh

5 years agoFix numeric_limits<T>::max() to avoid conflict with windows.h header (#5462)
ll-antn [Fri, 26 Jul 2019 16:14:05 +0000 (19:14 +0300)]
Fix numeric_limits<T>::max() to avoid conflict with windows.h header (#5462)

5 years agoSupport nested_flatbuffer attribute when parsing bfbs schema (#5448)
ll-antn [Fri, 26 Jul 2019 16:13:11 +0000 (19:13 +0300)]
Support nested_flatbuffer attribute when parsing bfbs schema (#5448)

5 years agoPin FlatBuffers Android Travis builds to NDK r17c (#5460)
Stewart Miles [Fri, 26 Jul 2019 00:58:02 +0000 (17:58 -0700)]
Pin FlatBuffers Android Travis builds to NDK r17c (#5460)

r17c is the last Android NDK to include stlport and gnustl.
We want to continue to support these deprecated STLs until we have
confidence few enough customers are using them.

5 years agoChange deprecated vector Length() to size() in tutorial (#5450)
Jason Monschke [Thu, 25 Jul 2019 18:09:40 +0000 (18:09 +0000)]
Change deprecated vector Length() to size() in tutorial (#5450)

5 years agoAdded missing Kotlin generated code change.
Wouter van Oortmerssen [Thu, 25 Jul 2019 18:08:06 +0000 (11:08 -0700)]
Added missing Kotlin generated code change.

Change-Id: I7eeee6519b6dc619691437e44272cf5424d0d4ca

5 years ago#4590 Fix Conan build (#5449)
Uilian Ries [Thu, 25 Jul 2019 18:06:40 +0000 (15:06 -0300)]
#4590 Fix Conan build (#5449)

* #4590 Fix Conan build

- Create separated build for Conan on master branch
- Add Clang 7,8
- Add Gcc 9

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* #4590 Do not build Conan for PRs

Signed-off-by: Uilian Ries <uilianries@gmail.com>
5 years agoAdd basic Kotlin support (#5409)
Paulo Pinheiro [Mon, 22 Jul 2019 23:05:15 +0000 (20:05 -0300)]
Add basic Kotlin support (#5409)

* [Kotlin] Add kotlin generate code for tests and add
kotlin test to TestAll.sh

* [Kotlin] Add Kotlin generator

This change adds support for generating Kotlin classes.

The approach of this generator is to keep it as close
as possible to the java generator for now, in order
to keep the change simple.

It uses the already implemented java runtime,
so we don't support cross-platform nor js Kotlin yet.

Kotlin tests are just a copy of the java tests.

* Add optional ident support for CodeWriter

Identation is important for some languages and
different projects have different ways of ident
code, e.g. tabs vs spaces, so we are adding optional
support on CodeWriter for identation.

* [Kotlin] Add Documentation for Kotlin

* [Kotlin] Modify generated code to use experimental Unsigned types.

5 years ago[C++] fix static_cast expression (#5441)
Alexey Geraskin [Thu, 18 Jul 2019 18:51:12 +0000 (21:51 +0300)]
[C++] fix static_cast expression (#5441)

5 years ago[rust] Ran rustfmt against library code (#5389)
jean-airoldie [Tue, 9 Jul 2019 20:41:51 +0000 (16:41 -0400)]
[rust] Ran rustfmt against library code (#5389)

5 years agoExtend the test of MonsterExtra (#5428)
Vladimir Glavnyy [Mon, 8 Jul 2019 18:22:56 +0000 (01:22 +0700)]
Extend the test of MonsterExtra (#5428)

* Extend the test of MonsterExtra

- Extend C++ test of MonsterExtra
- Add conversion of fbs/json NaNs to unsigned quiet-NaN
- Update documentation (cross-platform interoperability)

* Fix declaration of infinity constants int the test

5 years agoFix echo not interpret \n in GoTest.sh (#5426)
Thanabodee Charoenpiriyakij [Mon, 1 Jul 2019 18:42:00 +0000 (01:42 +0700)]
Fix echo not interpret \n in GoTest.sh (#5426)

When running GoTest.sh, the last step that checking go format files
are print \n instead of new line:

These files are not well gofmt'ed:\n\nMyGame/Example/Color.go
MyGame/Example/MonsterStorage_grpc.go

This changes fix it by echo NOT_FMT_FILES in separate line.

5 years agoRemove unused variables (#5382)
Vladimir Glavnyy [Mon, 1 Jul 2019 18:38:21 +0000 (01:38 +0700)]
Remove unused variables (#5382)

- Fix GenerateTextFromTable (aliasing typo)
- Fix unused variable in idl_gen_dart.cpp
- Fix std::string passing (should be non-const value or const-reference)
- Remove unused variables

5 years agoFix undefined behavior. Closes #5422 (#5423)
Andrew Noyes [Thu, 27 Jun 2019 21:11:31 +0000 (14:11 -0700)]
Fix undefined behavior. Closes #5422 (#5423)

* Fix undefined behavior. Closes #5422

* Move check into callers of make_space

5 years agoUpdate Utf8.java: more detailed exception message (#5421)
Edward [Thu, 27 Jun 2019 19:19:57 +0000 (12:19 -0700)]
Update Utf8.java: more detailed exception message (#5421)

Provide more detailed exception message for malformed 2 byte utf8 character

5 years agoFix for FLATBUFFERS_PREFER_PRINTF writing zero-length strings (#5418)
Adrian Perez [Thu, 27 Jun 2019 16:23:13 +0000 (09:23 -0700)]
Fix for FLATBUFFERS_PREFER_PRINTF writing zero-length strings (#5418)

5 years agoSet C# Struct/Table visibility to public (#5381) (#5416)
Vladimir Glavnyy [Tue, 25 Jun 2019 00:51:04 +0000 (07:51 +0700)]
Set C# Struct/Table visibility to public (#5381) (#5416)

5 years agoDon't check ForceDefaults when adding Offfset values (#5415)
Bryan Furia [Tue, 25 Jun 2019 00:49:53 +0000 (20:49 -0400)]
Don't check ForceDefaults when adding Offfset values (#5415)

5 years agoFixed broken Utf8Old.java
Wouter van Oortmerssen [Mon, 24 Jun 2019 23:53:50 +0000 (16:53 -0700)]
Fixed broken Utf8Old.java

This would not correctly encode/decode strings when substituted for
the default Utf8Safe.java

Change-Id: Ib303697663b5b8cbf6888492f5255b2a45384c04

5 years agoFix generating nested Flatbuffer accessors when they cross namespaces (#5414)
Bryan Furia [Mon, 24 Jun 2019 18:46:00 +0000 (14:46 -0400)]
Fix generating nested Flatbuffer accessors when they cross namespaces (#5414)

5 years agoFix compatability with Bazel 0.27 (#5412)
Austin Schuh [Thu, 20 Jun 2019 17:25:41 +0000 (10:25 -0700)]
Fix compatability with Bazel 0.27 (#5412)

rules_go was too old and using deprecated features.  Upgrade it.

5 years agoUpdated missing generated code for PR #5313 (fixed arrays)
Wouter van Oortmerssen [Thu, 20 Jun 2019 17:21:10 +0000 (10:21 -0700)]
Updated missing generated code for PR #5313 (fixed arrays)

Change-Id: I249140119e6241beb5aec5670d0e5ccddc8f5251

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