Commit Graph

167 Commits

Author SHA1 Message Date
BogDan Vatra
038ea7c1d3 Add ! operator 2016-06-01 10:05:27 +03:00
BogDan Vatra
0b0cf58f24 We already know the underlying_type.
We just need to pass it to DEFINE_BITMASK_OPERATORS macro
2016-06-01 10:04:55 +03:00
Wouter van Oortmerssen
7d1f372ba6 Merge pull request #3888 from bog-dan-ro/master
Define bit mask operators for scoped enums bitfields
2016-05-31 11:59:51 -07:00
Wouter van Oortmerssen
25e4ad19f6 Merge pull request #3889 from PSPDFKit-labs/james/avoid-msvc-align-error
MSVC doesn't allow alignment on function params.
2016-05-31 11:33:10 -07:00
BogDan Vatra
7dfe8e726b Define bit mask operators for scoped enums bitfields
Close #3887
2016-05-30 14:04:37 +03:00
Wouter van Oortmerssen
06eb6e94e3 Merge pull request #3880 from Lakedaemon/IsEverythingGenerated
shared method that exits early if everything is generated
2016-05-25 10:38:56 -07:00
Lakedaemon
4a8801da34 shared method that exits early if everything is generated 2016-05-25 15:15:56 +02:00
James Swift
b1e8be27a9 MSVC doesn't allow alignment on function params. This prevents the copy and thus avoids this issue https://msdn.microsoft.com/en-us/library/373ak2y1.aspx 2016-05-24 17:16:03 +02:00
Wouter van Oortmerssen
69eef0a0ec Fixes verifier not catching odd vtable sizes.
Bug: 28762769
Change-Id: Iec370482f67c4585e97dd5175c1a4258ddba47fe
Tested: on Linux.
2016-05-18 18:00:25 -07:00
Wouter van Oortmerssen
933c195e51 Merge pull request #3843 from Lakedaemon/refactoring
Transition 1 (nice diffs) Go, C++ and General generators with class
2016-04-27 13:59:16 -07:00
Wouter van Oortmerssen
c17cf022ea Fixed a verifier check that didn't return from its parent.
Change-Id: I1aef5fdba72de0c3bb8276c9f50fffa494f26e29
Tested: on Linux.
2016-04-22 11:31:35 -07:00
Lakedaemon
38597160f2 Enforcing the google C++ style guide 2016-04-15 13:20:26 +02:00
Nnamdi
039ab48b7a Stop CreateUninitializedVector returning a pointer to invalid memory.
CreateUninitializedVector was performing the following actions:
    1. call StartVector.
    2. call make_space, and set buf to point to the reserved space.
    3. call EndVector.

The problem is that a call to EndVector can ultimately call make_space, which
if the buffer is full, will cause a reallocation, invalidating the value stored
in buf.  So setting buf needs to be delayed until after EndVector.

The following code, when run under valgrind shows a write to free'd memory before
the change, but no such error after:

int main()
{
    flatbuffers::FlatBufferBuilder fbb(128);
    char *buf = nullptr;
    fbb.CreateUninitializedVector(128, &buf);
    *buf = 0;
}
2016-04-13 23:04:27 +01:00
Lakedaemon
8a64afabfd Transition 1 (with nice diffs) Go, Cpp and General code generators with class 2016-04-13 23:21:18 +02:00
Wouter van Oortmerssen
4a04bac250 Fixed struct -> class pre-declaration error.
Change-Id: I3730a6823d603982c4250d514e827e3f93d1f81e
Tested: on Linux.
2016-04-13 12:02:22 -07:00
Wouter van Oortmerssen
72fc45aa6a Made user-defined attributes available in the reflection data.
Tested: on Linux.

Bug: 27923233
Change-Id: Ic16675650e4a8e138c163f1e2131a3aad7008ada
2016-04-11 17:36:56 -07:00
Wouter van Oortmerssen
5e3f9d5175 Merge branch 'master' of https://github.com/google/flatbuffers 2016-04-04 16:55:25 -07:00
Wouter van Oortmerssen
e98b1912b3 add setloadfile and setfileexists functions to flatbuffers
to allow for custom file loaders. The targeted use case is android runtime.

(from CL 116980408)

