Fixed warning C4152: nonstandard extension, function/data pointer conversion in expression

This commit is contained in:
Sam Lantinga 2024-01-19 06:36:05 -08:00
parent 9fc1135e3b
commit b566bfce07
8 changed files with 11 additions and 11 deletions

View file

@ -120,7 +120,7 @@ void WIN_CoUninitialize(void)
} }
#ifndef __WINRT__ #ifndef __WINRT__
void *WIN_LoadComBaseFunction(const char *name) FARPROC WIN_LoadComBaseFunction(const char *name)
{ {
static SDL_bool s_bLoaded; static SDL_bool s_bLoaded;
static HMODULE s_hComBase; static HMODULE s_hComBase;

View file

@ -134,7 +134,7 @@ extern int WIN_SetError(const char *prefix);
#ifndef __WINRT__ #ifndef __WINRT__
/* Load a function from combase.dll */ /* Load a function from combase.dll */
void *WIN_LoadComBaseFunction(const char *name); FARPROC WIN_LoadComBaseFunction(const char *name);
#endif #endif
/* Wrap up the oddities of CoInitialize() into a common function. */ /* Wrap up the oddities of CoInitialize() into a common function. */

View file

@ -60,7 +60,7 @@ void *SDL_LoadObject(const char *sofile)
SDL_FunctionPointer SDL_LoadFunction(void *handle, const char *name) SDL_FunctionPointer SDL_LoadFunction(void *handle, const char *name)
{ {
void *symbol = (void *)GetProcAddress((HMODULE)handle, name); SDL_FunctionPointer symbol = (SDL_FunctionPointer)GetProcAddress((HMODULE)handle, name);
if (!symbol) { if (!symbol) {
char errbuf[512]; char errbuf[512];
SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf)); SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));

View file

@ -69,7 +69,7 @@ struct SDL_Thread
int(SDLCALL *userfunc)(void *); int(SDLCALL *userfunc)(void *);
void *userdata; void *userdata;
void *data; void *data;
void *endfunc; /* only used on some platforms. */ SDL_FunctionPointer endfunc; /* only used on some platforms. */
}; };
/* This is the function called to run a thread */ /* This is the function called to run a thread */

View file

@ -82,7 +82,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread)
const DWORD flags = thread->stacksize ? STACK_SIZE_PARAM_IS_A_RESERVATION : 0; const DWORD flags = thread->stacksize ? STACK_SIZE_PARAM_IS_A_RESERVATION : 0;
/* Save the function which we will have to call to clear the RTL of calling app! */ /* Save the function which we will have to call to clear the RTL of calling app! */
thread->endfunc = pfnEndThread; thread->endfunc = (SDL_FunctionPointer)pfnEndThread;
/* thread->stacksize == 0 means "system default", same as win32 expects */ /* thread->stacksize == 0 means "system default", same as win32 expects */
if (pfnBeginThread) { if (pfnBeginThread) {

View file

@ -271,7 +271,7 @@ int SDL_CalculateBlit(SDL_Surface *surface)
blit = SDL_Blit_Slow; blit = SDL_Blit_Slow;
} }
} }
map->data = blit; map->data = (void *)blit;
/* Make sure we have a blit function */ /* Make sure we have a blit function */
if (!blit) { if (!blit) {

View file

@ -214,13 +214,13 @@ int WIN_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path)
SDL_FunctionPointer WIN_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc) SDL_FunctionPointer WIN_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc)
{ {
void *func; SDL_FunctionPointer func;
/* This is to pick up extensions */ /* This is to pick up extensions */
func = _this->gl_data->wglGetProcAddress(proc); func = (SDL_FunctionPointer)_this->gl_data->wglGetProcAddress(proc);
if (!func) { if (!func) {
/* This is probably a normal GL function */ /* This is probably a normal GL function */
func = GetProcAddress(_this->gl_config.dll_handle, proc); func = (SDL_FunctionPointer)GetProcAddress(_this->gl_config.dll_handle, proc);
} }
return func; return func;
} }

View file

@ -65,9 +65,9 @@ int WIN_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path)
if (!vkGetInstanceProcAddr) { if (!vkGetInstanceProcAddr) {
goto fail; goto fail;
} }
_this->vulkan_config.vkGetInstanceProcAddr = (void *)vkGetInstanceProcAddr; _this->vulkan_config.vkGetInstanceProcAddr = (SDL_FunctionPointer)vkGetInstanceProcAddr;
_this->vulkan_config.vkEnumerateInstanceExtensionProperties = _this->vulkan_config.vkEnumerateInstanceExtensionProperties =
(void *)((PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr)( (SDL_FunctionPointer)vkGetInstanceProcAddr(
VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties"); VK_NULL_HANDLE, "vkEnumerateInstanceExtensionProperties");
if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) { if (!_this->vulkan_config.vkEnumerateInstanceExtensionProperties) {
goto fail; goto fail;