Age | Commit message (Collapse) | Author | Files | Lines |
|
This supports platforms where uint8_t does not exist.
If you are using a custom pb_syshdr.h, this may require adding
definitions for uint_least8_t etc.
|
|
This will still catch the most common bug of long int vs. long long int.
The uint8_t checks do not seem necessary, test for this will be added
in later commit.
|
|
This was never very clean code, but it was fast. Hopefully
compilers are smart enough to optimize it away, or the speed
difference is not very large. This should be checked.
However working code is always more important than fast code,
and the previous way couldn't really work for platforms that
do not have byte-sized memory access. Related to PR #191.
|
|
pb_istream_from_buffer: add const to prototype
|
|
This commit changes the prototype for pb_istream_from_buffer from:
pb_istream_t pb_istream_from_buffer(uint8_t *buf, size_t bufsize);
to
pb_istream_t pb_istream_from_buffer(const uint8_t *buf, size_t bufsize);
This allows pb_istream_from_buffer users to point to const buffers
without having to inspect code (to ensure practical const-ness) and then be
forced to manually cast away const.
In order to not break compatibility with existing programs (by
introducing a const/non-const union in the pb_istream_t state) we simply
cast away the const in pb_istream_from_buffer and re-apply it when
possible in the callbacks. Unfortunately we lose any compiler help in
the callbacks to ensure we are treating the buffer as const but manual
inspection is easy enough.
|
|
|
|
Add testcase for the same.
|
|
|
|
|
|
Fixes compilation error with anonymous unions when
it is not the last field in message. Also fixes
extraneous newlines in header file. Cleanup the
pb.h extraneous use of ##.
|
|
|
|
|
|
|
|
Cmake updates
|
|
* No need to specify the src path and the module path. Let cmake do it.
|
|
* Use CMAKE_CURRENT_LIST_DIR to learn the path of the currently running
file to determine location of NanoPB.
* Simplifies use in other projects.
|
|
Treat the source directory as immutable. Copy the generator directory
which previously generated files in-tree to the build directory and
then generate files.
Many emerging continuous integration build systems test builds across
multiple versions of dependencies protobuf and python versions in
particular. The previous source tree builds resulted in stale files
from the last build breaking the current build. By placing the build
files in the build directory, the build system automatically removes
stale files (removes output build directory) and regenerates them as
necessary.
|
|
generator: Remove trailing whitespace
|
|
* Remove trailing whitespace
* No functional changes
|
|
This bug was triggered when:
1. A .proto file included another .proto from a different directory.
2. The another .proto has an associated .options file.
Added regression test for the same.
|
|
|
|
The fread call always returned a message length of 1 byte,
making the fuzz stub used for external fuzzers useless. The
normal fuzztest.c was unaffected.
Bug found using afl-fuzz.
|
|
|
|
|
|
|
|
|
|
Add Travis CI Support
|
|
Add proper Python3 support to the generator
|
|
|
|
|
|
|
|
decode: Fix compiler issue with gcc-5
|
|
* gcc 5.0 and 5.1 appear to take issue with this line and generates the
following error:
/home/nitro/tmp/nanopb/pb_decode.c: In function ‘pb_decode_noinit’:
/home/nitro/tmp/nanopb/pb_decode.c:889:60: error: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Werror=conversion]
fields_seen[iter.required_field_index >> 3] |= (uint8_t)(1 << (iter.required_field_index & 7));
^
* This seems like a compiler bug, but this workaround is harmless.
|
|
* Still in testing currently.
|
|
* Test a number of C compilers
* Travis CI can't handle three languages (C, C++, Python)
* Add support for swapping python2/3 binaries
* Scons has made no attempts to support python3 yet:
* Build the matrix manually
* Scons doesn't inherit $CC/$CXX from parent environement,
so pass compiler flags directly
|
|
* Search $PATH for the python binary so that this works better with
things like virtualenv as used on Travis CI
|
|
* Initial working build for Travis CI build system.
|
|
* Work around this by checking the appropriate class for the given
* environment.
|
|
* This is a shot in the dark.
|
|
* Not sure how to handle this case in python2, seems to work
* Python 3 doesn't need this since all strings are utf-8
|
|
* Python3 ignores cmp() and __cmp__() and only needs __lt__() for
sorting. Delete and update as appropriate.
* Ref: https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
|
|
Create a FieldMaxSize class that:
* Accumlates all C assertions
* Handles the checking of the longest simple field
* Also python3 doesn't support max(None)
|
|
* This works with python2 and python3
|
|
* Invoked with `2to3 -w nanopb_generator.py`
* No other changes.
|
|
* Use the system python binary and make sure the generator works with
both instead.
|
|
Python2 is being phased out of the default python interpreter. Arch
Linux has moved some time ago and upcoming Debian realeases will follow.
My distro, Arch, doesn't have a python2-protobuf version, but does have
a python3 version. With a python 2 & 3 compatible generator the exact
interpreter can be ignored and can use the system default as most users
expect.
Update issue #155
|
|
|
|
Eliminates a warning on protoc 3.0.
|
|
|
|
This will allow message sizes and enum options to be available
across the include files.
Currently searching for .options files for included files may
not work for all path combinations, this is related to issue #116.
Should probably make a pull request to protoc about that.
|