From b39121c6a682eb8ae5efd29a875bd7c098185f04 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 20 Feb 2015 00:31:09 -0500 Subject: Refactor config file API. The config file API previously relied on binding config variables using M_BindVariable() which took a void pointer. It occurred to me that if used on a boolean variable, this would be erroneous, but the void pointer would make it impossible to tell. Split this into separate M_Bind{Foo}Variable() functions based on type, which allows for proper type checking on the pointers that are passed. Vaguely related to #509. --- src/i_joystick.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/i_joystick.c') diff --git a/src/i_joystick.c b/src/i_joystick.c index 06531a0b..eba7f21a 100644 --- a/src/i_joystick.c +++ b/src/i_joystick.c @@ -328,20 +328,20 @@ void I_BindJoystickVariables(void) { int i; - M_BindVariable("use_joystick", &usejoystick); - M_BindVariable("joystick_index", &joystick_index); - M_BindVariable("joystick_x_axis", &joystick_x_axis); - M_BindVariable("joystick_y_axis", &joystick_y_axis); - M_BindVariable("joystick_strafe_axis", &joystick_strafe_axis); - M_BindVariable("joystick_x_invert", &joystick_x_invert); - M_BindVariable("joystick_y_invert", &joystick_y_invert); - M_BindVariable("joystick_strafe_invert",&joystick_strafe_invert); + M_BindIntVariable("use_joystick", &usejoystick); + M_BindIntVariable("joystick_index", &joystick_index); + M_BindIntVariable("joystick_x_axis", &joystick_x_axis); + M_BindIntVariable("joystick_y_axis", &joystick_y_axis); + M_BindIntVariable("joystick_strafe_axis", &joystick_strafe_axis); + M_BindIntVariable("joystick_x_invert", &joystick_x_invert); + M_BindIntVariable("joystick_y_invert", &joystick_y_invert); + M_BindIntVariable("joystick_strafe_invert",&joystick_strafe_invert); for (i = 0; i < NUM_VIRTUAL_BUTTONS; ++i) { char name[32]; M_snprintf(name, sizeof(name), "joystick_physical_button%i", i); - M_BindVariable(name, &joystick_physical_buttons[i]); + M_BindIntVariable(name, &joystick_physical_buttons[i]); } } -- cgit v1.2.3