Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

merge in baruch, liamstask and kylemanna forks #12

Open
wants to merge 194 commits into
base: master
Choose a base branch
from

Conversation

eqvinox
Copy link

@eqvinox eqvinox commented Feb 28, 2016

This merges the most active forks I could find & adds standard autoconf/automake build.

Steve Dee and others added 30 commits February 5, 2014 14:02
Fixes a compiler warning.
Renamed gtest/include to gtest/gtest since that's what the include files
expected.

Adjusted the Makefile to work through it all.
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.
…ored gtest-all.cpp

builds cleanly (minus a couple warnings in the test code itself) on OS X 10.10.4 with “Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)”
previously, this was emitting the following warning (treated as error):

`c++ -g -Wall -Werror -I. -Igtest-1.7.0/include -o capn-test.o -c capn-test.cpp
capn-test.cpp:66:29: error: unused variable 'SUBSTRUCT_DEFAULT' [-Werror,-Wunused-const-variable]
static const AlignedData<2> SUBSTRUCT_DEFAULT = {{0,0,0,0,1,0,0,0,  0,0,0,0,0,0,0,0}};
                            ^
capn-test.cpp:67:29: error: unused variable 'STRUCTLIST_ELEMENT_SUBSTRUCT_DEFAULT' [-Werror,-Wunused-const-variable]
static const AlignedData<2> STRUCTLIST_ELEMENT_SUBSTRUCT_DEFAULT =
                            ^`
detly and others added 30 commits May 10, 2021 17:37
Fix code generation for nested unions.
Two extra annotations: donotinclude and typedefto
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 <curt@enfabrica.net>
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 <curt@enfabrica.net>
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 <curt@enfabrica.net>
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 <curt@enfabrica.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
Signed-off-by: David Lamparter <equinox@diac24.net>
Fixes: #58
Signed-off-by: David Lamparter <equinox@diac24.net>
This reverts commit 4109705, reversing
changes made to 5c4e497.
Signed-off-by: David Lamparter <equinox@diac24.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.