Commit Graph

2600 Commits

Author SHA1 Message Date
Casper 9aa08a429e
Use keep case for Rust union discriminant type. (#7321)
Fixes #7320.

I realize that Rust doesn't really follow the Namer convention, since
it uses Field case for methods... that's a future problem.

Co-authored-by: Casper Neo <cneo@google.com>
2022-05-23 15:53:00 -04:00
Bart van der Werf 9e8c758f54
Add explicit return types to lobster generated code (#7312)
* Add explicit return types to lobster generated code

* Add support for optional fields.

Convert to bool explicitly from int8 to match type signature
Fix whitespace
2022-05-23 10:50:01 -07:00
Björn Harrtell 74a25536be
Add size check to fix out of bounds read risk (#7304) 2022-05-13 15:15:00 -07:00
Brian Silverman 12917af8a2
Update Rust docs page (#7296)
I think these changes reflect the current state, but I found it hard to
track the state of some of the planned work. Hence why it'd be good to
have it documented :)

I also expanded some sections that I found misleading, as somebody
familiar with Rust and FlatBuffers separately. Parts of these pages seem
to be aimed at people familiar with FlatBuffers (ie via the other
documentation pages) but not each language, which I'm trying to
preserve. However, Rust does some things differently, and as somebody
with expectations about how typical Rust APIs work the discussion of
threading made me wonder what was different.
2022-05-12 10:02:14 -07:00
mr-swifter 1ea2472f7a
[swift] add had<ArrayName> property for arrays to check presence in a message (#7280) 2022-05-11 15:35:53 +02:00
pkasting 0fe13cb28c
Remove span ConstIterator/cbegin()/cend(). (#7295)
std::span lacks these; make  the flatbuffers STL emulation and tests
match.  This fixes a compile error in C++20 mode when using std::span.

Bug: chromium:1284275
2022-05-10 13:53:38 -07:00
Casper 385dddc66a
Namerkot (#7245)
* Namer for Kotlin

* delete unread cur_name_space_ and apply Namer to filename

Co-authored-by: Casper Neo <cneo@google.com>
2022-04-26 21:54:49 -04:00
Bogdan Opanchuk 750dde7669
Make `flatc` generate Rust files not requiring `std` (#7273)
* Set an explicit 2018 edition for Rust tests

* Replace all `std` usage with `core` and `alloc` in Rust code generator

* Update the generated files

* Make Rust tests actually use no_std when the corresponding feature is enabled
2022-04-26 21:40:03 -04:00
Keith Smiley 9917a168cd
[swift] Make swift module public (#7274) 2022-04-26 18:58:51 +02:00
Bogdan Opanchuk 76d3cca19c
Rust: fix a name conflict when building with "no_std" feature (#7268)
* Fix a name conflict when building with "no_std" feature

* Bump patch version
2022-04-25 13:09:41 -04:00
Derek Bailey c86e6d0e30 json inf parsing 2022-04-22 12:24:26 -07:00
Derek Bailey d34dc32c20 fix include order 2022-04-22 11:19:04 -07:00
Derek Bailey 234d86c92a fixed off-by-one in parser 2022-04-21 21:22:20 -07:00
Derek Bailey 746c73b910 Add Annotations for Monster schema and example buffer 2022-04-21 20:43:55 -07:00
Derek Bailey 0bbfd4b2e3 fixes for annotator 2022-04-21 11:46:16 -07:00
Joakim Hassila 7165219535
Update readme.md (#7257)
Added Swift to supported languages.
2022-04-20 09:49:35 -07:00
Joakim Hassila a45f564cf1
[performance] Add aggressive systematic inlining in ByteBuffer and FlatBufferBuilder (#7253)
Co-authored-by: Joakim Hassila <hassila@users.noreply.github.com>
2022-04-20 08:59:47 +02:00
Derek Bailey 9d45a64036 more google merge fixes 2022-04-19 14:35:20 -07:00
Derek Bailey ccfb4c20bf
Handle +/-inf in protos (#7256)
* Handle +/-inf in protos

* Check for digit in 4th pos
2022-04-19 13:07:26 -07:00
Derek Bailey 7bcd857b87
Specialize CreateVector with std::initializer_list (#7254) 2022-04-19 13:06:50 -07:00
Joakim Hassila 23c8ab34c1
Swift update performance benchmark infrastructure (#7255)
* Keep the underlying storage capacity when clearing the FlatBufferBuilder. Gives a significant performance boost for serialisation of many small messages.

* Use Googles Swift benchmark library for more consistent results and dynamic number of iterations, simplification of tests as result.

Co-authored-by: Joakim Hassila <hassila@users.noreply.github.com>
2022-04-19 10:52:10 +02:00
Derek Bailey 70002dc5ca various fixes for google merge 2022-04-18 21:15:35 -07:00
Derek Bailey 6e0e79f24f
Add test for nested buffer verifier (#7252)
* Add test for nested buffer verifier

* switch to base API
2022-04-18 10:20:06 -07:00
mustiikhalil b856368d75
Turn off go modules temporary until we get a proper fix (#7251) 2022-04-16 15:29:18 -07:00
Joakim Hassila e37156a305
Keep the underlying storage capacity when clearing the FlatBufferBuilder. Gives a significant performance boost for serialisation of many small messages. (#7250) 2022-04-16 11:25:44 +02:00
Derek Bailey a10b0e5464
Java namer variable keep case (#7249) 2022-04-15 16:33:35 -07:00
Derek Bailey 275b739944 allow overriding FLATBUFFERS_MAX_ALIGNMENT 2022-04-15 11:56:34 -07:00
Derek Bailey 9d1ce9a100
Add parameter back to EndVector (#7246) 2022-04-15 11:24:05 -07:00
Casper 79afe6c3d2
Make Java namespaces keep case by default (#7243)
Co-authored-by: Casper Neo <cneo@google.com>
2022-04-13 16:01:48 -07:00
Derek Bailey c6dbb22300 Add write permissions for labeller 2022-04-13 14:15:38 -07:00
Henner Zeller 18bacd3ea5
Expand test to make sure {}-initializers are properly understood by template. (#7242)
Since CreateVectorOfStrings() takes a templated container, make sure that
the default template deduction from just an initializer list will
still work.

Signed-off-by: Henner Zeller <hzeller@google.com>
2022-04-13 14:13:32 -07:00
Derek Bailey a2c913aec3 Add -Wnon-virtual-dtor 2022-04-12 16:22:39 -07:00
Derek Bailey 67b33b2942
set workflows permissions to read-only (#7239) 2022-04-11 20:01:00 -07:00
Paulo Pinheiro 7b5fd2bd05
[Kotlin] Fix key lookup returning null clashing with default value (#7237)
* [Java] Fix key lookup returning null clashing with default value

A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.

* [Kotlin] Fix key lookup returning null clashing with default value

A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.

Co-authored-by: Derek Bailey <derekbailey@google.com>
2022-04-11 17:17:19 -07:00
Paulo Pinheiro 7181d77700
[Java] Fix key lookup returning null clashing with default value (#7236)
A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.
2022-04-11 17:16:41 -07:00
Henner Zeller 7f663b1204
Allow CreateVectorOfStrings() to work with any string-type. (#7238)
Any string type that is supported by CreateString(), e.g.
const char* or string_view will now also work.

Signed-off-by: Henner Zeller <hzeller@google.com>
2022-04-11 17:02:19 -07:00
mustiikhalil 173ebb6944
Fixes a bug where the create function doesnt optional + required items (#7228)
Format sh file
2022-04-08 15:28:54 -07:00
Paulo Pinheiro d658239484
[Kotlin] Update gradle to 7.4.1 and simplify config files. (#7231)
* [Kotlin] Update gradle to 7.4.1 and simplify config files.

* [Kotlin] Add wrapper-validation-action to Kotlin Linux

* [Kotlin] Remove benchmark actions to reduce CI time

* [Kotlin] Move CI js test to Linux action, to increase Mac action speed

* [Kotlin] Generate gradle wrapper in order to be validate

Gradle wrapper from 3.3 to 4.0 are not verifiable because those files
were dynamically generated by Gradle in a non-reproducible way.

So they are now regenerated and will be checked using gitlab action:
gradle/wrapper-validation-action@v1
2022-04-08 11:23:13 -07:00
Derek Bailey ab4bf59e8c
remove toascii (#7234) 2022-04-07 20:48:26 -07:00
Derek Bailey eee44bbb26
disable cpp-linter (#7229) 2022-04-06 15:03:43 -07:00
Derek Bailey a63fa51a15
Create cpp-linter.yml (#7208)
* Create cpp-linter.yml

* Update cpp-linter.yml

* Update cpp-linter.yml

* Update bfbs_gen_lua.cpp

make some ill-formed edits to see if the linter flags them.

* Update cpp-linter.yml

Configured tidy checks

* Update cpp-linter.yml

Build project before linting to get compile_commands.json

* Update cpp-linter.yml

* Update cpp-linter.yml

* Update cpp-linter.yml

* Update cpp-linter.yml

* Update cpp-linter.yml

* lines only
2022-04-06 14:18:36 -07:00
mustiikhalil 2049e52101
Adds a way to verify/exposes Entities ids (#7221) 2022-04-06 22:54:01 +02:00
mustiikhalil 832c618f5f
Adds implementation flag for swift (#7202)
* Adds implementation flag for swift

Forces internal flag when using @_implementationOnly in swift

Fixes access type for verifier functions & encoder functions

Updates generated code

* Addresses PR comments & adds a code gen dir within the swift tests

* Adds test case for no-include

* Fixes code gen script

Removes prefix
2022-04-06 13:31:38 -07:00
Derek Bailey 14615699fa
Started to migrate to target_compile_options (#7222)
* Started to migrate to target_compile_options

* combined compile options together. Added Mac CI builds

* remove arm build (not supported). Fixed old-style-casts

* moved to using a ProjectConfig interface library to specify options

* remove the explicit CMAKE_CXX_STANDARD
2022-04-06 13:25:43 -07:00
avaliente-bc 20aad0c41e
[C++] stl_emulation span::count_ is not const anymore (#7226) (#7227)
In C++ we cannot have both assignment operator and const member. Since
span::operator= is defined, span::count_ constness must be removed.
2022-04-06 12:27:37 -07:00
Derek Bailey f083b33f2a
code gen flexbuffer verifier (#7207)
* code gen flexbuffer verifier

* remove verify nested flexbuffers from flexbuffers

* made function static, and placed higher in file

* moved function to own header
2022-04-05 16:29:42 -07:00
Stefan F bf17df346e
[C++] generate sorted #include directives (#7213)
* [C++] generate sorted #include directives

* using stable_sort instead of sort.
2022-04-04 15:20:55 -07:00
Stefan F 35281dedb5
Fix for [C++] flatc generates invalid Code in the default constructor for structs, when --cpp-field-case-style is used #7209 (#7211)
* Typo in flatc options (warning-as-errors instead of warnings-as-errors)

* VerifySizePrefixed (reflection::Schema) and GetAnySizePrefixedRoot added

* some review comments

* more review comments

* Fix for https://github.com/google/flatbuffers/issues/7209

* Fixes [C++] flatc generates invalid Code for union field accessors, when --cpp-field-case-style is used #7210
2022-04-01 13:35:57 -07:00
Jamie-Jameson c9651b7420
Add overloads for C# ByteBuffer/FlatBufferBuilder to allow adding vector blocks from ArraySegments or IntPtr (#7193)
* Add overloads to Add/Put for ArraySegment and IntPtr

In order to allow using code to reduce memory allocations, add overloads to ByteBuffer's and FlatBuffersBuilder's Put/Add methods that take ArraySegment<T> or IntPtr respectively.
Also, adaptions to the c# code generator in flatc to emit corresponding CreateVectorBlock() overloads

* Add missing files generated with generate_code.py

The previous commit changed the C# code generate, but didn't contain the updated generated test files.

* Incorporate review findings

(1) Adhere to 80 characters limit.
(2) In FlatBufferBuilder.Add(IntPtr,int), move zero length check topmost and add sanity check against negative input
2022-04-01 13:35:07 -07:00
Derek Bailey 26c3b3adab
Update codeql.yml
Replaced autobuild with cmake and make.
2022-03-31 22:19:51 -07:00