Twenty-seven header comments describe code that has changed #63
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: TODO.md, "Header comments that describe code that has changed" (at
bbb7b8f)Twenty-one manual chapters and two tutorial games were written against
src/rather than against the header comments. Twenty-seven claims across the public
headers were false when checked.
AGENTS.mdalready warns thatTODO.md"carried eleven entries describing codethat had already changed"; this is the same failure in the headers, and Doxygen
publishes it.
Nothing catches these.
WARN_IF_UNDOCUMENTEDproves a symbol has a comment,not that the comment is true, and
api_surfacestrips comments precisely becauseprose is not a declaration.
The full list is in the manual, each noted in the chapter that covers the
subsystem. The ones that would actively mislead a caller:
physics.h:8-9,195-- thephysics.engineproperty andakgl_game_initcalling the factory. Neither exists, and a caller who believes it writes
the program that segfaults on frame one (filed separately).
renderer.h--frame_start/frame_end/draw_texture"dereferenceselfbefore it is checked". Each function's first statement is
FAIL_ZERO_RETURN(errctx, self, ...).sprite.h--speedis "seconds, scaled to milliseconds". It ismilliseconds scaled to nanoseconds. Also claims
framesis unbounded(bounded at
src/sprite.c:207) and thatakgl_sprite_initializeoverreadsvia
memcpy(it usesaksl_strncpy).character.h--speedtime"in seconds" (milliseconds), andsprite_addnever releasing a displaced sprite (
src/character.c:60,77-79releases it).actor.h-- thecmhfblock comment says the_offhandlers zeroacceleration, thrust, environmental and velocity. They zero only
ax/txor
ay/ty; zeroingeywas the gravity-cancel defect fixed in 0.6.0, andtwo
@notes still describe it.json_helpers.h-- the conventions block saysdestis not NULL-checked andthat only
akgl_get_json_string_valuechecks its key. All eleven accessorscheck
dest, and all seven key-taking accessors checkkey.assets.h:17-18-- "akgl_game_init(or a bareakgl_audio_init) has tohave run first".
akgl_mixeris created only inakgl_game_init;akgl_audio_initopens the synthesizer's stream and never touches it, soakgl_load_start_bgmafter only that hands NULL toMIX_LoadAudio.registry.h:54--akgl_registry_initcreating seven registries and notproperties. It creates eight including properties; the genuinely false part
is that
akgl_game_initnever calls it at all, calling the eightindividually in a different order.
tilemap.h:59-60,354-357,447-450,462-468-- object and tileset countsunbounded, and
akgl_tilemap_releasedouble-freeing. All fixed; the survivinghalf of the last one is that
releasedoes not release the map's actors.controller.h:232-234,262-263-- a negativecontrolmapidnot rejected. Bothcall sites check.
README.md(already corrected) -- "ONLY supports TilED TMJ tilemaps withtileset external references". Backwards:
"source"appears nowhere insrc/tilemap.c, andakgl_tilemap_load_tilesets_eachreadscolumns/firstgid/tilecount/imageinline. Only embedded tilesetsload.
Worth deciding while closing this: whether anything can be made to catch the
next one. A doc comment that names a status, a bound or a check is a claim the test
suite could assert, and the three that would have been caught cheaply are the ones
naming a status.
Files:
include/akgl/*.h,docs/Filed by Tachikoma (Claude Code, Opus 5, 1M context)