From 4ff4c8d352f76b658214029988eab7ce1d69efe8 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 23 Feb 2023 08:35:44 +0100 Subject: Internal updates. --- misc/examples/bits.c | 2 +- misc/examples/make.sh | 5 ++--- misc/examples/printspan.c | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'misc/examples') diff --git a/misc/examples/bits.c b/misc/examples/bits.c index 730dd953..6f28c52d 100644 --- a/misc/examples/bits.c +++ b/misc/examples/bits.c @@ -1,7 +1,7 @@ #include #include -int main() +int main(void) { c_with (cbits set = cbits_with_size(23, true), cbits_drop(&set)) { printf("count %" c_ZI ", %" c_ZI "\n", cbits_count(&set), cbits_size(&set)); diff --git a/misc/examples/make.sh b/misc/examples/make.sh index 19a53880..5ac0b653 100755 --- a/misc/examples/make.sh +++ b/misc/examples/make.sh @@ -7,10 +7,9 @@ if [ "$(uname)" = 'Linux' ]; then fi cc=gcc; cflags="-s -O2 -std=c99 -Wconversion -Wpedantic -Wall -Wsign-compare -Wwrite-strings" -#cc=gcc; cflags="-s -O2 -std=c99 -Werror -Wfatal-errors -Wpedantic -Wall $sanitize" +#cc=gcc; cflags="-g -std=c99 -Werror -Wfatal-errors -Wpedantic -Wall $sanitize" #cc=tcc; cflags="-Wall -std=c99" -#cc=clang; cflags="-s -O2 -std=c99 -Werror -Wfatal-errors -Wpedantic -Wall -Wsign-compare -Wwrite-strings" -#cc=clang; cflags="-s -O2 -std=c99 -Werror -Wfatal-errors -Wpedantic -Wall -DSTC_CSTR_V1 -DSTC_CSMAP_V1" +#cc=clang; cflags="-s -O2 -std=c99 -Werror -Wfatal-errors -Wpedantic -Wall -Wno-unused-function -Wsign-compare -Wwrite-strings" #cc=gcc; cflags="-x c++ -s -O2 -Wall -std=c++20" #cc=g++; cflags="-x c++ -s -O2 -Wall" #cc=cl; cflags="-O2 -nologo -W3 -MD" diff --git a/misc/examples/printspan.c b/misc/examples/printspan.c index c7b0c609..81f6fa14 100644 --- a/misc/examples/printspan.c +++ b/misc/examples/printspan.c @@ -9,7 +9,7 @@ #define i_val int #include #define i_val_str -#include +#include #include using_cspan(intspan, int, 1); @@ -25,7 +25,7 @@ int main() c_auto (cvec_int, vec) c_auto (cstack_int, stk) c_auto (cdeq_int, deq) - c_auto (cset_str, set) + c_auto (csset_str, set) { intspan sp1 = cspan_make(intspan, {1, 2}); printMe( sp1 ); @@ -48,9 +48,9 @@ int main() deq = c_make(cdeq_int, {1, 2, 3, 4, 5, 6, 7, 8}); printMe( (intspan)cspan_from(&deq) ); - set = c_make(cset_str, {"1", "2", "3", "4", "5", "6", "7", "8", "9"}); - printf("%d:", (int)cset_str_size(&set)); - c_foreach (e, cset_str, set) + set = c_make(csset_str, {"5", "7", "4", "3", "8", "2", "1", "9", "6"}); + printf("%d:", (int)csset_str_size(&set)); + c_foreach (e, csset_str, set) printf(" %s", cstr_str(e.ref)); puts(""); } -- cgit v1.2.3