Skip to content

Conversation

@mardy
Copy link
Collaborator

@mardy mardy commented Nov 30, 2025

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);
      |                ^~~~~~~~~~~~~

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);
      |                ^~~~~~~~~~~~~
```
@DacoTaco
Copy link
Member

DacoTaco commented Dec 1, 2025

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

@mardy
Copy link
Collaborator Author

mardy commented Dec 1, 2025

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?

No, the change is only about the parameters (commit 5714b83ae7602e3f64a0a83f820d4715032249a5).

im asking to check if the arguments are in fact not needed and can be ignored or needed to keep the same behavior

In this case I think it's irrelevant, since the function is called as often as previously.

@DacoTaco
Copy link
Member

DacoTaco commented Dec 1, 2025

ah ok, ye that makes sense looking at the commit. lgtm then (i can't merge hehe)

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