Commit graph

12 commits

Author SHA1 Message Date
Jason Heeris
bbc208cf04 Simplified size calculation. 2021-05-10 17:52:42 +08:00
Jason Heeris
d29faccc64 Implemented capn_size() for dynamically calculating the required buffer size for capn_write_mem(). 2021-05-10 17:52:42 +08:00
Alex Helfet
408505ae31 8 byte alignment on capn_segment, updated comments about this.
As discussed in PR: https://github.com/opensourcerouting/c-capnproto/pull/15#discussion_r107588334
2017-03-23 05:11:45 +00:00
Alex Helfet
ef88fd8e9d Fixed some issues raised by eqvinox in pull request.
PR URL: 1b25eae747
2017-03-23 04:33:03 +00:00
Alex Helfet
0be620602a Fix compiler warnings and errors in GCC. 2017-03-22 17:40:05 +00:00
Theo Hill
7b7346a73c lib: make buf arg const in write_fd pointer
For capn_write_fd() the write() function would be ideal to pass as
write_fd, but write() has type ssize_t (*)(int, const void *, size_t),
whereas write_fd expects ssize_t (*)(int, void *, size_t). Passing
write() directly with GCC 5.4 causes a warning
-Wincompatible-pointer-types (on by default).
2016-08-06 17:42:19 -07:00
David Lamparter
f2058f60c0 lib: make capn_{de,in}flate + capn_stream private
There is no point in having these functions be part of the public API.
2016-06-27 16:06:02 +02:00
David Lamparter
33ae16bba8 lib: don't overrun buffer in capn_write_mem_packed
Missing braces end up scaling the offset by * 4 ... which is actually a
stack/heap overflow.
2016-06-27 16:03:03 +02:00
David Lamparter
48535d02bd whitespace fixes 2016-06-22 13:44:56 +02:00
Nathanael Jones
27df3d6064 Align capn_segment to 64-bit boundaries on MSVC
Unless capn_segment is defined with __declspec(align(64)),
check_segment_alignment fails to compile in x86 mode, as (sizeof(struct
capn_segment)&7) -> (44 & 7) evaluates to 4
Always compiles in x64 mode, as (sizeof(struct capn_segment)&7) -> (80 &
7) evaluates to 0
2016-05-11 10:30:41 -07:00
David Lamparter
00eaeeb936 lib: fix API
capn_new_string is exported as symbol but not in the header
capn_write_mem_packed is internal but the symbol is visible
2016-03-19 00:39:30 +01:00
David Lamparter
811d3046e1 rename to "[lib]capnp_c", use lib/ subdir 2016-03-19 00:39:29 +01:00
Renamed from capn-malloc.c (Browse further)