Various application fixes by Jan Roeloffzen, bug #5182, part 4/4

dxdiag: tabs -> spaces, UINT -> UINT_PTR, remove unused assignments, simplify code, fix compiler warnings

svn path=/trunk/; revision=47461
This commit is contained in:
Gregor Schneider 2010-05-30 20:36:20 +00:00
parent ad964bddb1
commit 8117e46131
4 changed files with 15 additions and 15 deletions

View file

@ -151,7 +151,7 @@ BOOL DDPrimarySurfaceTest(HWND hWnd){
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_TIMER && TimerID == msg.wParam)
if (msg.message == WM_TIMER && TimerID == msg.wParam)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
@ -200,7 +200,7 @@ VOID DDRedrawFrame(LPDIRECTDRAWSURFACE lpDDSurface)
BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen){
UINT TimerID, TimerIDUpdate;
UINT_PTR TimerID, TimerIDUpdate;
LPDIRECTDRAW lpDD;
LPDIRECTDRAWSURFACE lpDDPrimarySurface;
LPDIRECTDRAWSURFACE lpDDBackBuffer;
@ -288,6 +288,7 @@ BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen){
/* set our timers, TimerID - for test timeout, TimerIDUpdate - for frame updating */
TimerID = SetTimer(hWnd, -1, (UINT)TEST_DURATION, NULL);
TimerIDUpdate = SetTimer(hWnd, 2, (UINT)10, NULL);
(void)TimerIDUpdate;
while (TRUE)
{

View file

@ -129,13 +129,13 @@ BOOL CALLBACK DirectInputEnumDevCb(
ZeroMemory(&GuidPath, sizeof(DIPROPGUIDANDPATH));
GuidPath.diph.dwSize = sizeof(DIPROPGUIDANDPATH);
GuidPath.diph.dwHeaderSize = sizeof(DIPROPHEADER);
GuidPath.diph.dwHow = DIPH_DEVICE;
GuidPath.diph.dwHow = DIPH_DEVICE;
hResult = pDev->lpVtbl->GetProperty(pDev, DIPROP_GUIDANDPATH, (LPDIPROPHEADER)&GuidPath);
ZeroMemory(&TypeName, sizeof(TypeName));
TypeName.diph.dwSize = sizeof(TypeName);
TypeName.diph.dwHeaderSize = sizeof(DIPROPHEADER);
TypeName.diph.dwHow = DIPH_DEVICE;
TypeName.diph.dwHow = DIPH_DEVICE;
hResult = pDev->lpVtbl->GetProperty(pDev, DIPROP_GETPORTDISPLAYNAME, (LPDIPROPHEADER)&TypeName);
@ -191,7 +191,7 @@ InitializeDirectInputDialog(HWND hwndDlg)
Context.pObj = pObj;
Context.hwndDlg = hwndDlg;
InitListViewColumns(&Context);
hResult = pObj->lpVtbl->EnumDevices(pObj, DI8DEVCLASS_ALL, DirectInputEnumDevCb, (PVOID)&Context, DIEDFL_ALLDEVICES);
pObj->lpVtbl->EnumDevices(pObj, DI8DEVCLASS_ALL, DirectInputEnumDevCb, (PVOID)&Context, DIEDFL_ALLDEVICES);
pObj->lpVtbl->Release(pObj);
}

View file

@ -178,10 +178,10 @@ EnumerateServiceProviders(HKEY hKey, HWND hDlgCtrl, DIRECTPLAY_GUID * PreDefProv
{
DWORD dwIndex = 0;
LONG result;
WCHAR szName[50];
WCHAR szName[50];
WCHAR szGUID[40];
WCHAR szTemp[63];
WCHAR szResult[MAX_PATH+20] = {0};
WCHAR szResult[MAX_PATH+20] = {0};
DWORD RegProviders = 0;
DWORD ProviderIndex;
DWORD dwName;
@ -203,13 +203,12 @@ EnumerateServiceProviders(HKEY hKey, HWND hDlgCtrl, DIRECTPLAY_GUID * PreDefProv
szResult[0] = L'\0';
LoadStringW(hInst, PreDefProviders[dwIndex].ResourceID, szResult, sizeof(szResult)/sizeof(WCHAR));
szResult[(sizeof(szResult)/sizeof(WCHAR))-1] = L'\0';
lResult = SendMessageW(hDlgCtrl, LVM_INSERTITEM, 0, (LPARAM)&Item);
Item.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEM, 0, (LPARAM)&Item);
Item.iSubItem = 1;
szResult[0] = L'\0';
LoadStringW(hInst, IDS_REG_FAIL, szResult, sizeof(szResult)/sizeof(WCHAR));
szResult[(sizeof(szResult)/sizeof(WCHAR))-1] = L'\0';
Item.iItem = lResult;
Item.iSubItem = 1;
lResult = SendMessageW(hDlgCtrl, LVM_SETITEM, 0, (LPARAM)&Item);
SendMessageW(hDlgCtrl, LVM_SETITEM, 0, (LPARAM)&Item);
}
dwIndex = 0;
@ -228,8 +227,7 @@ EnumerateServiceProviders(HKEY hKey, HWND hDlgCtrl, DIRECTPLAY_GUID * PreDefProv
if (ProviderIndex == UINT_MAX)
{
/* a custom service provider was found */
lResult = ListView_GetItemCount(hDlgCtrl);
Item.iItem = lResult;
Item.iItem = ListView_GetItemCount(hDlgCtrl);
/* FIXME
* on Windows Vista we need to use RegLoadMUIString which is not available for older systems
@ -291,7 +289,7 @@ EnumerateServiceProviders(HKEY hKey, HWND hDlgCtrl, DIRECTPLAY_GUID * PreDefProv
}
}
dwIndex++;
}while(result != ERROR_NO_MORE_ITEMS);
}while(result != ERROR_NO_MORE_ITEMS);
/* check if all providers have been registered */
// if (RegProviders == 15)
@ -330,7 +328,7 @@ InitializeDirectPlayDialog(HWND hwndDlg)
return;
/* enumerate providers */
result = EnumerateServiceProviders(hKey, hDlgCtrl, DirectPlaySP);
EnumerateServiceProviders(hKey, hDlgCtrl, DirectPlaySP);
RegCloseKey(hKey);
}

View file

@ -275,6 +275,7 @@ void InitializeDirectSoundPage(PDXDIAG_CONTEXT pContext)
/* release the DSound object */
// pObj->lpVtbl->Release(pObj);
(void)hResult;
}