Change-Id: I8785c0acf714fab41d8f6fc9f1c52875423b8f5b
2016-04-04 13:03:22 -07:00
Wouter van Oortmerssen
c8c0082413 Fix flatbuffers conversion warnings.
(from CL 116785833)

Change-Id: I0fb0e1318fd70cba51e229a93f535c6639bbb331
2016-04-04 13:03:22 -07:00
Wouter van Oortmerssen
1c1d079113 Fix flatc build for msvc.
(from CL 117010760)

Change-Id: I0ee77cf87d0cb00b94887356745b85423b1375a6
2016-04-04 13:03:22 -07:00
Wouter van Oortmerssen
7523e4ad49 Fixed potential integer overflow in the Verifier.
This overflow could allow malformed FlatBuffers to pass the verifier.

Change-Id: Ia993299a761b00b93e53e8aff2689b631755763c
Tested: on Linux.
Bug: 27903580
2016-04-04 13:03:22 -07:00
Wouter van Oortmerssen
f4a5c9de50 Fixed VS assignment constructor warning. 2016-04-04 13:00:48 -07:00
Nnamdi
35f6bb5060 Added --gen-name-strings command line option.
To support the use case described in issue google/flatbuffers#3826, a new command line option --gen-name-strings
has been added, which will cause a static GetFullyQualifiedName function to be added
to the C++ output for tables/structs.
2016-03-29 22:25:04 +01:00
Wouter van Oortmerssen
e6b79f0002 Added stream & idempotent annotations for RPCs.
Change-Id: Ia8651c1051808fdda0dc0ba52ec991777f868e88
Tested: on Linux.
2016-03-09 15:03:05 -08:00
Wouter van Oortmerssen
1a63eb46bb Added RPC declarations to the schema parser.
This is the first step in RPC support. Actual code generation
to follow.

Change-Id: I96c40fec3db671d100dd9eb509a71c5cbe55bfb2
Tested: on Linux.
Bug: 20122696
2016-03-09 13:47:40 -08:00
Wouter van Oortmerssen
fbc8af40e3 Allow JSON numeric fields to be specified by a numeric data in a string.
Change-Id: I6a3fae1e71434a7384edc39b8602bd84a0432edb
Tested: on Linux.
Bug: 24140897
2016-03-07 17:22:51 -08:00
Wouter van Oortmerssen
958fc6ec49 Added support for easy string pooling.
Change-Id: I790cf681c1bffff800d77afb0e2f908d1c827679
Tested: on Linux.
Bug: 26186542
2016-03-07 12:58:36 -08:00
Oli Wilkinson
dbf6702371 Added support for C# partial class generation when the csharp_partial attribute is used on a table/struct. 2016-01-21 15:42:30 +00:00
Oli Wilkinson
112a619ec1 Disabled assignment operator of TableKeyComparator; was causing warning C4512 on VS2010 and thus causing the build to fail. 2016-01-20 18:59:51 +00:00
Mark Klara
69a31b807a Revamping the FlatBuffers docs.
Adding an API reference for the supported languages.

General docs cleanup, including a new `tutorial` section that
supports all of the supported languages.

Added samples for each supported language to mirror the new
tutorial page.

Cleaned up all the links by making them `@ref` style links,
instead of referencing the names of the generated `.html` files.

Removed all generated files that were unnecessarily committed.

Also fixed the C# tests (two were failing due to a missing file).

Bug: b/25801305

Tested: Tested all samples on Ubuntu, Mac, and Android. Docs were
generated using doxygen and viewed on Chrome.

Change-Id: I2acaba6e332a15ae2deff5f26a4a25da7bd2c954
2016-01-19 14:31:17 -08:00
Wouter van Oortmerssen
7d70082590 Merge pull request #3706 from evolutional/fix-3506
Check (& skip) of the utf-8 byte order mark
2016-01-19 11:10:07 -08:00
Wouter van Oortmerssen
6136dd490a Merge pull request #3498 from ncpenke/gcc-4.4.3-support
Gcc 4.4.3 support
2016-01-19 10:27:57 -08:00
Oli Wilkinson
cbe8747b59 Added check (& skipping) of the utf-8 byte order mark (0xEF BB BF) at the beginning of the file 2016-01-18 20:14:39 +00:00
Chandra Penke
b63ebad49d Fix #3497: Add support for compiling in g++ 4.4 and 4.5
- Removed uses of lambda expressions

