260 Commits

Author SHA1 Message Date
Robert Edmonds
c797b07eec protobuf-c/: gratuitous style changes
dave's original style drives me crazy. reformat the C code in
protobuf-c/ with "indent -kr -i8" and manually reflow for readability.

try to fit most lines in 80 columns, but due to the lengthy type and
function names in protobuf-c, enforcing an 80 column rule would result
in a lot of cramped statements, so try to fit lines in up to 100 columns
if it would improve readability. (e.g., one <=100 column line is
probably better than 3-4 <=80 column lines.)

ultimately i'd like to adopt most of the recommendations in the linux
coding style: https://www.kernel.org/doc/Documentation/CodingStyle.
this commit gets us most of the kernel indentation and comment coding
style recommendations. later commits will tackle style recommendations
that require more intrusive changes: breaking up large functions,
replacing macros that affect control flow (e.g., DO_ALLOC). this will
hopefully facilitate review and make the code base easier to maintain.

i ran the old and new versions of protobuf-c.c through something like:

  gcc -S -D__PRETTY_FUNCTION__=0 -D__FILE__=0 -D__LINE__=0 -Wall -O0 \
    -o protobuf-c.S -c protobuf-c.c

and reviewed the diffs of the assembly output to spot any functions that
changed, and went back to make sure that any differences were
functionally equivalent.
2014-01-11 13:41:11 -05:00
Robert Edmonds
934ff223db README.md: update due to the protobuf-c-rpc split out 2014-01-10 13:25:11 -05:00
Robert Edmonds
e3c49dfff2 TODO: remove protobuf-c-rpc 2014-01-10 13:25:11 -05:00
Robert Edmonds
ce1c8bbeb5 protobuf-c-rpc/: remove 2014-01-10 13:25:11 -05:00
Robert Edmonds
10e451eb6a .gitignore: remove protobuf-c-rpc 2014-01-10 13:25:11 -05:00
Robert Edmonds
5c4f8eafa7 .travis.yml: remove protobuf-c-rpc 2014-01-10 13:25:11 -05:00
Robert Edmonds
410a5b8e4e configure.ac: remove protobuf-c-rpc 2014-01-10 13:25:11 -05:00
Robert Edmonds
e8a55cf186 Makefile.am: remove protobuf-c-rpc 2014-01-10 13:25:11 -05:00
Ilya Lipnitskiy
0e9f999aa8 protobuf-c/protobuf-c.c: do not print unpack errors by default
(fixes #26)
2013-12-21 00:05:11 -08:00
Nick Galbreath
c1ff5d6bad protobuf-c/protobuf-c.c: prevent possible overflow on 64-bit systems
(fixes #106)
2013-12-20 23:45:19 -08:00
Ilya Lipnitskiy
b915eed32f protobuf-c/protobuf-c.c: fix compiler warnings (fixes #115)
protoc-c/c_enum.cc: fix compiler warnings
protoc-c/c_field.cc: fix compiler warnings
2013-12-17 00:08:42 -08:00
Robert Edmonds
9f39b7621e LICENSE: add a statement about the ownership of protoc-c output
Signed-off-by: Dave Benson <lahiker42@gmail.com>
2013-12-09 14:09:10 -05:00
Robert Edmonds
db4ab0ee85 ChangeLog: fix trailing whitespace 2013-12-09 14:08:57 -05:00
Ilya Lipnitskiy
ffb1c2462a protobuf-c/protobuf-c.c: add explicit casts in parsing functions for
better compatibility with 8- and 16-bit platforms (integrate fixes
from #47)
2013-12-03 22:40:40 -08:00
Ilya Lipnitskiy
5b3ac9ca97 protobuf-c.c: wrap DO_ALLOC macro in a do {} while(0) statement 2013-12-02 15:43:08 -08:00
Ilya Lipnitskiy
3ec5aa1256 protobuf-c-rpc/protobuf-c-rpc.c: remove the duplicate call to
protobuf_c_dispatch_close_fd() (fixes #82)
2013-11-27 16:13:24 -08:00
Ilya Lipnitskiy
b5b1d4e907 protobuf-c/protobuf-c.{c,h}: remove the unused protobuf_c_system_allocator 2013-11-27 15:53:56 -08:00
Ilya Lipnitskiy
b1056e922a protobuf-c-rpc/protobuf-c-rpc.c: perform a more thorough message
check for server closures (responses) to not crash the server in case of
a malformed message (related to #76)
2013-11-27 15:21:40 -08:00
Ilya Lipnitskiy
fb39c17616 protobuf-c/protobuf-c.c: add a few extra checks to
protobuf_c_message_check
2013-11-27 15:21:02 -08:00
Ilya Lipnitskiy
746ea972bc protobuf-c/protobuf-c.c: fix a logic error when a failed merge would
leave a dangling pointer to the parsed submessage
2013-11-22 17:37:09 -08:00
Ilya Lipnitskiy
7b665e9ce4 protobuf-c/protobuf-c.c: add return code check to merge_messages calls 2013-11-22 17:31:00 -08:00
Robert Edmonds
54464b90c4 ChangeLog: Issue #91 2013-11-22 19:48:44 -05:00
Ilya Lipnitskiy
b00f6d221c t/generated-code2/test-generated-code2.c: Rename test_optional_merge to
test_field_merge
2013-11-22 16:35:19 -08:00
Ilya Lipnitskiy
f4b9fd20a5 protobuf-c/protobuf-c.c: add functionality to merge multiple instances
of the same field on the wire (Fixes #91)
t/generated-code2/test-generated-code2.c: add a test case for merging
messages
t/test-full.proto: expand message definitions to test for merging nested
messages
2013-11-22 15:34:07 -08:00
Robert Edmonds
1f5e813fe7 protobuf-c/protobuf-c.c: the no_unpacking_needed case only executes on little endian 2013-11-21 17:13:11 -05:00
Robert Edmonds
49faa55bc2 IS_LITTLE_ENDIAN -> !defined(WORDS_BIGENDIAN)
this simplifies the AC_C_BIGENDIAN invocation.
2013-11-21 17:12:00 -05:00
Robert Edmonds
97c43baba3 there's no protobuf-c-config.h file with the new build system 2013-11-20 15:30:15 -05:00
Robert Edmonds
7c7cc361b5 ChangeLog: 0.16 updates 2013-11-20 15:04:46 -05:00
Robert Edmonds
3b3f78ce5d Makefile.am: bump libprotobuf-c SONAME 2013-11-20 15:04:24 -05:00
Robert Edmonds
79f2767e1c remove alloca() remnants 2013-11-20 14:41:54 -05:00
Ilya Lipnitskiy
5f122c44e0 protoc-c/main.cc: add a version string to protoc-c based on the
PACKAGE_STRING provided by autotools (fixes #52)
2013-11-19 00:11:05 -08:00
Ilya Lipnitskiy
59688a92b3 protobuf-c-rpc/protobuf-c-rpc.c: free the timer created by autoreconnect
in case the client has failed to connect and got destroyed (fixes #70)

protobuf-c-rpc/t/test-rpc.c: add a test case for #70
2013-11-18 22:22:46 -08:00
Ilya Lipnitskiy
5d74333219 protobuf-c-rpc/protobuf-c-rpc.c: handle server responses with NULL
messages on the client side (fixes #78)

protobuf-c-rpc/t/test-rpc.c: add a test case for #78
2013-11-18 22:14:36 -08:00
Ilya Lipnitskiy
4610a0d40e protobuf-c-rpc/protobuf-c-rpc.c: rename AF_LOCAL to AF_UNIX (Fixes #100) 2013-11-18 22:03:42 -08:00
Ilya Lipnitskiy
e9529ac463 .gitignore: Ignore temporary files that end with ~ 2013-11-18 21:08:53 -08:00
Ilya Lipnitskiy
0508aa0d6e protoc-c/c_file.cc: Add source .proto file name to the generated files 2013-11-18 21:05:44 -08:00
Robert Edmonds
2689e06257 README.md: add a section on contributing patches 2013-11-18 20:41:22 -05:00
Robert Edmonds
23c9b03ea7 update copyright and license statements throughout
per https://code.google.com/p/protobuf/source/detail?r=50, the license
on google-originated protobuf code was switched from Apache-2.0 to
BSD-3-Clause (so-called "New BSD" license). update any of the google
license statements to use this new license.

per email with dave, drop the third clause on his BSD-3-Clause license,
so this now becomes BSD-2-Clause.

make sure to use consistent indentation and wrapping throughout.
2013-11-18 20:25:34 -05:00
Robert Edmonds
92b11ac5db protobuf-c/protobuf-c.h: update PROTOBUF_C_MINOR 2013-11-18 18:17:10 -05:00
Robert Edmonds
12b18decb2 README.md: expand the overview, and add a brief build/usage synopsis 2013-11-18 18:14:46 -05:00
Robert Edmonds
aab12f20bc .travis.yml: use system protobuf packages and build using distcheck
the change that required protobuf >= 2.5.0 has been reverted, so there's
no need to build protobuf from source. use the system protobuf packages
instead.

also use distcheck to build and check the distribution. this will run
the test suite and perform various other checks. it will also perform a
VPATH build using the distribution tarball, which will catch any files
present in the git repository but inadvertently not distributed in the
tarball.

also test the build when configured with "--enable-rpc".
2013-11-18 14:35:52 -05:00
Robert Edmonds
9e86cda282 Makefile.am: protobuf-c-rpc/: make sure that the gsk* header files get distributed 2013-11-18 14:32:57 -05:00
Robert Edmonds
c64da22059 configure.ac: add the protobuf version to the configure summary 2013-11-18 14:32:31 -05:00
Robert Edmonds
4142d7e92e build system: remove --disable-protoc option
for some reason, "make distcheck" fails when the build is configured
with --disable-protoc. i haven't been able to track down the root cause
(it appears the build is trying to generate the generated pb-c files for
the test cases, but the test cases should be disabled when
--disable-protoc is specified). so, remove the --disable-protoc option.
libprotobuf-c should always be tested as part of a build, and this can't
be done unless protoc-c is built. this also reduces the number of build
combinations that need to be tested.
2013-11-18 14:24:05 -05:00
Robert Edmonds
8551bf637d configure.ac: print out C++ related build flags 2013-11-18 13:59:17 -05:00
Robert Edmonds
43b94a4bc4 fix VPATH builds
this commit fixes VPATH builds where the build tree is separate from the
source tree. this will allow us to run "make distcheck".
2013-11-18 13:53:28 -05:00
Robert Edmonds
3128296851 t/test-full.proto: revert 'option allow_alias = true;'
this option is only supported by the upstream protobuf compiler starting
with version 2.5.0. this version is not yet widely available in the
debian/ubuntu repositories, and we would like to avoid breaking the
build on those platforms with the distribution version of protobuf
installed, so revert the following commits:

 - 5ee9c03478ea13bba03e7d7edacf723f324200c2
 - 84e41e7329f1f0fc09b41ee96e17b28a792cefcf
2013-11-18 13:00:44 -05:00
Ilya Lipnitskiy
2dfe54f2ed Add a README 2013-11-18 00:12:57 -08:00
Ilya Lipnitskiy
fce41f255e Add a travis-CI config file 2013-11-18 00:09:48 -08:00
Ilya Lipnitskiy
84e41e7329 Add version check for the protobuf package (needed for allow_alias option to work) 2013-11-17 23:31:39 -08:00