shithub: m8c

Download patch

ref: b960255025fac920d12f89ef3493fb09ba2eb40b
parent: d9e9e18ee28a0de26ad481d6718267ca9b2d3509
author: laamaa <jonne.kokkonen@gmail.com>
date: Sat Sep 6 17:17:01 EDT 2025

minor cleanups

--- a/src/gamepads.c
+++ b/src/gamepads.c
@@ -22,7 +22,7 @@
  * @return The number of successfully initialized game controllers. Returns -1 if an error occurs
  *         during the initialization process.
  */
-int gamepads_initialize() {
+int gamepads_initialize(void) {
 
   int num_joysticks = 0;
   SDL_JoystickID *joystick_ids = NULL;
@@ -92,7 +92,7 @@
 }
 
 // Closes all open game controllers
-void gamepads_close() {
+void gamepads_close(void) {
 
   for (int i = 0; i < MAX_CONTROLLERS; i++) {
     if (game_controllers[i])
--- a/src/gamepads.h
+++ b/src/gamepads.h
@@ -2,15 +2,10 @@
 // Created by jonne on 8/19/24.
 //
 
-#ifndef GAMECONTROLLERS_H_
-#define GAMECONTROLLERS_H_
+#ifndef GAMEPADS_H_
+#define GAMEPADS_H_
 
-#include "config.h"
-#include "input.h"
+int gamepads_initialize(void);
+void gamepads_close(void);
 
-int gamepads_initialize();
-void gamepads_close();
-int gamecontrollers_handle_buttons(const config_params_s *conf);
-input_msg_s gamecontrollers_handle_special_messages(const config_params_s *conf);
-
-#endif //GAMECONTROLLERS_H_
+#endif //GAMEPADS_H_
--- a/src/input.c
+++ b/src/input.c
@@ -21,7 +21,7 @@
   int analog_values[SDL_GAMEPAD_AXIS_COUNT];
 } gamepad_state = {0};
 
-static unsigned char toggle_input_keyjazz() {
+static unsigned char toggle_input_keyjazz(void) {
   keyjazz_enabled = !keyjazz_enabled;
   SDL_LogDebug(SDL_LOG_CATEGORY_SYSTEM, keyjazz_enabled ? "Keyjazz enabled" : "Keyjazz disabled");
   return keyjazz_enabled;
--- a/src/main.c
+++ b/src/main.c
@@ -106,15 +106,6 @@
   return conf;
 }
 
-/**
- * Handles the initialization of a device and verifies its connection state.
- *
- * @param wait_for_device A flag indicating whether the system should wait for the device to
- * connect. If set to 0 and the device is not detected, the application exits.
- * @param preferred_device A string representing the preferred device to initialize.
- * @return An unsigned char indicating the connection state of the device.
- *         Returns 1 if the device is connected successfully, or 0 if not connected.
- */
 // Main callback loop - read inputs, process data from the device, render screen
 SDL_AppResult SDL_AppIterate(void *appstate) {
   if (appstate == NULL) {
--- a/src/render.c
+++ b/src/render.c
@@ -94,7 +94,7 @@
 }
 
 // Creates an intermediate texture dynamically based on window size
-static void create_hd_texture() {
+static void create_hd_texture(void) {
   int window_width, window_height;
 
   // Get the current window size
@@ -739,7 +739,9 @@
   }
   SDL_SetRenderTarget(rend, main_texture);
   renderer_set_font_mode(1);
-  global_background_color.r = 0, global_background_color.g = 0, global_background_color.b = 0;
+  global_background_color.r = 0;
+  global_background_color.g = 0;
+  global_background_color.b = 0;
   fx_cube_init(rend, (SDL_Color){255, 255, 255, 255}, texture_width, texture_height,
                fonts[font_mode]->glyph_x);
   SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "Screensaver initialized");
--