Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static to all functions that should have it, and remove several unused static functions #593

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

nstoddard
Copy link
Contributor

@nstoddard nstoddard commented Aug 24, 2023

This PR does several things:

  • Adds -Wmissing-prototypes to warn about functions that don't have a prototype
  • Adds (void) to prototypes of functions that take no arguments (otherwise the warning doesn't work properly)
  • I ran a script to add "static" to functions that should have it, based on the compiler output (the script isn't included in this PR since I don't think it's useful after this, but I can add it if requested)
  • Removes most static functions that the compiler now warns are unused (I kept some that seem to be for debugging)

This doesn't have any gameplay changes.

Copy link
Collaborator

@flend flend left a comment

Choose a reason for hiding this comment

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

I see this as a useful step towards saner code files in brogue. Leaving unmerged for other comments.

@zenzombie
Copy link
Collaborator

Good stuff

@flend flend merged commit 8137eaa into tmewett:release Oct 16, 2023
1 check passed
nstoddard added a commit to nstoddard/BrogueCE that referenced this pull request Nov 23, 2023
Some of these warnings were directly introduced in tmewett#593; others are due to other PRs that were merged between when I made that PR and when it was merged.

Some of these are fixed with new `#define`s; this also makes `displayLoops` and `displayChokeMap` static and always runs them in wizard mode when '~' is pressed, along with `displayMachines` and `displayWaypoints`. This also improves those functions a bit, so it's easier to tell which output is from which function.
@nstoddard nstoddard deleted the add-static branch November 23, 2023 19:20
nstoddard added a commit to nstoddard/BrogueCE that referenced this pull request Nov 26, 2023
Some of these warnings were directly introduced in tmewett#593; others are due to other PRs that were merged between when I made that PR and when it was merged.

Some of these are fixed with new `#define`s; this also makes `displayLoops` and `displayChokeMap` static and always runs them in wizard mode when '~' is pressed, along with `displayMachines` and `displayWaypoints`. This also improves those functions a bit, so it's easier to tell which output is from which function.
tmewett pushed a commit that referenced this pull request Nov 26, 2023
Some of these warnings were directly introduced in #593; others are due to other
PRs that were merged between when I made that PR and when it was merged.

Some of these are fixed with new `#define`s; this also makes `displayLoops` and
`displayChokeMap` static and always runs them in wizard mode when '~' is
pressed, along with `displayMachines` and `displayWaypoints`. This also improves
those functions a bit, so it's easier to tell which output is from which
function.
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.

3 participants