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

Code cleanup #293

Merged
merged 26 commits into from
Jul 1, 2024
Merged

Code cleanup #293

merged 26 commits into from
Jul 1, 2024

Conversation

erkyrath
Copy link
Contributor

Changes from @heasm66, somewhat tidied up. These allow the code to pass extra-super-careful compile-time checks.

  • The error message "Opcode unavailable in this Z-machine version" safety-checks the opcode value before printing. (Utility function opcode_name_z().)
  • isdigit(), isalnum(), etc macros wants argument cast to uchar.
  • In Infix code in asm.c, use INITAO() and related macros to initialize assembly_operand structs.
  • In --trace asm output, when a Z-string has abbreviation marks, print "<ABBR>" rather than ctrl-A characters.
  • Replace hardcoded constant 35 with MAX_TRACE_STRING_LEN.
  • Added /* Fall through */ comments to silence compiler warnings.
  • Added line breaks between statements to silence compiler warnings.
  • Changed some local variables to uint32 and added casts where necessary.
  • Added return; after a couple of compiler_error() calls.
  • Changed ASSERT_ZCODE() and ASSERT_GLULX() macros to complete no-ops rather than 0 expressions.

@erkyrath erkyrath mentioned this pull request Jun 11, 2024
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.

2 participants