logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0004-All-Avoid-return-with-expression-in-void-function.patch (2425B)


  1. From b58ec7875cbc169eed7fea709c95769c0318c442 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 7 Nov 2020 14:40:36 -0800
  4. Subject: [PATCH] All: Avoid return with expression in void function
  5. This is not permitted by ISO C (C99 6.8.6.4p1 [0]).
  6. [0] https://port70.net/~nsz/c/c99/n1256.html#6.8.6.4p1
  7. ---
  8. src/core/input.c | 2 +-
  9. src/core/interface.c | 2 +-
  10. src/gb/core.c | 2 +-
  11. src/gba/core.c | 2 +-
  12. 4 files changed, 4 insertions(+), 4 deletions(-)
  13. diff --git a/src/core/input.c b/src/core/input.c
  14. index fab88a50e..da18e5c89 100644
  15. --- a/src/core/input.c
  16. +++ b/src/core/input.c
  17. @@ -615,7 +615,7 @@ void mInputSetPreferredDevice(struct Configuration* config, const char* platform
  18. char deviceId[KEY_NAME_MAX];
  19. snprintf(deviceId, sizeof(deviceId), "device%i", playerId);
  20. - return ConfigurationSetValue(config, sectionName, deviceId, deviceName);
  21. + ConfigurationSetValue(config, sectionName, deviceId, deviceName);
  22. }
  23. const char* mInputGetCustomValue(const struct Configuration* config, const char* platformName, uint32_t type, const char* key, const char* profile) {
  24. diff --git a/src/core/interface.c b/src/core/interface.c
  25. index e6288e274..b808e32ba 100644
  26. --- a/src/core/interface.c
  27. +++ b/src/core/interface.c
  28. @@ -15,7 +15,7 @@ static void _rtcGenericSample(struct mRTCSource* source) {
  29. switch (rtc->override) {
  30. default:
  31. if (rtc->custom->sample) {
  32. - return rtc->custom->sample(rtc->custom);
  33. + rtc->custom->sample(rtc->custom);
  34. }
  35. break;
  36. case RTC_NO_OVERRIDE:
  37. diff --git a/src/gb/core.c b/src/gb/core.c
  38. index 9f67fd19d..5bceb1fae 100644
  39. --- a/src/gb/core.c
  40. +++ b/src/gb/core.c
  41. @@ -400,7 +400,7 @@ static void _GBCoreUnloadROM(struct mCore* core) {
  42. mCheatDeviceDestroy(gbcore->cheatDevice);
  43. gbcore->cheatDevice = NULL;
  44. }
  45. - return GBUnloadROM(core->board);
  46. + GBUnloadROM(core->board);
  47. }
  48. static void _GBCoreChecksum(const struct mCore* core, void* data, enum mCoreChecksumType type) {
  49. diff --git a/src/gba/core.c b/src/gba/core.c
  50. index 901d25111..9444c8a5b 100644
  51. --- a/src/gba/core.c
  52. +++ b/src/gba/core.c
  53. @@ -506,7 +506,7 @@ static void _GBACoreUnloadROM(struct mCore* core) {
  54. mCheatDeviceDestroy(gbacore->cheatDevice);
  55. gbacore->cheatDevice = NULL;
  56. }
  57. - return GBAUnloadROM(core->board);
  58. + GBAUnloadROM(core->board);
  59. }
  60. static void _GBACoreChecksum(const struct mCore* core, void* data, enum mCoreChecksumType type) {
  61. --
  62. 2.29.2