Skip to content

Conversation

@Phytolizer
Copy link

  • Fix a typo that causes a compiler error when CUTE_TILED_FREE is defined to use the ctx argument.
  • Add some simple code in test_cute_tiled/main.cpp to detect a regression.

Resolve a compiler error when CUTE_TILED_FREE is defined to use the
`ctx` argument.
If a typo like the one fixed in 0fbc4a5
happens again, the test will fail.
@Phytolizer
Copy link
Author

Phytolizer commented Nov 2, 2025

Replicate the error like so (copying the regression test without the fix):

[kyle@kyle-desktop-ku test_cute_tiled]$ git show --oneline --no-patch
7c3eb14 (HEAD -> master, origin/master, origin/HEAD) Fix alpha bit shift to use use 0xFFu instead of 0xFF literal (#413)
[kyle@kyle-desktop-ku test_cute_tiled]$ git cherry-pick 2083cf8c73dd4e6aa03991afe2861291bb56a2da
[master d934b59] regression: add "dummy" alloc overrides for test_cute_tiled
 Date: Sun Nov 2 11:09:25 2025 -0600
 1 file changed, 13 insertions(+)
[kyle@kyle-desktop-ku test_cute_tiled]$ make
rm -f tests
g++ -I../ main.cpp -o tests
../cute_tiled.h: In function ‘void cute_tiled_free_map_internal(cute_tiled_map_internal_t*)’:
../cute_tiled.h:2903:79: error: ‘mem_ctx’ was not declared in this scope
 2903 |                         if (desc->animation) CUTE_TILED_FREE(desc->animation, mem_ctx);
      |                                                                               ^~~~~~~
main.cpp:18:51: note: in definition of macro ‘CUTE_TILED_FREE’
   18 | #define CUTE_TILED_FREE(ptr, ctx) dummy_free(ptr, ctx)
      |                                                   ^~~
make: *** [Makefile:2: tests] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant