Skip to content

refactor: remove unused declarations flagged by the linter#327

Merged
forketyfork merged 2 commits into
mainfrom
refactor/remove-dead-code
May 30, 2026
Merged

refactor: remove unused declarations flagged by the linter#327
forketyfork merged 2 commits into
mainfrom
refactor/remove-dead-code

Conversation

@forketyfork
Copy link
Copy Markdown
Owner

Solution

The dead-code linter flagged four public declarations with no callers anywhere in the repo. This PR removes them:

  • src/c.zig — the SDL_RENDERER_ACCELERATED and SDL_RENDERER_PRESENTVSYNC flag constants. VSync is set through SDL_SetRenderVSync, so these flags were never read.
  • src/gfx/primitives.zigfillCircle, which nothing drew.
  • src/input/mapper.zigkeyToChar. Key-to-escape-sequence encoding goes through encodeKey, not this char-mapping helper.

Each symbol was checked with a repo-wide search before removal: only its definition site turned up, with no references in source or tests. No behavior changes, no documentation referenced these symbols.

zig build, zig build test, and just lint all pass clean, and the lint that previously reported the four warnings now shows no issues.

Issue: The dead-code linter reported four public declarations that no
code references: two SDL renderer flag constants in c.zig, fillCircle in
gfx/primitives.zig, and keyToChar in input/mapper.zig.
Solution: Remove all four after confirming no callers exist anywhere in
the repo. VSync is configured through SDL_SetRenderVSync rather than the
renderer flags, and key encoding goes through encodeKey rather than the
char-mapping helper, so nothing depends on the removed code.
@forketyfork forketyfork marked this pull request as ready for review May 30, 2026 19:14
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ed79628fba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gfx/primitives.zig
The gfx/* module table in ARCHITECTURE.md still advertised filled
circles and fillCircle() after the function was removed. Update the
description and helper list so the rendering utility surface matches the
code. Addresses review comment on PR #327.
@forketyfork forketyfork merged commit 21279c3 into main May 30, 2026
4 checks passed
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