Derek Bailey [Thu, 5 Nov 2020 21:12:19 +0000 (13:12 -0800)]
Converted globs to use single quotes (#6240)
Derek Bailey [Thu, 5 Nov 2020 21:02:33 +0000 (13:02 -0800)]
More adjustments to the auto labeler (#6239)
Derek Bailey [Thu, 5 Nov 2020 20:50:33 +0000 (12:50 -0800)]
Updated Lua labeller glob (#6238)
Charlie Yin [Thu, 5 Nov 2020 19:23:56 +0000 (11:23 -0800)]
Support size-prefixed buffers and add tests for size-prefixed messages (#6232)
mustiikhalil [Sat, 31 Oct 2020 15:35:44 +0000 (18:35 +0300)]
Removes duplicate swift in labeler (#6228)
Removed grpc tag from swift label set & removes duplicate swift label
Derek Bailey [Fri, 30 Oct 2020 21:01:35 +0000 (14:01 -0700)]
Added more labels for auto labeler (#6227)
Derek Bailey [Fri, 30 Oct 2020 20:18:59 +0000 (13:18 -0700)]
[C#] Optional Scalars (#6217)
* [C#] Optional Scalars
* Moved scalar optional check to avoid null enum conversion
Paulo Pinheiro [Fri, 30 Oct 2020 20:18:36 +0000 (21:18 +0100)]
[Label Bot] Add Java and Kotlin support for the label bot (#6226)
CI is an unrelated timeout.
Casper [Thu, 29 Oct 2020 19:57:29 +0000 (12:57 -0700)]
Implement `Debug` trait for Rust flatbuffers. (#6207)
* Refactor idl_gen_rust to a ForAllX continuation pattern.
* Removed unneeded SetValue and updated sample rust gencode
* Make Rust flatbuffers print right
* Generated code and removed unnecessary trait constraint
* bumped rust version. Release required
* removed an unwrap in Rust Debug-print unions
* Tested formatting flatbuffers in rust.
* Set float precision in flaky debug-print test
* impl Debug for structs too
Co-authored-by: Casper Neo <cneo@google.com>
mustiikhalil [Thu, 29 Oct 2020 06:05:25 +0000 (09:05 +0300)]
[Label Bot] Adds some languages to labeler bot (#6222)
* Adds swift, ts, go, py to labeler bot
* Removes unneeded dir search
Derek Bailey [Thu, 29 Oct 2020 05:02:32 +0000 (22:02 -0700)]
Auto Labeler Setup, Just C# for now (#6221)
Derek Bailey [Thu, 29 Oct 2020 04:25:02 +0000 (21:25 -0700)]
Auto Labeler Setup, Just C# for now (#6218)
* Auto Labeler Setup, Just C# for now
* Removed trailer comma as that might caused the issue
* Removed any[].
* Changed .cs glob
Casper [Thu, 29 Oct 2020 02:23:22 +0000 (19:23 -0700)]
Updated comments and fixed a fundamental type error. (#6214)
* Updated comments and fixed a fundemental type error.
* bump rust flatbuffers semver
Co-authored-by: Casper Neo <cneo@google.com>
Kamil Rojewski [Wed, 28 Oct 2020 16:45:23 +0000 (17:45 +0100)]
optional scalars for ts/js (#6215)
* optional scalars for ts/js
* removed range based for
* removed range based for
Derek Bailey [Wed, 28 Oct 2020 05:51:58 +0000 (22:51 -0700)]
Adds NetTest.bat to run .NET Core tests on Windows (#6216)
Paulo Pinheiro [Tue, 27 Oct 2020 00:46:50 +0000 (01:46 +0100)]
[Java] Implement optional scalars (#6212)
Java implementation of optional scalars, following issue #6014.
mustiikhalil [Mon, 26 Oct 2020 19:38:24 +0000 (22:38 +0300)]
Empties the sharedString map on reset on go and csharp (#6187)
Fixes go tests
Derek Bailey [Mon, 26 Oct 2020 04:42:29 +0000 (21:42 -0700)]
Removed C# references from java generator. Move annotations closer to definitions (#6204)
mustiikhalil [Sun, 25 Oct 2020 12:59:30 +0000 (15:59 +0300)]
Adds readable size to asserts in read functions (#6210)
Casper [Sat, 24 Oct 2020 22:46:55 +0000 (15:46 -0700)]
Refactor idl_gen_rust (#6206)
* Refactor idl_gen_rust to a ForAllX continuation pattern.
* Updated rust sample code
Co-authored-by: Casper Neo <cneo@google.com>
Vladimir Glavnyy [Thu, 22 Oct 2020 21:07:29 +0000 (04:07 +0700)]
Fix typo in flatbuffers::span declaration. (#6202)
Paulo Pinheiro [Thu, 22 Oct 2020 20:36:02 +0000 (22:36 +0200)]
Kotlin test optional enum (#6201)
* Add test for optional enums in Kotlin
* Rename optional_scalars2.fbs into optional_scalars.fbs
Also updated all references in the project to point to
"optional_scalars.fbs" instead of "optional_scalars2.fbs".
Casper [Tue, 20 Oct 2020 15:00:31 +0000 (08:00 -0700)]
Mass Refactoring to use `IsString` and other BASE_TYPE helpers (#6193)
* Updated SupportsAdvancedUnionFeatures to look out for string
* Mass refactoring to use BASE_TYPE helper functions.
Co-authored-by: Casper Neo <cneo@google.com>
Casper [Mon, 19 Oct 2020 20:16:00 +0000 (13:16 -0700)]
Updated SupportsAdvancedUnionFeatures to look out for string (#6190)
Co-authored-by: Casper Neo <cneo@google.com>
Björn Harrtell [Mon, 19 Oct 2020 20:11:35 +0000 (22:11 +0200)]
[JS/TS] Rewrite flexbuffers JS to TS (#6148)
* Partial TS rewrite
* Completed port but bugs remain
* Expose builder function
* Break out and fix stack-value and formatting
Casper [Mon, 19 Oct 2020 18:40:03 +0000 (11:40 -0700)]
Rework enums in rust. (#6098)
* Rework enums in rust.
They're now a unit struct, rather than an enum. This is a
backwards incompatible change but the previous version had UB
and was also backwards incompatible so...
* Update and test sample rust flatbuffers
* Use bitflags crate to properly support rust enums.
Previously, the bitflags attribute was just ignored. This is a breaking change
as the bitflgs API is not like a normal rust enum (duh).
* variant_name() -> Option<_>
* repr transparent
* Reexport bitflags from flatbuffers
* Make bitflags constants CamelCase, matching normal enums
* Deprecate c-style associated enum constants
Co-authored-by: Casper Neo <cneo@google.com>
schoetbi [Fri, 16 Oct 2020 17:43:09 +0000 (19:43 +0200)]
idl_gen_json_schema Fix generation of arrays of enums (#6184)
* idl_gen_json_schema.cpp: Fixed generation of arrays of enums
#6175
* Fixed failing unit tests
* GenBaseType generate "integer".
Fixes #6066
* Ran tests/generate_code.
* Removed modern R"()" strings
* changed std::to_string to NumToString
Niels Hofmans [Thu, 15 Oct 2020 22:47:06 +0000 (00:47 +0200)]
fix(go_test): remove deprecated grpc call (#6183)
tira-misu [Thu, 15 Oct 2020 22:28:25 +0000 (00:28 +0200)]
Add generation of JSON Schema to library (#6165)
* Fix C/C++ Create<Type>Direct with sorted vectors
If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".
* Changes due to code review
* Improve code readability
* Add generate of JSON schema to string to lib
* option indent_step is supported
* Remove unused variables
* Fix break in test
* Fix style to be consistent with rest of the code
dependabot[bot] [Tue, 13 Oct 2020 05:58:29 +0000 (22:58 -0700)]
Bump junit from 4.12 to 4.13.1 in /grpc/tests (#6173)
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
dependabot[bot] [Tue, 13 Oct 2020 05:58:03 +0000 (22:58 -0700)]
Bump junit from 4.12 to 4.13.1 in /grpc (#6172)
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
astange [Mon, 12 Oct 2020 19:25:10 +0000 (15:25 -0400)]
[C++] Add option to not generate direct copy methods. (#6166)
* Add option to not generate direct copy methods.
The direct copy methods generated by flatc utilize std::vector which isn't allowed on some embedded systems. Permit users of the compiler to not generate these methods so they don't have to be stubbed out.
* Update docs for no-cpp-direct-copy option.
Vladimir Glavnyy [Mon, 12 Oct 2020 19:24:18 +0000 (02:24 +0700)]
Add Array initialization from struct constructor (#5865) (#6147)
- add flatbuffers::span
- add new constructor for `struct` with `array`
- add some test for flatbuffers::span and 'arrays_test.fbs'
astange [Mon, 12 Oct 2020 16:14:45 +0000 (12:14 -0400)]
Cast to right type for reserved_ subtraction (#6167)
reserved_ is a size_t so ensure that the output of cur_ - buf_ is cast to that to avoid compiler warnings.
Casper [Sat, 10 Oct 2020 18:49:02 +0000 (11:49 -0700)]
Fixed rust nested flatbuffers for tables other than self (#6062)
* Fixed rust nested flatbuffers for tables other than self
* replaced lifetimes
* Use WrapInNameSpace and also update samples
Co-authored-by: Casper Neo <cneo@google.com>
Anass Al [Thu, 8 Oct 2020 15:00:40 +0000 (08:00 -0700)]
[C++] Fix -Wnarrowing and -Woverflow due to signed bitfields on G++ ARM (#6163)
Older versions of GCC (at least on ARM) complain about narrowing conversions and
overflows when setting the reference index (defined as an 11-bit signed integer
bitfield) to -1:
```
error: narrowing conversion of '-1' from 'int' to 'short unsigned int' inside { } [-Wnarrowing]
error: conversion from 'short unsigned int' to 'short unsigned int:11' changes value from '65535' to '2047'
```
This is due to the signedness of integer bitfields (not explicitly signed or
unsigned) being implementation-defined. This addresses this issue by explicitly
defining the signedness of all the bitfields in `flatbuffers::TypeCode` in C++.
mustiikhalil [Wed, 7 Oct 2020 16:56:30 +0000 (19:56 +0300)]
[TS] GRPC Implementation (#6141)
* GRPC implementation for Typescript
* Fixes a couple of issues
* Finished implementing the typescript support for grpc
* Updated generated code
* Fixes CI
Casper [Wed, 7 Oct 2020 16:46:09 +0000 (09:46 -0700)]
Moved C++ to optional_scalars2 and added some tests. (#6162)
* Moved C++ to optional_scalars2 and added some tests.
Also deleted unused optional_scalars_generated.lobster
* Fixed whitespece in C++ gencode & fixed BUILD file
* Moved C++ onto optional_scalars2 in the .bat file
Co-authored-by: Casper Neo <cneo@google.com>
ImmConCon [Tue, 6 Oct 2020 22:55:22 +0000 (00:55 +0200)]
[Rust] Upgrade flatbuffers library to 2018 edition (#6159)
* [Rust] Upgrade flatbuffers lib to 2018 edition
* Pushed version
mrmarkwell [Tue, 6 Oct 2020 17:56:45 +0000 (10:56 -0700)]
Flatbuffer C++ UnpackTo optimization for vectors of non-bool bytes. (#6154)
UnpackTo copies vector elements one-by-one, which can be very inefficient depending on the quality of the compiler optimizations performed. This change updates the operation for vectors of bytes that aren't enums to use 'std::copy', which is usually highly optimized.
vectors of types that are more than one byte can't be optimized in this way because of the endianness of the serialized bytes vs. the target architecture endianness.
vectors of enums can't be optimized because they are required to be static_cast into the appropriate enum type when stored in the vector.
vectors of bools can be optimized in most cases, but since the standard
allows std::vector<bool> template specialization for space-savings,
std::copy doesn't work on every implementation (looking at you
Microsoft). Thus, this optimization is skipped for vector<bool>.
For a specific example, this improves the latency of unpacking large buffers on the Hexagon DSP by about 10x.
Co-authored-by: Matthew Markwell <markwell@google.com>
mustiikhalil [Tue, 6 Oct 2020 16:00:14 +0000 (19:00 +0300)]
Enables optional enums in swift (#6160)
[Swift] Enables optional enums
Wouter van Oortmerssen [Fri, 2 Oct 2020 17:53:47 +0000 (10:53 -0700)]
Updated Lobster test for optional bools/enums
The codegen for this was already correct, just added more tests
Casper [Fri, 2 Oct 2020 17:30:39 +0000 (10:30 -0700)]
Ruopt enum (#6156)
* Rust support for optional enums
* make optional_scalars2 for languages that support optional enums
Co-authored-by: Casper Neo <cneo@google.com>
Vladimir Glavnyy [Fri, 2 Oct 2020 17:27:30 +0000 (00:27 +0700)]
Fix generation of C++ code with Optional<Enum> (#6155)
Conan Chen [Mon, 28 Sep 2020 18:56:59 +0000 (14:56 -0400)]
[C#] Fix and improve project files (#6142)
* [C#] Fix and improve project files
* "net35" target included for Unity 5
* "net46" target included for Unity 2017
* "netstandard2.0" target included for Unity 2018 and general use
* "netstandard2.1" target included for Span<T> support
Included project properties for defining UNSAFE_BYTEBUFFER, BYTEBUFFER_NO_BOUNDS_CHECK, and ENABLE_SPAN_T conditional compilation symbols.
* Add documentation on building for C#
Kamil Rojewski [Mon, 28 Sep 2020 16:45:48 +0000 (18:45 +0200)]
possibility to create a vector from an iterator (#6135)
Stefan F [Mon, 28 Sep 2020 16:28:47 +0000 (18:28 +0200)]
flatc should output a warning, when an attribute is attached more than once (#6146)
* Added missing EndTable() call to VerifyObject()
VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables.
https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg
* Added Check to VerifyAlignment
https://stackoverflow.com/questions/
59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri
* Add GetStringView (Convenience function to get string_view from a String returning an empty string_view on null pointer) like GetString, GetCstring
* flatc should warn, when an attribute is attached more than once.
flatc.exe -b duplicate.fbs
warning: duplicate.fbs(5, 36): warning: attribute already found: priority
duplicate.fbs:
namespace MyGame;
attribute "priority";
table Monster (priority:1, priority:2) {
}
root_type Monster;
Anass Al [Mon, 28 Sep 2020 15:54:50 +0000 (08:54 -0700)]
[Python/JS/TS] Codegen SizeOf method for structs (#6136)
* [Python] Codegen SizeOf classmethod for structs
This codegens a `SizeOf()` classmethod for all structs since we can't
determine the size of a FlatBuffer generated struct from Python otherwise.
* [JS/TS] Codegen sizeOf static method for structs
This codegens a `sizeOf()` static method for all structs since we can't
determine the size of a FlatBuffer generated struct from JavaScript or
TypeScript otherwise.
石晓伟 [Mon, 28 Sep 2020 15:10:06 +0000 (23:10 +0800)]
unix2dos on tests/FlatBuffers.Test/FlatBuffers.Core.Test.csproj (#6133)
春条 [Fri, 25 Sep 2020 17:39:28 +0000 (02:39 +0900)]
SpanT is available in .Net Standard 2.0. (#6137)
Nat Jeffries [Thu, 24 Sep 2020 16:35:29 +0000 (09:35 -0700)]
Add static cast to avoid implicit double promotion. (#6132)
Add static cast from float to double in flexbuffers.h to avoid implicit double promotion error. This error is surfacing during the tensorflow lite for microcontrollers build since we enabled -Werror and -Wdouble-promotion.
春条 [Wed, 23 Sep 2020 20:16:00 +0000 (05:16 +0900)]
[C#]Change to ENABLE_SPAN_T that doesn't require UNSAFE_BYTEBUFFER. (#6073)
* ENABLE_SPAN_T doesn't require UNSAFE_BYTEBUFFER.
Change to ENABLE_SPAN_T that doesn't require UNSAFE_BYTEBUFFER.
* Selectable framework.
Changed target framework to allow selection of 2.0 or 2.1 (or higher)
* Added target framework version check.
* Add core test project.
* Added run on .Net Core.
Derek Bailey [Wed, 23 Sep 2020 20:14:51 +0000 (13:14 -0700)]
Revert "[C#] Fix and improve project files (#6116)" (#6130)
This reverts commit
750281630b097dc311b3a18578c82e98ba2438db.
Mark Nauwelaerts [Wed, 23 Sep 2020 00:57:01 +0000 (02:57 +0200)]
Minireflect fixed array (#6129)
* CMakeLists: also really generate optional_scalars as needed by test elsewhere
* [C++] Handle fixed-length array in minireflection
Fixes #6128
Björn Harrtell [Mon, 21 Sep 2020 16:46:24 +0000 (18:46 +0200)]
[JS/TS] fix flatbuffers default export (#6123)
* [TS/JS] Export flatbuffers namespace as default export
* [TS/JS] Fully qualified name
* Export as default and named
Vladimir Glavnyy [Mon, 21 Sep 2020 16:37:01 +0000 (23:37 +0700)]
Add missed file generated by optional_scalar.fbs (#6125)
Conan Chen [Mon, 21 Sep 2020 16:32:59 +0000 (12:32 -0400)]
[C#] Fix and improve project files (#6116)
* [C#] Fix and improve project files
* "net35" target included for Unity 5
* "net46" target included for Unity 2017
* "netstandard2.0" target included for Unity 2018 and general use
* "netstandard2.1" target included for Span<T> support
Included project properties for defining UNSAFE_BYTEBUFFER, BYTEBUFFER_NO_BOUNDS_CHECK, and ENABLE_SPAN_T conditional compiler constants.
* Add documentation on building for C#
Vladimir Glavnyy [Mon, 21 Sep 2020 16:31:27 +0000 (23:31 +0700)]
Add CharToLower and CharToUpper into util.s (#6126)
This commit adds replacement of `::tolower` and `::toupper`.
Added CharToLower and CharToUpper routines reduce the number of cast operators
that required for correct usage of standard C/C++ `::tolower/toupper` routines.
Vladimir Glavnyy [Fri, 18 Sep 2020 19:51:17 +0000 (02:51 +0700)]
Add support of Optional<T> scalars to C++ code generator (#6092)
Paulo Pinheiro [Fri, 18 Sep 2020 06:31:51 +0000 (08:31 +0200)]
[Kotlin] Support for optional scalars. (#6115)
More information on #6014
mustiikhalil [Thu, 17 Sep 2020 19:28:42 +0000 (22:28 +0300)]
Bump version for latest swift version (#6121)
Björn Harrtell [Thu, 17 Sep 2020 19:21:14 +0000 (21:21 +0200)]
[JS/TS] Modernize TypeScript / JavaScript flatbuffers support (#6095)
Anass Al [Thu, 17 Sep 2020 19:19:07 +0000 (12:19 -0700)]
[JS] Add getFullyQualifiedName() (#6119)
This optionally generates a static `getFullyQualifiedName()` function to get
the fully-qualified name of a type in JavaScript and TypeScript in a similar
fashion to the C++ codegen.
Diogo Monteiro [Thu, 17 Sep 2020 18:55:24 +0000 (19:55 +0100)]
[Java] allowing larger buffer sizes when growing a byte buffer (#6118)
Related with issue #6113.
`(old_buf_size & 0xC0000000) != 0` checks if we can duplicate old_buf_size
and still be under 2GB (by checking if bit 30 or 31 is 1). This doesn't
allow buffers larger than 1GB.
The strategy now is to allocate a buffer with the maximum array size
when we detect that we are overflowing the 2GB.
Also changed default buffer size to 1024.
mustiikhalil [Thu, 17 Sep 2020 14:10:59 +0000 (17:10 +0300)]
[Swift] Migrates struct write APIS to write directly to the buffer (#6093)
* Migrates struct write APIS to in place APIS
* Fixes indentation in grpc swift
Casper [Fri, 11 Sep 2020 21:20:32 +0000 (14:20 -0700)]
Optional-ness in reflection (#6097)
* Optional scalars in reflection
* fixed name collision
* Remove code duplicated by merge
Co-authored-by: Casper Neo <cneo@google.com>
Casper [Thu, 10 Sep 2020 20:04:36 +0000 (16:04 -0400)]
Rename Nullable scalars to Optional scalars (#6112)
Co-authored-by: Casper Neo <cneo@google.com>
Ruslan Burakov [Thu, 10 Sep 2020 20:03:15 +0000 (23:03 +0300)]
Avoid memcpy call for empty vectors (#6111)
Co-authored-by: kuddai <kuddai92@gmail.com>
Maxim Zaks [Thu, 10 Sep 2020 19:36:37 +0000 (21:36 +0200)]
[JS] FlexBuffers Fix for wrong type of offset and length values (#6107)
* Adding FlexBuffers support for Dart language
* Introduce snapshot method.
* Fix docu
* Replacing extension methods with static methods in order to support older Dart version
* Improving code based on PR feedback. Mainly rename refactoring.
* Addressing all PR feedback which does not need clarification
* exchange dynamic type with Object
* Adds better API documentation.
[] operator throws a very descriptive exception in case of a bad key.
* Implementation of JavaScript FlexBuffers decoder
* implements JS FlexBuffers builder
* replacing _toF32 with Math.fround
* Introducing test for BigInt number
* Moving functions from BitWitdth & ValueType object into BitWidthUtil and ValueTypeUtil accordingly.
Removing defensive checks.
Introducing fix for large int numbers by converting them to BigInt type.
Introducing handling for BigInt type in `add` method.
Using TextEncoder and Decoder to handle string / utf8 conversion.
* rename variable
* Lets user turn deduplication strategies for strings, keys and vector of keys off while building FlexBuffer.
Implements quick sort and choses quick sort if the number of keys is bigger then 20.
Removes unnecessary dict lookups in BitWidthUtil helper functions
* make iwidth and uwidth computation simpler and faster
* Making redInt and readUint a bit faster and shim the BigInt / BigUint usage
* Fixing a bug in FlexBuffers JS, where offsets and lengths are stored and read as int and not as uint values.
* Fixing a bug in FlexBuffers Dart, where offset and length values are stored and read as int values instead of uint values
mugisoba [Wed, 9 Sep 2020 22:02:24 +0000 (07:02 +0900)]
fix c# json serializer commandline argument docs (#6104)
Laurentiu Cristofor [Fri, 4 Sep 2020 22:52:13 +0000 (15:52 -0700)]
Fix for issue 6100: incorrect shrinking logic in ResizeContext() (#6102)
Maxim Zaks [Mon, 31 Aug 2020 19:16:55 +0000 (21:16 +0200)]
[JS] FlexBuffers Support (#5973)
* Adding FlexBuffers support for Dart language
* Introduce snapshot method.
* Fix docu
* Replacing extension methods with static methods in order to support older Dart version
* Improving code based on PR feedback. Mainly rename refactoring.
* Addressing all PR feedback which does not need clarification
* exchange dynamic type with Object
* Adds better API documentation.
[] operator throws a very descriptive exception in case of a bad key.
* Implementation of JavaScript FlexBuffers decoder
* implements JS FlexBuffers builder
* replacing _toF32 with Math.fround
* Introducing test for BigInt number
* Moving functions from BitWitdth & ValueType object into BitWidthUtil and ValueTypeUtil accordingly.
Removing defensive checks.
Introducing fix for large int numbers by converting them to BigInt type.
Introducing handling for BigInt type in `add` method.
Using TextEncoder and Decoder to handle string / utf8 conversion.
* rename variable
* Lets user turn deduplication strategies for strings, keys and vector of keys off while building FlexBuffer.
Implements quick sort and choses quick sort if the number of keys is bigger then 20.
Removes unnecessary dict lookups in BitWidthUtil helper functions
* make iwidth and uwidth computation simpler and faster
* Making redInt and readUint a bit faster and shim the BigInt / BigUint usage
Vladimir Glavnyy [Mon, 31 Aug 2020 19:13:23 +0000 (02:13 +0700)]
[C++] Small refactoring of the C++ code generator (#6091)
This commit performs refactoring (Extract Method) of the C++ code generator.
It extracts code generation of a table getter/mutator into separated methods.
Navin Mohan [Mon, 31 Aug 2020 18:32:13 +0000 (00:02 +0530)]
Wrap verify file id condition in Check call (#6085)
Run clang-format
Update testcase
Wybe Westra [Mon, 24 Aug 2020 16:55:38 +0000 (18:55 +0200)]
+ Add `removable-media` plug to the snapcraft config (#6083)
mustiikhalil [Sat, 22 Aug 2020 19:39:09 +0000 (22:39 +0300)]
Adds proper access types for swift object api & flatbuffers & grpc (#6081)
Fixes accessor in greeter.swift
Small fix for ci
Wouter van Oortmerssen [Tue, 18 Aug 2020 21:29:44 +0000 (14:29 -0700)]
[Lobster] missed a test
Wouter van Oortmerssen [Tue, 18 Aug 2020 21:00:22 +0000 (14:00 -0700)]
[CMake] enabled multi-core builds in VS projects
Wouter van Oortmerssen [Tue, 18 Aug 2020 21:00:02 +0000 (14:00 -0700)]
[Lobster] optional scalars support
Yoon Kyong Sik [Tue, 18 Aug 2020 16:44:43 +0000 (01:44 +0900)]
[Kotlin] Attach JvmStatic annotation to each method in companion object (#6052)
* Attach JvmStatic annotation to each method of companion object
Kotlin does not have static accessor so companion object used instead of static.
It's so natural. But when use kotlin companion object methods on java it is very inconvenient.
```java
GeneratedClassByFlatBuffer.Companion.someMethod()
```
If use @JvmStatic annotation it can be shorten like below.
```java
GeneratedClassByFlatBuffer.someMethod()
```
* Formatting by Idea Google C++ style
* Add comments - Commit for missing cla
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add comments - Commit for missing cla
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Reset code formatting except modified lines
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Pass missing flag to validateVersion method
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add annotations to missing method in companion object
* addVector
* createVector
* endVector
* tableCreator
And also I tried add compiler option for generate annotation who don't like this operation.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Modify unmatched option name in compiler usage
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add missing operation for finishSizePrefixed and finishStructBuffer method.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add compiled example with --kotlin-gen-jvmstatic option.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Fix Compiler.md
Change option name from --gen-jvm-static-annotation to --kotlin-gen-jvmstatic
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Use IDLOptions reference instead of bool parameter.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Change option name - kotlin_gen_jvmstatic to gen_jvmstatic
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Use IDLOptions reference instead of bool parameter and missing process @JvmStatic as suffix.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add code generation for --gen-jvmstatic option
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Miss typo directory for including.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Miss typo variable suffix for including.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Fix camel case to snake case.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Rollback generate code for gen_jvmstatic option.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Delete generated test files.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* add missing new line at end of file.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Remove generated test file by command line.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
Co-authored-by: sam <sam@jennifersoft.com>
Derek Bailey [Mon, 17 Aug 2020 20:10:10 +0000 (13:10 -0700)]
[C#] Cleaned up .NET testing script for Mono (#6016)
* Cleaned up .NET testing script for Mono
Cleaned up the .NET testing script to make it a little better. It
purposefully doesn't delete the .NET installer and SDk after running the
script, so that they can be used in subsequent invocations. This greatly
speeds up the script.
The downloaded files are ignored by git by default. They can be
explicitly cleaned up by runnning the clean script (clean.sh).
* Trying using older Version indicator
* Remove lins to monsterdata and reference it directly.
* Updated appveryor script to remove copying of files no longer needed
* Continue to update appveyor script to work. Disabled CS0169 in ByteBufferTest
mustiikhalil [Tue, 4 Aug 2020 10:53:40 +0000 (13:53 +0300)]
Adds a serialize helper function to native table (#6059)
* Adds a serialize helper function to native table
* Updated version
Max Burke [Mon, 3 Aug 2020 19:08:52 +0000 (12:08 -0700)]
[TS] Fix four bugs with imported types in TypeScript. (#6054)
* [TS] Fix four bugs with imported types in TypeScript.
* When a type had a vector of imported enums:
1) the enum type's file wasn't added to the generated code's list of
imports; and
2) the enum wasn't prefixed with the NS<hash> prefix and wasn't getting
resolved; but
3) non-enum types (ie, "flatbuffers.Offset") were getting the NS<hash>
prefix when they weren't.
* Also, type name prefixes weren't properly attributed with imported
structs in unions because the source definition passed to the typename
prefixing method was for the union, not for the location of the imported
struct.
* clang fmt
* Use of enum_def / struct_def for prefixing types needs to have the files
added to imported files when not generating all types.
* clang fmt
Liu Liu [Fri, 31 Jul 2020 07:07:45 +0000 (00:07 -0700)]
[Swift] Append namespace for Swift Grpc implementation (#6049)
* [Swift] Append namespace for Swift Grpc implementation
* Separate ServiceName from ServiceQualifiedName.
Omer Akram [Thu, 30 Jul 2020 22:56:21 +0000 (03:56 +0500)]
export a __version__ variable for python module (#5309)
* export a __version__ variable for python module
* assign version to be used below
* better support python2
* Add copyright header
Kamil Rojewski [Thu, 30 Jul 2020 22:55:11 +0000 (00:55 +0200)]
adding fb import when no other imports are present (#6030)
Co-authored-by: Kamil Rojewski <kamil.rojewski@gmail.com>
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
mustiikhalil [Mon, 27 Jul 2020 16:57:50 +0000 (19:57 +0300)]
[Feature] Checks for Nullable strings (#6050)
* Allows null strings in createString method c#
* Adds nullable strings to JS and swift
* Changes js checks
* Fixes typo
Liu Liu [Mon, 27 Jul 2020 08:06:11 +0000 (01:06 -0700)]
[Swift] RFC: Switch Swift namespace from public enum to ordinary concat with _ (#6045)
This PR attempts to switch namespace from public enum back to ordinary
concat with _ in Swift. This kept style similar with protobuf, but
different from other popular style guide in Swift.
This is needed because previously, when we do `public enum`, we don't
really know when to declare and when to extend (extension). With namespace
implementation in this PR, there is no such ambiguity.
Casper [Sat, 25 Jul 2020 20:46:20 +0000 (13:46 -0700)]
Rust codegen improvements and lint fixes (#6046)
* Improve rust codegen
* one more unneeded lifetime
* Added a derive default
Co-authored-by: Casper Neo <cneo@google.com>
mustiikhalil [Sat, 25 Jul 2020 14:59:34 +0000 (17:59 +0300)]
adds code gen for optional scalars in swift (#6038)
Adds swift test code
Replaces if statments
Adds swift to supported languages for optionals
Moved std::string to auto
Adds nullable scalars support in object api
jdess [Fri, 24 Jul 2020 17:35:27 +0000 (19:35 +0200)]
[C++] Fix compiler error from deleted assignment operator (#6036) (#6047)
* [C++] Fix compiler error from deleted assignment operator (#6036)
The assignment operator of the `buf_` member is deleted, we cannot call it from the assignment operator of the `TableKeyComparator` struct.
=> Also delete the assignment operator of the `TableKeyComparator` struct (already private anyhow).
* [C++] Fix compiler error from deleted assignment operator (#6036) - fix extraneous semicolon
The assignment operator of the `buf_` member is deleted, we cannot call it from the assignment operator of the `TableKeyComparator` struct.
=> Also delete the assignment operator of the `TableKeyComparator` struct (already private anyhow).
Casper [Thu, 23 Jul 2020 23:30:27 +0000 (16:30 -0700)]
Optional Scalars support for Rust (#6034)
* First draft of rust optionals
* Code cleanup around ftBool and ftVectorOfBool
* Tests for Rust optional scalars
* test bools too
Co-authored-by: Casper Neo <cneo@google.com>
Shengzhe [Tue, 21 Jul 2020 18:08:01 +0000 (11:08 -0700)]
Allow to run cpp tests under grpc/tests/ using bazel. (#6040)
This is the first step to upgrade grpc dependency to the latest version.
- Patch protobuf 3.6.1. and grpc 1.15.1 to fix build errors when using the latest Bazel version (3.4.1).
- Add grpc/tests:grpc_test. One can kick off tests in Bazel by calling `bazel test grpc/tests/...`.
- Add missing build targets in tests/BUILD in order to support grpc/tests/BUILD
Olivier Le Doeuff [Mon, 20 Jul 2020 19:26:01 +0000 (21:26 +0200)]
Fix git command executed in wrong folder when doing cmake superbuild (#6039)
mustiikhalil [Mon, 20 Jul 2020 17:38:50 +0000 (20:38 +0300)]
[Swift] Optional Scalars Preparation (#6028)
* Perpares swift to take optional scalars + adds optional string helper method + disables linters in generated code
* Small fix for generated code
* Update grpc support to alpha 17 for swift
Vasyl Gello [Mon, 20 Jul 2020 17:18:02 +0000 (20:18 +0300)]
tests: Check for both quiet and signaling NaN on mipsel/hppa (#6029)
MIPSEL, MIPS64EL and HP-PA architectures have quiet and
signaling NaNs swapped. The test assumes correct values
for i386 / amd64 but obviously fails on these architectures.
It is documented in many places, like
https://software.llnl.gov/yorick-doc/stdlib/ieee.html :
Warning-- apparently there is no universal standard for what
constitutes signalling versus quiet NaN
on MIPS and HPPA architectures, qNaN and sNaN are reversed
https://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html :
-mnan=2008
-mnan=legacy
These options control the encoding of the special
not-a-number (NaN) IEEE 754 floating-point data.
The -mnan=legacy option selects the legacy encoding.
In this case quiet NaNs (qNaNs) are denoted by the first
bit of their trailing significand field being 0, whereas
signaling NaNs (sNaNs) are denoted by the first bit of
their trailing significand field being 1.
The -mnan=2008 option selects the IEEE 754-2008 encoding.
In this case qNaNs are denoted by the first bit of their
trailing significand field being 1, whereas sNaNs are
denoted by the first bit of their trailing significand
field being 0.
The default is -mnan=legacy unless GCC has been configured
with --with-nan=2008.
The behavior mentioned above causes FTBFS in Debian starting
with 1.12.0:
https://buildd.debian.org/status/fetch.php?pkg=flatbuffers&arch=mips64el&ver=1.12.1%7Egit20200711.
33e2d80%2Bdfsg1-0.1&stamp=
1594830681&raw=0
https://buildd.debian.org/status/fetch.php?pkg=flatbuffers&arch=mipsel&ver=1.12.1%7Egit20200711.
33e2d80%2Bdfsg1-0.1&stamp=
1594832647&raw=0
https://buildd.debian.org/status/fetch.php?pkg=flatbuffers&arch=hppa&ver=1.12.1%7Egit20200711.
33e2d80%2Bdfsg1-0.1&stamp=
1594830726&raw=0
For HP-PA (PA-RISC) there is no way to override the reversal,
and for MIPSEL/MIPS64EL there is no macro defining the '-mnan'
choice, so both variants were added with OR boolean operator.
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
Dmitry [Thu, 16 Jul 2020 20:49:42 +0000 (23:49 +0300)]
support deprecated flag in json schema (#6022)
Casper [Thu, 16 Jul 2020 20:43:47 +0000 (13:43 -0700)]
Flatc parser support for nullable scalars (#6026)
* Parser support for nullable scalars
* Use older C++ features
* use default element
* Add a test for json, flexbuffers, and null
* test comments and names
Co-authored-by: Casper Neo <cneo@google.com>
Zhaoxuan Jiang [Sat, 11 Jul 2020 00:42:22 +0000 (08:42 +0800)]
[Dart] Generate constant values map for enums (#6025)
Dart schema compiler generated a static getter for enum values, which
always created a new map instance for its callers. See #5819.
Now it generates const map for better performance
and readability.
Kamil Rojewski [Mon, 6 Jul 2020 15:40:56 +0000 (17:40 +0200)]
Using proper symbol name for reexport (#6021)
Co-authored-by: Kamil Rojewski <kamil.rojewski@gmail.com>