Cleanup extraneous elses

This commit is contained in:
twinaphex 2014-08-27 03:28:22 +02:00
parent cec2afe6cb
commit 228569c8f8
9 changed files with 27 additions and 46 deletions

View File

@ -165,8 +165,8 @@ static bool gl_cg_set_mvp(void *data, const math_matrix *mat)
cgGLSetMatrixParameterfc(prg[active_index].mvp, mat->data);
return true;
}
else
return false;
return false;
}
#define SET_COORD(name, coords_name, len) do { \
@ -876,8 +876,7 @@ static unsigned gl_cg_num(void)
{
if (cg_active)
return cg_shader->passes;
else
return 0;
return 0;
}
static bool gl_cg_filter_type(unsigned index, bool *smooth)
@ -889,16 +888,15 @@ static bool gl_cg_filter_type(unsigned index, bool *smooth)
*smooth = cg_shader->pass[index - 1].filter == RARCH_FILTER_LINEAR;
return true;
}
else
return false;
return false;
}
static enum gfx_wrap_type gl_cg_wrap_type(unsigned index)
{
if (cg_active && index)
return cg_shader->pass[index - 1].wrap;
else
return RARCH_WRAP_BORDER;
return RARCH_WRAP_BORDER;
}
static void gl_cg_shader_scale(unsigned index, struct gfx_fbo_scale *scale)
@ -928,8 +926,7 @@ static bool gl_cg_mipmap_input(unsigned index)
{
if (cg_active && index)
return cg_shader->pass[index - 1].mipmap;
else
return false;
return false;
}
static struct gfx_shader *gl_cg_get_current_shader(void)

View File

@ -351,8 +351,7 @@ static bool link_program(GLuint prog)
glUseProgram(prog);
return true;
}
else
return false;
return false;
}
static GLuint compile_program(const char *vertex, const char *fragment, unsigned i)
@ -1148,16 +1147,14 @@ static bool gl_glsl_filter_type(unsigned index, bool *smooth)
*smooth = glsl_shader->pass[index - 1].filter == RARCH_FILTER_LINEAR;
return true;
}
else
return false;
return false;
}
static enum gfx_wrap_type gl_glsl_wrap_type(unsigned index)
{
if (glsl_enable && index)
return glsl_shader->pass[index - 1].wrap;
else
return RARCH_WRAP_BORDER;
return RARCH_WRAP_BORDER;
}
static void gl_glsl_shader_scale(unsigned index, struct gfx_fbo_scale *scale)
@ -1187,8 +1184,7 @@ static bool gl_glsl_mipmap_input(unsigned index)
{
if (glsl_enable && index)
return glsl_shader->pass[index - 1].mipmap;
else
return false;
return false;
}
static struct gfx_shader *gl_glsl_get_current_shader(void)

View File

@ -390,8 +390,7 @@ static unsigned hlsl_num(void)
{
if (hlsl_active)
return cg_shader->passes;
else
return 0;
return 0;
}
static bool hlsl_filter_type(unsigned index, bool *smooth)
@ -403,8 +402,7 @@ static bool hlsl_filter_type(unsigned index, bool *smooth)
*smooth = cg_shader->pass[index - 1].filter = RARCH_FILTER_LINEAR;
return true;
}
else
return false;
return false;
}
static void hlsl_shader_scale(unsigned index, struct gfx_fbo_scale *scale)
@ -425,8 +423,7 @@ static bool hlsl_set_mvp(void *data, const math_matrix *mat)
prg[active_index].v_ctable->SetMatrix(d3d_device_ptr, prg[active_index].mvp, (D3DXMATRIX*)&prg[active_index].mvp_val);
return true;
}
else
return false;
return false;
}
static bool hlsl_mipmap_input(unsigned index)

View File

@ -332,8 +332,8 @@ static bool apple_joypad_button(unsigned port, uint16_t joykey)
// Check hat.
if (GET_HAT_DIR(joykey))
return false;
else // Check the button
return (port < MAX_PLAYERS && joykey < 32) ? (g_current_input_data.pad_buttons[port] & (1 << joykey)) != 0 : false;
// Check the button
return (port < MAX_PLAYERS && joykey < 32) ? (g_current_input_data.pad_buttons[port] & (1 << joykey)) != 0 : false;
}
static int16_t apple_joypad_axis(unsigned port, uint32_t joyaxis)

View File

@ -128,8 +128,7 @@ static bool linuxraw_is_pressed(linuxraw_input_t *linuxraw, const struct retro_k
const struct retro_keybind *bind = &binds[id];
return bind->valid && linuxraw_key_pressed(linuxraw, binds[id].key);
}
else
return false;
return false;
}
static int16_t linuxraw_analog_pressed(linuxraw_input_t *linuxraw,

View File

@ -103,11 +103,9 @@ static bool linuxraw_joypad_init_pad(const char *path, struct linuxraw_joypad *p
epoll_ctl(g_epoll, EPOLL_CTL_ADD, pad->fd, &event);
return true;
}
else
{
RARCH_ERR("[Joypad]: Failed to open pad %s (error: %s).\n", path, strerror(errno));
return false;
}
RARCH_ERR("[Joypad]: Failed to open pad %s (error: %s).\n", path, strerror(errno));
return false;
}
static void handle_plugged_pad(void)

View File

@ -76,8 +76,7 @@ static inline int16_t compute_axis(const struct input_absinfo *info, int value)
return 0x7fff;
else if (axis < -0x7fff)
return -0x7fff;
else
return axis;
return axis;
}
static void poll_pad(unsigned p)
@ -532,8 +531,7 @@ static bool udev_joypad_button(unsigned port, uint16_t joykey)
if (GET_HAT_DIR(joykey))
return udev_joypad_hat(pad, joykey);
else
return joykey < NUM_BUTTONS && pad->buttons[joykey];
return joykey < NUM_BUTTONS && pad->buttons[joykey];
}
static int16_t udev_joypad_axis(unsigned port, uint32_t joyaxis)

View File

@ -136,9 +136,8 @@ const char* winxinput_joypad_name (unsigned pad)
if (xplayer < 0)
return dinput_joypad.name(pad);
else
// TODO: Different name if disconnected?
return XBOX_CONTROLLER_NAMES[xplayer];
// TODO: Different name if disconnected?
return XBOX_CONTROLLER_NAMES[xplayer];
}
static bool winxinput_joypad_init(void)
@ -245,8 +244,7 @@ static bool winxinput_joypad_query_pad(unsigned pad)
int xplayer = pad_index_to_xplayer_index(pad);
if (xplayer > -1)
return g_winxinput_states[xplayer].connected;
else
return dinput_joypad.query_pad(pad);
return dinput_joypad.query_pad(pad);
}
static void winxinput_joypad_destroy(void)
@ -392,8 +390,7 @@ static bool winxinput_joypad_rumble(unsigned pad, enum retro_rumble_effect effec
{
if (dinput_joypad.set_rumble)
return dinput_joypad.set_rumble(pad, effect, strength);
else
return false;
return false;
}

View File

@ -81,8 +81,7 @@ static bool x_is_pressed(x11_input_t *x11, const struct retro_keybind *binds, un
const struct retro_keybind *bind = &binds[id];
return bind->valid && x_key_pressed(x11, binds[id].key);
}
else
return false;
return false;
}
static int16_t x_pressed_analog(x11_input_t *x11, const struct retro_keybind *binds, unsigned index, unsigned id)