forked from jmckaskill/c-capnproto
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c-capnproto sync-up merge #4
Open
eqvinox
wants to merge
178
commits into
liamstask:master
Choose a base branch
from
opensourcerouting:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Conflicts: capn-malloc.c
Fixes a compiler warning.
No real need to build a gtest archive, gtest-all.cc includes all the files so a single .o is fine.
It is not used and we already validated the total buffer size beforehand.
Should make it a bit more readable, the variable is used before that case as well but doesn't require the zero initialization in that case.
The hdr variable gets the same constants as value but it is easier to understand that the constants are used than the hdr which needs to be traced to the value it received.
The header of packing is a single byte and nothing was written to the first byte anyway.
This uses the capn_deflate function. The current use may get smaller packing than the maximum possible due to the inability to peak around segments as it packs each segment on its own. This saves time compared to copying everything into one place and saves effort by not requiring to change the interface of capn_deflate to support multiple different buffers. It should be possible to make the capn_deflate state machine better to handle the multiple buffers case too.
* Rip out the gtest built in here. Use the system library. * Test against gtest-1.7.0-1 on Arch Linux * Add the missing -lpthread library
* These should be easily verified as correct. * Tested on gcc-5.2.0 and clang-3.6.2
* Never referenced and generate warnings on modern compilers * Tested on gcc-5.2.0 and clang-3.6.2
* Later versions of compilers/pre-processors are upset about the syntax * Bracket unterminated string with proper comment tags
* My compilers mark these as errors * Attempt to be more correct * Tested on gcc-5.2.0 and clang-3.6.2
Fix code generation for nested unions.
Two extra annotations: donotinclude and typedefto
…er size for capn_write_mem().
…cked serialisation.
Implemented capn_size() for calculating buffer size
…l_type Change capn_write_mem return value from int to int64_t
…tent with a recent change to capn_write_mem().
This patch modifies the code generator to only generate C-language `#include <imported_schema.h>` lines for imports that are actually used. Imagine this transitive import scenario: schema A imports a definition from schema B. However, the definition imported from schema B was itself imported from schema C. In this case, the code generated for schema A need not include the header file for schema B, as it only needs definitions from schema C. Signed-off-by: Curt Brune <[email protected]>
This patch adds an annotation for creating name spaces within capnproto files with the C-language code generator. Use the annotation like this: using C = import "/c.capnp"; $C.namespace("sample_namespace_"); The string passed into the namespace annotation is prepended to the name of all the struct's in the schema file. Signed-off-by: Curt Brune <[email protected]>
This patch adds the 'const' keyword to constant definitions generated by the compiler. Previously the compiler generated constants like this: foo.h ====== extern int foo; foo.c ====== int foo = 5; With this patch, the generated code looks like: foo.h ====== extern const int foo; foo.c ====== const int foo = 5; Signed-off-by: Curt Brune <[email protected]>
When working with integer constants, it is convenient to use #define macros for the constants, as opposed to a variable of constant type. This patch adds a '#define CONSTANT (value)' definition to the generated header files. The name of the constant is in SCREAMING_SNAKE_CASE, converted from the regular camelCase. Signed-off-by: Curt Brune <[email protected]>
Signed-off-by: David Lamparter <[email protected]>
Signed-off-by: David Lamparter <[email protected]>
Fixes: #58 Signed-off-by: David Lamparter <[email protected]>
Signed-off-by: David Lamparter <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This syncs up the major c-capnproto forks (liamstask, kylemanna, baruch)