Skip to content

ymfm: Clean up numerous warnings#3539

Merged
richardg867 merged 1 commit into
86Box:masterfrom
cold-brewed:ymfm-sprintf-fix
Aug 11, 2023
Merged

ymfm: Clean up numerous warnings#3539
richardg867 merged 1 commit into
86Box:masterfrom
cold-brewed:ymfm-sprintf-fix

Conversation

@cold-brewed

Copy link
Copy Markdown
Contributor

Summary

Cleaning up a bunch of ymfm warnings:

  • One such warning revolved around the YMF278B implementation. The index was based around a ternary which made gcc unhappy. Cleaned up by matching the official example (existing code did not match)
  • Another issue was cleaned up by adding a conditional to make gcc happy (this one resulted in several warnings)

In addition, all sprintfs were cleaned up to snprintfs to make clang happy. Since ymfm uses pointer arithmetic to write to the buffer a special macro had to be created to be passed to snprintf and properly calculate the remaining size. You'll see the macro as SNPRINTF_BUFFER_SIZE_CALC.

Checklist

  • I have discussed this with core contributors already

References

N/A

@richardg867
richardg867 merged commit 0e37602 into 86Box:master Aug 11, 2023
@cold-brewed
cold-brewed deleted the ymfm-sprintf-fix branch August 11, 2023 19:30
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