Skip to content

Commit

Permalink
Enable warning C4255: fn signature without args
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopey committed Dec 1, 2024
1 parent fd34a86 commit 81459ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4146")
# C4245: signed const to unsigned
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4245")
# C4255: function declaration missing arguments
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4255")
# C4305: truncation from double to float
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4305")
# C4701: potentially uninitialized local variable used
Expand Down
4 changes: 2 additions & 2 deletions src/controller/joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int joystick_create(controller *ctrl, int joystick_id) {

static vector every_gamepad;

void joystick_init() {
void joystick_init(void) {
int num_joysticks = SDL_NumJoysticks();
vector_create_with_size(&every_gamepad, sizeof(SDL_GameController *), num_joysticks);

Expand All @@ -218,7 +218,7 @@ void joystick_init() {
}
}

void joystick_close() {
void joystick_close(void) {
iterator it;
vector_iter_begin(&every_gamepad, &it);
SDL_GameController **gamepad;
Expand Down
4 changes: 2 additions & 2 deletions src/controller/joystick.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ int joystick_nth_id(int n);
int joystick_name_to_id(const char *name, int offset);
int joystick_offset(int id, const char *name);

void joystick_init();
void joystick_close();
void joystick_init(void);
void joystick_close(void);
void joystick_menu_poll_all(controller *menu_ctrl, ctrl_event **ev);
void joystick_deviceadded(int sdl_joystick_index);
void joystick_deviceremoved(int sdl_joystick_instance_id);
Expand Down

0 comments on commit 81459ea

Please sign in to comment.