ogc: update signature of resetcallback#118
ogc: update signature of resetcallback#118mardy wants to merge 1 commit intodevkitPro:ogc-sdl-2.28from
Conversation
The type of the resetcallback function in libogc was changed in 2018, to
add the IRQ and context paramters. For some reason, though, the mismatch
was not reported by the previous compilers.
```
/home/mardy/src/git/gamedev/2SDL/src/main/wii/SDL_wii_main.c:70:26: error: passing argument 1 of 'SYS_SetResetCallback' from incompatible pointer type [-Wincompatible-pointer-types]
70 | SYS_SetResetCallback(ResetCB);
| ^~~~~~~
| |
| void (*)(void)
In file included from /opt/devkitpro/libogc/include/gccore.h:62,
from /opt/devkitpro/libogc/include/ogcsys.h:4,
from /home/mardy/src/git/gamedev/2SDL/src/main/wii/SDL_wii_main.c:40:
/opt/devkitpro/libogc/include/ogc/system.h:384:50: note: expected 'resetcallback' {aka 'void (*)(unsigned int, void *)'} but argument is of type 'void (*)(void)'
384 | resetcallback SYS_SetResetCallback(resetcallback cb);
| ~~~~~~~~~~~~~~^~
/home/mardy/src/git/gamedev/2SDL/src/main/wii/SDL_wii_main.c:49:13: note: 'ResetCB' declared here
49 | static void ResetCB()
| ^~~~~~~
/opt/devkitpro/libogc/include/ogc/system.h:251:16: note: 'resetcallback' declared here
251 | typedef void (*resetcallback)(u32 irq, void* ctx);
| ^~~~~~~~~~~~~
```
|
question: in that change in 2018, was it only the callback signature that was changed or was it also called more often, which required the signature to change? im asking to check if the arguments are in fact not needed and can be ignored or needed to keep the same behavior |
No, the change is only about the parameters (commit 5714b83ae7602e3f64a0a83f820d4715032249a5).
In this case I think it's irrelevant, since the function is called as often as previously. |
|
ah ok, ye that makes sense looking at the commit. lgtm then (i can't merge hehe) |
|
This was fixed with c07fc5d while I was fiddling with new toolchain stuff. Sorry, I missed this PR |
The type of the resetcallback function in libogc was changed in 2018, to add the IRQ and context paramters. For some reason, though, the mismatch was not reported by the previous compilers.