-
Notifications
You must be signed in to change notification settings - Fork 459
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
Enable -Wint-conversion
warning
#1266
Changes from 61 commits
4969e83
f103844
be427de
c6f2a0e
4d96323
d6ce52b
8c8cad7
3b5f503
8e77c4a
7c566eb
ab64e54
f2e4c5c
f991415
a258564
d6c2dce
b086cc7
19d6dfa
0657e70
443b3c4
26237ce
b25b01c
3ece9f5
ca2f535
f86069f
c49ad33
bf613bc
dc1c186
af9e263
7818d33
d33eb83
874e2e5
4004a04
e975181
c9dd22a
0c1fc99
f9e3f61
147acd2
76d7256
3180426
2faa3ca
d76ea74
c1ae29e
dd897f4
ad5ae53
82a2f59
674b6a7
b9f983b
e88f040
d51729a
51dede1
87a29db
7812d7e
a0047e4
d0808f1
bb59adc
86f5b68
7daadeb
e718227
6d51251
7d6c361
6013f79
c5d27ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1441,7 +1441,7 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { | |
|
||
sampleBankTable = gAudioCtx.sampleBankTable; | ||
numFonts = gAudioCtx.soundFontTable->numEntries; | ||
change.oldAddr = AudioHeap_SearchCaches(SAMPLE_TABLE, CACHE_EITHER, sampleBankId); | ||
change.oldAddr = (uintptr_t)AudioHeap_SearchCaches(SAMPLE_TABLE, CACHE_EITHER, sampleBankId); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I defer to @engineer124 on all the audio stuff in here, most of these structs are quite deep. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Admittedly, low level audio does a lot of weird pointer manipulation with offsets and indexing when both transferring audio assets from rom to ram (sequences/soundfonts/samples), and even more weird pointer/offset math when extracting meaningful information from it (especially soundfonts, that's really messy when it comes to pointers). Given that, I think I'd need to sit down and summarize all the pointer math involved in audio and share that to figure out what kind of types we need. That would take time though, so for now I think I'm fine with just making sure it's consistent i.e. warning free? |
||
if (change.oldAddr == 0) { | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you also removed -Wno-format-security, what does that imply?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does nothing currently. https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security
It warns you for cases when you misuse printf/scanf functions, like passing a float when you have a
%u
We could annotate some variadic functions that work similar to printf (with
__attribute__ ((format (printf, 2, 3)))
) but that's a out of scope for this PRThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a confusing attribute. Yeah, don't think we need to worry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to link the docs about it
https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Function-Attributes.html#Common-Function-Attributes
I think it could actually be useful in the future