mirror of
https://github.com/reactos/reactos.git
synced 2024-06-03 03:01:49 +00:00
[REACTOS] Fix MSVC printf format warnings
This commit is contained in:
parent
b8a1a612b2
commit
58588b76e2
|
@ -352,7 +352,7 @@ ValidateSizes(ULONG Length, DWORD ProcCount, DWORD BytesRead, DWORD SpecificSize
|
|||
/* Check whether this covers a specific entry and a generic entry for every processor */
|
||||
if ((sizeof(FILESYSTEM_STATISTICS) + SpecificSize) * ProcCount > BytesRead)
|
||||
{
|
||||
_ftprintf(stderr, _T("Only performed a partial read: %lu (expected: %lu)\n"), BytesRead, (sizeof(FILESYSTEM_STATISTICS) + SpecificSize));
|
||||
_ftprintf(stderr, _T("Only performed a partial read: %lu (expected: %Iu)\n"), BytesRead, (sizeof(FILESYSTEM_STATISTICS) + SpecificSize));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ VOID DisplayWin32ErrorDbg(DWORD dwErrorCode, const char *file, int line)
|
|||
VOID DisplayWin32Error(DWORD dwErrorCode)
|
||||
#endif
|
||||
{
|
||||
LPVOID lpMsgBuf;
|
||||
PWSTR lpMsgBuf;
|
||||
#if DBG
|
||||
WCHAR szMsg[255];
|
||||
#endif
|
||||
|
@ -44,7 +44,7 @@ VOID DisplayWin32Error(DWORD dwErrorCode)
|
|||
NULL );
|
||||
|
||||
#if DBG
|
||||
if (swprintf(szMsg, L"%hs:%d: %s", file, line, lpMsgBuf))
|
||||
if (swprintf(szMsg, L"%hs:%d: %s", file, line, (PWSTR)lpMsgBuf))
|
||||
{
|
||||
MessageBoxW(NULL, szMsg, NULL, MB_OK | MB_ICONERROR);
|
||||
}
|
||||
|
|
|
@ -724,13 +724,13 @@ Return Value:
|
|||
if((Pdo->Characteristics & FILE_REMOVABLE_MEDIA) == 0) {
|
||||
|
||||
if (diskData->PartitionStyle == PARTITION_STYLE_MBR) {
|
||||
sprintf(string, "S%08lx_O%I64lx_L%I64lx",
|
||||
sprintf(string, "S%08lx_O%I64x_L%I64x",
|
||||
diskData->Mbr.Signature,
|
||||
commonExtension->StartingOffset,
|
||||
commonExtension->PartitionLength);
|
||||
commonExtension->StartingOffset.QuadPart,
|
||||
commonExtension->PartitionLength.QuadPart);
|
||||
} else {
|
||||
sprintf(string,
|
||||
"S%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02xS_O%I64lx_L%I64lx",
|
||||
"S%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02xS_O%I64x_L%I64x",
|
||||
diskData->Efi.DiskId.Data1,
|
||||
diskData->Efi.DiskId.Data2,
|
||||
diskData->Efi.DiskId.Data3,
|
||||
|
@ -742,8 +742,8 @@ Return Value:
|
|||
diskData->Efi.DiskId.Data4[5],
|
||||
diskData->Efi.DiskId.Data4[6],
|
||||
diskData->Efi.DiskId.Data4[7],
|
||||
commonExtension->StartingOffset,
|
||||
commonExtension->PartitionLength);
|
||||
commonExtension->StartingOffset.QuadPart,
|
||||
commonExtension->PartitionLength.QuadPart);
|
||||
}
|
||||
} else {
|
||||
sprintf(string, "RM");
|
||||
|
|
|
@ -110,7 +110,7 @@ TestKs()
|
|||
// Allocate a KS Pin Connection Request Structure
|
||||
//
|
||||
Length = sizeof(KSPIN_CONNECT) + sizeof(KSDATAFORMAT_WAVEFORMATEX);
|
||||
printf("Length %ld KSPIN %u DATAFORMAT %u\n", Length, sizeof(KSPIN_CONNECT), sizeof(KSDATAFORMAT_WAVEFORMATEX));
|
||||
printf("Length %ld KSPIN %Iu DATAFORMAT %Iu\n", Length, sizeof(KSPIN_CONNECT), sizeof(KSDATAFORMAT_WAVEFORMATEX));
|
||||
PinConnect = (PKSPIN_CONNECT)HeapAlloc(GetProcessHeap(), 0, Length);
|
||||
DataFormat = (PKSDATAFORMAT_WAVEFORMATEX)(PinConnect + 1);
|
||||
|
||||
|
|
|
@ -362,7 +362,7 @@ _tmain(int argc, const TCHAR *argv[])
|
|||
hFile = CreateFile(argv[3], FILE_READ_DATA, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
_ftprintf(stderr, _T("Failed to open file: %s\n"), GetLastError());
|
||||
_ftprintf(stderr, _T("Failed to open file: %lu\n"), GetLastError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ static BOOL CALLBACK cb_AddPage(HPROPSHEETPAGE page, LPARAM lParam)
|
|||
g_Pages.Add(page);
|
||||
if (lParam != (LPARAM)&g_Pages)
|
||||
{
|
||||
wprintf(L"Propsheet failed to pass lParam, got: 0x%x\n", lParam);
|
||||
wprintf(L"Propsheet failed to pass lParam, got: 0x%Ix\n", lParam);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -417,7 +417,7 @@ SOCKET make_listening_socket( int port ) {
|
|||
|
||||
fprintf( stderr, "Creating the listener\n" );
|
||||
SOCKET l = socket( PF_INET, SOCK_STREAM, 0 );
|
||||
fprintf( stderr, "Socket %x\n", l );
|
||||
fprintf( stderr, "Socket %I64x\n", l );
|
||||
|
||||
if( l == INVALID_SOCKET ) return l;
|
||||
if( bind( l, (struct sockaddr *)&sa, sizeof( sa ) ) < 0 ) {
|
||||
|
|
|
@ -618,7 +618,7 @@ _tmain(int argc, const TCHAR *argv[])
|
|||
OutputBuffer = HeapAlloc(GetProcessHeap(), 0, VolumeInfo.BytesPerFileRecordSegment + sizeof(NTFS_FILE_RECORD_OUTPUT_BUFFER));
|
||||
if (OutputBuffer == NULL)
|
||||
{
|
||||
_ftprintf(stderr, _T("Failed to allocate %x bytes\n"), VolumeInfo.BytesPerFileRecordSegment + sizeof(NTFS_FILE_RECORD_OUTPUT_BUFFER));
|
||||
_ftprintf(stderr, _T("Failed to allocate %Ix bytes\n"), VolumeInfo.BytesPerFileRecordSegment + sizeof(NTFS_FILE_RECORD_OUTPUT_BUFFER));
|
||||
CloseHandle(VolumeHandle);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ _tmain(int argc, const TCHAR *argv[])
|
|||
_tprintf(_T("Total sectors\t\t: %I64u\n"), VolumeInfo.NumberSectors.QuadPart);
|
||||
_tprintf(_T("Total clusters\t\t: %I64u\n"), VolumeInfo.TotalClusters.QuadPart);
|
||||
_tprintf(_T("Free clusters\t\t: %I64u\n"), VolumeInfo.FreeClusters.QuadPart);
|
||||
_tprintf(_T("Free space\t\t: %I64u MB (%u%% of drive)\n"), (VolumeInfo.FreeClusters.QuadPart * VolumeInfo.BytesPerCluster) >> 20, (VolumeInfo.FreeClusters.QuadPart * 100) / VolumeInfo.TotalClusters.QuadPart);
|
||||
_tprintf(_T("Free space\t\t: %I64u MB (%I64u%% of drive)\n"), (VolumeInfo.FreeClusters.QuadPart * VolumeInfo.BytesPerCluster) >> 20, (VolumeInfo.FreeClusters.QuadPart * 100) / VolumeInfo.TotalClusters.QuadPart);
|
||||
|
||||
_tprintf(_T("\nAllocation Size\n---------------\n"));
|
||||
_tprintf(_T("Bytes per sector\t: %lu\n"), VolumeInfo.BytesPerSector);
|
||||
|
@ -144,11 +144,11 @@ _tmain(int argc, const TCHAR *argv[])
|
|||
_tprintf(_T("Clusters per MFT record\t: %lu\n"), VolumeInfo.ClustersPerFileRecordSegment);
|
||||
|
||||
_tprintf(_T("\nMFT Information\n---------------\n"));
|
||||
_tprintf(_T("MFT size\t\t: %I64u MB (%u%% of drive)\n"), VolumeInfo.MftValidDataLength.QuadPart >> 20, (VolumeInfo.MftValidDataLength.QuadPart * 100) / VolumeSize);
|
||||
_tprintf(_T("MFT size\t\t: %I64u MB (%I64u%% of drive)\n"), VolumeInfo.MftValidDataLength.QuadPart >> 20, (VolumeInfo.MftValidDataLength.QuadPart * 100) / VolumeSize);
|
||||
_tprintf(_T("MFT start cluster\t: %I64u\n"), VolumeInfo.MftStartLcn.QuadPart);
|
||||
_tprintf(_T("MFT zone clusters\t: %I64u - %I64u\n"), VolumeInfo.MftZoneStart.QuadPart, VolumeInfo.MftZoneEnd.QuadPart);
|
||||
MftClusters = VolumeInfo.MftZoneEnd.QuadPart - VolumeInfo.MftZoneStart.QuadPart;
|
||||
_tprintf(_T("MFT zone size\t\t: %I64u MB (%u%% of drive)\n"), (MftClusters * VolumeInfo.BytesPerCluster) >> 20, (MftClusters * 100) / VolumeInfo.TotalClusters.QuadPart);
|
||||
_tprintf(_T("MFT zone size\t\t: %I64u MB (%I64u%% of drive)\n"), (MftClusters * VolumeInfo.BytesPerCluster) >> 20, (MftClusters * 100) / VolumeInfo.TotalClusters.QuadPart);
|
||||
_tprintf(_T("MFT mirror start\t: %I64u\n"), VolumeInfo.Mft2StartLcn.QuadPart);
|
||||
|
||||
_tprintf(_T("\nMeta-Data files\n---------------\n"));
|
||||
|
|
|
@ -21,7 +21,7 @@ int wmain(int argc, WCHAR * argv[])
|
|||
wsprintf(ServiceName.Buffer,
|
||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%S",
|
||||
argv[1]);
|
||||
wprintf(L"%s %u %d\n", ServiceName.Buffer, ServiceName.Length, wcslen(ServiceName.Buffer));
|
||||
wprintf(L"%s %u %Id\n", ServiceName.Buffer, ServiceName.Length, wcslen(ServiceName.Buffer));
|
||||
Status = NtLoadDriver(&ServiceName);
|
||||
free(ServiceName.Buffer);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -21,7 +21,7 @@ int wmain(int argc, WCHAR * argv[])
|
|||
wsprintf(ServiceName.Buffer,
|
||||
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\%S",
|
||||
argv[1]);
|
||||
wprintf(L"%s %d %d\n", ServiceName.Buffer, ServiceName.Length, wcslen(ServiceName.Buffer));
|
||||
wprintf(L"%s %d %Ud\n", ServiceName.Buffer, ServiceName.Length, wcslen(ServiceName.Buffer));
|
||||
Status = NtUnloadDriver(&ServiceName);
|
||||
free(ServiceName.Buffer);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
|
@ -46,7 +46,7 @@ PrintWin32Error(
|
|||
DWORD ErrorCode
|
||||
)
|
||||
{
|
||||
PVOID lpMsgBuf;
|
||||
LPWSTR lpMsgBuf;
|
||||
|
||||
FormatMessageW(
|
||||
(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM),
|
||||
|
|
|
@ -146,8 +146,8 @@ static void test2(LPCWSTR pwsz, LPCWSTR pwszExpected, LPCWSTR pwszExpectedPartNa
|
|||
if (!bOK)
|
||||
{
|
||||
printf("input: : %2Iu chars \"%S\"\n", wcslen(pwsz), pwsz);
|
||||
printf("Expected: %2u chars \"%S\"\n", lenExp, pwszExpected);
|
||||
printf("Actual : %2u chars \"%S\"\n", lenAct, lenAct ? pwszActual : L"(null)");
|
||||
printf("Expected: %2Iu chars \"%S\"\n", lenExp, pwszExpected);
|
||||
printf("Actual : %2Iu chars \"%S\"\n", lenAct, lenAct ? pwszActual : L"(null)");
|
||||
return;
|
||||
}
|
||||
} else
|
||||
|
@ -156,8 +156,8 @@ static void test2(LPCWSTR pwsz, LPCWSTR pwszExpected, LPCWSTR pwszExpectedPartNa
|
|||
PWSTR pwszActual = NtName.Buffer + 4;
|
||||
const size_t lenAct = (NtName.Length - 8) / 2;
|
||||
check_result(FALSE, "Unexpected NtName (expected NULL)");
|
||||
printf("input: : %2u chars \"%S\"\n", wcslen(pwsz), pwsz);
|
||||
printf("Actual : %2u chars \"%S\"\n", lenAct, pwszActual);
|
||||
printf("input: : %2Iu chars \"%S\"\n", wcslen(pwsz), pwsz);
|
||||
printf("Actual : %2Iu chars \"%S\"\n", lenAct, pwszActual);
|
||||
}
|
||||
|
||||
if (pwszExpectedPartName) {
|
||||
|
@ -167,17 +167,17 @@ static void test2(LPCWSTR pwsz, LPCWSTR pwszExpected, LPCWSTR pwszExpectedPartNa
|
|||
wcscmp(PartName, pwszExpectedPartName) == 0;
|
||||
check_result(bOK, "PartName does not match expected");
|
||||
if (!bOK) {
|
||||
printf("input: : %2u chars \"%S\"\n", wcslen(pwsz), pwsz);
|
||||
printf("Expected: %2u chars \"%S\"\n", lenExp, pwszExpectedPartName);
|
||||
printf("Actual : %2u chars \"%S\"\n", lenAct, lenAct ? PartName : L"(null)");
|
||||
printf("input: : %2Iu chars \"%S\"\n", wcslen(pwsz), pwsz);
|
||||
printf("Expected: %2Iu chars \"%S\"\n", lenExp, pwszExpectedPartName);
|
||||
printf("Actual : %2Iu chars \"%S\"\n", lenAct, lenAct ? PartName : L"(null)");
|
||||
return;
|
||||
}
|
||||
} else
|
||||
if (PartName)
|
||||
{
|
||||
check_result(FALSE, "Unexpected PartName (expected NULL).");
|
||||
printf("input: : %2u chars \"%S\"\n", wcslen(pwsz), pwsz);
|
||||
printf("Actual : %2u chars %S\n", wcslen(PartName), PartName);
|
||||
printf("input: : %2Iu chars \"%S\"\n", wcslen(pwsz), pwsz);
|
||||
printf("Actual : %2Iu chars %S\n", wcslen(PartName), PartName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ void DumpMsgList(const char* lstName, const tagMsgList *ml)
|
|||
for (i1 = 0; i1 < ml->msgCount; i1++)
|
||||
{
|
||||
dlgProcName = (ml->msgList[i1].DlgProc) ? "DlgProc" : "WndProc";
|
||||
printf("#%.3d %s, msg 0x%x, wParam 0x%x, lParam 0x%Ix, result %d\n",
|
||||
printf("#%.3d %s, msg 0x%x, wParam 0x%Ix, lParam 0x%Ix, result %d\n",
|
||||
i1,
|
||||
dlgProcName,
|
||||
ml->msgList[i1].msg,
|
||||
|
|
|
@ -23,7 +23,7 @@ START_TEST(LoadImage)
|
|||
HDC hdc, hdcScreen;
|
||||
ICONINFO ii;
|
||||
|
||||
sscanf (test_argv[2], "%lu", (ULONG_PTR*) &arg);
|
||||
sscanf (test_argv[2], "%Iu", (ULONG_PTR*) &arg);
|
||||
|
||||
ok(handle != arg, "Got same handles\n");
|
||||
|
||||
|
@ -81,7 +81,7 @@ START_TEST(LoadImage)
|
|||
}
|
||||
|
||||
/* Start child process */
|
||||
sprintf( path, "%s LoadImage %lu", test_argv[0], (ULONG_PTR)handle );
|
||||
sprintf( path, "%s LoadImage %Iu", test_argv[0], (ULONG_PTR)handle );
|
||||
memset( &si, 0, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
CreateProcessA( NULL, path, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi );
|
||||
|
|
|
@ -23,9 +23,9 @@ MixerThread(LPVOID Parameter)
|
|||
while(GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (msg.message == MM_MIXM_CONTROL_CHANGE)
|
||||
printf("got MM_MIXM_CONTROL_CHANGE wParam %x lParam %lx\n", msg.wParam, msg.lParam);
|
||||
printf("got MM_MIXM_CONTROL_CHANGE wParam %Ix lParam %Ix\n", msg.wParam, msg.lParam);
|
||||
else if (msg.message == MM_MIXM_LINE_CHANGE)
|
||||
printf("got MM_MIXM_LINE_CHANGE wParam %x lParam %lx\n", msg.wParam, msg.lParam);
|
||||
printf("got MM_MIXM_LINE_CHANGE wParam %Ix lParam %Ix\n", msg.wParam, msg.lParam);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -3022,7 +3022,7 @@ static NTSTATUS get_manifest_in_pe_file( struct actctx_loader* acl, struct assem
|
|||
|
||||
if ((!((ULONG_PTR)resname >> 16)))
|
||||
{
|
||||
sprintfW(resnameBuf, L"#%u", (ULONG_PTR)resname);
|
||||
sprintfW(resnameBuf, L"#%u", PtrToUlong(resname));
|
||||
resptr = resnameBuf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue