platform/upstream/flatbuffers.git
5 years agoclean up unnecessary outer rust gen-snippet (#5013)
csmoe [Wed, 24 Oct 2018 03:16:18 +0000 (11:16 +0800)]
clean up unnecessary outer rust gen-snippet (#5013)

* clean up unneeded outer rust gen-snippet

* update generated rust file

5 years agoUse stdlib context in generated Go files (#4904)
Felix Hanley [Mon, 22 Oct 2018 23:28:58 +0000 (10:28 +1100)]
Use stdlib context in generated Go files (#4904)

5 years agoMake alignment checking optional. (#5011)
Doug Muir [Mon, 22 Oct 2018 23:14:44 +0000 (16:14 -0700)]
Make alignment checking optional. (#5011)

5 years agomake flatbuffers::IsFieldPresent safer (#4988)
Frank Benkstein [Mon, 22 Oct 2018 22:57:45 +0000 (15:57 -0700)]
make flatbuffers::IsFieldPresent safer (#4988)

Give the vtable offset enum inside each table the name
"FlatBuffersVTableOffset" and base type voffset_t so it can be used as a
dependent type in IsFieldPresent. This makes that function slightly
safer since it prevents calling it with arbitrary, non-table types.
Now, the only way to use IsFieldPresent incorrectly is to create your
own type which does not inherit from flatbuffers::Table but has a
dependent voffset convertible type "FlatBuffersVTableOffset".

5 years agoAdd fuzzer test for scalar numbers in json. (#4996)
Vladimir Glavnyy [Mon, 22 Oct 2018 22:44:18 +0000 (05:44 +0700)]
Add fuzzer test for scalar numbers in json.  (#4996)

* Add fuzzer test for scalar numbers in json. Grammar-based regex used to check correctness.

* Fix conversation

5 years agoCI check generate code (#4998)
Frank Benkstein [Mon, 22 Oct 2018 22:41:12 +0000 (15:41 -0700)]
CI check generate code (#4998)

* call reflection code generation from tests

This simplifies instructions to contributors so they don't forget to update
reflection code.

* add error handling to generate_code scripts

Let them propagate their errors instead of swallowing them so they show
up when called in CI.

* apply editorconfig to shell scripts

* use ordered map in dart codegen

Using an unordered map in the codegen can lead to spurious diffs in the
generated dart code.

* add CI check for generate_code being run

* update reflection_generated.h

* disable diff-check for monster_test.bfbs

Work around #5008.

5 years agoforbid enum values that are out of range (#4977)
Frank Benkstein [Thu, 18 Oct 2018 17:39:08 +0000 (19:39 +0200)]
forbid enum values that are out of range (#4977)

* forbid enum values that are out of range

Enum values that are out of range can lead to generated C++ code that does
not compile.  Also forbid boolean enums.

* update enum and union documentation slightly

5 years agoEfficient Conversion of a FlatBufferBuilder to a MessageBuilder (#4980)
Sumant Tambe [Thu, 18 Oct 2018 17:32:59 +0000 (10:32 -0700)]
Efficient Conversion of a FlatBufferBuilder to a MessageBuilder (#4980)

* Efficient conversion of FlatBufferBuilder to grpc::MessageBuilder

* Added a variety of tests to validate correctness of the MessageBuilder move operations.
Disable MessageBuilder half-n-half tests on MacOS.

* Fix failing Android build

* Generalized the MessageBuilder move constructor to accept a deallocator

5 years ago[Python] Fast serialization of numpy vectors (#4829)
Felix Frank [Tue, 16 Oct 2018 00:07:08 +0000 (02:07 +0200)]
[Python] Fast serialization of numpy vectors (#4829)

[Python] Fast serialization of numpy vectors (#4829)

5 years agoGo - Use Go bool type for bool fields (#4962)
kostya-sh [Mon, 15 Oct 2018 23:55:59 +0000 (00:55 +0100)]
Go - Use Go bool type for bool fields (#4962)

* Use Go bool type for bool fields, and store non-default bool field to test data

5 years agodisallow c style casts (#4981)
Frank Benkstein [Mon, 15 Oct 2018 22:11:31 +0000 (00:11 +0200)]
disallow c style casts (#4981)

Fixes #4857.

5 years agodon't use std::function in flatbuffers::Parser (#4995)
Frank Benkstein [Mon, 15 Oct 2018 19:26:35 +0000 (21:26 +0200)]
don't use std::function in flatbuffers::Parser (#4995)

std::function makes code harder to debug because it requires stepping
through a separate destructor and call operator.  It's use unnecessary
in the Parser since the functions taking functors are private and are
only used within idl_parser.cpp.  Therefore the definitions can stay in
idl_parser.cpp as well.  Only care must be taken that the definitions
appear before use but that's already true and all compilers will
complain equally if it get's violated.  This change might also improve
performance since it might allow inlining where it wasn't possible
before but I haven't measured that.

5 years agoadd :runtime_cc target (#4994)
iceboy [Mon, 15 Oct 2018 19:18:15 +0000 (12:18 -0700)]
add :runtime_cc target (#4994)

5 years agofix missing newline in flatc help message (#4992)
Frank Benkstein [Thu, 11 Oct 2018 22:54:01 +0000 (00:54 +0200)]
fix missing newline in flatc help message (#4992)

5 years agofix #4974 (#4989)
Frank Benkstein [Thu, 11 Oct 2018 19:40:41 +0000 (21:40 +0200)]
fix #4974 (#4989)

5 years agoRefactoring of idl_parser (#4948)
Vladimir Glavnyy [Thu, 11 Oct 2018 17:37:47 +0000 (00:37 +0700)]
Refactoring of idl_parser (#4948)

* Refactoring of numbers parser

More accurate parse of float and double.
Hexadecimal floats.
Check "out-of-range" of uint64 fields.
Check correctness of default values and metadata.

* Remove locale-independent code strtod/strtof from PR #4948.

* small optimization

* Add is_(ascii) functions

* is_ascii cleanup

* Fix format conversation

* Refine number parser

* Make code compatible with Android build

* Remove unnecessary suppression of warning C4127

5 years agobetter output on TestError (#4979)
Frank Benkstein [Thu, 11 Oct 2018 17:33:12 +0000 (19:33 +0200)]
better output on TestError (#4979)

Print a slightly better error message when a TestError fails.

5 years agoAdd @javax.annotation.Generated to generated flatbuffer Java types (#4986)
Rikard Lundmark [Mon, 8 Oct 2018 22:29:22 +0000 (23:29 +0100)]
Add @javax.annotation.Generated to generated flatbuffer Java types (#4986)

* Add @javax.annotation.Generated to generated flatbuffer Java types.

* Updating test goldens.

5 years agodon't crash when calling EnumNameXXX on sparse enum (#4982)
Frank Benkstein [Mon, 8 Oct 2018 21:37:35 +0000 (23:37 +0200)]
don't crash when calling EnumNameXXX on sparse enum (#4982)

Make an out-of-bounds check for enum values before using them to index the
names array.  For consistency with non-sparse enums an empty string is
returned.

Fixes #4821

5 years agoFix expected type of enum values in reflection tables (#4944)
Michael Edwards [Mon, 8 Oct 2018 21:29:29 +0000 (23:29 +0200)]
Fix expected type of enum values in reflection tables (#4944)

Fixes #4930

5 years agoUse enum types in generated read/mutate methods for Go (#4978)
kostya-sh [Mon, 8 Oct 2018 21:25:37 +0000 (22:25 +0100)]
Use enum types in generated read/mutate methods for Go (#4978)

5 years agoAdd missing const on Reference::As<> (#4975)
cor3ntin [Mon, 8 Oct 2018 19:52:01 +0000 (21:52 +0200)]
Add missing const on Reference::As<> (#4975)

Reference::As<> was needlessly mutable wich made them
less safe and harder to use

5 years agoDisable armeabi builds for Android and re-enable CI builds. (#4970)
Stewart Miles [Mon, 8 Oct 2018 19:43:57 +0000 (12:43 -0700)]
Disable armeabi builds for Android and re-enable CI builds. (#4970)

armeabi support was removed from the Android NDK so we should no
longer build it.  Since this fixes the Android build failures this
commit also re-enables Travis Android builds.

While re-enabling Android builds, some recent changes broke C++98
support so this fixes those issues as well which include:
- Conditionally compiling use of move constructors, operators and
  std::move.
- Changing sample to use flatbuffers::unique_ptr rather than
  std::unique_ptr.

Finally, added the special "default_ptr_type" value for the
"cpp_ptr_type" attribute.  This expands to the value passed to
the "--cpp-ptr-type" argument of flatc.

5 years agoIn Javascript, generate bidirectional mappings for enums, between Name: Value and...
Taj Morton [Thu, 4 Oct 2018 17:37:22 +0000 (10:37 -0700)]
In Javascript, generate bidirectional mappings for enums, between Name: Value and between Value: Name. (#4960)

5 years agoFix recursion counter check. Add control to override depth of nested … (#4953)
Vladimir Glavnyy [Thu, 4 Oct 2018 16:27:37 +0000 (23:27 +0700)]
Fix recursion counter check. Add control to override depth of nested … (#4953)

* Fix recursion counter check. Add control to override depth of nested objects.

* Change if-condition to `>=`

5 years agoBumped version to 1.10.1 for all languages. v1.10.0
Wouter van Oortmerssen [Wed, 3 Oct 2018 19:48:47 +0000 (12:48 -0700)]
Bumped version to 1.10.1 for all languages.

Change-Id: I9a6256d90ea800834a887afdcf888df412018933

5 years agoUpdated TestAll.sh with Rust.
Wouter van Oortmerssen [Wed, 3 Oct 2018 19:27:27 +0000 (12:27 -0700)]
Updated TestAll.sh with Rust.

Change-Id: I751f3bbd85eb1b521e1533c68f95442af0d18b8a

5 years agoAdds __reset method to Struct and Table (#4966)
Jason Neufeld [Wed, 3 Oct 2018 19:09:30 +0000 (12:09 -0700)]
Adds __reset method to Struct and Table (#4966)

This allow recycling/pooling instances without leaking ByteBuffers, by
providing a mechanism to reset instance to newly constructed state.

5 years agoAssert tests on the first failure. (#4952)
Vladimir Glavnyy [Wed, 3 Oct 2018 19:04:14 +0000 (02:04 +0700)]
Assert tests on the first failure. (#4952)

* Assert tests on the first failure. Disable pop-up message box on assertion.

* Fix format and code style

* Move MSVC dependent code to ifdef

5 years agoUse standard header for generated Go files (#4961)
kostya-sh [Wed, 3 Oct 2018 18:19:40 +0000 (19:19 +0100)]
Use standard header for generated Go files (#4961)

As recommended by https://golang.org/pkg/cmd/go/internal/generate/:

  To convey to humans and machine tools that code is generated,
  generated source should have a line early in the file that
  matches the following regular expression (in Go syntax):

        ^// Code generated .* DO NOT EDIT\.$

5 years agoAllow tables that are entirely composed of native inlines to be copied. (#4958)
Taj Morton [Mon, 1 Oct 2018 23:27:54 +0000 (16:27 -0700)]
Allow tables that are entirely composed of native inlines to be copied. (#4958)

5 years agoTurn on gRPC tests in travis build (#4955)
Sumant Tambe [Mon, 1 Oct 2018 22:59:04 +0000 (15:59 -0700)]
Turn on gRPC tests in travis build (#4955)

Download and build with a known grpc version

5 years agoParser error message reports both the line number and the cursor position. (#4954)
Vladimir Glavnyy [Mon, 1 Oct 2018 21:57:36 +0000 (04:57 +0700)]
Parser error message reports both the line number and the cursor position. (#4954)

5 years agoRemove lifetime specifier on table getter methods (#4949)
Matt Mastracci [Sat, 29 Sep 2018 03:11:05 +0000 (21:11 -0600)]
Remove lifetime specifier on table getter methods (#4949)

With the old-style code, the test fails with a borrow-checker error:

```
  #[inline]
  pub fn name(&'a self) -> &'a str {
    self._tab.get::<flatbuffers::ForwardsUOffset<&str>>(Monster::VT_NAME, None).unwrap()
  }
```

```
error[E0597]: `e` does not live long enough
   --> tests/integration_test.rs:273:57
    |
273 |         let enemy_of_my_enemy = monster.enemy().map(|e| e.name());
    |                                                         ^      - `e` dropped here while still borrowed
    |                                                         |
    |                                                         borrowed value does not live long enough
274 |         assert_eq!(enemy_of_my_enemy, Some("Fred"));
275 |     }
    |     - borrowed value needs to live until here
```

5 years agoloosen lifetimes in type signature of Table::get (#4925)
kzvi [Fri, 28 Sep 2018 03:56:49 +0000 (20:56 -0700)]
loosen lifetimes in type signature of Table::get (#4925)

5 years agoAdd more apis to query vector types from a reference (#4823)
Shivendra Agarwal [Thu, 27 Sep 2018 19:34:27 +0000 (01:04 +0530)]
Add more apis to query vector types from a reference (#4823)

* Add more apis to query vector types from a reference

https://github.com/google/flatbuffers/issues/4818

* changing order of apis

* another reordering

* removed vector element type api as not needed as for now

5 years agoAdd missed defined(clang) and fix the wrong placement of #pragma push/pop for MSVC...
Vladimir Glavnyy [Thu, 27 Sep 2018 19:31:43 +0000 (02:31 +0700)]
Add missed defined(clang) and fix the wrong placement of #pragma push/pop for MSVC compiler (#4946)

5 years agodon't return Option from required table field accessors (#4926)
kzvi [Thu, 27 Sep 2018 04:11:25 +0000 (21:11 -0700)]
don't return Option from required table field accessors (#4926)

5 years agorust: Fixed MakeCamelCase (#4932) (#4936)
jean-airoldie [Wed, 26 Sep 2018 20:35:02 +0000 (16:35 -0400)]
rust: Fixed MakeCamelCase (#4932) (#4936)

* Fixed MakeCamelCase behavior when supplied Upper_Camel_Case,
snake_case and UPPERCASE strings.
* Modified the rust integration test to reflect changes.

5 years agoAdd FlatBufferBuilder move semantics tests to the main test suite (#4902)
Sumant Tambe [Mon, 24 Sep 2018 19:03:31 +0000 (12:03 -0700)]
Add FlatBufferBuilder move semantics tests to the main test suite (#4902)

* Add FlatBufferBuilder move semantics tests to main

Do not eagerly delete/reset allocators in release and release_raw functions
Update android, vs2010 build files
New tests for various types of FlatBufferBuilders and move semantics

* Improve test failure output with function names

5 years agoToStringVisitor settings to allow pretty formatted JSON (#4933)
Michael Edwards [Mon, 24 Sep 2018 16:29:49 +0000 (18:29 +0200)]
ToStringVisitor settings to allow pretty formatted JSON (#4933)

5 years agoAdd compare operator to code generated for c++ (#4940)
Thomas [Fri, 21 Sep 2018 23:53:59 +0000 (01:53 +0200)]
Add compare operator to code generated for c++ (#4940)

* Add operator== for c++ genated code

New "--gen-compare" option for flatc to generate compare operators. The operators are defined based on object based api types.

Inspired by issue #263.

* Improve compare operator for c++.
Thanks for the code review.

- Improve robustness against future schema extensions
- Code style
- Fix --rust generation in generate_code.sh

5 years agoUpdated readme.md
Wouter van Oortmerssen [Fri, 21 Sep 2018 17:42:00 +0000 (10:42 -0700)]
Updated readme.md

Change-Id: I9b0664a3bde44a4ee44ef0fd117d0e4bedc132d9

5 years agoChanged JS/TS codegen to use stable non-compiler dependent hash.
Wouter van Oortmerssen [Fri, 21 Sep 2018 16:41:11 +0000 (09:41 -0700)]
Changed JS/TS codegen to use stable non-compiler dependent hash.

Different implementations of std::hash kept littering commits with
namespace changes.

Change-Id: Ic2d4fdcd76f8fef9802bc1572eb74ae7427085e3

5 years agoAdded missing Dart codegen files.
Wouter van Oortmerssen [Fri, 21 Sep 2018 16:40:04 +0000 (09:40 -0700)]
Added missing Dart codegen files.

Change-Id: Ic97f5b50fa191f967672c404f737d302462fc6ac

5 years ago[C#] Fix compile issue when compiling with older versions of C# (#4938)
Christopher Cifra [Thu, 20 Sep 2018 22:07:03 +0000 (17:07 -0500)]
[C#] Fix compile issue when compiling with older versions of C# (#4938)

* C# support for directly reading and writting to memory other than byte[].  For example, ByteBuffer can be initialized with a custom allocator which uses shared memory / memory mapped files.

Public access to the backing buffer uses Span<T> instead of ArraySegment<T>.

Writing to the buffer now supports Span<T> in addition to T[].

To maintain backwards compatibility ENABLE_SPAN_T must be defined.

* Remove usage of expression bodied method so that ByteBuffer can be compiled with older version of C#.

5 years agoAdd Rust to Appveyor config. (#4928)
Robert [Wed, 12 Sep 2018 18:44:51 +0000 (11:44 -0700)]
Add Rust to Appveyor config. (#4928)

5 years agoAdd ByteBufferFactory#releaseByteBuffer (#4914)
Enrico Olivelli [Thu, 6 Sep 2018 18:08:08 +0000 (20:08 +0200)]
Add ByteBufferFactory#releaseByteBuffer (#4914)

This adds the ability to dispose unused buffers or to return them to an object pool

5 years agorust: more builder lifetimes predicates (#4923)
Robert [Thu, 6 Sep 2018 01:15:30 +0000 (18:15 -0700)]
rust: more builder lifetimes predicates (#4923)

5 years agorust: more builder lifetimes logic (#4917)
Robert [Wed, 5 Sep 2018 04:53:39 +0000 (21:53 -0700)]
rust: more builder lifetimes logic (#4917)

5 years agofix rust flatbuffers create_vector docs (#4913)
Onur Karaman [Tue, 4 Sep 2018 21:30:31 +0000 (14:30 -0700)]
fix rust flatbuffers create_vector docs (#4913)

Manual vector creation begins with start_vector, not create_vector.

5 years agorust generator: fix builder lifetime switch (#4912)
Robert [Tue, 4 Sep 2018 21:29:27 +0000 (14:29 -0700)]
rust generator: fix builder lifetime switch (#4912)

5 years agorust generator: fix enum member comments (#4911)
Robert [Tue, 4 Sep 2018 20:52:31 +0000 (13:52 -0700)]
rust generator: fix enum member comments (#4911)

5 years agoreadme.md: add Rust as a supported language
Robert [Tue, 4 Sep 2018 06:38:41 +0000 (23:38 -0700)]
readme.md: add Rust as a supported language

5 years agoUpdate Cargo.toml for Crates.io package
Robert [Tue, 4 Sep 2018 02:42:25 +0000 (19:42 -0700)]
Update Cargo.toml for Crates.io package

5 years agodelete and ignore Cargo.lock files (#4906)
Robert [Tue, 4 Sep 2018 02:33:38 +0000 (19:33 -0700)]
delete and ignore Cargo.lock files (#4906)

5 years agoFix extern crate in root namespace (#4905)
Chris Holcombe [Tue, 4 Sep 2018 02:09:38 +0000 (19:09 -0700)]
Fix extern crate in root namespace (#4905)

Imports the Rust FlatBuffers runtime crate even when not using a namespace in a schema.

5 years agoRust: Add basic crate-level documentation
Robert [Tue, 4 Sep 2018 01:01:31 +0000 (18:01 -0700)]
Rust: Add basic crate-level documentation

5 years agoUpdate Rust runtime crate version for publishing
Robert [Tue, 4 Sep 2018 00:13:10 +0000 (17:13 -0700)]
Update Rust runtime crate version for publishing

5 years agoPort FlatBuffers to Rust (#4898)
Robert [Mon, 3 Sep 2018 00:05:50 +0000 (17:05 -0700)]
Port FlatBuffers to Rust (#4898)

This is a port of FlatBuffers to Rust. It provides code generation and a
runtime library derived from the C++ implementation. It utilizes the
Rust type system to provide safe and fast traversal of FlatBuffers data.

There are 188 tests, including many fuzz tests of roundtrips for various
serialization scenarios. Initial benchmarks indicate that the canonical
example payload can be written in ~700ns, and traversed in ~100ns.

Rustaceans may be interested in the Follow, Push, and SafeSliceAccess
traits. These traits lift traversals, reads, writes, and slice accesses
into the type system, providing abstraction with no runtime penalty.

5 years agoAdd move semantics to MessageBuilder, FlatBufferBuilder, SliceAllocator, and vector_d...
Sumant Tambe [Thu, 30 Aug 2018 23:43:22 +0000 (16:43 -0700)]
Add move semantics to MessageBuilder, FlatBufferBuilder, SliceAllocator, and vector_downward (#4893)

Unit tests
Update flatbuffers + gRPC build instructions
Update CMakeLists.txt with cmake variables for grpc and protobuf install paths
Update tests for travis build

5 years agoDetachedBuffer cannot be rewrapped (#4885)
Gabriel Nützi [Fri, 24 Aug 2018 17:57:57 +0000 (19:57 +0200)]
DetachedBuffer cannot be rewrapped (#4885)

* Simple ReleaseRaw implemented

* [doc]

* clear_buffer and clear_allocator introduced

* auto

* typos

* rename because of -Werror=shadow

5 years agoC# support for directly reading and writting to memory other than byte[]. For exampl...
Christopher Cifra [Thu, 23 Aug 2018 17:05:31 +0000 (12:05 -0500)]
C# support for directly reading and writting to memory other than byte[].  For example, ByteBuffer can be initialized with a custom allocator which uses shared memory / memory mapped files. (#4886)

Public access to the backing buffer uses Span<T> instead of ArraySegment<T>.

Writing to the buffer now supports Span<T> in addition to T[].

To maintain backwards compatibility ENABLE_SPAN_T must be defined.

5 years agoUpdated preprocessor check for template aliases. (#4888)
Derek Bailey [Thu, 23 Aug 2018 16:48:03 +0000 (09:48 -0700)]
Updated preprocessor check for template aliases. (#4888)

5 years agoMono Fix for Unsafe Mode (#4887)
Derek Bailey [Mon, 20 Aug 2018 23:31:44 +0000 (16:31 -0700)]
Mono Fix for Unsafe Mode (#4887)

* Added preprocessor define for C++ if Template Aliases are supported by the compiler

* Revert "Revert "Performance Increase of Vector of Structures using .NET BlockCopy (#4830)""

This reverts commit 1f5eae5d6a135ff6811724f6c57f911d1f46bb15.

* Put<T> method was inside #if UNSAFE_BYTEBUFFER which caused compilation failure when building in unsafe mode

* Revert "Added preprocessor define for C++ if Template Aliases are supported by the compiler"

This reverts commit a75af7352127c261baf0b6cca5cb823e13e78f11.

5 years agoRevert "Performance Increase of Vector of Structures using .NET BlockCopy (#4830)"
Wouter van Oortmerssen [Mon, 20 Aug 2018 19:08:21 +0000 (12:08 -0700)]
Revert "Performance Increase of Vector of Structures using .NET BlockCopy (#4830)"

This reverts commit 7b50004ec9a1b86db2b1b61a9906e52227f62b35.

Change-Id: I09d6869c16aa3c7fadc537fc9c76eaa3cf7ee7ea

5 years agoAdded missing dart/ts test changes.
Wouter van Oortmerssen [Mon, 20 Aug 2018 18:54:37 +0000 (11:54 -0700)]
Added missing dart/ts test changes.

Change-Id: I836091193485b890710f1df779d4d770f729a27a

5 years agoAdd C#/Java generator behaviour for 'private' attribute (#4882)
Andy Martin [Thu, 16 Aug 2018 22:25:33 +0000 (23:25 +0100)]
Add C#/Java generator behaviour for 'private' attribute (#4882)

* Added 'private' attribute, supported when generating C# and Java

* Added use of 'private' attribute in monster_test

5 years agoConan build packages on CI (#4590) (#4594)
Uilian Ries [Thu, 16 Aug 2018 19:17:52 +0000 (16:17 -0300)]
Conan build packages on CI (#4590) (#4594)

* Build Conan package on Travis CI (#4590)

- Added multi package support on Linux, running on Travis CI
- Only upload when branch is a tag and named "vX.Y.Z"
- Replace Conan injection by Conan wrapper
- Removed os_build os_arch -- Conan 1.0.1 hotfix

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* Build Conan package on OSX (#4590)

- Added jobs to build Flatbuffers on OSX running on Travis

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* Build Conan package on Windows (#4590)

- Added support necessary to build Flatbuffers on Windows (conan)
- Added Appveyor jobs to build Conan package
- Only build Conan package when release (tag)

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* Reduce Conan CI support to simple scripts (#4590)

- Removed msvc 10 x86_64 workaround
- Updated conan remote address
- Added Bincrafters' package tools

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* Add fPIC option on Conan recipe (#4590)

- Add fPIC as optional. It works on Linux and OSX
- Update recipe metadata: author, homepage, license
- Checking for flatc and flathash on Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* Build Conan package on CI (#4590)

- Add rule to run conan job only for tags
- Run Conan on Linux, OSX and Windows
- Update package tool to new interface

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* Update Conan username (#4590)

- Use google as default username

Signed-off-by: Uilian Ries <uilianries@gmail.com>
* Update OSX version on CI (#4590)

- Use latest OSX 9.3 version to build Conan package

Signed-off-by: Uilian Ries <uilianries@gmail.com>
5 years agoProposing use of C++ header files and functions (#4869)
kulswanand [Mon, 13 Aug 2018 23:36:11 +0000 (05:06 +0530)]
Proposing use of C++ header files and functions (#4869)

* Proposing use of C++ header files and functions

Proposing use of C++ header files and functions instead of C header file and functions.
Here are few examples for comparison :

C                            C++
<cstdio>                <iostream> & <fstream>
printf()                     cout
fopen()                    ifstream
etc ...

Please let me know if there are any comments.

* Updated diff based on review comments

5 years agoUse string_view if _HAS_CXX17 is true (#4876)
iceboy [Mon, 13 Aug 2018 23:19:51 +0000 (16:19 -0700)]
Use string_view if _HAS_CXX17 is true (#4876)

Current version of VC2017 is not setting __cplusplus to correct value, instead they use _MSC_VER, _MSVC_LANG and _HAS_CXX17 macros.

5 years agoFixed use of uoffset_t in verifier could cause wrap around.
Wouter van Oortmerssen [Mon, 13 Aug 2018 16:24:13 +0000 (09:24 -0700)]
Fixed use of uoffset_t in verifier could cause wrap around.

The verifier must be resilient against any corrupt data, so
now using size_t thru-out to ensure any 64-bit offsets can
be represented.

Also added verification of alignment.

Change-Id: I87a22aa6b045c2d83b69b47a47153f2e15ad7e06
Tested: on Linux, also with libfuzzer.

5 years ago Update JavaScript IDL generator to remove invalid Closure JSDoc comments (#4873)
Matias Cudich [Fri, 10 Aug 2018 22:27:51 +0000 (15:27 -0700)]
 Update JavaScript IDL generator to remove invalid Closure JSDoc comments (#4873)

* Update JavaScript IDL generator to remove invalid Closure JSDoc comments

* Revert erroneous changes

* A few more tweaks

* Updated generated code

5 years agoRemove FLATBUFFERS_COPTS from bazel BUILD (#4872)
iceboy [Fri, 10 Aug 2018 20:43:48 +0000 (13:43 -0700)]
Remove FLATBUFFERS_COPTS from bazel BUILD (#4872)

fixes #4868

5 years agoCorrectly generate identifier for enums. (#4871)
cubeleo [Fri, 10 Aug 2018 20:41:32 +0000 (13:41 -0700)]
Correctly generate identifier for enums. (#4871)

This should allow the EnumName* function to work with enums generated
using the --scoped-enum flag.

5 years agoClarify flatbuffer reflection struct sizes to be less error-prone. (#4870)
Andrew Selle [Fri, 10 Aug 2018 17:55:54 +0000 (10:55 -0700)]
Clarify flatbuffer reflection struct sizes to be less error-prone. (#4870)

5 years agoAdd licenses to BUILD (#4867)
iceboy [Fri, 10 Aug 2018 15:21:17 +0000 (08:21 -0700)]
Add licenses to BUILD (#4867)

This allows to build flatbuffers from third_party directory.

5 years agoEnsure strings are null terminated when written from Dart (#4862)
Dan Field [Thu, 9 Aug 2018 16:50:54 +0000 (12:50 -0400)]
Ensure strings are null terminated when written from Dart (#4862)

* Update for Dart 2.x constants

* Fix strings, update test, add CHANGELOG for Dart

5 years agoTemporarily disabled Android CI until fix.
Wouter van Oortmerssen [Mon, 6 Aug 2018 23:51:28 +0000 (16:51 -0700)]
Temporarily disabled Android CI until fix.

Change-Id: I0c6758db7b4007e84b7ab8daaecd233711df8cab

5 years agoAttach header directory information to the "flatbuffers" library target (#4849)
Vladimir Glavnyy [Mon, 6 Aug 2018 21:59:29 +0000 (04:59 +0700)]
Attach header directory information to the "flatbuffers" library target (#4849)

* Attach header directory information to the "flatbuffers" library target, if the CMake version supports it.

* Cleanup and documentation update

5 years agoPublishing flatc with conan (#4852)
Kamil Rojewski [Mon, 6 Aug 2018 19:45:35 +0000 (21:45 +0200)]
Publishing flatc with conan (#4852)

* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data

* Not importing flatbuffers for TS test generation

* Not overwriting generated js for tests

* AppVeyor test fixes

* Generating the most strict TS code possible

* Not returning null when creating vectors

* Not returning null from struct contructors

* Vector of unions for ts/js

* Sanity check for languages

* Indentation fix + output test files

* Vectors of unions for php

* Fixes to union vector handling + tests

* Fix for strictPropertyInitialization

* Fix for new aligned operator new for gcc >= 7.1

* Not generating imports/ns prefixes with --gen-all

* TypeScript docs

* Missing imports of enums

* Missing TS links

* Enabled vector of unions for java, since it seems to work

* Added jitpack config

* Added obj to vector of unions getter

* Removed unneeded accessor

* Bumped jdk version in pom.xml

* Vector of unions support for c#

* Missing TypeScript doc processing

* Option to NOT force libc++ when building with clang

* Publishing flatc with conan

5 years agoRemove using namespace std; (#4851)
Charlie Harrison [Mon, 6 Aug 2018 19:08:49 +0000 (15:08 -0400)]
Remove using namespace std; (#4851)

5 years agoFixed VS2010 compile error.
Wouter van Oortmerssen [Mon, 6 Aug 2018 19:06:59 +0000 (12:06 -0700)]
Fixed VS2010 compile error.

Change-Id: Ibd970d30b51f77a2ac9c125e400c9f1b19a81cbc

5 years agoFlatBuffers implementation for the Lobster programming language
aardappel [Tue, 24 Jul 2018 02:03:11 +0000 (19:03 -0700)]
FlatBuffers implementation for the Lobster programming language

Language, see: http://strlen.com/lobster/ and https://github.com/aardappel/lobster

5 years agoAdds multi-line to FLatBufferToString (#4847)
shassani [Fri, 27 Jul 2018 19:45:12 +0000 (12:45 -0700)]
Adds multi-line to FLatBufferToString (#4847)

Adding multi-line option to FlatBufferToString method in minireflect to allow more readable output for larger flatbuffers.

5 years agoFixed FlatBufferBuilder::Required not checking vtable size.
Wouter van Oortmerssen [Fri, 27 Jul 2018 19:40:44 +0000 (12:40 -0700)]
Fixed FlatBufferBuilder::Required not checking vtable size.

As reported in: https://github.com/google/flatbuffers/issues/4846
Tested: on Linux.

Change-Id: Id5e82dc5a46a681119cfe5a15415d522aac0e1f2

5 years agoFor sparse enums, use a switch statement to generate EnumNameXXX(). (#4845)
cubeleo [Fri, 27 Jul 2018 15:32:19 +0000 (08:32 -0700)]
For sparse enums, use a switch statement to generate EnumNameXXX(). (#4845)

5 years agoMerge pull request #4843 from rw/2018-07--explicit-enumish-types
Robert [Thu, 26 Jul 2018 23:57:01 +0000 (16:57 -0700)]
Merge pull request #4843 from rw/2018-07--explicit-enumish-types

go: give enums their own scalar types

5 years agogo: give enums their own scalar types
rw [Thu, 26 Jul 2018 23:40:56 +0000 (16:40 -0700)]
go: give enums their own scalar types

5 years agoUpdate FLATBUFFERS_HAS_STRING_VIEW __cplusplus checks to the versions provided by...
Paul Reimer [Thu, 26 Jul 2018 22:40:41 +0000 (15:40 -0700)]
Update FLATBUFFERS_HAS_STRING_VIEW __cplusplus checks to the versions provided by the standard feature test macros. (#4841)

5 years agoMerge pull request #4820 from nairb774/master
Robert [Thu, 26 Jul 2018 22:35:45 +0000 (15:35 -0700)]
Merge pull request #4820 from nairb774/master

[Go] encode.go performance changes

5 years agoUpdate for Dart 2.x constants (#4842)
Dan Field [Thu, 26 Jul 2018 21:21:23 +0000 (17:21 -0400)]
Update for Dart 2.x constants (#4842)

5 years agoPerformance Increase of Vector of Structures using .NET BlockCopy (#4830)
Derek Bailey [Thu, 26 Jul 2018 20:44:40 +0000 (13:44 -0700)]
Performance Increase of Vector of Structures using .NET BlockCopy (#4830)

* Added Get<vector_name>Array() method for accessing vectors of structures in C# using Buffer.Blockcopy().

* Added Get<vector_name>Array() method for accessing vectors of structures in C# using Buffer.Blockcopy().

Added Create<Name>VectorBlock() method to add a typed array using Buffer.BlockCopy() to speed up creation of vector of arrays

New Lua files for namespace test

* fixed c++ style issue

6 years agoFixed minalign in Lua being reset on StartObject
Wouter van Oortmerssen [Mon, 23 Jul 2018 23:36:21 +0000 (16:36 -0700)]
Fixed minalign in Lua being reset on StartObject

Change-Id: I9cd62b38c8dc526f069726a88baef63e4b0dae57

6 years agogo: do not clobber minalign when we create objects (#4834)
Robert [Mon, 23 Jul 2018 23:34:08 +0000 (16:34 -0700)]
go: do not clobber minalign when we create objects (#4834)

6 years agopython: do not clobber minalign when we create objects (#4833)
Robert [Mon, 23 Jul 2018 23:29:45 +0000 (16:29 -0700)]
python: do not clobber minalign when we create objects (#4833)

6 years agoAdd missing public header `minireflect.h` to bazel build (#4832)
Evan Moran [Mon, 23 Jul 2018 23:28:49 +0000 (16:28 -0700)]
Add missing public header `minireflect.h` to bazel build (#4832)

6 years agoFixing bazel build's missing lua file (#4831)
Evan Moran [Mon, 23 Jul 2018 23:28:09 +0000 (16:28 -0700)]
Fixing bazel build's missing lua file (#4831)

6 years agoAdds ForceStringAlignment to flatbuffers. (#4828)
shassani [Thu, 19 Jul 2018 23:00:31 +0000 (16:00 -0700)]
Adds ForceStringAlignment to flatbuffers. (#4828)

ForceStringAlignment is useful for memory aligning string fields in flatbuffers.

6 years agoRestricting (typed=false, fixed=true) combination in flexbuffer CreateVector (#4825)
Shivendra Agarwal [Thu, 19 Jul 2018 21:59:06 +0000 (03:29 +0530)]
Restricting (typed=false, fixed=true) combination in flexbuffer CreateVector (#4825)

https://github.com/google/flatbuffers/issues/4815