Ported my C game to WASM, here's every bug that I hit
ernesernesto.github.io
Ported my C game to WASM, here's every bug that I hit
1–10 of 116 posts
Re: Ported my C game to WASM, here's every bug that I hit
#2Re: Ported my C game to WASM, here's every bug that I hit
#3Since this is one of the bugs, I always recommemd writing
game->boardPieces = swAlloc(sizeof(ThingHandle*) * row * column);
Like this instead: game->boardPieces = swAlloc(sizeof *game->boardPieces * row * column);
It's not 100% better, but it cuts out a few tokens which helps readability and moves the significant asterix further left where I think it's easier to spot.Re: Ported my C game to WASM, here's every bug that I hit
#4Re: Ported my C game to WASM, here's every bug that I hit
#5> Web is 32-bit. Your 64-bit structs will break. This was the root cause of most of my bugs. WASM is 32-bit address space, pointers are 4 bytes not 8.
Re: Ported my C game to WASM, here's every bug that I hit
#6Meta: a space is missing in the title. Since this is one of the bugs, I always recommemd writing game->boardPieces = swAlloc(sizeof(ThingHandle*) * row * column); Like this instead: game->boardPieces = swAlloc(sizeof *game->boardPieces * row * column); It's not 100% better, but it cuts out a few tokens which helps readability and moves the significant asterix further left where I think it's easier to spot.
I like the word "everybug" :-D
Re: Ported my C game to WASM, here's every bug that I hit
#7Re: Ported my C game to WASM, here's every bug that I hit
#8The memory64 proposal was merged into upstream last year, any reason to opt into 32 bit despite that?