@@ -62,24 +62,24 @@ struct gl_renderer {
6262#endif
6363};
6464
65- static void * try_get_proc_address (const char * name ) {
66- void * address ;
65+ static fn_ptr_t try_get_proc_address (const char * name ) {
66+ fn_ptr_t address ;
6767
6868 address = eglGetProcAddress (name );
6969 if (address ) {
7070 return address ;
7171 }
7272
73- address = dlsym (RTLD_DEFAULT , name );
73+ address = ( fn_ptr_t ) dlsym (RTLD_DEFAULT , name );
7474 if (address ) {
7575 return address ;
7676 }
7777
78- return NULL ;
78+ return ( fn_ptr_t ) NULL ;
7979}
8080
81- static void * get_proc_address (const char * name ) {
82- void * address ;
81+ static fn_ptr_t get_proc_address (const char * name ) {
82+ fn_ptr_t address ;
8383
8484 address = try_get_proc_address (name );
8585 if (address == NULL ) {
@@ -183,7 +183,7 @@ struct gl_renderer *gl_renderer_new_from_gbm_device(
183183
184184 if (supports_egl_ext_platform_base ) {
185185#ifdef EGL_EXT_platform_base
186- egl_get_platform_display_ext = try_get_proc_address ("eglGetPlatformDisplayEXT" );
186+ egl_get_platform_display_ext = ( PFNEGLGETPLATFORMDISPLAYEXTPROC ) try_get_proc_address ("eglGetPlatformDisplayEXT" );
187187 if (egl_get_platform_display_ext == NULL ) {
188188 LOG_ERROR ("Couldn't resolve \"eglGetPlatformDisplayEXT\" even though \"EGL_EXT_platform_base\" was listed as supported.\n" );
189189 supports_egl_ext_platform_base = false;
@@ -195,7 +195,8 @@ struct gl_renderer *gl_renderer_new_from_gbm_device(
195195
196196 if (supports_egl_ext_platform_base ) {
197197#ifdef EGL_EXT_platform_base
198- egl_create_platform_window_surface_ext = try_get_proc_address ("eglCreatePlatformWindowSurfaceEXT" );
198+ egl_create_platform_window_surface_ext = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC
199+ ) try_get_proc_address ("eglCreatePlatformWindowSurfaceEXT" );
199200 if (egl_create_platform_window_surface_ext == NULL ) {
200201 LOG_ERROR (
201202 "Couldn't resolve \"eglCreatePlatformWindowSurfaceEXT\" even though \"EGL_EXT_platform_base\" was listed as supported.\n"
@@ -217,8 +218,9 @@ struct gl_renderer *gl_renderer_new_from_gbm_device(
217218 bool failed_before = false;
218219
219220#ifdef EGL_VERSION_1_5
220- PFNEGLGETPLATFORMDISPLAYPROC egl_get_platform_display = try_get_proc_address ("eglGetPlatformDisplay" );
221- PFNEGLCREATEPLATFORMWINDOWSURFACEPROC egl_create_platform_window_surface = try_get_proc_address ("eglCreatePlatformWindowSurface" );
221+ PFNEGLGETPLATFORMDISPLAYPROC egl_get_platform_display = (PFNEGLGETPLATFORMDISPLAYPROC ) try_get_proc_address ("eglGetPlatformDisplay" );
222+ PFNEGLCREATEPLATFORMWINDOWSURFACEPROC egl_create_platform_window_surface = (PFNEGLCREATEPLATFORMWINDOWSURFACEPROC
223+ ) try_get_proc_address ("eglCreatePlatformWindowSurface" );
222224
223225 if (egl_display == EGL_NO_DISPLAY && egl_get_platform_display != NULL ) {
224226 egl_display = egl_get_platform_display (EGL_PLATFORM_GBM_KHR , gbm_device , NULL );
@@ -550,7 +552,7 @@ int gl_renderer_clear_current(struct gl_renderer *renderer) {
550552 return 0 ;
551553}
552554
553- void * gl_renderer_get_proc_address (ASSERTED struct gl_renderer * renderer , const char * name ) {
555+ fn_ptr_t gl_renderer_get_proc_address (ASSERTED struct gl_renderer * renderer , const char * name ) {
554556 ASSERT_NOT_NULL (renderer );
555557 ASSERT_NOT_NULL (name );
556558 return get_proc_address (name );
@@ -628,7 +630,7 @@ int gl_renderer_make_this_a_render_thread(struct gl_renderer *renderer) {
628630 return 0 ;
629631}
630632
631- void gl_renderer_cleanup_this_render_thread () {
633+ void gl_renderer_cleanup_this_render_thread (void ) {
632634 EGLDisplay display ;
633635 EGLContext context ;
634636 EGLBoolean egl_ok ;
0 commit comments