Fix random warnings

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2023-04-23 14:21:58 +02:00
parent c79b3afbbd
commit b2b7ade9c0
2 changed files with 4 additions and 2 deletions

View file

@ -5,6 +5,7 @@
* This software may be modified and distributed under the terms * This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details. * of the MIT license. See the LICENSE file for details.
*/ */
#define _POSIX_C_SOURCE 200809L
#include "schema.capnp.h" #include "schema.capnp.h"
#include "str.h" #include "str.h"
@ -12,6 +13,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <ctype.h>
struct value { struct value {
struct Type t; struct Type t;

View file

@ -413,7 +413,7 @@ int64_t capn_size(struct capn *c)
size_t headersz, datasz = 0; size_t headersz, datasz = 0;
struct capn_ptr root; struct capn_ptr root;
struct capn_segment *seg; struct capn_segment *seg;
int i; uint32_t i;
if (c->segnum == 0) if (c->segnum == 0)
return -1; return -1;
@ -421,7 +421,7 @@ int64_t capn_size(struct capn *c)
root = capn_root(c); root = capn_root(c);
seg = root.seg; seg = root.seg;
headersz = 8 * ((2 + c->segnum) / 2); headersz = 8 * ((2 + c->segnum) / 2);
for (i = 0; i < c->segnum; i++, seg = seg->next) { for (i = 0; i < c->segnum; i++, seg = seg->next) {
if (0 == seg) if (0 == seg)