Skip to content

C lint: t_geometry_hazards checks its readback buffer, and notes who owns its program - #979

Open
capibawa wants to merge 1 commit into
seedds:mainfrom
capibawa:tidy-geometry-hazards
Open

capibawa wants to merge 1 commit into
seedds:mainfrom
capibawa:tidy-geometry-hazards

Conversation

@capibawa

@capibawa capibawa commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

What and why

clang-tidy's ratchet fails on main, and so on every pull request (for example this run on #974, which doesn't touch the file). It reports two findings in dm/gfx/tests/t_geometry_hazards.m that the baseline doesn't have:

  • clang-analyzer-nullability.NullablePassedToNonnull: the readback buffer, which newBufferWithLength may return as nil, goes straight to the blit. The test now fails its check and resets when the buffer wasn't made.
  • clang-analyzer-osx.cocoa.RetainCount: a potential leak of the program pr. It isn't one: serial_put hands pr to g_by_serial (its CFBridgingRetain), which owns it. A NOLINT says so, on the line where the analyzer reports the leak.

These are the same two changes that brought #957's clang-tidy back to the baseline.

Checked

Docs

  • No game files, keys or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

…owns its program

clang-tidy's ratchet fails on main, and so on every pull request, with two findings in dm/gfx/tests/t_geometry_hazards.m that the baseline does not have. One is clang-analyzer-nullability.NullablePassedToNonnull: the readback buffer from newBufferWithLength, which may be nil, goes straight to the blit. The other is clang-analyzer-osx.cocoa.RetainCount: a potential leak of the program 'pr'.

The test now fails its check and resets when the readback buffer was not made. The leak is not one: serial_put hands pr to g_by_serial (its CFBridgingRetain), which owns it. A NOLINT says so, on the line where the analyzer reports the leak (the posix_memalign line after serial_put).

Checked: on seedds#957's branch the same two changes took the ratchet back to the baseline (clang-tidy passed in CI), and t_geometry_hazards passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MKLOL pushed a commit to MKLOL/nxnative that referenced this pull request Nov 2, 2026
…ersed

The earlier commits converted RGBA4 through a representation layer of its own for format views, integer images, scaled copies and 3D mirrors: cases no game is known to reach. RGBA4 now uses the existing packed-format crossings (uploads, buffer <-> texture copies, ReadTexels, storage readbacks, and the in-place mapping of linear and buffer textures), reversing the four nibbles where the RGB565 family exchanges red and blue. Same-size views in another format keep the RGB565 family's documented limit. Main's own clang-tidy fixture findings are left to their pull requests (seedds#958, seedds#959, seedds#979).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6nJ82QTpmojw3kPgmTLxZ
MKLOL pushed a commit to MKLOL/nxnative that referenced this pull request Nov 2, 2026
…ersed

The earlier commits converted RGBA4 through a representation layer of its own for format views, integer images, scaled copies and 3D mirrors: cases no game is known to reach. RGBA4 now uses the existing packed-format crossings (uploads, buffer <-> texture copies, ReadTexels, storage readbacks, and the in-place mapping of linear and buffer textures), reversing the four nibbles where the RGB565 family exchanges red and blue. Same-size views in another format keep the RGB565 family's documented limit. Main's own clang-tidy fixture findings are left to their pull requests (seedds#958, seedds#959, seedds#979).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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