Browse Source

Removed unnecessary const-qualifiers in src and test files

Petar Popovic 6 months ago
parent
commit
020fb6889c

+ 2 - 2
src/core/linux/SDL_dbus.c

@@ -341,7 +341,7 @@ bool SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *int
     return result;
 }
 
-bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result)
+bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, int expectedtype, void *result)
 {
     bool retval = false;
 
@@ -358,7 +358,7 @@ bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node,
     return retval;
 }
 
-bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result)
+bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, int expectedtype, void *result)
 {
     return SDL_DBus_QueryPropertyOnConnection(dbus.session_conn, node, path, interface, property, expectedtype, result);
 }

+ 2 - 2
src/core/linux/SDL_dbus.h

@@ -94,12 +94,12 @@ extern SDL_DBusContext *SDL_DBus_GetContext(void);
 // These use the built-in Session connection.
 extern bool SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...);
 extern bool SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...);
-extern bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result);
+extern bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, int expectedtype, void *result);
 
 // These use whatever connection you like.
 extern bool SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...);
 extern bool SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...);
-extern bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result);
+extern bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, int expectedtype, void *result);
 
 extern void SDL_DBus_ScreensaverTickle(void);
 extern bool SDL_DBus_ScreensaverInhibit(bool inhibit);

+ 1 - 1
src/dialog/SDL_dialog_utils.c

@@ -97,7 +97,7 @@ char *convert_filters(const SDL_DialogFileFilter *filters, int nfilters,
     return combined;
 }
 
