fixed some warnings (msvc /W4)

svn path=/trunk/; revision=22893
This commit is contained in:
Christoph von Wittich 2006-07-06 16:26:40 +00:00
parent 305978e29e
commit 69ac6cf7f8
2 changed files with 16 additions and 12 deletions

View file

@ -131,8 +131,8 @@ void ListByClass()
if (rc == ERROR_SUCCESS) if (rc == ERROR_SUCCESS)
{ {
InsertIntoListView(i,ClassDescription,ClassName); InsertIntoListView(i,ClassDescription,ClassName);
TextOut(hDC, 200, 40, empty, strlen(empty)); TextOut(hDC, 200, 40, empty, (int) strlen(empty));
TextOut(hDC, 200, 40, ClassDescription, strlen(ClassDescription)); TextOut(hDC, 200, 40, ClassDescription, (int) strlen(ClassDescription));
_tprintf(_T("%d %s (%s)\n"), i, ClassName, ClassDescription); _tprintf(_T("%d %s (%s)\n"), i, ClassName, ClassDescription);
} }
else else
@ -183,8 +183,8 @@ void ListByClass()
{ {
_tprintf(_T("- %s\n"), PropertyBuffer); _tprintf(_T("- %s\n"), PropertyBuffer);
InsertIntoListView(0,PropertyBuffer," "); InsertIntoListView(0,PropertyBuffer," ");
TextOut(hDC, 200, 40, empty, strlen(empty)); TextOut(hDC, 200, 40, empty, (int) strlen(empty));
TextOut(hDC, 200, 40, PropertyBuffer, strlen(PropertyBuffer)); TextOut(hDC, 200, 40, PropertyBuffer, (int) strlen(PropertyBuffer));
} }
else else
_tprintf(_T("SetupDiGetDeviceRegistryProperty() failed with status 0x%lx\n"), GetLastError()); _tprintf(_T("SetupDiGetDeviceRegistryProperty() failed with status 0x%lx\n"), GetLastError());
@ -239,16 +239,16 @@ CONFIGRET ListSubNodes(DEVINST parent, DWORD Level)
_tprintf(_T("%s\n"), DisplayName); _tprintf(_T("%s\n"), DisplayName);
sprintf(temp,"%s%s",LevelSpaces,DisplayName); sprintf(temp,"%s%s",LevelSpaces,DisplayName);
InsertIntoListView(0,temp," "); InsertIntoListView(0,temp," ");
TextOut(hDC, 200, 40, empty, strlen(empty)); TextOut(hDC, 200, 40, empty, (int) strlen(empty));
TextOut(hDC, 200, 40, DisplayName, strlen(DisplayName)); TextOut(hDC, 200, 40, DisplayName, (int) strlen(DisplayName));
} }
else else
{ {
_tprintf(_T("(unknown device)\n")); _tprintf(_T("(unknown device)\n"));
sprintf(temp,"%s%s",LevelSpaces,"(unknown device)"); sprintf(temp,"%s%s",LevelSpaces,"(unknown device)");
InsertIntoListView(0,temp," "); InsertIntoListView(0,temp," ");
TextOut(hDC, 200, 40, empty, strlen(empty)); TextOut(hDC, 200, 40, empty, (int) strlen(empty));
TextOut(hDC, 200, 40, "(unknown device)", strlen("(unknown device)")); TextOut(hDC, 200, 40, "(unknown device)", (int) strlen("(unknown device)"));
} }
cr = ListSubNodes(child, Level + 1); cr = ListSubNodes(child, Level + 1);
if (cr != CR_SUCCESS) if (cr != CR_SUCCESS)
@ -328,8 +328,8 @@ int ListByInterface(const GUID* guid)
if (SetupDiGetDeviceInterfaceDetail(hDevInfo, &DeviceInterfaceData, DeviceInterfaceDetailData, sizeof(Buffer), NULL, NULL)) if (SetupDiGetDeviceInterfaceDetail(hDevInfo, &DeviceInterfaceData, DeviceInterfaceDetailData, sizeof(Buffer), NULL, NULL))
{ {
_tprintf(_T("- device %-2ld: %s\n"), i, DeviceInterfaceDetailData->DevicePath); _tprintf(_T("- device %-2ld: %s\n"), i, DeviceInterfaceDetailData->DevicePath);
TextOut(hDC, 200, 40, empty, strlen(empty)); TextOut(hDC, 200, 40, empty, (int) strlen(empty));
TextOut(hDC, 200, 40, DeviceInterfaceDetailData->DevicePath, strlen(DeviceInterfaceDetailData->DevicePath)); TextOut(hDC, 200, 40, DeviceInterfaceDetailData->DevicePath, (int) strlen(DeviceInterfaceDetailData->DevicePath));
InsertIntoListView(i,DeviceInterfaceDetailData->DevicePath," "); InsertIntoListView(i,DeviceInterfaceDetailData->DevicePath," ");
} }
else else
@ -481,7 +481,7 @@ switch (uMessage)
InitListView(); InitListView();
CreateButtons(g_hInst, hWnd); CreateButtons(g_hInst, hWnd);
TextOut(hDC, 200, 40, empty, strlen(empty)); TextOut(hDC, 200, 40, empty, (int) strlen(empty));
break; break;
@ -657,7 +657,7 @@ void InsertIntoListView(int typ, LPTSTR name, LPTSTR intern_name)
} }
else else
item.pszText = ""; item.pszText = "";
item.cchTextMax = _tcslen(item.pszText); item.cchTextMax = (int) _tcslen(item.pszText);
if (item.cchTextMax == 0) if (item.cchTextMax == 0)
item.pszText = LPSTR_TEXTCALLBACK; item.pszText = LPSTR_TEXTCALLBACK;
item.iImage = 0; item.iImage = 0;

View file

@ -3,6 +3,10 @@
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
static const WCHAR szROS[] = { 'R','e','a','c','t','O','S','\n',0 }; static const WCHAR szROS[] = { 'R','e','a','c','t','O','S','\n',0 };
UNREFERENCED_PARAMETER(lpCmdLine);
UNREFERENCED_PARAMETER(nCmdShow);
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(hInstance);
ShellAbout(0, szROS, 0, 0); ShellAbout(0, szROS, 0, 0);
return 1; return 1;
} }