From 1073dce14b61a912242eb1e8b6d7118281d62be5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 29 Sep 2010 21:13:52 -0700 Subject: [PATCH] Make the union nameless to reduce the complexity of the API. (Are there any compilers still in use that don't support this?) --- include/SDL_syswm.h | 4 ++-- src/video/cocoa/SDL_cocoawindow.m | 2 +- src/video/win32/SDL_win32events.c | 8 ++++---- src/video/win32/SDL_win32window.c | 2 +- src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11window.c | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h index e0b999c4d..ddf0151ba 100644 --- a/include/SDL_syswm.h +++ b/include/SDL_syswm.h @@ -133,7 +133,7 @@ struct SDL_SysWMmsg /* No Cocoa window events yet */ } cocoa; #endif - } msg; + } /*msg*/; }; /** @@ -175,7 +175,7 @@ struct SDL_SysWMinfo NSWindow *window; } cocoa; #endif - } info; + } /*info*/; }; #endif /* SDL_PROTOTYPES_ONLY */ diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 38f2aeda9..8d1c46aab 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -708,7 +708,7 @@ - (BOOL)canBecomeMainWindow if (info->version.major <= SDL_MAJOR_VERSION) { info->subsystem = SDL_SYSWM_COCOA; - info->info.cocoa.window = nswindow; + info->cocoa.window = nswindow; return SDL_TRUE; } else { SDL_SetError("Application not compiled with SDL %d.%d\n", diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index a34380216..c51c68111 100644 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -114,10 +114,10 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SDL_VERSION(&wmmsg.version); wmmsg.subsystem = SDL_SYSWM_WINDOWS; - wmmsg.msg.win.hwnd = hwnd; - wmmsg.msg.win.msg = msg; - wmmsg.msg.win.wParam = wParam; - wmmsg.msg.win.lParam = lParam; + wmmsg.win.hwnd = hwnd; + wmmsg.win.msg = msg; + wmmsg.win.wParam = wParam; + wmmsg.win.lParam = lParam; SDL_SendSysWMEvent(&wmmsg); } diff --git a/src/video/win32/SDL_win32window.c b/src/video/win32/SDL_win32window.c index 2c6720a39..271b95744 100644 --- a/src/video/win32/SDL_win32window.c +++ b/src/video/win32/SDL_win32window.c @@ -552,7 +552,7 @@ WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; if (info->version.major <= SDL_MAJOR_VERSION) { info->subsystem = SDL_SYSWM_WINDOWS; - info->info.win.window = hwnd; + info->win.window = hwnd; return SDL_TRUE; } else { SDL_SetError("Application not compiled with SDL %d.%d\n", diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index f2471dc7c..808439c61 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -90,7 +90,7 @@ X11_DispatchEvent(_THIS) SDL_VERSION(&wmmsg.version); wmmsg.subsystem = SDL_SYSWM_X11; - wmmsg.msg.x11.event = xevent; + wmmsg.x11.event = xevent; SDL_SendSysWMEvent(&wmmsg); } diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 7410a67ba..bce684c03 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1125,8 +1125,8 @@ X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) if (info->version.major == SDL_MAJOR_VERSION && info->version.minor == SDL_MINOR_VERSION) { info->subsystem = SDL_SYSWM_X11; - info->info.x11.display = display; - info->info.x11.window = data->xwindow; + info->x11.display = display; + info->x11.window = data->xwindow; return SDL_TRUE; } else { SDL_SetError("Application not compiled with SDL %d.%d\n",