-char *convert_filter(const SDL_DialogFileFilter filter, NameTransform ntf,
+char *convert_filter(SDL_DialogFileFilter filter, NameTransform ntf,
                      const char *prefix, const char *separator,
                      const char *suffix, const char *ext_prefix,
                      const char *ext_separator, const char *ext_suffix)

+ 1 - 1
src/dialog/SDL_dialog_utils.h

@@ -41,7 +41,7 @@ char *convert_filters(const SDL_DialogFileFilter *filters, int nfilters,
 
 // Converts one filter into a single string.
 // <prefix>[filter name]<separator>[filter extension list]<suffix>
-char *convert_filter(const SDL_DialogFileFilter filter, NameTransform ntf,
+char *convert_filter(SDL_DialogFileFilter filter, NameTransform ntf,
                      const char *prefix, const char *separator,
                      const char *suffix, const char *ext_prefix,
                      const char *ext_separator, const char *ext_suffix);

+ 1 - 1
src/events/SDL_keyboard.c

@@ -888,7 +888,7 @@ void SDL_SetModState(SDL_Keymod modstate)
 }
 
 // Note that SDL_ToggleModState() is not a public API. SDL_SetModState() is.
-void SDL_ToggleModState(const SDL_Keymod modstate, const bool toggle)
+void SDL_ToggleModState(SDL_Keymod modstate, bool toggle)
 {
     SDL_Keyboard *keyboard = &SDL_keyboard;
     if (toggle) {

+ 1 - 1
src/events/SDL_keyboard_c.h

@@ -82,6 +82,6 @@ extern void SDL_SendEditingTextCandidates(char **candidates, int num_candidates,
 extern void SDL_QuitKeyboard(void);
 
 // Toggle on or off pieces of the keyboard mod state.
-extern void SDL_ToggleModState(const SDL_Keymod modstate, const bool toggle);
+extern void SDL_ToggleModState(SDL_Keymod modstate, bool toggle);
 
 #endif // SDL_keyboard_c_h_

+ 1 - 1
src/render/SDL_render.c

@@ -354,7 +354,7 @@ bool SDL_FlushRenderer(SDL_Renderer *renderer)
     return true;
 }
 
-void *SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
+void *SDL_AllocateRenderVertices(SDL_Renderer *renderer, size_t numbytes, size_t alignment, size_t *offset)
 {
     const size_t needed = renderer->vertex_data_used + numbytes + alignment;
     const size_t current_offset = renderer->vertex_data_used;

+ 1 - 1
src/render/SDL_sysrender.h

@@ -359,7 +359,7 @@ extern SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode
 /* drivers call this during their Queue*() methods to make space in a array that are used
    for a vertex buffer during RunCommandQueue(). Pointers returned here are only valid until
    the next call, because it might be in an array that gets realloc()'d. */
-extern void *SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset);
+extern void *SDL_AllocateRenderVertices(SDL_Renderer *renderer, size_t numbytes, size_t alignment, size_t *offset);
 
 // Let the video subsystem destroy a renderer without making its pointer invalid.
 extern void SDL_DestroyRendererWithoutFreeing(SDL_Renderer *renderer);

+ 1 - 1
src/stdlib/SDL_string.c

@@ -79,7 +79,7 @@ char *SDL_UCS4ToUTF8(Uint32 codepoint, char *dst)
 
 
 // this expects `from` and `to` to be UTF-32 encoding!
-int SDL_CaseFoldUnicode(const Uint32 from, Uint32 *to)
+int SDL_CaseFoldUnicode(Uint32 from, Uint32 *to)
 {
     // !!! FIXME: since the hashtable is static, maybe we should binary
     // !!! FIXME: search it instead of walking the whole bucket.

+ 1 - 1
src/stdlib/SDL_sysstdlib.h

@@ -26,7 +26,7 @@
 // just a few special pieces right now.
 
 // this expects `from` to be a Unicode codepoint, and `to` to point to AT LEAST THREE Uint32s.
-int SDL_CaseFoldUnicode(const Uint32 from, Uint32 *to);
+int SDL_CaseFoldUnicode(Uint32 from, Uint32 *to);
 
 #endif
 

+ 1 - 1
src/video/x11/SDL_x11pen.c

@@ -402,7 +402,7 @@ static void X11_XInput2NormalizePenAxes(const X11_PenHandle *pen, float *coords)
 }
 
 void X11_PenAxesFromValuators(const X11_PenHandle *pen,
-                              const double *input_values, const unsigned char *mask, const int mask_len,
+                              const double *input_values, const unsigned char *mask, int mask_len,
                               float axis_values[SDL_PEN_AXIS_COUNT])
 {
     for (int i = 0; i < SDL_PEN_AXIS_COUNT; i++) {

+ 1 - 1
src/video/x11/SDL_x11pen.h

@@ -55,7 +55,7 @@ typedef struct X11_PenHandle
 
 // Converts XINPUT2 valuators into pen axis information, including normalisation.
 extern void X11_PenAxesFromValuators(const X11_PenHandle *pen,
-                                     const double *input_values, const unsigned char *mask, const int mask_len,
+                                     const double *input_values, const unsigned char *mask, int mask_len,
                                      float axis_values[SDL_PEN_AXIS_COUNT]);
 
 // Add a pen (if this function's further checks validate it).

+ 2 - 2
test/testaudio.c

@@ -731,7 +731,7 @@ static Texture *CreateTexture(const char *fname)
     return tex;
 }
 
-static Thing *CreateLogicalDeviceThing(Thing *parent, const SDL_AudioDeviceID which, const float x, const float y);
+static Thing *CreateLogicalDeviceThing(Thing *parent, SDL_AudioDeviceID which, float x, float y);
 
 static void DeviceThing_ondrag(Thing *thing, int button, float x, float y)
 {
@@ -903,7 +903,7 @@ static void LogicalDeviceThing_onmousewheel(Thing *thing, float y)
     SDL_SetAudioDeviceGain(thing->data.logdev.devid, thing->meter);
 }
 
-static Thing *CreateLogicalDeviceThing(Thing *parent, const SDL_AudioDeviceID which, const float x, const float y)
+static Thing *CreateLogicalDeviceThing(Thing *parent, SDL_AudioDeviceID which, float x, float y)
 {
     static const ThingType can_be_dropped_onto[] = { THING_TRASHCAN, THING_NULL };
     Thing *physthing = ((parent->what == THING_LOGDEV) || (parent->what == THING_LOGDEV_RECORDING)) ? parent->data.logdev.physdev : parent;