- Added custom defines for constexpr and nullptr

- Removed trailing comma of last value from generated enums
2016-01-09 06:30:50 -06:00
Wouter van Oortmerssen
586fdee89b Merge pull request #3494 from parnic/fix-vs2012-static-analysis
Fixed MS static analysis warnings
2016-01-06 12:34:08 -08:00
Chris Pickett
178f768f7f Changed how the SA warning is suppressed to avoid pragma stuff 2016-01-06 14:21:18 -06:00
Chris Pickett
a3363def52 Updated comment on endif for new name 2016-01-06 12:21:17 -06:00
Chris Pickett
b4fef31d84 Made requested revisions for naming and spacing 2016-01-06 12:20:38 -06:00
Chris Pickett
cfd6e7dea8 Documented what the suppressed warning is about 2016-01-06 12:04:46 -06:00
Chris Pickett
30013b4ff8 Fixed MS static analysis warnings
Cleaned up a few warnings to allow VS2012 to compile idl_parser and idl_gen_text (for exporting binary protobuf blobs as JSON) cleanly under static analysis.
2016-01-05 13:38:59 -06:00
Chris Pickett
4731c7e502 Fix build for platforms not supporting realpath
Added a check for a preprocessor definition that can be set if the platform you're building for doesn't support any notion of absolute path resolution/realpath()/etc.
2016-01-05 11:04:16 -06:00
Wouter van Oortmerssen
a6a38f6035 Merge branch 'master' of https://github.com/google/flatbuffers
Fixed conflicts and added missing generated files.

Change-Id: I4321c798543292d814c2c9e8b238c203b7526c7b
2016-01-04 13:06:19 -08:00
Wouter van Oortmerssen
451272b618 Made error checking macros less prone to clashes.
Change-Id: Ieb252ce01446551699d935507bc95ee286fe1ddd
Tested: on Linux.
2015-12-29 16:33:00 -08:00
Nalinichandra Penke
13d0594b4c Fix #2775: Add parser option to skip unknown JSON fields 2015-12-22 00:02:19 -08:00
Wouter van Oortmerssen
995ee86a6e Added an IsFieldPresent helper function.
This is implemented as a template function, since Table::CheckField
is not reachable by subclasses of Table (private base class).

Change-Id: I1ed4d47ce7cb672460ccab61cf7442eb9136b0f1
Tested: on Linux.
Bug: 26273432
2015-12-21 12:17:59 -08:00
Wouter van Oortmerssen
40a33b1d06 Replaced exception handling in the parser with error checking.
This to allow the code to run on a greater range of build
configurations (that don't allow exceptions/RTTI).

If anyone ever doubts the usefulness of exception handling,
please show them this commit.

Change-Id: If7190babdde93c3f9cd97b8e1ab447bf0c81696d
Tested: on Linux.
2015-12-21 12:17:59 -08:00
Wouter van Oortmerssen
45bda6e08d Added --gen-all to generate code for a schema and all its includes.
Also refactored the way options are stored.

Change-Id: I709ac908cd2aba396c9c282725cf1d42ccce0882
Tested: on Linux.
2015-12-04 09:44:31 -08:00
Wouter van Oortmerssen
3881bbd651 Multiple schemas parsed by flatc are now parsed independently.
It used to be such that later schemas could depend on earlier
schemas. This was a convenience from days before include files
were implemented. Nowadays they cause subtle bugs rather than being
useful, so this functionality has been removed.

You now need to explicitly include files you depend upon.

Change-Id: Id8292c3c621fc38fbd796da2d2cbdd63efc230d1
Tested: on Linux.
2015-12-02 11:12:39 -08:00
Wouter van Oortmerssen
fc1cfd287a Allow vectors to be aligned beyond their natural type.
Change-Id: I09ade6b688a6b97d65fd832558917225d86c9118
2015-12-02 11:12:39 -08:00
Chris
1d457a0271 Fix use of std::max when Windows.h is imported. 2015-12-02 11:12:39 -08:00