Commit b3489305 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Build with nameless structs and unions.

parent f2c55128
......@@ -22,18 +22,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <string.h>
#include <stdlib.h> /* abs() */
#include <sys/types.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include <stdlib.h>
#include "user_private.h"
#include "wine/debug.h"
......@@ -115,9 +104,9 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_id( const IMAGE_RESOURCE_DI
while (min <= max)
{
pos = (min + max) / 2;
if (entry[pos].u.Id == id)
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].u2.s2.OffsetToDirectory);
if (entry[pos].u.Id > id) max = pos - 1;
if (entry[pos].Id == id)
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry[pos].OffsetToDirectory);
if (entry[pos].Id > id) max = pos - 1;
else min = pos + 1;
}
return NULL;
......@@ -134,7 +123,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_default( const IMAGE_RESOURCE_
{
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->u2.s2.OffsetToDirectory);
return (const IMAGE_RESOURCE_DIRECTORY *)((const char *)root + entry->OffsetToDirectory);
}
/*************************************************************************
......@@ -453,7 +442,7 @@ static UINT ICO_ExtractIconExW(
while(n<iconDirCount && xprdeTmp)
{
if(xprdeTmp->u.Id == iId)
if(xprdeTmp->Id == iId)
{
nIconIndex = n;
break;
......@@ -489,7 +478,7 @@ static UINT ICO_ExtractIconExW(
const IMAGE_RESOURCE_DIRECTORY *resdir;
/* go down this resource entry, name */
resdir = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)rootresdir + xresent->u2.s2.OffsetToDirectory);
resdir = (const IMAGE_RESOURCE_DIRECTORY *)((const char *)rootresdir + xresent->OffsetToDirectory);
/* default language (0) */
resdir = find_entry_default(resdir,rootresdir);
......
......@@ -24,8 +24,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#include "user_private.h"
#include "dbt.h"
#include "wine/server.h"
......@@ -80,11 +78,11 @@ void WINAPI keybd_event( BYTE bVk, BYTE bScan,
INPUT input;
input.type = INPUT_KEYBOARD;
input.u.ki.wVk = bVk;
input.u.ki.wScan = bScan;
input.u.ki.dwFlags = dwFlags;
input.u.ki.time = 0;
input.u.ki.dwExtraInfo = dwExtraInfo;
input.ki.wVk = bVk;
input.ki.wScan = bScan;
input.ki.dwFlags = dwFlags;
input.ki.time = 0;
input.ki.dwExtraInfo = dwExtraInfo;
NtUserSendInput( 1, &input, sizeof(input) );
}
......@@ -98,12 +96,12 @@ void WINAPI mouse_event( DWORD dwFlags, DWORD dx, DWORD dy,
INPUT input;
input.type = INPUT_MOUSE;
input.u.mi.dx = dx;
input.u.mi.dy = dy;
input.u.mi.mouseData = dwData;
input.u.mi.dwFlags = dwFlags;
input.u.mi.time = 0;
input.u.mi.dwExtraInfo = dwExtraInfo;
input.mi.dx = dx;
input.mi.dy = dy;
input.mi.mouseData = dwData;
input.mi.dwFlags = dwFlags;
input.mi.time = 0;
input.mi.dwExtraInfo = dwExtraInfo;
NtUserSendInput( 1, &input, sizeof(input) );
}
......
......@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "user_private.h"
......
......@@ -26,9 +26,6 @@
#include <string.h>
#include <wchar.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
......@@ -644,14 +641,14 @@ BOOL WINAPI EnumDisplaySettingsExA(LPCSTR lpszDeviceName, DWORD iModeNum,
lpDevMode->dmBitsPerPel = devmodeW.dmBitsPerPel;
lpDevMode->dmPelsHeight = devmodeW.dmPelsHeight;
lpDevMode->dmPelsWidth = devmodeW.dmPelsWidth;
lpDevMode->u2.dmDisplayFlags = devmodeW.u2.dmDisplayFlags;
lpDevMode->dmDisplayFlags = devmodeW.dmDisplayFlags;
lpDevMode->dmDisplayFrequency = devmodeW.dmDisplayFrequency;
lpDevMode->dmFields = devmodeW.dmFields;
lpDevMode->u1.s2.dmPosition.x = devmodeW.u1.s2.dmPosition.x;
lpDevMode->u1.s2.dmPosition.y = devmodeW.u1.s2.dmPosition.y;
lpDevMode->u1.s2.dmDisplayOrientation = devmodeW.u1.s2.dmDisplayOrientation;
lpDevMode->u1.s2.dmDisplayFixedOutput = devmodeW.u1.s2.dmDisplayFixedOutput;
lpDevMode->dmPosition.x = devmodeW.dmPosition.x;
lpDevMode->dmPosition.y = devmodeW.dmPosition.y;
lpDevMode->dmDisplayOrientation = devmodeW.dmDisplayOrientation;
lpDevMode->dmDisplayFixedOutput = devmodeW.dmDisplayFixedOutput;
}
if (lpszDeviceName) RtlFreeUnicodeString(&nameW);
return ret;
......@@ -1051,7 +1048,7 @@ BOOL WINAPI PhysicalToLogicalPoint( HWND hwnd, POINT *point )
static DISPLAYCONFIG_ROTATION get_dc_rotation(const DEVMODEW *devmode)
{
if (devmode->dmFields & DM_DISPLAYORIENTATION)
return devmode->u1.s2.dmDisplayOrientation + 1;
return devmode->dmDisplayOrientation + 1;
else
return DISPLAYCONFIG_ROTATION_IDENTITY;
}
......@@ -1060,7 +1057,7 @@ static DISPLAYCONFIG_SCANLINE_ORDERING get_dc_scanline_ordering(const DEVMODEW *
{
if (!(devmode->dmFields & DM_DISPLAYFLAGS))
return DISPLAYCONFIG_SCANLINE_ORDERING_UNSPECIFIED;
else if (devmode->u2.dmDisplayFlags & DM_INTERLACED)
else if (devmode->dmDisplayFlags & DM_INTERLACED)
return DISPLAYCONFIG_SCANLINE_ORDERING_INTERLACED;
else
return DISPLAYCONFIG_SCANLINE_ORDERING_PROGRESSIVE;
......@@ -1078,7 +1075,7 @@ static DISPLAYCONFIG_PIXELFORMAT get_dc_pixelformat(DWORD dmBitsPerPel)
static void set_mode_target_info(DISPLAYCONFIG_MODE_INFO *info, const LUID *gpu_luid, UINT32 target_id,
UINT32 flags, const DEVMODEW *devmode)
{
DISPLAYCONFIG_TARGET_MODE *mode = &(info->u.targetMode);
DISPLAYCONFIG_TARGET_MODE *mode = &info->targetMode;
info->infoType = DISPLAYCONFIG_MODE_INFO_TYPE_TARGET;
info->adapterId = *gpu_luid;
......@@ -1102,7 +1099,7 @@ static void set_mode_target_info(DISPLAYCONFIG_MODE_INFO *info, const LUID *gpu_
mode->targetVideoSignalInfo.totalSize.cx = devmode->dmPelsWidth;
mode->targetVideoSignalInfo.totalSize.cy = devmode->dmPelsHeight;
}
mode->targetVideoSignalInfo.u.videoStandard = D3DKMDT_VSS_OTHER;
mode->targetVideoSignalInfo.videoStandard = D3DKMDT_VSS_OTHER;
mode->targetVideoSignalInfo.scanLineOrdering = get_dc_scanline_ordering(devmode);
}
......@@ -1111,7 +1108,7 @@ static void set_path_target_info(DISPLAYCONFIG_PATH_TARGET_INFO *info, const LUI
{
info->adapterId = *gpu_luid;
info->id = target_id;
info->u.modeInfoIdx = mode_index;
info->modeInfoIdx = mode_index;
info->outputTechnology = DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EXTERNAL;
info->rotation = get_dc_rotation(devmode);
info->scaling = DISPLAYCONFIG_SCALING_IDENTITY;
......@@ -1125,7 +1122,7 @@ static void set_path_target_info(DISPLAYCONFIG_PATH_TARGET_INFO *info, const LUI
static void set_mode_source_info(DISPLAYCONFIG_MODE_INFO *info, const LUID *gpu_luid,
UINT32 source_id, const DEVMODEW *devmode)
{
DISPLAYCONFIG_SOURCE_MODE *mode = &(info->u.sourceMode);
DISPLAYCONFIG_SOURCE_MODE *mode = &(info->sourceMode);
info->infoType = DISPLAYCONFIG_MODE_INFO_TYPE_SOURCE;
info->adapterId = *gpu_luid;
......@@ -1136,7 +1133,7 @@ static void set_mode_source_info(DISPLAYCONFIG_MODE_INFO *info, const LUID *gpu_
mode->pixelFormat = get_dc_pixelformat(devmode->dmBitsPerPel);
if (devmode->dmFields & DM_POSITION)
{
mode->position = devmode->u1.s2.dmPosition;
mode->position = devmode->dmPosition;
}
else
{
......@@ -1150,7 +1147,7 @@ static void set_path_source_info(DISPLAYCONFIG_PATH_SOURCE_INFO *info, const LUI
{
info->adapterId = *gpu_luid;
info->id = source_id;
info->u.modeInfoIdx = mode_index;
info->modeInfoIdx = mode_index;
info->statusFlags = DISPLAYCONFIG_SOURCE_IN_USE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment