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

@ -200,7 +200,7 @@ VOID DDRedrawFrame(LPDIRECTDRAWSURFACE lpDDSurface)
BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen){ BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen){
UINT TimerID, TimerIDUpdate; UINT_PTR TimerID, TimerIDUpdate;
LPDIRECTDRAW lpDD; LPDIRECTDRAW lpDD;
LPDIRECTDRAWSURFACE lpDDPrimarySurface; LPDIRECTDRAWSURFACE lpDDPrimarySurface;
LPDIRECTDRAWSURFACE lpDDBackBuffer; LPDIRECTDRAWSURFACE lpDDBackBuffer;
@ -288,6 +288,7 @@ BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen){
/* set our timers, TimerID - for test timeout, TimerIDUpdate - for frame updating */ /* set our timers, TimerID - for test timeout, TimerIDUpdate - for frame updating */
TimerID = SetTimer(hWnd, -1, (UINT)TEST_DURATION, NULL); TimerID = SetTimer(hWnd, -1, (UINT)TEST_DURATION, NULL);
TimerIDUpdate = SetTimer(hWnd, 2, (UINT)10, NULL); TimerIDUpdate = SetTimer(hWnd, 2, (UINT)10, NULL);
(void)TimerIDUpdate;
while (TRUE) while (TRUE)
{ {

View file

@ -191,7 +191,7 @@ InitializeDirectInputDialog(HWND hwndDlg)
Context.pObj = pObj; Context.pObj = pObj;
Context.hwndDlg = hwndDlg; Context.hwndDlg = hwndDlg;
InitListViewColumns(&Context); 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); pObj->lpVtbl->Release(pObj);
} }

View file

@ -203,13 +203,12 @@ EnumerateServiceProviders(HKEY hKey, HWND hDlgCtrl, DIRECTPLAY_GUID * PreDefProv
szResult[0] = L'\0'; szResult[0] = L'\0';
LoadStringW(hInst, PreDefProviders[dwIndex].ResourceID, szResult, sizeof(szResult)/sizeof(WCHAR)); LoadStringW(hInst, PreDefProviders[dwIndex].ResourceID, szResult, sizeof(szResult)/sizeof(WCHAR));
szResult[(sizeof(szResult)/sizeof(WCHAR))-1] = L'\0'; 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'; szResult[0] = L'\0';
LoadStringW(hInst, IDS_REG_FAIL, szResult, sizeof(szResult)/sizeof(WCHAR)); LoadStringW(hInst, IDS_REG_FAIL, szResult, sizeof(szResult)/sizeof(WCHAR));
szResult[(sizeof(szResult)/sizeof(WCHAR))-1] = L'\0'; szResult[(sizeof(szResult)/sizeof(WCHAR))-1] = L'\0';
Item.iItem = lResult; SendMessageW(hDlgCtrl, LVM_SETITEM, 0, (LPARAM)&Item);
Item.iSubItem = 1;
lResult = SendMessageW(hDlgCtrl, LVM_SETITEM, 0, (LPARAM)&Item);
} }
dwIndex = 0; dwIndex = 0;
@ -228,8 +227,7 @@ EnumerateServiceProviders(HKEY hKey, HWND hDlgCtrl, DIRECTPLAY_GUID * PreDefProv
if (ProviderIndex == UINT_MAX) if (ProviderIndex == UINT_MAX)
{ {
/* a custom service provider was found */ /* a custom service provider was found */
lResult = ListView_GetItemCount(hDlgCtrl); Item.iItem = ListView_GetItemCount(hDlgCtrl);
Item.iItem = lResult;
/* FIXME /* FIXME
* on Windows Vista we need to use RegLoadMUIString which is not available for older systems * on Windows Vista we need to use RegLoadMUIString which is not available for older systems
@ -330,7 +328,7 @@ InitializeDirectPlayDialog(HWND hwndDlg)
return; return;
/* enumerate providers */ /* enumerate providers */
result = EnumerateServiceProviders(hKey, hDlgCtrl, DirectPlaySP); EnumerateServiceProviders(hKey, hDlgCtrl, DirectPlaySP);
RegCloseKey(hKey); RegCloseKey(hKey);
} }

View file

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