Skip to content

Commit

Permalink
[PATCH] Fix some C++ build issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Nov 29, 2014
1 parent 3c9e978 commit 9ed2ba8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion decompress/zip_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int read_zip_file(const char * archive_path,
*buf = malloc(file_info.uncompressed_size + 1 );

bytes_read = unzReadCurrentFile( zipfile, *buf, file_info.uncompressed_size );
if (bytes_read != file_info.uncompressed_size)
if (bytes_read != (ssize_t)file_info.uncompressed_size)
{
RARCH_ERR(
"We tried to read %d bytes, but only got %d of file %s in zip %s.\n",
Expand Down
3 changes: 2 additions & 1 deletion frontend/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ bool main_load_content(int argc, char **argv, args_type() args,
process_args_t process_args)
{
bool retval = true;
int i, ret = 0, rarch_argc = 0;
int ret = 0, rarch_argc = 0;
unsigned i;
char *rarch_argv[MAX_ARGS] = {NULL};
char *argv_copy [MAX_ARGS] = {NULL};
char **rarch_argv_ptr = (char**)argv;
Expand Down
31 changes: 18 additions & 13 deletions gfx/shader/shader_glsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,18 +1121,18 @@ static bool gl_glsl_set_mvp(void *data, const math_matrix_4x4 *mat)
(void)data;

if (!glsl || !glsl->glsl_shader->modern)
goto fallback;
{
#ifndef NO_GL_FF_MATRIX
gl_ff_matrix(mat);
#endif
return false;
}

int loc = glsl->gl_uniforms[glsl->glsl_active_index].mvp;
if (loc >= 0)
glUniformMatrix4fv(loc, 1, GL_FALSE, mat->data);

return true;
fallback:
#ifndef NO_GL_FF_MATRIX
gl_ff_matrix(mat);
#endif
return false;
}

static bool gl_glsl_set_coords(const void *data)
Expand All @@ -1141,7 +1141,12 @@ static bool gl_glsl_set_coords(const void *data)
glsl_shader_data_t *glsl = (glsl_shader_data_t*)driver.video_shader_data;

if (!glsl || !glsl->glsl_shader->modern || !coords)
goto fallback;
{
#ifndef NO_GL_FF_VERTEX
gl_ff_vertex(coords);
#endif
return false;
}

/* Avoid hitting malloc on every single regular quad draw. */
GLfloat short_buffer[4 * (2 + 2 + 4 + 2)];
Expand All @@ -1151,7 +1156,12 @@ static bool gl_glsl_set_coords(const void *data)
(2 + 2 + 4 + 2), sizeof(*buffer));

if (!buffer)
goto fallback;
{
#ifndef NO_GL_FF_VERTEX
gl_ff_vertex(coords);
#endif
return false;
}

size_t size = 0;

Expand Down Expand Up @@ -1226,11 +1236,6 @@ static bool gl_glsl_set_coords(const void *data)
if (buffer != short_buffer)
free(buffer);
return true;
fallback:
#ifndef NO_GL_FF_VERTEX
gl_ff_vertex(coords);
#endif
return false;
}

static void gl_glsl_use(void *data, unsigned idx)
Expand Down
2 changes: 1 addition & 1 deletion input/keyboard_event_xkb.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void handle_xkb(
mod |= xkb_state_mod_index_is_active(
xkb_state,
*map_idx,
(XKB_STATE_MODS_EFFECTIVE) > 0) ? *map_bit : 0;
(enum xkb_state_component)((XKB_STATE_MODS_EFFECTIVE) > 0)) ? *map_bit : 0;
}

input_keyboard_event(value, input_translate_keysym_to_rk(code),
Expand Down

0 comments on commit 9ed2ba8

Please sign in to comment.