Petteri Aimonen [Thu, 14 Nov 2013 15:56:42 +0000 (17:56 +0200)]
Optimize the common case of 1-byte reads for varints.
For PB_BUFFER_ONLY configuration, this gives 20% speedup without
increasing code size.
Petteri Aimonen [Wed, 13 Nov 2013 20:10:42 +0000 (22:10 +0200)]
Make tests build in a separate folder, add to gitignore
Petteri Aimonen [Mon, 11 Nov 2013 07:22:32 +0000 (09:22 +0200)]
Fix path in FindNanopb.cmake.
Update issue 94
Status: FixedInGit
Petteri Aimonen [Thu, 7 Nov 2013 14:47:14 +0000 (16:47 +0200)]
Setting version to 0.2.5-dev
Petteri Aimonen [Thu, 7 Nov 2013 14:44:41 +0000 (16:44 +0200)]
Publishing nanopb-0.2.4
Petteri Aimonen [Sat, 2 Nov 2013 20:19:26 +0000 (22:19 +0200)]
Add dates to changelog
Petteri Aimonen [Sat, 2 Nov 2013 20:11:27 +0000 (22:11 +0200)]
Update changelog
Petteri Aimonen [Sat, 2 Nov 2013 20:05:49 +0000 (22:05 +0200)]
Generate #define tags for extension fields also.
Update issue 93
Status: FixedInGit
Petteri Aimonen [Tue, 29 Oct 2013 14:32:47 +0000 (16:32 +0200)]
Remove the NANOPB_INTERNALS functions from public API.
These have been deprecated since nanopb-0.1.6 (some since 0.1.3).
Equivalent functions with better interface are available in the API.
Update issue 91
Status: FixedInGit
Petteri Aimonen [Tue, 29 Oct 2013 14:24:50 +0000 (16:24 +0200)]
Declare static functions before use.
For compliance with MISRA C rules (issue 91).
Petteri Aimonen [Tue, 29 Oct 2013 14:19:07 +0000 (16:19 +0200)]
Cleanup of comments.
Petteri Aimonen [Tue, 29 Oct 2013 13:44:35 +0000 (15:44 +0200)]
Add a definition of the security model to the documentation.
Petteri Aimonen [Tue, 29 Oct 2013 13:32:51 +0000 (15:32 +0200)]
Rename some internal functions to have unique names
Petteri Aimonen [Thu, 24 Oct 2013 18:45:39 +0000 (21:45 +0300)]
Detect invalid sizes when encoding bytes fields.
Petteri Aimonen [Thu, 24 Oct 2013 06:52:40 +0000 (09:52 +0300)]
Same fix for EncodedSize.__mul__
Petteri Aimonen [Thu, 24 Oct 2013 05:44:59 +0000 (08:44 +0300)]
Handle also longs in EncodedSize
Petteri Aimonen [Wed, 23 Oct 2013 18:21:43 +0000 (21:21 +0300)]
Fix the size of length prefix for messages in other files.
Petteri Aimonen [Wed, 23 Oct 2013 18:01:11 +0000 (21:01 +0300)]
Generate message size #defines also for messages defined in multiple files.
Add testcase for the same.
Petteri Aimonen [Sun, 20 Oct 2013 18:49:55 +0000 (21:49 +0300)]
Define pb_size_t and pb_ssize_t data types.
Use these in pb_field_t definition to clean up some #ifs, and also
to prepare for solving issue #82.
Petteri Aimonen [Sun, 20 Oct 2013 18:42:00 +0000 (21:42 +0300)]
Check array max size when encoding.
Update issue 90
Status: FixedInGit
Petteri Aimonen [Thu, 26 Sep 2013 07:23:37 +0000 (10:23 +0300)]
Add #defines for the maximum encoded message size.
Update issue 89
Status: FixedInGit
Petteri Aimonen [Wed, 18 Sep 2013 09:47:32 +0000 (12:47 +0300)]
Setting version to 0.2.4-dev
Petteri Aimonen [Wed, 18 Sep 2013 09:44:46 +0000 (12:44 +0300)]
Publishing nanopb-0.2.3
Petteri Aimonen [Fri, 13 Sep 2013 10:41:57 +0000 (13:41 +0300)]
Update changelog
Petteri Aimonen [Fri, 13 Sep 2013 10:35:25 +0000 (13:35 +0300)]
Add a new very simple example
Petteri Aimonen [Fri, 13 Sep 2013 09:59:31 +0000 (12:59 +0300)]
Move examples into subfolders, add READMEs
Petteri Aimonen [Fri, 13 Sep 2013 08:31:45 +0000 (11:31 +0300)]
Merge branch 'dev_get_rid_of_ternary_operator'
Petteri Aimonen [Fri, 13 Sep 2013 08:30:58 +0000 (11:30 +0300)]
Fine-tune the naming of new macros before merging into
Requires re-generation of files generated with dev_get_rid_of_ternary_operator.
Petteri Aimonen [Wed, 11 Sep 2013 14:33:50 +0000 (17:33 +0300)]
Expand extra_fields test to cover field skipping in case of streams.
Petteri Aimonen [Wed, 11 Sep 2013 13:51:53 +0000 (16:51 +0300)]
Disable warning about uint64_t (long long)
Petteri Aimonen [Wed, 11 Sep 2013 13:45:52 +0000 (16:45 +0300)]
Fix build error when path contains spaces
Petteri Aimonen [Wed, 11 Sep 2013 13:13:19 +0000 (16:13 +0300)]
Merge branch 'dev_tests_using_scons'
Petteri Aimonen [Wed, 11 Sep 2013 11:55:56 +0000 (14:55 +0300)]
Add tests for different compilation options
Petteri Aimonen [Wed, 11 Sep 2013 10:42:56 +0000 (13:42 +0300)]
Windows build fixes
Petteri Aimonen [Wed, 11 Sep 2013 10:16:20 +0000 (13:16 +0300)]
Make all the tests ANSI C compatible.
Petteri Aimonen [Wed, 11 Sep 2013 06:53:51 +0000 (09:53 +0300)]
Get rid of the ternary operator in the pb_field_t initialization.
Some compilers where unable to detect that the ternary operator
can be evaluated at the compile time. This commit does the evaluation
on the Python side, which should fix the problem.
The new .pb.c files are generated using PB_FIELD2() macro. The old
PB_FIELD() macro remains, so that previously generated files keep
working.
Petteri Aimonen [Tue, 10 Sep 2013 19:34:54 +0000 (22:34 +0300)]
Move the rest of the tests to scons
Petteri Aimonen [Tue, 10 Sep 2013 17:54:29 +0000 (20:54 +0300)]
Compiler options for GCC, clang and tcc
Petteri Aimonen [Mon, 9 Sep 2013 07:53:04 +0000 (10:53 +0300)]
Move the declarations of _pb_ostream_t and _pb_istream_t before first use.
Otherwise Microsoft Visual C++ threats them as C++ classes instead of plain
structs, forbidding use in C linkage functions.
Thanks to Markus Schwarzenberg for the patch.
Update issue 84
Status: Started
Petteri Aimonen [Tue, 10 Sep 2013 14:44:32 +0000 (17:44 +0300)]
Build fixes for Windows/Visual C++
Petteri Aimonen [Tue, 10 Sep 2013 09:39:39 +0000 (12:39 +0300)]
Add an example pb_syshdr.h file for platforms without C99.
This allows building the tests easily on Visual C++ in C mode.
Also add checks to pb.h that the defined integer types are of
the proper sizes. This may prevent some difficult to debug problems
later..
Petteri Aimonen [Tue, 10 Sep 2013 08:34:57 +0000 (11:34 +0300)]
Convert more test cases to scons
Petteri Aimonen [Mon, 9 Sep 2013 07:53:04 +0000 (10:53 +0300)]
Move the declarations of _pb_ostream_t and _pb_istream_t before first use.
Otherwise Microsoft Visual C++ threats them as C++ classes instead of plain
structs, forbidding use in C linkage functions.
Thanks to Markus Schwarzenberg for the patch.
Update issue 84
Status: Started
Petteri Aimonen [Sun, 8 Sep 2013 16:55:05 +0000 (19:55 +0300)]
Add support for running the nanopb generator as protoc plugin.
Will be used to implement issue 47.
For now, symlink nanopb_generator.py as protoc-gen-nanopb and
use protoc --nanopb_out=. to call it.
Petteri Aimonen [Sun, 8 Sep 2013 14:52:03 +0000 (17:52 +0300)]
Start moving the tests into subfolders. Transition to SCons for build system for the tests.
Only a few tests updated so far. Have to include all the rest before merging to mainline.
Update issue 63
Status: Started
Petteri Aimonen [Sun, 8 Sep 2013 08:05:20 +0000 (11:05 +0300)]
Handle unsupported extension field types more gracefully.
Previously the generator would stop with NotImplementedException as
soon as a required or repeated extension field is found. New behaviour
is to just ignore the unsupported field and note that in a comment
in the generated file.
Furthermore, allow skipping of extension fields using the generator
option (nanopb).type = FT_IGNORE.
Update issue 83
Status: FixedInGit
Petteri Aimonen [Sun, 18 Aug 2013 19:12:31 +0000 (22:12 +0300)]
Setting version to 0.2.3-dev
Petteri Aimonen [Sun, 18 Aug 2013 19:11:38 +0000 (22:11 +0300)]
Publishing nanopb-0.2.2
Petteri Aimonen [Thu, 8 Aug 2013 17:45:30 +0000 (20:45 +0300)]
Update changelog
Petteri Aimonen [Thu, 8 Aug 2013 17:37:59 +0000 (20:37 +0300)]
Document field extensions support
Update issue 17
Status: FixedInGit
Petteri Aimonen [Thu, 8 Aug 2013 17:05:30 +0000 (20:05 +0300)]
Document PB_SYSTEM_HEADER
Petteri Aimonen [Mon, 22 Jul 2013 16:00:04 +0000 (19:00 +0300)]
Finish the testcase for extensions
Petteri Aimonen [Mon, 22 Jul 2013 15:59:15 +0000 (18:59 +0300)]
Fix bugs in extension support when multiple extension fields are present.
Petteri Aimonen [Wed, 17 Jul 2013 17:21:51 +0000 (20:21 +0300)]
Extension support implemented for decoder.
Testing is still needed. Also only 'optional' extension fields
are supported now, 'repeated' fields are not yet supported.
Petteri Aimonen [Wed, 17 Jul 2013 16:29:06 +0000 (19:29 +0300)]
Add test case for extensions decoding
Petteri Aimonen [Wed, 17 Jul 2013 16:23:19 +0000 (19:23 +0300)]
Implement extension support for the encoder
Petteri Aimonen [Tue, 16 Jul 2013 21:06:54 +0000 (00:06 +0300)]
Implement generator support for extension fields (no encoder/decoder support yet)
Petteri Aimonen [Tue, 16 Jul 2013 08:31:38 +0000 (11:31 +0300)]
Fix formatting in documentation
Kent Ryhorchuk [Tue, 16 Jul 2013 01:04:47 +0000 (18:04 -0700)]
Check for empty message type before incrementing required_field_index.
If you have a message that defined as empty, but attempt to decode a
message that has one or more unknown fields then pb_decode fails. The
method used to count the number of required fields counts 1 required
field because the default type of PB_LAST_FIELD is PB_HTYPE_REQUIRED.
Petteri Aimonen [Tue, 16 Jul 2013 08:07:34 +0000 (11:07 +0300)]
Add test case for extra fields in AllTypes
Petteri Aimonen [Sat, 6 Jul 2013 13:16:00 +0000 (16:16 +0300)]
Add pb_decode_delimited and pb_encode_delimited wrapper functions.
Update issue 74
Status: FixedInGit
Petteri Aimonen [Sat, 6 Jul 2013 12:55:15 +0000 (15:55 +0300)]
Clean up the comments in pb_encode.h and pb_decode.h
Petteri Aimonen [Sat, 6 Jul 2013 12:27:31 +0000 (15:27 +0300)]
Add section in pb.h for changing compilation settings.
Update issue 76
Status: FixedInGit
Petteri Aimonen [Sat, 6 Jul 2013 12:25:42 +0000 (15:25 +0300)]
Add error message macros to API reference.
Petteri Aimonen [Sat, 6 Jul 2013 10:49:47 +0000 (13:49 +0300)]
Document the .options file usage.
Also add note about the 'packed' message option being incompatible
with CPUs that do not support unaligned access.
Update issue 12
Status: FixedInGit
Update issue 77
Status: FixedInGit
Petteri Aimonen [Sat, 6 Jul 2013 10:01:21 +0000 (13:01 +0300)]
Switch the example project to use the new .options file
Petteri Aimonen [Mon, 3 Jun 2013 19:46:19 +0000 (22:46 +0300)]
Include the field tags in the generated .pb.h file.
Patch from Michael Haberler.
Petteri Aimonen [Sun, 14 Apr 2013 07:07:46 +0000 (10:07 +0300)]
Setting version to 0.2.2-dev
Petteri Aimonen [Sun, 14 Apr 2013 07:06:47 +0000 (10:06 +0300)]
Publishing nanopb-0.2.1
Petteri Aimonen [Sun, 14 Apr 2013 07:04:46 +0000 (10:04 +0300)]
Update changelog
Petteri Aimonen [Sun, 14 Apr 2013 06:46:39 +0000 (09:46 +0300)]
Handle unterminated strings when encoding.
If the null terminator is not present, string will be limited to the
data size of the field.
If you are still using the pb_enc_string (deprecated since 0.1.3) from
callbacks, now would be an excellent time to stop. The pb_field_t for
the callback will not contain proper data_size. Use pb_encode_string()
instead.
Update issue 68
Status: FixedInGit
Petteri Aimonen [Sun, 14 Apr 2013 06:26:42 +0000 (09:26 +0300)]
Fix bug with empty strings in repeated string callbacks.
Fix suggested by Henrik Carlgren. Added also unit test for the bug.
Update issue 73
Status: FixedInGit
Petteri Aimonen [Mon, 8 Apr 2013 08:00:28 +0000 (11:00 +0300)]
Avoid maybe-uninitialized warning
Patch from dch.
dch [Sun, 7 Apr 2013 14:28:51 +0000 (15:28 +0100)]
No need to include stdbool.h separately
dch [Sun, 7 Apr 2013 14:28:05 +0000 (15:28 +0100)]
__pragma keyword is only supported by recent Microsoft compilers
Petteri Aimonen [Tue, 2 Apr 2013 17:01:31 +0000 (20:01 +0300)]
Do not generate has_ fields for callback fields.
The arg field can be used to store the field presence from inside
the callback. Furthermore, having the has_ field for encoding callbacks
would be more annoying than useful.
Update issue 70
Status: FixedInGit
Petteri Aimonen [Tue, 2 Apr 2013 16:55:21 +0000 (19:55 +0300)]
Change the callback function to use void**.
NOTE: This change breaks backwards-compatibility by default.
If you have old callback functions, you can define PB_OLD_CALLBACK_STYLE
to retain the old behaviour.
If you want to convert your old callbacks to new signature, you need
to do the following:
1) Change decode callback argument to void **arg
and encode callback argument to void * const *arg.
2) Change any reference to arg into *arg.
The rationale for making the new behaviour the default is that it
simplifies the common case of "allocate some memory in decode callback".
Update issue 69
Status: FixedInGit
Petteri Aimonen [Wed, 13 Mar 2013 13:34:12 +0000 (15:34 +0200)]
Fix warning on clang.
Update issue 67
Status: FixedInGit
Petteri Aimonen [Wed, 13 Mar 2013 13:22:00 +0000 (15:22 +0200)]
Add support for packed structures on IAR and MSVC.
Update issue 66
Status: FixedInGit
Petteri Aimonen [Sat, 9 Mar 2013 21:03:09 +0000 (23:03 +0200)]
Make the generator options accept a file name in addition to format string.
Petteri Aimonen [Sat, 9 Mar 2013 12:56:34 +0000 (14:56 +0200)]
Add PB_SYSTEM_HEADER compile time option.
This allows replacing the C99 standard include file names with
a single system-specific file. It should provide all the necessary
system functions (typedefs, memset, memcpy, strlen).
Update issue 62
Status: FixedInGit
Petteri Aimonen [Sat, 9 Mar 2013 12:52:38 +0000 (14:52 +0200)]
Rename pb_field_iterator_t field 'current' to 'pos'.
This avoids a name clash when compiling as Linux kernel module.
Update issue 60
Status: FixedInGit
Petteri Aimonen [Sat, 9 Mar 2013 12:49:15 +0000 (14:49 +0200)]
Implement error message support for the encoder side.
Update issue 7
Status: FixedInGit
Petteri Aimonen [Sat, 9 Mar 2013 12:45:41 +0000 (14:45 +0200)]
alltypes.proto no longer needs to include nanopb.proto
Petteri Aimonen [Sat, 9 Mar 2013 12:23:44 +0000 (14:23 +0200)]
Switch alltypes.proto to use the new .options file mechanism.
Petteri Aimonen [Sat, 9 Mar 2013 12:21:21 +0000 (14:21 +0200)]
Add simple support for separate options file.
Update issue 12
Still needs documentation.
Petteri Aimonen [Sat, 9 Mar 2013 11:12:09 +0000 (13:12 +0200)]
Fix additional bug with empty message types.
pb_field_next() would access past the fields array.
Petteri Aimonen [Sat, 9 Mar 2013 11:09:14 +0000 (13:09 +0200)]
Add option to run the tests with mudflap to detect pointer errors.
Petteri Aimonen [Sat, 9 Mar 2013 10:51:47 +0000 (12:51 +0200)]
Improve the fuzztest.
Enable -fstack-protector-all to detect any stack smashing bugs. Also
use test_decode3 for maximal vulnerable surface.
Petteri Aimonen [Sat, 9 Mar 2013 10:43:35 +0000 (12:43 +0200)]
Fix error in backwards compatibility testcase
Petteri Aimonen [Sat, 9 Mar 2013 10:35:07 +0000 (12:35 +0200)]
Fix bug with decoding empty message types. Add test for the same.
Note: the bug only applies to empty message types. Empty messages
of non-empty message types are not affected.
Update issue 65
Status: FixedInGit
Petteri Aimonen [Wed, 6 Mar 2013 16:02:57 +0000 (18:02 +0200)]
Add a dummy field if struct would otherwise be empty.
Update issue 64
Status: FixedInGit
Petteri Aimonen [Mon, 4 Mar 2013 17:27:42 +0000 (19:27 +0200)]
Add generator option to configure #include directives.
This suits complex projects, where there are multiple interdependent .proto files
in various directories. Patch by Michael Haberler.
Petteri Aimonen [Sat, 2 Mar 2013 14:35:17 +0000 (16:35 +0200)]
Setting version to 0.2.1-dev
Petteri Aimonen [Sat, 2 Mar 2013 14:32:54 +0000 (16:32 +0200)]
Publishing nanopb-0.2.0
Petteri Aimonen [Sat, 2 Mar 2013 14:32:15 +0000 (16:32 +0200)]
Update changelog
Petteri Aimonen [Sat, 2 Mar 2013 14:27:31 +0000 (16:27 +0200)]
Update documentation
Petteri Aimonen [Thu, 28 Feb 2013 14:42:34 +0000 (16:42 +0200)]
Add --extension option to generator.
Patch courtesy of Michael Haberler.
Pavel Ilin [Thu, 31 Jan 2013 18:01:09 +0000 (19:01 +0100)]
Added CMake file for use in projects linking against nanopb.
Petteri Aimonen [Thu, 21 Feb 2013 17:38:56 +0000 (19:38 +0200)]
Merge branch 'dev-0.2'