Const does not make sense here, and compiler actually throws warning
(error with -Werror) when you would try to compile it.
In file included from include/flatbuffers/flexbuffers.h:24,
from include/flatbuffers/idl.h:26,
from include/flatbuffers/code_generators.h:22,
from src/code_generators.cpp:17:
include/flatbuffers/util.h: In function ‘int flatbuffers::FromUTF8(const char**)’:
include/flatbuffers/util.h:325:44: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
if ((static_cast<const unsigned char>(tmp) << len) & 0x80) return -1; // Bit after leading 1's must be 0.
^
cc1plus: all warnings being treated as errors
This warning caught by gcc8:
$ g++ --version
g++ (GCC) 8.0.1 20180222 (Red Hat 8.0.1-0.16)
An assert in flexbuffers was bit-shifting a 64-bit number by
64 bits, which throws up warnings in some automated tools.
The same assert also checks to see if the number of bytes
being shifted is 8. Swapped the order, so that the bitshift
only occurs if the number of bits being shifted is not 64.
Should be the same behavior, but plays nicer with diagnostic
tools.
* Added '--oneof-union' option.
Used with the .proto -> .fbs converter, will translate protobuff oneofs to flatbuffer unions.
Updated proto test to check both methods of converting oneofs.
* Added '--oneof-union' option.
Used with the .proto -> .fbs converter, will translate protobuff oneofs to flatbuffer unions.
Updated proto test to check both methods of converting oneofs.
* FlatBuffers: Moved MakeCamel() into idl_parser.cpp
Removes library dependency on Java/C# generator code.
Lookup type of nested flatbuffer field with either raw name or fully qualified name as already done in the parser.
LookupCreateStruct tries both the raw name and the fully qualified one.
Without this, we cannot reference types outside of the current namespace, e.g. in a different module.
* added intended use-cases to monster_test.fbs
* added check for `cpp_ptr_type` on hashed fields
added default value 'naked' to `cpp_ptr_type` on hashed fields
* added C++ generation of cpp_type vectors
removed ctor call for vector fields
added condition !vector for cpp_type check
added Pack() and UnPack() code generation for vector of hashes
added generation of correct resolve/rehash for cpp_type elements
* added attribute 'cpp_ptr_type_get' to hold accessor for pointer types possible where '.get()' does not work
use case: cpp_ptr_type:"std::weak_ptr", cpp_ptr_type_get:".lock().get()"
* run flatc to re-generate headers
* added bool param is_ctor to GetDefaultScalarValue() to differentiate between usage places
* modified monster_test.fbs to remove usage of shared_ptr/weak_ptr
reason: STLport does not support std::shared_ptr and std::weak_ptr
* run flatc again to re-generate headers
* fixed symbol unique_ptr not in namespace std when building with STLport
* 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
As Error does not inherit from Exception, a generic `catch(Exception ex)` will not catch this error.
A simple change from `Error` to `Exception` is not sufficient as an `Exception` is checked by the compiler, so in order to keep this issue unchecked, I am proposing raising a `RuntimeException` which is not checked, but is still a subclass of `Exception`.
The only possible breaking change would be if a consumer was explicitly catching `Error` already for this library.
https://github.com/google/flatbuffers/issues/4629
* added support for parsing hash on vector elements
reversed check for scalar to check for vector
added C++ generation of cpp_type vectors
removed ctor call for vector fields
added condition !vector for cpp_type check
added Pack() and UnPack() code generation for vector of hashes
* schema change:
added table Referrable and weak references towards it from Monster
added single_weak_reference to Monster table
changed order with vector_of_weak_references
* re-generated monster schema dependent code
added Referrable.cs to FlatBuffers.Test.csproj
It was missing some helpers when we choose to use
size prefixed FlatBuffers.
* Add general helper : GetPrefixedSize
* Add generated helpers :
* GetSizePrefixedXXX
* VerfifySizePrefixedXXXBuffer
* FinishSizePrefixedXXXBuffer
* mini_reflect: Add DefaultTypeTable
Currently it's very easy to make a mistake when it comes to
instantiating the TypeTable to print a buffer because it is not type
safe.
This will allow us to write safer cpp code:
flatbuffers::FlatBufferToString(reinterpret_cast<const uint8_t *>(&t),
decltype(t)::DefaultTypeTable());
* c++: mini_reflect: update generated code
* Ensure types and names are set for mini_reflect
* c++: mini_refelct: update unit tests with new typed TypeTable
* Adding PR feedback of sylte and naming convention
* 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
src/idl_parser.cpp: In member function 'flatbuffers::CheckedError flatbuffers::Parser::ParseHexNum(int, uint64_t*)':
src/idl_parser.cpp:220:62: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
if (!isxdigit(static_cast<const unsigned char>(cursor_[i])))
^
src/idl_parser.cpp: In member function 'flatbuffers::CheckedError flatbuffers::Parser::Next()':
src/idl_parser.cpp:260:62: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
if(!isdigit(static_cast<const unsigned char>(*cursor_))) return NoError();
^
cc1plus: all warnings being treated as errors
- Fixed ForceVectorAlignment (and possibly other call-sites) not
setting minalign_.
- Fixed flipped alignment parameters in CopyTable (reflection).
- Made aligment for FlatBufferBuilder internal buffer configurable
(useful when reading a constructed buffer directly).
- Ensured Alignment rounding is always up.
Change-Id: I33ca4887d92a09cb11a369c14a109f4b07ae707a
Tested: on Linux.
Some implementations (e.g. C++98) won't support 64-bit enum values,
but there is no reason to silently truncate them.
Change-Id: I8629563523a96e887068f9c0efcd53741f60e0d6
Tested: on Linux.
Date: Mon Jan 15 11:38:20 2018 -0200
Compilation failure with grpc.h
If cmake run with flag FLATBUFFERS_BUILD_GRPCTEST=ON
compilation fails.
Fix :
-Fix argument list for overriden function in grpc.
-Fix member function name called by FlatBufferBuilder from
buf() to scratch_data()
Previously, FlatBufferBuilder used 3 resizable buffers:
- serialization (vector_downward)
- field offsets (std::vector)
- vtable offsets (std::vector)
Since the serialization buffer grows downwards, the bottom part of
it can be used as a "scratchpad" storage for the other two. Since
field offsets are only accumulated during table construction, and
vtable offsets only after table construction, the two can trivially
share the same storage.
Not only does this reduce the amount of allocation, it also removes
the bulk of std::vector usage from FlatBufferBuilder which was
the #1 cause of slow-down in debug mode, see e.g.:
https://stackoverflow.com/questions/36085285/any-way-to-improve-flatbuffer-performance-in-debug-c-msvc
Change-Id: I0224cf2f2a863d2d7ef762bc9163b52fdc149522
Tested: on Linux.
Without this change, the compiler tries to select the following overload
when CreateString is passed a `char *`:
template<typename T>
Offset<String> CreateString(const T &str) {
return CreateString(str.c_str(), str.length());
}
which is not valid since char pointers don't have methods.
(Fixes#4579)
Signed-off-by: Andrew Gunnerson <chenxiaolong@cxl.epac.to>
Avoids the following compile error when char is unsigned:
error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-unsigned-zero-compare]
* new maven jar called flatbuffers-java-grpc which contains utility class supporting generated code for grpc over flatbuffers; grpc java unit test based on maven and junit (maven is used only for simplicity of testing); removed straneous namespace_test/NamespaceA/TableInC.java which is not longer used in the test and no longer generated but contains complilation errors if java compiler picks it up
* moved java grpc tests files according to review request
* Added missing generated code for Java gRPC.
Change-Id: Iada090fe2e99b80a4b7c2f8e39c838a992a1feae
* added missing name and url