* Correct the usage in the flathash program
As it is possible to have -- before the occurrence of the first
input STRING.
* Exit with 1 in the flathash program when an error occurs
This to support code that relied on tables being multiline,
but not vectors.
This behavior was changed in:
b1a925dfc2 (diff-c45c8fbffbc64f7ff4aa2978612b10d8)
Change-Id: I4c95471b643b2b3fab95e06b1294e19d686b492c
This was incompatible with -Wc++98-c++11-compat on some platforms,
due to local variables in the function.
Change-Id: Idef510c2cefe944eef2e0656f5a219c2158063e6
implement better custom string type constructor alternative
for Unpack() and fix bug with vector of custom string types
in Pack().
Squashed commit of the following:
commit e9519c647e
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:24:49 2019 +0100
tests: regenerate code, reverts change to CreateVectorOfStrings().
commit 117e3b0679
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:15:05 2019 +0100
idl_gen_cpp.cpp: move clang-format on/off outside of declaration, so they are kept properly aligned automatically.
commit 4791923806
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:11:40 2019 +0100
idl_gen_cpp.cpp: full clang-format run with provided Google format file, enforce 80 lines width.
commit 2f0402f9ff
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Tue Mar 5 18:09:32 2019 +0100
CppUsage: address requested changes.
idl_gen_cpp.cpp: fix formatting, keep CreateVectorOfStrings for normal string cases.
commit 371d4e0b79
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 16:35:29 2019 +0100
Fix compile error with a vector of non-std::strings. CreateVectorOfStrings() expects a vector of std::string types, but that's not always the case.
commit 92b90d7f0f
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 16:15:36 2019 +0100
Document requirement for custom string types to implement empty() and be constructible from std::string.
Add new option --cpp-str-flex-ctor to construct custom string types not via std::string, but (char * + length).
commit 28cb2e92d5
Author: Luca Longinotti <luca.longinotti@inivation.com>
Date: Fri Mar 1 14:31:17 2019 +0100
idl_gen_cpp.cpp: clang-format run, to better separate changes in content from formatting.
Change-Id: I4887ba2f2c632b9e7a8c938659b088cd95690870
* Don't use inner attributes for `allow`
Messes with being able to easily include elsewhere
* Regenerate tests
* No-op to retrigger CI
* Add the rest of the `allow` attributes
Thanks for tackling this, @tymcauley !
* big endian docker test -- wip
* tweaks
* tweaks
* tweaks
* docker tweaks
* fix conditional compilation issues
* reactivate other docker tests
* try some more cross-platform config (from tymcauley)
* Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1
Co-Authored-By: rw <rw@users.noreply.github.com>
* Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1
Co-Authored-By: rw <rw@users.noreply.github.com>
* Update tests/docker/languages/Dockerfile.testing.rust.big_endian.1_30_1
Co-Authored-By: rw <rw@users.noreply.github.com>
* Resolved Rust warnings during big-endian builds.
* Unify Rust test suites for x86 and MIPS builds.
Note that I had to add four extra packages to the MIPS `Dockerfile`:
`libexpat1`, `libmagic1`, `libmpdec2`, and `libreadline7`. For a reason
I couldn't identify, even the simplest Rust MIPS binaries run with
`qemu-mips` would fail with a segfault when run through this
`Dockerfile`. After installing the `gdb-multiarch` package to attempt to
debug the issue, the binaries ran successfully. I pared down the
packages installed by `gdb-multiarch`, and these four packages are the
minimum subset necessary to get Rust MIPS binaries running under
`qemu-mips`.
* Changed Rust tests to use `Vector`s instead of direct-slice-access.
The direct-slice-access method is not available on big-endian targets,
but `flatbuffers::Vector`s provide an array interface that is available
on all platforms.
* Resolved FooStruct endianness issues using explicit struct constructor.
This more closely resembles how FlatBuffers structs are constructed in
generated Rust code.
* Added explanation of how `FooStruct` parallels generated struct code.
Also collected duplicate implementations of `FooStruct` into a common
location.
* Stop building for Windows until the build passes
ERROR: D:/b/bk-windows-java8-bd0z/bazel/flatbuffers/BUILD:123:1: Couldn't build file _objs/flatbuffers_test/test.obj: undeclared inclusion(s) in rule '//:flatbuffers_test':
this rule is missing dependency declarations for the following files included by 'tests/test.cpp':
'tests/monster_test_generated.h'
'tests/monster_extra_generated.h'
The files in tests are being found instead of the generated files since
Windows doesn't have any sandboxing. For now, let's disable the rules
and come back to it.
* Fix buildifier warnings
Clean up docstrings and add a module docstring.
* Fix lifetime in union _as_ accessors
In the accessors for union field, the return value is implicitly taking the lifetime of &self.
This is irrelevant and prevents usages of the returned value, because it is needlessly bound to the parent field lifetime.
This patch makes the return value inherit the lifetime of the data, like other methods do.
vtable and vtable size depends only on `Table#bb_pos` but calculated in
`Table#_offset` method on each field lookup.
Doing this with every call of `Table#__offset` is redundant.
These values can be read once with change of `Table#bb_pos` and reused
for any field lookup.
Fixed a bug that prevented vtable reuse during buffer construction in the lua library.
Also fixed a bug in vtable equality check that was revealed after the first fix.
On Solaris Sparc, calling NumToString() with a char called the primary
version, not the signed char or unsigned char specializations, which
caused integer to string conversions to be missed.
For some reason, Offset<T> is being considered a scalar, which
causes EndianSwap to be passed an Offset<T>. This doesn't work,
as it does not support types with non-trivial constructors. This
change adds an overload to WriteScalar(), which works around this.
* Remove byte* property in ByteBufferAllocator.
This allows consumers to read/write into native memory, but without
having to always pin the managed `byte[]` when working with managed
memory. This allows for users to not need to Dispose() ByteBuffers
when they are using the default ByteArrayAllocator class.
Instead, we use `Span<byte> GetSpan()` methods to get access to the
underlying memory buffer.
Fix#5181
* Add a set of benchmark tests.
* Add ReadOnly spans.
This allows consumers to use ReadOnlyMemory<byte> as the backing storage
for ByteBuffers, which is useful in read-only scenarios.
* Run tests using ENABLE_SPAN_T in appveyor.
* Fix FlatBuffers.Test.csproj to work on older MSBuild versions.
* Change the test script to test UNSAFE_BYTEBUFFER
* Address PR feedback.
Remove IDisposable from ByteBuffer.
* Respond to PR feedback.
* Add RPM packaging support
Using the existing PackageDebian as template add support for
generating an rpm with the package target.
* Restore debian package target
Also add an option to advertise the fact.
* Update package description
C-n-p from README.md
* Update rpm package maintainer
* Add utility for checking the encoding of source files
- accept source files with ASCII or UTF-8 without BOM
- accept only CRLF line ending
* Fix non-ascii symbol in idl_parcer.cpp
* Remove BOM from test.cpp
There is a test code error that causes the CanReadCppGeneratedWireFile test to fail when ENABLE_SPAN_T is defined. When TestarrayofboolsLength is not 0, then the GetTestarrayofboolsBytes() should have a length.