snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 12373b018e985ba0bc5628dcaceb7c406a350e45
parent e49c837cd790b0c6e4cbccafb148d2687a132258
Author: default <nobody@localhost>
Date:   Tue,  8 Oct 2024 07:45:17 +0200

Added -pedantic compilation flag.

Diffstat:
MMakefile | 2+-
Mxs.h | 2+-
Mxs_random.h | 3++-
Mxs_url.h | 2+-
4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,6 +1,6 @@ PREFIX=/usr/local PREFIX_MAN=$(PREFIX)/man -CFLAGS?=-g -Wall -Wextra +CFLAGS?=-g -Wall -Wextra -pedantic all: snac diff --git a/xs.h b/xs.h @@ -1070,7 +1070,7 @@ typedef struct { int size; /* size of full dict (_XS_TYPE_SIZE) */ int first; /* first node for sequential search */ int root; /* root node for hashed search */ - ditem_hdr ditems[]; /* the ditems */ + /* a bunch of ditem_hdr and value follows */ } dict_hdr; diff --git a/xs_random.h b/xs_random.h @@ -66,7 +66,8 @@ void *xs_rnd_buf(void *buf, int size) /* fill with full integers */ while (n--) { xs_rnd_int32_d(&s); - p = memcpy(p, &s, sizeof(s)) + sizeof(s); + memcpy(p, &s, sizeof(s)); + p += sizeof(s); } if ((n = size % sizeof(s))) { diff --git a/xs_url.h b/xs_url.h @@ -17,7 +17,7 @@ xs_str *xs_url_dec(const char *str) while (*str) { if (*str == '%') { - int i; + unsigned int i; if (sscanf(str + 1, "%02x", &i) == 1) { unsigned char uc = i;