Commit ffae0123 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

setupapi: Remove superfluous pointer casts.

parent 90358516
......@@ -1242,7 +1242,7 @@ HKEY WINAPI SetupDiCreateDevRegKeyW(
HINF InfHandle,
PCWSTR InfSectionName)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
HKEY key = INVALID_HANDLE_VALUE;
......@@ -1381,7 +1381,7 @@ BOOL WINAPI SetupDiCreateDeviceInfoW(
DWORD CreationFlags,
PSP_DEVINFO_DATA DeviceInfoData)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
BOOL ret = FALSE, allocatedInstanceId = FALSE;
LPCWSTR instanceId = NULL;
......@@ -1520,7 +1520,7 @@ BOOL WINAPI SetupDiRegisterDeviceInfo(
PVOID CompareContext,
PSP_DEVINFO_DATA DupDeviceInfoData)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
TRACE("%p %p %08x %p %p %p\n", DeviceInfoSet, DeviceInfoData, Flags,
......@@ -1575,7 +1575,7 @@ BOOL WINAPI SetupDiEnumDeviceInfo(
}
if (devinfo && devinfo != INVALID_HANDLE_VALUE)
{
struct DeviceInfoSet *list = (struct DeviceInfoSet *)devinfo;
struct DeviceInfoSet *list = devinfo;
if (list->magic == SETUP_DEVICE_INFO_SET_MAGIC)
{
if (index < list->cDevices)
......@@ -1676,7 +1676,7 @@ BOOL WINAPI SetupDiGetDeviceInstanceIdW(
DWORD DeviceInstanceIdSize,
PDWORD RequiredSize)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
TRACE("%p %p %p %d %p\n", DeviceInfoSet, DeviceInfoData, DeviceInstanceId,
......@@ -2029,7 +2029,7 @@ static void SETUPDI_AddDeviceInterfaces(SP_DEVINFO_DATA *dev, HKEY key,
static void SETUPDI_EnumerateMatchingInterfaces(HDEVINFO DeviceInfoSet,
HKEY key, const GUID *interface, LPCWSTR enumstr)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
DWORD i, len;
WCHAR subKeyName[MAX_PATH];
LONG l;
......@@ -2227,7 +2227,7 @@ static void SETUPDI_EnumerateMatchingDeviceInstances(struct DeviceInfoSet *set,
static void SETUPDI_EnumerateMatchingDevices(HDEVINFO DeviceInfoSet,
LPCWSTR parent, HKEY key, const GUID *class, DWORD flags)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
DWORD i, len;
WCHAR subKeyName[MAX_PATH];
LONG l = ERROR_SUCCESS;
......@@ -2378,7 +2378,7 @@ BOOL WINAPI SetupDiGetDeviceInfoListDetailA(
HDEVINFO DeviceInfoSet,
PSP_DEVINFO_LIST_DETAIL_DATA_A DevInfoData )
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
TRACE("%p %p\n", DeviceInfoSet, DevInfoData);
......@@ -2411,7 +2411,7 @@ BOOL WINAPI SetupDiGetDeviceInfoListDetailW(
HDEVINFO DeviceInfoSet,
PSP_DEVINFO_LIST_DETAIL_DATA_W DevInfoData )
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
TRACE("%p %p\n", DeviceInfoSet, DevInfoData);
......@@ -2481,7 +2481,7 @@ BOOL WINAPI SetupDiCreateDeviceInterfaceW(
DWORD CreationFlags,
PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
SP_DEVICE_INTERFACE_DATA *iface = NULL;
BOOL ret;
......@@ -2606,7 +2606,7 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
HINF InfHandle,
PCWSTR InfSectionName)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
HKEY key = INVALID_HANDLE_VALUE, interfacesKey;
LONG l;
......@@ -2714,7 +2714,7 @@ BOOL WINAPI SetupDiDeleteDeviceInterfaceRegKey(
PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
DWORD Reserved)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
HKEY parent;
BOOL ret = FALSE;
......@@ -2786,7 +2786,7 @@ BOOL WINAPI SetupDiEnumDeviceInterfaces(
DWORD MemberIndex,
PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
BOOL ret = FALSE;
TRACE("%p, %p, %s, %d, %p\n", DeviceInfoSet, DeviceInfoData,
......@@ -2882,7 +2882,7 @@ BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
TRACE("%p\n", devinfo);
if (devinfo && devinfo != INVALID_HANDLE_VALUE)
{
struct DeviceInfoSet *list = (struct DeviceInfoSet *)devinfo;
struct DeviceInfoSet *list = devinfo;
if (list->magic == SETUP_DEVICE_INFO_SET_MAGIC)
{
......@@ -2917,7 +2917,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(
PDWORD RequiredSize,
PSP_DEVINFO_DATA DeviceInfoData)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct InterfaceInfo *info;
DWORD bytesNeeded = offsetof(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath)
+ 1;
......@@ -2989,7 +2989,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(
PDWORD RequiredSize,
PSP_DEVINFO_DATA DeviceInfoData)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct InterfaceInfo *info;
DWORD bytesNeeded = offsetof(SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath)
+ sizeof(WCHAR); /* include NULL terminator */
......@@ -3088,7 +3088,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyA(
PDWORD RequiredSize)
{
BOOL ret = FALSE;
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
TRACE("%04x %p %d %p %p %d %p\n", (DWORD)DeviceInfoSet, DeviceInfoData,
......@@ -3149,7 +3149,7 @@ BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(
PDWORD RequiredSize)
{
BOOL ret = FALSE;
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
TRACE("%04x %p %d %p %p %d %p\n", (DWORD)DeviceInfoSet, DeviceInfoData,
......@@ -3208,7 +3208,7 @@ BOOL WINAPI SetupDiSetDeviceRegistryPropertyA(
DWORD PropertyBufferSize)
{
BOOL ret = FALSE;
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
TRACE("%p %p %d %p %d\n", DeviceInfoSet, DeviceInfoData, Property,
......@@ -3256,7 +3256,7 @@ BOOL WINAPI SetupDiSetDeviceRegistryPropertyW(
DWORD PropertyBufferSize)
{
BOOL ret = FALSE;
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
TRACE("%p %p %d %p %d\n", DeviceInfoSet, DeviceInfoData, Property,
......@@ -3733,7 +3733,7 @@ HKEY WINAPI SetupDiOpenDevRegKey(
DWORD KeyType,
REGSAM samDesired)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
HKEY key = INVALID_HANDLE_VALUE;
......@@ -3849,7 +3849,7 @@ BOOL WINAPI SetupDiDeleteDevRegKey(
DWORD HwProfile,
DWORD KeyType)
{
struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet;
struct DeviceInfoSet *set = DeviceInfoSet;
struct DeviceInfo *devInfo;
BOOL ret = FALSE;
......
......@@ -115,7 +115,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
{
WCHAR driveW[20];
unsigned int i;
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
LPDISKSPACELIST list = DiskSpace;
BOOL rc = FALSE;
static const WCHAR bkslsh[]= {'\\',0};
......@@ -144,7 +144,7 @@ BOOL WINAPI SetupQuerySpaceRequiredOnDriveA(HDSKSPC DiskSpace,
*/
BOOL WINAPI SetupDestroyDiskSpaceList(HDSKSPC DiskSpace)
{
LPDISKSPACELIST list = (LPDISKSPACELIST)DiskSpace;
LPDISKSPACELIST list = DiskSpace;
HeapFree(GetProcessHeap(),0,list);
return TRUE;
}
......@@ -76,7 +76,7 @@ static void add_section( struct dll_info *info, const char *name, DWORD size, DW
IMAGE_SECTION_HEADER *sec = (IMAGE_SECTION_HEADER *)(info->nt + 1);
sec += info->nt->FileHeader.NumberOfSections;
memcpy( (char *)sec->Name, name, min( strlen(name), sizeof(sec->Name)) );
memcpy( sec->Name, name, min( strlen(name), sizeof(sec->Name)) );
sec->Misc.VirtualSize = ALIGN( size, section_alignment );
sec->VirtualAddress = info->mem_pos;
sec->SizeOfRawData = size;
......
......@@ -982,7 +982,7 @@ static struct inf_file *parse_file( HANDLE handle, const WCHAR *class, DWORD sty
}
else
{
WCHAR *new_buff = (WCHAR *)buffer;
WCHAR *new_buff = buffer;
/* UCS-16 files should start with the Unicode BOM; we should skip it */
if (*new_buff == 0xfeff)
new_buff++;
......
......@@ -1493,7 +1493,7 @@ UINT WINAPI SetupDefaultQueueCallbackA( PVOID context, UINT notification,
UINT_PTR param1, UINT_PTR param2 )
{
FILEPATHS_A *paths = (FILEPATHS_A *)param1;
struct default_callback_context *ctx = (struct default_callback_context *)context;
struct default_callback_context *ctx = context;
switch(notification)
{
......@@ -1557,7 +1557,7 @@ UINT WINAPI SetupDefaultQueueCallbackW( PVOID context, UINT notification,
UINT_PTR param1, UINT_PTR param2 )
{
FILEPATHS_W *paths = (FILEPATHS_W *)param1;
struct default_callback_context *ctx = (struct default_callback_context *)context;
struct default_callback_context *ctx = context;
switch(notification)
{
......
......@@ -287,7 +287,7 @@ static INT_PTR CDECL sc_FNNOTIFY_A(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
TRACE("(fdint == %d, pfdin == ^%p)\n", fdint, pfdin);
if (pfdin && pfdin->pv && (*((void **) pfdin->pv) == (void *)SC_HSC_A_MAGIC))
phsc = (PSC_HSC_A) pfdin->pv;
phsc = pfdin->pv;
else {
ERR("pv %p is not an SC_HSC_A.\n", (pfdin) ? pfdin->pv : NULL);
return -1;
......@@ -412,7 +412,7 @@ static INT_PTR CDECL sc_FNNOTIFY_W(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION p
TRACE("(fdint == %d, pfdin == ^%p)\n", fdint, pfdin);
if (pfdin && pfdin->pv && (*((void **) pfdin->pv) == (void *)SC_HSC_W_MAGIC))
phsc = (PSC_HSC_W) pfdin->pv;
phsc = pfdin->pv;
else {
ERR("pv %p is not an SC_HSC_W.\n", (pfdin) ? pfdin->pv : NULL);
return -1;
......
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