diff --git a/driver.h b/driver.h index f20cf578a2..735475a021 100644 --- a/driver.h +++ b/driver.h @@ -112,7 +112,7 @@ enum // RetroArch specific bind IDs. struct retro_keybind { bool valid; - int id; + unsigned id; const char *desc; enum retro_key key; diff --git a/fifo_buffer.h b/fifo_buffer.h index c7c38a37aa..86fd377431 100644 --- a/fifo_buffer.h +++ b/fifo_buffer.h @@ -20,6 +20,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #ifndef FIFO_BUF_TYPEDEF #define FIFO_BUF_TYPEDEF typedef struct fifo_buffer fifo_buffer_t; @@ -32,4 +36,9 @@ void fifo_free(fifo_buffer_t *buffer); size_t fifo_read_avail(fifo_buffer_t *buffer); size_t fifo_write_avail(fifo_buffer_t *buffer); +#ifdef __cplusplus +} #endif + +#endif + diff --git a/file.h b/file.h index a2dc182ff3..c8f5d5e161 100644 --- a/file.h +++ b/file.h @@ -28,11 +28,7 @@ extern "C" { #endif -// Generic file, path and directory handling. - -ssize_t read_file(const char *path, void **buf); -bool read_file_string(const char *path, char **buf); -bool write_file(const char *path, const void *buf, size_t size); +// Handles files related to libretro. bool load_state(const char *path); bool save_state(const char *path); diff --git a/file_path.h b/file_path.h index 3f9b844eb2..0b1fed1576 100644 --- a/file_path.h +++ b/file_path.h @@ -11,6 +11,10 @@ extern "C" { #endif +ssize_t read_file(const char *path, void **buf); +bool read_file_string(const char *path, char **buf); +bool write_file(const char *path, const void *buf, size_t size); + // Yep, this is C alright ;) union string_list_elem_attr { diff --git a/gfx/gl.c b/gfx/gl.c index 8a7cb9d9ad..bdce346451 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -369,7 +369,8 @@ static void gl_shader_scale(void *data, unsigned index, struct gfx_fbo_scale *sc static void gl_compute_fbo_geometry(void *data, unsigned width, unsigned height, unsigned vp_width, unsigned vp_height) { - unsigned i, last_width, last_height, last_max_width, last_max_height; + int i; + unsigned last_width, last_height, last_max_width, last_max_height; gl_t *gl = (gl_t*)data; last_width = width; last_height = height; @@ -907,7 +908,7 @@ static void gl_check_fbo_dimensions(void *data) static void gl_frame_fbo(void *data, const struct gl_tex_info *tex_info) { - size_t i; + int i; gl_t *gl = (gl_t*)data; GLfloat fbo_tex_coords[8] = {0.0f}; diff --git a/gfx/scaler/scaler.h b/gfx/scaler/scaler.h index 86f420c131..59455ca31a 100644 --- a/gfx/scaler/scaler.h +++ b/gfx/scaler/scaler.h @@ -42,9 +42,9 @@ enum scaler_type struct scaler_filter { int16_t *filter; - size_t filter_len; - size_t filter_stride; - int *filter_pos; + int filter_len; + int filter_stride; + int *filter_pos; }; struct scaler_ctx diff --git a/gfx/shader_glsl.c b/gfx/shader_glsl.c index b11e953b64..7d3cb30040 100644 --- a/gfx/shader_glsl.c +++ b/gfx/shader_glsl.c @@ -1209,7 +1209,7 @@ static void gl_glsl_shader_scale(unsigned index, struct gfx_fbo_scale *scale) static unsigned gl_glsl_get_prev_textures(void) { - int i, j; + unsigned i, j; if (!glsl_enable) return 0; diff --git a/thread.h b/thread.h index 8c3b0de27a..7420098bd3 100644 --- a/thread.h +++ b/thread.h @@ -19,6 +19,10 @@ #include "boolean.h" #include +#ifdef __cplusplus +extern "C" { +#endif + // Implements the bare minimum needed for RetroArch. :) typedef struct sthread sthread_t; @@ -50,6 +54,9 @@ int scond_broadcast(scond_t *cond); #endif void scond_signal(scond_t *cond); +#ifdef __cplusplus +} +#endif #endif diff --git a/tools/retroarch-joyconfig.c b/tools/retroarch-joyconfig.c index 12355154b7..b470266f8b 100644 --- a/tools/retroarch-joyconfig.c +++ b/tools/retroarch-joyconfig.c @@ -131,7 +131,7 @@ static void get_binds(config_file_t *conf, config_file_t *auto_conf, int player, int last_axis = -1; bool block_axis = false; - unsigned timeout_ticks = g_timeout * 100; + int timeout_ticks = g_timeout * 100; poll_joypad(driver, joypad, &old_poll); fprintf(stderr, "\nJoypads tend to have stale state after opened.\nPress some buttons and move some axes around to make sure joypad state is completely neutral before proceeding.\nWhen done, press Enter ... ");