Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
twiddlingbits committed Mar 25, 2024
1 parent 8668c1e commit 7ad17e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
**/out/*
**/a.exe
ld-v-out.txt
**/.parcel-cache/*
examples/**/dist/*
examples/**/*.o
Expand Down
11 changes: 4 additions & 7 deletions notes-to-self.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 9 additions & 7 deletions source/unit-test/Makefile-pr
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7ad17e0

Please sign in to comment.