C89 build fixes

This commit is contained in:
twinaphex 2017-05-19 03:34:53 +02:00
parent fa9fe88547
commit b0398c1482
25 changed files with 47 additions and 45 deletions

View File

@ -900,10 +900,10 @@ static bool next_string(char **_ptr, char **_str)
static bool int_string(char *str, int *val)
{
char *endptr = NULL;
if (!str)
return false;
char *endptr = NULL;
*val = (int) strtol(str, &endptr, 0);
return ((*str != '\0') && (*endptr == '\0'));
}

View File

@ -503,7 +503,7 @@ bool x11_connect(void)
return true;
}
void x11_update_title(void *data, video_frame_info_t *video_info)
void x11_update_title(void *data, void *data2)
{
char title[128];

View File

@ -62,7 +62,7 @@ bool x11_alive(void *data);
bool x11_connect(void);
void x11_update_title(void *data, video_frame_info_t *video_info);
void x11_update_title(void *data, void *data2);
bool x11_input_ctx_new(bool true_full);

View File

@ -471,7 +471,7 @@ dpi_fallback:
return true;
}
static void android_gfx_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
static void android_gfx_ctx_swap_buffers(void *data, void *data2)
{
android_ctx_data_t *and = (android_ctx_data_t*)data;

View File

@ -427,10 +427,11 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
}
#if defined(HAVE_COCOA)
static void cocoagl_gfx_ctx_update_title(void *data, video_frame_info_t *video_info)
static void cocoagl_gfx_ctx_update_title(void *data, void *data2)
{
ui_window_cocoa_t view;
const ui_window_t *window = ui_companion_driver_get_window_ptr();
video_frame_info_t *video_info = (video_frame_info_t*)data2;
const ui_window_t *window = ui_companion_driver_get_window_ptr();
view.data = (CocoaView*)nsview_get_ptr();
@ -538,7 +539,7 @@ static bool cocoagl_gfx_ctx_has_windowed(void *data)
}
#endif
static void cocoagl_gfx_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
static void cocoagl_gfx_ctx_swap_buffers(void *data, void *data2)
{
if (!(--g_fast_forward_skips < 0))
return;

View File

@ -75,7 +75,7 @@ static bool gfx_ctx_d3d_set_resize(void *data, unsigned new_width, unsigned new_
return true;
}
static void gfx_ctx_d3d_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_d3d_swap_buffers(void *data, void *data2)
{
d3d_video_t *d3d = (d3d_video_t*)data;
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
@ -83,8 +83,9 @@ static void gfx_ctx_d3d_swap_buffers(void *data, video_frame_info_t *video_info)
d3d_swap(d3d, d3dr);
}
static void gfx_ctx_d3d_update_title(void *data, video_frame_info_t *video_info)
static void gfx_ctx_d3d_update_title(void *data, void *data2)
{
video_frame_info_t *video_info = (video_frame_info_t*)data2;
#ifdef _XBOX
if (video_info->fps_show)
{

View File

@ -228,9 +228,10 @@ static bool gfx_ctx_drm_queue_flip(void)
return false;
}
static void gfx_ctx_drm_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_drm_swap_buffers(void *data, void *data2)
{
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
video_frame_info_t *video_info = (video_frame_info_t*)data2;
switch (drm_api)
{

View File

@ -74,7 +74,7 @@ static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
*quit = false;
}
static void gfx_ctx_emscripten_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_emscripten_swap_buffers(void *data, void *data2)
{
(void)data;
/* no-op in emscripten, no way to force swap/wait for VSync in browsers */

View File

@ -86,7 +86,7 @@ static bool gfx_ctx_gdi_set_resize(void *data,
return false;
}
static void gfx_ctx_gdi_update_window_title(void *data, video_frame_info_t *video_info)
static void gfx_ctx_gdi_update_window_title(void *data, void *data2)
{
const ui_window_t *window = ui_companion_driver_get_window_ptr();
char title[128];
@ -284,7 +284,7 @@ static uint32_t gfx_ctx_gdi_get_flags(void *data)
return flags;
}
static void gfx_ctx_gdi_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_gdi_swap_buffers(void *data, void *data2)
{
(void)data;

View File

@ -34,7 +34,7 @@ static void gfx_ctx_null_check_window(void *data, bool *quit,
(void)resize;
}
static void gfx_ctx_null_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_null_swap_buffers(void *data, void *data2)
{
(void)data;
}

View File

@ -180,7 +180,7 @@ static void gfx_ctx_khr_display_set_swap_interval(void *data, unsigned swap_inte
}
}
static void gfx_ctx_khr_display_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_khr_display_swap_buffers(void *data, void *data2)
{
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
vulkan_present(&khr->vk, khr->vk.context.current_swapchain_index);

View File

@ -241,7 +241,7 @@ static void gfx_ctx_mali_fbdev_set_swap_interval(void *data, unsigned swap_inter
#endif
}
static void gfx_ctx_mali_fbdev_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_mali_fbdev_swap_buffers(void *data, void *data2)
{
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;

View File

@ -203,7 +203,7 @@ static bool gfx_ctx_opendingux_suppress_screensaver(void *data, bool enable)
return false;
}
static void gfx_ctx_opendingux_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_opendingux_swap_buffers(void *data, void *data2)
{
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;

View File

@ -337,7 +337,7 @@ static bool osmesa_ctx_has_windowed(void *data)
return true;
}
static void osmesa_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
static void osmesa_ctx_swap_buffers(void *data, void *data2)
{
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
osmesa_fifo_accept(osmesa);

View File

@ -173,7 +173,7 @@ static bool gfx_ctx_ps3_suppress_screensaver(void *data, bool enable)
return false;
}
static void gfx_ctx_ps3_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_ps3_swap_buffers(void *data, void *data2)
{
(void)data;
#ifdef HAVE_LIBDBGFONT

View File

@ -413,7 +413,7 @@ static void gfx_ctx_qnx_set_swap_interval(void *data, unsigned swap_interval)
#endif
}
static void gfx_ctx_qnx_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_qnx_swap_buffers(void *data, void *data2)
{
qnx_ctx_data_t *qnx = (qnx_ctx_data_t*)data;

View File

@ -266,7 +266,7 @@ static void sdl_ctx_get_video_size(void *data,
}
}
static void sdl_ctx_update_title(void *data, video_frame_info_t *video_info)
static void sdl_ctx_update_title(void *data, void *data2)
{
char title[128];
@ -365,7 +365,7 @@ static bool sdl_ctx_has_windowed(void *data)
return true;
}
static void sdl_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
static void sdl_ctx_swap_buffers(void *data, void *data2)
{
#ifdef HAVE_SDL2
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;

View File

@ -581,7 +581,7 @@ error:
return false;
}
static void gfx_ctx_vc_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_vc_swap_buffers(void *data, void *data2)
{
vc_ctx_data_t *vc = (vc_ctx_data_t*)data;

View File

@ -219,7 +219,7 @@ static void gfx_ctx_vivante_set_swap_interval(void *data, unsigned swap_interval
#endif
}
static void gfx_ctx_vivante_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_vivante_swap_buffers(void *data, void *data2)
{
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;

View File

@ -1567,7 +1567,7 @@ static void *gfx_ctx_wl_get_context_data(void *data)
}
#endif
static void gfx_ctx_wl_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_wl_swap_buffers(void *data, void *data2)
{
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;

View File

@ -350,7 +350,7 @@ static void gfx_ctx_wgl_check_window(void *data, bool *quit,
}
}
static void gfx_ctx_wgl_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_wgl_swap_buffers(void *data, void *data2)
{
(void)data;
@ -405,7 +405,7 @@ static bool gfx_ctx_wgl_set_resize(void *data,
return false;
}
static void gfx_ctx_wgl_update_title(void *data, video_frame_info_t *video_info)
static void gfx_ctx_wgl_update_title(void *data, void *data2)
{
const ui_window_t *window = ui_companion_driver_get_window_ptr();

View File

@ -307,7 +307,7 @@ static void gfx_ctx_x_swap_interval(void *data, unsigned interval)
}
}
static void gfx_ctx_x_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_x_swap_buffers(void *data, void *data2)
{
gfx_ctx_x_data_t *x = (gfx_ctx_x_data_t*)data;

View File

@ -490,7 +490,7 @@ static void gfx_ctx_xegl_show_mouse(void *data, bool state)
x11_show_mouse(g_x11_dpy, g_x11_win, state);
}
static void gfx_ctx_xegl_swap_buffers(void *data, video_frame_info_t *video_info)
static void gfx_ctx_xegl_swap_buffers(void *data, void *data2)
{
xegl_ctx_data_t *xegl = (xegl_ctx_data_t*)data;

View File

@ -388,11 +388,11 @@ static const shader_backend_t *shader_ctx_drivers[] = {
/* Stub functions */
static void update_window_title_null(void *data, video_frame_info_t *video_info)
static void update_window_title_null(void *data, void *data2)
{
}
static void swap_buffers_null(void *data, video_frame_info_t *video_info)
static void swap_buffers_null(void *data, void *data2)
{
}

View File

@ -319,14 +319,6 @@ typedef struct video_shader_ctx_texture
typedef void (*gfx_ctx_proc_t)(void);
typedef struct video_frame_info video_frame_info_t;
typedef void (*update_window_title_cb)(void*, video_frame_info_t *video_info);
typedef void (*swap_buffers_cb)(void*, video_frame_info_t *video_info);
typedef bool (*get_metrics_cb)(void *data, enum display_metric_types type,
float *value);
typedef bool (*set_resize_cb)(void*, unsigned, unsigned);
typedef struct video_info
{
/* Width of window.
@ -452,13 +444,20 @@ typedef struct video_frame_info
float xmb_alpha_factor;
char fps_text[128];
update_window_title_cb cb_update_window_title;
swap_buffers_cb cb_swap_buffers;
get_metrics_cb cb_get_metrics;
set_resize_cb cb_set_resize;
void (*cb_update_window_title)(void*, void *);
void (*cb_swap_buffers)(void*, void *);
bool (*cb_get_metrics)(void *data, enum display_metric_types type,
float *value);
bool (*cb_set_resize)(void*, unsigned, unsigned);
void *context_data;
} video_frame_info_t;
typedef void (*update_window_title_cb)(void*, void*);
typedef bool (*get_metrics_cb)(void *data, enum display_metric_types type,
float *value);
typedef bool (*set_resize_cb)(void*, unsigned, unsigned);
typedef struct gfx_ctx_driver
{
/* The opaque pointer is the underlying video driver data (e.g. gl_t for
@ -521,7 +520,7 @@ typedef struct gfx_ctx_driver
/* Swaps buffers. VBlank sync depends on
* earlier calls to swap_interval. */
swap_buffers_cb swap_buffers;
void (*swap_buffers)(void*, void *);
/* Most video backends will want to use a certain input driver.
* Checks for it here. */