From 9a87d2371999c964d655cef6ea9ad213217e5703 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 18 Mar 2023 15:24:14 -0700 Subject: [PATCH] Style: Fixup instances of `void` arguments The style we have here is that functions with no arguments are to have explicit `void` arguments, even though this doesn't apply in C++, because it does apply in C. Unfortunately, some have slipped through the cracks. This commit fixes them. --- desktop_version/src/Game.cpp | 8 ++++---- desktop_version/src/Game.h | 8 ++++---- desktop_version/src/Graphics.cpp | 6 +++--- desktop_version/src/Graphics.h | 6 +++--- desktop_version/src/Music.cpp | 24 ++++++++++++------------ desktop_version/src/Music.h | 2 +- desktop_version/src/Render.cpp | 2 +- desktop_version/src/Screen.cpp | 2 +- desktop_version/src/Screen.h | 2 +- desktop_version/src/Textbox.cpp | 2 +- desktop_version/src/Textbox.h | 2 +- 11 files changed, 32 insertions(+), 32 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 52187025..ee21222f 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -754,7 +754,7 @@ void Game::setstate(const int gamestate) } } -void Game::incstate() +void Game::incstate(void) { if (!statelocked) { @@ -770,12 +770,12 @@ void Game::setstatedelay(const int delay) } } -void Game::lockstate() +void Game::lockstate(void) { statelocked = true; } -void Game::unlockstate() +void Game::unlockstate(void) { statelocked = false; } @@ -7394,7 +7394,7 @@ void Game::sabotage_time_trial(void) timetrialparlost = true; } -bool Game::isingamecompletescreen() +bool Game::isingamecompletescreen(void) { return (state >= 3501 && state <= 3518) || (state >= 3520 && state <= 3522); } diff --git a/desktop_version/src/Game.h b/desktop_version/src/Game.h index 67cfac8e..070bfc41 100644 --- a/desktop_version/src/Game.h +++ b/desktop_version/src/Game.h @@ -175,13 +175,13 @@ public: void setstate(int gamestate); - void incstate(); + void incstate(void); void setstatedelay(int delay); - void lockstate(); + void lockstate(void); - void unlockstate(); + void unlockstate(void); void updatestate(void); @@ -265,7 +265,7 @@ public: bool hascontrol, jumpheld; int jumppressed; int gravitycontrol; - bool isingamecompletescreen(); + bool isingamecompletescreen(void); bool muted; int mutebutton; diff --git a/desktop_version/src/Graphics.cpp b/desktop_version/src/Graphics.cpp index cdf29e9e..5f29f4c3 100644 --- a/desktop_version/src/Graphics.cpp +++ b/desktop_version/src/Graphics.cpp @@ -548,7 +548,7 @@ int Graphics::clear(const int r, const int g, const int b, const int a) return result; } -int Graphics::clear() +int Graphics::clear(void) { return clear(0, 0, 0, 255); } @@ -3099,7 +3099,7 @@ void Graphics::textboxpadtowidth(size_t new_w) textboxes[m].padtowidth(new_w); } -void Graphics::textboxcentertext() +void Graphics::textboxcentertext(void) { if (!INBOUNDS_VEC(m, textboxes)) { @@ -3122,7 +3122,7 @@ void Graphics::textboxprintflags(const uint32_t flags) textboxes[m].resize(); } -void Graphics::textboxcommsrelay() +void Graphics::textboxcommsrelay(void) { /* Special treatment for the gamestate textboxes in Comms Relay */ if (!INBOUNDS_VEC(m, textboxes)) diff --git a/desktop_version/src/Graphics.h b/desktop_version/src/Graphics.h index d59d0ebc..acb15126 100644 --- a/desktop_version/src/Graphics.h +++ b/desktop_version/src/Graphics.h @@ -107,11 +107,11 @@ public: void textboxpadtowidth(size_t new_w); - void textboxcentertext(); + void textboxcentertext(void); void textboxprintflags(uint32_t flags); - void textboxcommsrelay(); + void textboxcommsrelay(void); void textboxadjust(void); @@ -190,7 +190,7 @@ public: int set_blendmode(SDL_Texture* texture, SDL_BlendMode blendmode); int clear(int r, int g, int b, int a); - int clear(); + int clear(void); int copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest); int copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest, double angle, const SDL_Point* center, SDL_RendererFlip flip); diff --git a/desktop_version/src/Music.cpp b/desktop_version/src/Music.cpp index 61c0ca6f..f48a4d28 100644 --- a/desktop_version/src/Music.cpp +++ b/desktop_version/src/Music.cpp @@ -125,12 +125,12 @@ end: VVV_free(mem); } - void Dispose() + void Dispose(void) { VVV_free(wav_buffer); } - void Play() + void Play(void) { if (!valid) { @@ -200,7 +200,7 @@ end: } } - static void Pause() + static void Pause(void) { for (size_t i = 0; i < VVV_MAX_CHANNELS; i++) { @@ -208,7 +208,7 @@ end: } } - static void Resume() + static void Resume(void) { for (size_t i = 0; i < VVV_MAX_CHANNELS; i++) { @@ -216,7 +216,7 @@ end: } } - static void Destroy() + static void Destroy(void) { if (voices != NULL) { @@ -291,7 +291,7 @@ end: SDL_RWclose(rw); } - void Dispose() + void Dispose(void) { stb_vorbis_close(vorbis); VVV_free(read_buf); @@ -351,7 +351,7 @@ end: return true; } - static void Halt() + static void Halt(void) { if (!IsHalted()) { @@ -361,12 +361,12 @@ end: } } - static bool IsHalted() + static bool IsHalted(void) { return musicVoice == NULL; } - static void Pause() + static void Pause(void) { if (!IsHalted()) { @@ -375,12 +375,12 @@ end: } } - static bool IsPaused() + static bool IsPaused(void) { return paused || IsHalted(); } - static void Resume() + static void Resume(void) { if (!IsHalted()) { @@ -872,7 +872,7 @@ void musicclass::play(int t) } } -void musicclass::resume() +void musicclass::resume(void) { MusicTrack::Resume(); } diff --git a/desktop_version/src/Music.h b/desktop_version/src/Music.h index ce2aed30..dd9a9112 100644 --- a/desktop_version/src/Music.h +++ b/desktop_version/src/Music.h @@ -19,7 +19,7 @@ public: void destroy(void); void play(int t); - void resume(); + void resume(void); void resumefade(const int fadein_ms); void pause(void); void haltdasmusik(void); diff --git a/desktop_version/src/Render.cpp b/desktop_version/src/Render.cpp index a023171d..9b512d24 100644 --- a/desktop_version/src/Render.cpp +++ b/desktop_version/src/Render.cpp @@ -2284,7 +2284,7 @@ static void draw_roomname_menu(void) * the same in Flip Mode. */ #define FLIP(y, h) (graphics.flipmode ? 220 - (y) - (h) : (y)) -static MapRenderData getmaprenderdata() +static MapRenderData getmaprenderdata(void) { MapRenderData data; diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index fc8f0114..5d89a5bb 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -267,7 +267,7 @@ void Screen::GetWindowSize(int* x, int* y) } } -void Screen::RenderPresent() +void Screen::RenderPresent(void) { SDL_RenderPresent(m_renderer); graphics.clear(); diff --git a/desktop_version/src/Screen.h b/desktop_version/src/Screen.h index 6a419d6d..02284a59 100644 --- a/desktop_version/src/Screen.h +++ b/desktop_version/src/Screen.h @@ -19,7 +19,7 @@ public: void ResizeToNearestMultiple(void); void GetWindowSize(int* x, int* y); - void RenderPresent(); + void RenderPresent(void); void toggleFullScreen(void); void toggleScalingMode(void); diff --git a/desktop_version/src/Textbox.cpp b/desktop_version/src/Textbox.cpp index 1eb553bc..9b0f8479 100644 --- a/desktop_version/src/Textbox.cpp +++ b/desktop_version/src/Textbox.cpp @@ -159,7 +159,7 @@ void textboxclass::padtowidth(size_t new_w) resize(); } -void textboxclass::centertext() +void textboxclass::centertext(void) { padtowidth(w-16); } diff --git a/desktop_version/src/Textbox.h b/desktop_version/src/Textbox.h index dd5a1cba..4e82effc 100644 --- a/desktop_version/src/Textbox.h +++ b/desktop_version/src/Textbox.h @@ -32,7 +32,7 @@ public: void padtowidth(size_t new_w); - void centertext(); + void centertext(void); public: //Fundamentals std::vector lines;