From e1f36e66a53ff526d566c0e95bb3082a1c8b194c Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 30 Mar 2022 22:49:16 -0600 Subject: [PATCH] Reduce casts to `(void)` --- src/SFML/Main/MainAndroid.cpp | 37 ++++++++---------------------- src/SFML/Window/DRM/DRMContext.cpp | 7 ++---- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/src/SFML/Main/MainAndroid.cpp b/src/SFML/Main/MainAndroid.cpp index 46ac3f76d..1e08ca93e 100644 --- a/src/SFML/Main/MainAndroid.cpp +++ b/src/SFML/Main/MainAndroid.cpp @@ -245,9 +245,8 @@ void getScreenSizeInPixels(ANativeActivity* activity, int* width, int* height) //////////////////////////////////////////////////////////// -static void onStart(ANativeActivity* activity) +static void onStart(ANativeActivity* /* activity */) { - (void) activity; } @@ -285,9 +284,8 @@ static void onPause(ANativeActivity* activity) //////////////////////////////////////////////////////////// -static void onStop(ANativeActivity* activity) +static void onStop(ANativeActivity* /* activity */) { - (void) activity; } @@ -340,8 +338,6 @@ static void onDestroy(ANativeActivity* activity) //////////////////////////////////////////////////////////// static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) { - (void) window; - sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity); std::scoped_lock lock(states->mutex); @@ -365,10 +361,8 @@ static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* wind //////////////////////////////////////////////////////////// -static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) +static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* /* window */) { - (void) window; - sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity); std::scoped_lock lock(states->mutex); @@ -392,18 +386,14 @@ static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* wi //////////////////////////////////////////////////////////// -static void onNativeWindowRedrawNeeded(ANativeActivity* activity, ANativeWindow* window) +static void onNativeWindowRedrawNeeded(ANativeActivity* /* activity */, ANativeWindow* /* window */) { - (void) activity; - (void) window; } //////////////////////////////////////////////////////////// -static void onNativeWindowResized(ANativeActivity* activity, ANativeWindow* window) +static void onNativeWindowResized(ANativeActivity* /* activity */, ANativeWindow* /* window */) { - (void) activity; - (void) window; } @@ -442,18 +432,14 @@ static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) //////////////////////////////////////////////////////////// -static void onWindowFocusChanged(ANativeActivity* activity, int focused) +static void onWindowFocusChanged(ANativeActivity* /* activity */, int /* focused */) { - (void) activity; - (void) focused; } //////////////////////////////////////////////////////////// -static void onContentRectChanged(ANativeActivity* activity, const ARect* rect) +static void onContentRectChanged(ANativeActivity* activity, const ARect* /* rect */) { - (void) rect; - // Retrieve our activity states from the activity instance sf::priv::ActivityStates* states = sf::priv::retrieveStates(activity); std::scoped_lock lock(states->mutex); @@ -472,16 +458,14 @@ static void onContentRectChanged(ANativeActivity* activity, const ARect* rect) //////////////////////////////////////////////////////////// -static void onConfigurationChanged(ANativeActivity* activity) +static void onConfigurationChanged(ANativeActivity* /* activity */) { - (void) activity; } //////////////////////////////////////////////////////////// -static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) +static void* onSaveInstanceState(ANativeActivity* /* activity */, size_t* outLen) { - (void) activity; *outLen = 0; return nullptr; @@ -489,9 +473,8 @@ static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) //////////////////////////////////////////////////////////// -static void onLowMemory(ANativeActivity* activity) +static void onLowMemory(ANativeActivity* /* activity */) { - (void) activity; } diff --git a/src/SFML/Window/DRM/DRMContext.cpp b/src/SFML/Window/DRM/DRMContext.cpp index 9760e84f9..c15d9b0d4 100644 --- a/src/SFML/Window/DRM/DRMContext.cpp +++ b/src/SFML/Window/DRM/DRMContext.cpp @@ -48,12 +48,9 @@ namespace EGLDisplay display = EGL_NO_DISPLAY; int waitingForFlip = 0; - static void pageFlipHandler(int fd, unsigned int frame, - unsigned int sec, unsigned int usec, void* data) + static void pageFlipHandler(int /* fd */, unsigned int /* frame */, + unsigned int /* sec */, unsigned int /* usec */, void* data) { - // suppress unused param warning - (void)fd, (void)frame, (void)sec, (void)usec; - int* temp = static_cast(data); *temp = 0; }