diff --git a/shlr/sdb/Makefile b/shlr/sdb/Makefile index 8cdc52cf7b..1425767d2a 100644 --- a/shlr/sdb/Makefile +++ b/shlr/sdb/Makefile @@ -30,10 +30,10 @@ include wasi.mk x xxx cxx: # $(MAKE) CC="gcc -x c++ -Wall -fpermissive" - $(MAKE) CC=g++ CFLAGS="-fPIC -x c++ -Wall -fpermissive" + $(MAKE) CC=g++ CFLAGS="-fPIC -x c++ -Wall -fpermissive -I../include -Werror" o xo xoxo ox: - g++ -o sdb src/*.c -I src/ + g++ -o sdb src/*.c -I include/ wasi wasm: $(WASI_SDK) ${MAKE} include/sdb/version.h @@ -70,7 +70,7 @@ EMCCFLAGS=-O2 -s EXPORTED_FUNCTIONS="['_sdb_querys','_sdb_new0']" #EMCCFLAGS+=--embed-file sdb.data sdb.js: include/sdb/version.h - cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js ${CFILES} + cd src ; emcc ${EMCCFLAGS} -I../include -o ../sdb.js ${CFILES} clean: rm -f include/sdb/version.h diff --git a/shlr/sdb/config.mk b/shlr/sdb/config.mk index 93ebfc7587..6c00a7724b 100644 --- a/shlr/sdb/config.mk +++ b/shlr/sdb/config.mk @@ -45,7 +45,7 @@ CFLAGS+=-Wsign-compare # some old gcc doesnt support this # CFLAGS+=-Wmissing-field-initializers #CFLAGS+=-O3 -CFLAGS+=-g -Wall -O0 +# CFLAGS+=-g -Wall -O0 #CFLAGS+=-g #LDFLAGS+=-g -flto diff --git a/shlr/sdb/meson.build b/shlr/sdb/meson.build index bbfa1279b7..390edabd4d 100644 --- a/shlr/sdb/meson.build +++ b/shlr/sdb/meson.build @@ -70,7 +70,7 @@ libsdb_sources = [ 'src/text.c' ] -sdb_inc = include_directories(['.', 'include']) +sdb_inc = include_directories(['include']) rpath_lib = '' rpath_exe = '' if get_option('local') and get_option('default_library') == 'shared' diff --git a/shlr/sdb/src/Makefile b/shlr/sdb/src/Makefile index 785df1ba79..794ed28b0a 100644 --- a/shlr/sdb/src/Makefile +++ b/shlr/sdb/src/Makefile @@ -1,10 +1,11 @@ include ../config.mk -CFLAGS:=-g $(CFLAGS) +# CFLAGS:=-g $(CFLAGS) OBJ=cdb.o buffer.o cdb_make.o ls.o ht.o ht_uu.o sdb.o num.o base64.o match.o OBJ+=json.o ns.o lock.o util.o disk.o query.o array.o fmt.o journal.o text.o OBJ+=dict.o ht_pp.o ht_up.o ht_pu.o set.o diff.o -CFLAGS+=-I ../include +SDB_CFLAGS+=-I../include +SDB_CXXFLAGS+=-I../include SOBJ=$(subst .o,.o.o,${OBJ}) WITHPIC?=1 BIN=sdb${EXT_EXE} @@ -77,7 +78,7 @@ mrproper clean: ifneq ($(SILENT),) @echo LD $< endif - $(CC) $(LDFLAGS) -c $(CFLAGS) -o $@ $< + $(CC) $(LDFLAGS) -c $(CFLAGS) $(SDB_CFLAGS) -o $@ $< S=$ @@ -85,14 +86,14 @@ S=$ ifneq ($(SILENT),) @echo CC $< endif - $(CC) -c ${CPPFLAGS} ${CFLAGS} ${CFLAGS_SHARED} -o $@ $< + $(CC) -c ${CPPFLAGS} ${CFLAGS} $(SDB_CFLAGS) ${CFLAGS_SHARED} -o $@ $< %.o.o: %.c ifneq ($(SILENT),) @echo CC PIC $< endif @mv `echo $<|sed -e 's,\.c$S,\.d,g'` $<.tmp 2>/dev/null || true - $(CC) -c ${CPPFLAGS} ${CFLAGS} ${CFLAGS_SHARED} -o $@ $< + $(CC) -c ${CPPFLAGS} ${CFLAGS} $(SDB_CFLAGS) ${CFLAGS_SHARED} -o $@ $< @mv `echo $<|sed -e 's,\.c$S,\.d,g'` `echo $<|sed -e 's,\.c$S,\._d,g'` 2>/dev/null || true @mv $<.tmp `echo $<|sed -e 's,\.c$S,\.d,g'` 2>/dev/null ||true diff --git a/shlr/sdb/src/array.c b/shlr/sdb/src/array.c index b4dc72a70f..3047caf175 100644 --- a/shlr/sdb/src/array.c +++ b/shlr/sdb/src/array.c @@ -24,8 +24,8 @@ static const char *Aindexof(const char *str, int idx) { } static int astrcmp(const char *a, const char *b) { - register char va = *a; - register char vb = *b; + char va = *a; + char vb = *b; for (;;) { if (va == '\0' || va == SDB_RS) { if (vb == '\0' || vb == SDB_RS) { diff --git a/shlr/sdb/src/json/Makefile b/shlr/sdb/src/json/Makefile index 9f075f0008..1ddc32ddc7 100644 --- a/shlr/sdb/src/json/Makefile +++ b/shlr/sdb/src/json/Makefile @@ -4,7 +4,7 @@ HASOVR=$(shell clang -Wno-initializer-overrides -E -&1| grep unknow ifeq ($(HASOVR),) CFLAGS+=-Wno-initializer-overrides endif -CFLAGS+=-Wall -g +# CFLAGS+=-Wall -g BIN=a.out OBJ=rangstr.o path.o js0n.o api.o main.o OBJ+=../libsdb.a diff --git a/shlr/sdb/src/sdb.c b/shlr/sdb/src/sdb.c index 7ea703b85b..264b6fe5cb 100644 --- a/shlr/sdb/src/sdb.c +++ b/shlr/sdb/src/sdb.c @@ -775,7 +775,7 @@ typedef struct { static bool sdb_foreach_match_cb(void *user, const char *k, const char *v) { _match_sdb_user *o = (_match_sdb_user*)user; - SdbKv tkv = {0}; + SdbKv tkv = {{0}}; tkv.base.key = (char *)k; tkv.base.value = (char *)v; if (sdbkv_match (&tkv, o->expr)) {