Commit Graph

1525 Commits

Author SHA1 Message Date
Wouter van Oortmerssen ea9d60bbdf Added missing dart/ts test changes.
Change-Id: I836091193485b890710f1df779d4d770f729a27a
2018-08-20 12:05:37 -07:00
Andy Martin c2c3a84aaf 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
2018-08-16 15:25:33 -07:00
Uilian Ries 1f03becd24 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>
2018-08-16 12:17:52 -07:00
kulswanand c721009491 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
2018-08-13 16:36:11 -07:00
iceboy 55289c55bf 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.
2018-08-13 16:19:51 -07:00
Wouter van Oortmerssen ed2415eb72 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.
2018-08-13 14:52:50 -07:00
Matias Cudich aaa89429d3 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
2018-08-10 15:27:51 -07:00
iceboy 12e5cf0b29 Remove FLATBUFFERS_COPTS from bazel BUILD (#4872)
fixes #4868
2018-08-10 13:43:48 -07:00
cubeleo 75601b81cc Correctly generate identifier for enums. (#4871)
This should allow the EnumName* function to work with enums generated
using the --scoped-enum flag.
2018-08-10 13:41:32 -07:00
Andrew Selle e203882d54 Clarify flatbuffer reflection struct sizes to be less error-prone. (#4870) 2018-08-10 10:55:54 -07:00
iceboy b9f1103b8a Add licenses to BUILD (#4867)
This allows to build flatbuffers from third_party directory.
2018-08-10 08:21:17 -07:00
Dan Field fd40cc61a4 Ensure strings are null terminated when written from Dart (#4862)
* Update for Dart 2.x constants

* Fix strings, update test, add CHANGELOG for Dart
2018-08-09 09:50:54 -07:00
Wouter van Oortmerssen 38a6623f34 Temporarily disabled Android CI until fix.
Change-Id: I0c6758db7b4007e84b7ab8daaecd233711df8cab
2018-08-06 16:52:09 -07:00
Vladimir Glavnyy 27e4f43b77 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
2018-08-06 14:59:29 -07:00
Kamil Rojewski 42515cfd33 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
2018-08-06 12:45:35 -07:00
Charlie Harrison 5d3648b88a Remove using namespace std; (#4851) 2018-08-06 12:08:49 -07:00
Wouter van Oortmerssen fc3ce7d1ab Fixed VS2010 compile error.
Change-Id: Ibd970d30b51f77a2ac9c125e400c9f1b19a81cbc
2018-08-06 12:06:59 -07:00
aardappel 4898809eca FlatBuffers implementation for the Lobster programming language
Language, see: http://strlen.com/lobster/ and https://github.com/aardappel/lobster
2018-07-29 13:23:00 -07:00
shassani ca5aaf62d3 Adds multi-line to FLatBufferToString (#4847)
Adding multi-line option to FlatBufferToString method in minireflect to allow more readable output for larger flatbuffers.
2018-07-27 12:45:12 -07:00
Wouter van Oortmerssen c80f8d18c1 Fixed FlatBufferBuilder::Required not checking vtable size.
As reported in: https://github.com/google/flatbuffers/issues/4846
Tested: on Linux.

Change-Id: Id5e82dc5a46a681119cfe5a15415d522aac0e1f2
2018-07-27 12:41:50 -07:00
cubeleo 0d1559bdd4 For sparse enums, use a switch statement to generate EnumNameXXX(). (#4845) 2018-07-27 08:32:19 -07:00
Robert 8b39a0ee53
Merge pull request #4843 from rw/2018-07--explicit-enumish-types
go: give enums their own scalar types
2018-07-26 16:57:01 -07:00
rw f675f6433c go: give enums their own scalar types 2018-07-26 16:46:35 -07:00
Paul Reimer 118093b613 Update FLATBUFFERS_HAS_STRING_VIEW __cplusplus checks to the versions provided by the standard feature test macros. (#4841) 2018-07-26 15:40:41 -07:00
Robert 1bb2a3bd08
Merge pull request #4820 from nairb774/master
[Go] encode.go performance changes
2018-07-26 15:35:45 -07:00
Dan Field 2361dfb66a Update for Dart 2.x constants (#4842) 2018-07-26 14:21:23 -07:00
Derek Bailey 7b50004ec9 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
2018-07-26 13:44:40 -07:00
Wouter van Oortmerssen 6e185d06a7 Fixed minalign in Lua being reset on StartObject
Change-Id: I9cd62b38c8dc526f069726a88baef63e4b0dae57
2018-07-23 16:36:21 -07:00
Robert c949229395 go: do not clobber minalign when we create objects (#4834) 2018-07-23 16:34:08 -07:00
Robert e1d5fda5d4 python: do not clobber minalign when we create objects (#4833) 2018-07-23 16:29:45 -07:00
Evan Moran a2603ec27e Add missing public header `minireflect.h` to bazel build (#4832) 2018-07-23 16:28:49 -07:00
Evan Moran 5f1b1ad42c Fixing bazel build's missing lua file (#4831) 2018-07-23 16:28:09 -07:00
shassani 4235a25640 Adds ForceStringAlignment to flatbuffers. (#4828)
ForceStringAlignment is useful for memory aligning string fields in flatbuffers.
2018-07-19 16:00:31 -07:00
Shivendra Agarwal 88cd182349 Restricting (typed=false, fixed=true) combination in flexbuffer CreateVector (#4825)
https://github.com/google/flatbuffers/issues/4815
2018-07-19 14:59:06 -07:00
Shivendra Agarwal 7c824ef690 Fixing an assert in flexbuffers CreateVector (#4824)
An assert was blocking the creation of typedvectors. It was wrongly checking for limited types even though vector was not of fixedTyped.
2018-07-19 14:55:06 -07:00
Kamil Rojewski 6bfa107f4e Option to NOT force libc++ when building with clang (#4826)
* 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
2018-07-19 09:40:28 -07:00
Wouter van Oortmerssen 0cd8daf14e Missing Lua generated files
Change-Id: Id668ade474805dd9c7e108a478db3551d6a62b48
2018-07-16 16:44:49 -07:00
Wouter van Oortmerssen 79f2adc50a Renamed Verifier methods
The name Verify was getting too overloaded, and confused
the VS compiler

Change-Id: I26423a4d513e4def2f4e41d7f278bb683fc12518
2018-07-16 16:42:10 -07:00
Wouter van Oortmerssen dcfe38c58f Dart generated code changes
Change-Id: I1110974a375acb9668552294632658d9d1779772
2018-07-16 16:42:10 -07:00
shassani 51d9641de6 flatbuffer force-empty option (#4822) 2018-07-16 16:05:06 -07:00
Wouter van Oortmerssen af6c0e6839 Updated fuzzer scripts
Point to new Chromium location
Also enable UBSan

Change-Id: I4ba182e3c6a967ad89090b776d05762fa9ae6e40
2018-07-16 15:51:28 -07:00
Wouter van Oortmerssen 7c3cb5caa1 Fixed assert in ParseSingleValue (found by fuzzer)
Change-Id: I84674eaab75b2b455e918b04e3027920430678ac
2018-07-16 15:51:28 -07:00
Wouter van Oortmerssen 8f1bebba05 C++ verifier now primarily uses offsets instead of pointers.
Fix for: https://bugs.chromium.org/p/chromium/issues/detail?id=834710

Before, the verifier would create pointers to objects, and then
verify they are inside the buffer. But since even constructing pointers
that are outside a valid allocation is Undefinied Behavior in C++, this
can trigger UBSAN (with -fsanitize=pointer-overflow).

Now instead the bounds checking is first performed using offsets
before pointers are even created.

Change-Id: If4d376e90df9847e543247e70a062671914dae1b
Tested: on Linux.
2018-07-16 15:51:28 -07:00
xgdgsc cda1525f84 📝 release mode in building doc (#4819) 2018-07-16 12:56:14 -07:00
Damien Pontifex 72b05bc865 Convert net/FlatBuffers project to be compatible with netstandard (#4811) 2018-07-16 09:13:36 -07:00
Brian Atkinson b3e4d9169b [Go] Force a single, early bounds check on read and write paths.
As an example, GetInt64 used to perform 8 bounds checks, one for each
slice access. By performing a bound check on the highest index, the
number of checks is reduced to one through bounds-check-elimination.
2018-07-15 16:49:21 -07:00
Brian Atkinson e2eb6af3e3 [Go] Unroll WriteUint64 and WriteInt64.
This enables both WriteUint64 and WriteInt64 to both be inlined as
well as implemented with a single assembly instruction. The current Go
compiler refuses to inline functions with for loops. The compiler is
also not smart enough to produce a single assembly instruction for the
for-loop.
2018-07-15 16:47:17 -07:00
Wouter van Oortmerssen b188fde27e Fixed Uint() method actually storing a signed int.
Also fixed two constructors missing explicit.

Change-Id: I147b2d2517bb660d92d4b0167992c115ed65dca7
2018-07-06 12:30:43 -07:00
Derek Bailey ba5eb3b5cf Lua (5.3) Language addition (#4804)
* starting Lua port of python implmention. Syncing commit

* Bulk of Lua module port from Python done. Not tested, only static analysis. Need to work on binary strings. Started work on flatc lua code generation

* Fixed all the basic errors to produced a binary output from the builder, don't know if it is generated correctly, but it contains data, so that must be good

* fixed binary set command that was extending the array improperly

* continued improvement

* Moved lua submodules down a directory so their names don't clash with potential other modules. Added compat module to provide Lua versioning logic

* Successful sample port from Python

* working on testing Lua code with formal tests

* continued to work on tests and fixes to code to make tests pass

* Added reading buffer test

* Changed binaryarray implmentation to use a temporary table for storing data, and then serialize it to a string when requested. This double the rate of building flatbuffers compared to the string approach.

* Didn't need encode module as it just added another layer of indirection that isn't need

* profiled reading buffers, optimizations to increase read performance of monster data to ~7 monster / millisecond

* Writing profiler improvments. Get about
~2 monsters/millisecond building rate

* removed Numpy generation from Lua (came from the Python port)

* math.pow is deprecated in Lua 5.3, so changed to ^ notation. Also added .bat script for starting Lua tests

* adding results of generate_code.bat

* simple edits for code review in PR.

* There was a buffer overflow in inserting the keywords into the unorder set for both the Lua and Python code gens. Changed insertion to use iterators.

* fixed spacing issue

* basic documenation/tutorial updates. Updated sample_binary.lua to reflect the tutorial better

* removed windows-specific build step in Lua tests
2018-07-05 15:55:57 -07:00
Vladimir Glavnyy 8ea293b988 Issue #4799 fixed. Generator for KeyCompareWithValue is extracted. (#4802)
* Issue #4799 fixed. Generator for KeyCompareWithValue is extracted.

* format fix
2018-07-05 09:23:40 -07:00