summaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-23 08:35:44 +0100
committerTyge Løvset <[email protected]>2023-02-23 08:35:44 +0100
commit4ff4c8d352f76b658214029988eab7ce1d69efe8 (patch)
treeb4344007993fdb6460b7d4ecd3536a7f1e2b91b6 /misc
parent95f0b246cedc2d3669575ed2bfb398e6fbcb2b2f (diff)
downloadSTC-modified-4ff4c8d352f76b658214029988eab7ce1d69efe8.tar.gz
STC-modified-4ff4c8d352f76b658214029988eab7ce1d69efe8.zip
Internal updates.
Diffstat (limited to 'misc')
-rw-r--r--misc/examples/bits.c2
-rwxr-xr-xmisc/examples/make.sh5
-rw-r--r--misc/examples/printspan.c10
3 files changed, 8 insertions, 9 deletions
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 <stdio.h>
#include <stc/cbits.h>
-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 <stc/cdeq.h>
#define i_val_str
-#include <stc/cset.h>
+#include <stc/csset.h>
#include <stc/cspan.h>
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("");
}