diff --git a/.gitignore b/.gitignore index 1fcd31fe..17d2c298 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ **/out/* **/a.exe +ld-v-out.txt **/.parcel-cache/* examples/**/dist/* examples/**/*.o diff --git a/notes-to-self.txt b/notes-to-self.txt index 0ab9ea7e..48812cf9 100644 --- a/notes-to-self.txt +++ b/notes-to-self.txt @@ -62,23 +62,17 @@ awbasic - test all workspace builds should opnew.cpp be renamed newop.cpp? move png to doc folder in the npm package add source? -remove ld-v-out.txt substitution strings not support in mod.divLob(), eg console.log("The price is %.2f.", price); -add 'gotcha' section to debugging readme - static class functions, accidental re-entrant c -/0 in C hangs with no exception or error +/0 in hangs with no exception or error does sqrt() optimize to _builtin_sqrt()? doesn't appear too. update twr_sqrt? (unreachable) is one way to term a web assembly function and throw an exception in JS. Are there others? what is -lwasm? clang --target=wasm32-unknown-unknown-wasm -o test.wasm test.c -lwasm balls performance analysis -- when lots of balls, "drawSeq" is 1/3 of time, moveAllBallsis 1/3, isCollisionNext 12%, moveSingleBall 17% -the following prints strange 1e+2 for result of .1g ->>snprintf(buf, sizeof(buf), "BALLS: %d of %d FPS: %.1g", m_numBalls, MAX_BALLS, m_fps); -look at my implementation of precision for %g %f % e, they are handled differently but i treat the the same lots of this spec still to go: https://cplusplus.com/reference/cstdio/printf/ add last new call (fillchar) to balls test c++ class add css string to d2d_setfillstyle() add linear gradient support remove -v from balls makefile (after inspecting results) -revert twr_dbg_printf newline change and add twr_debuglog investigate exceptions more: https://emscripten.org/docs/porting/exceptions.html index/async.html in examples have links to switched to bundled/unbundled versions, but the bundled version requires a file server, and they only really work with the azure version. The local example builds are now a bit confusing. index.html/examples/unbundled switch is hard coded to web site so i cant test it locally @@ -96,6 +90,9 @@ add source to module, also perhaps this is needed for above //twr_snprintf(b, sizeof(b), "%6.2d", -5); // NOT IMPLEMENTED YET doc? -- if (twr_strcmp(b, "1.234568e+2")!=0) return 0; // NOTE gcc printf %e gives 1.234568e+02 and if (twr_strcmp(b, "1.00000e+7")!=0) return 0; // GCC give 1e+07 +revert twr_dbg_printf newline change and add twr_debuglog +add 'gotcha' section to debugging readme - static class functions, accidental re-entrant c +remove ld-v-out.txt NOTES: good wasm article: https://surma.dev/things/c-to-webassembly/index.html diff --git a/source/unit-test/Makefile-pr b/source/unit-test/Makefile-pr index e7df4212..b3b91d1b 100644 --- a/source/unit-test/Makefile-pr +++ b/source/unit-test/Makefile-pr @@ -1,18 +1,20 @@ # This makefile builds pr.c, which I used to generate gcc printf output, to determine how twr-crt should function # tested with mingw32-make -LIBS = -lm -CC = gcc -CFLAGS = -g -Wall -Wextra -fdiagnostics-color=always -std=c17 -pedantic +# use mingw32-make -f Makefile-pr -.PHONY: clean +LIBS := -lm +CC := gcc +CFLAGS := -g -Wall -Wextra -fdiagnostics-color=always -std=c17 -pedantic -out/pr.exe: out/pr.o - $(CC) out/pr.o -Wall $(LIBS) -o out/pr.exe +default: out/pr.exe -out/pr.o: pr.c +out/pr.o: pr.c $(CC) pr.c $(CFLAGS) -c -o out/pr.o +out/pr.exe: out/pr.o + $(CC) out/pr.o -Wall $(LIBS) -o out/pr.exe + # Below only works on Windows clean: rm -f out/pr.o