freerdp: fix several type related warnings
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Thu, 8 May 2014 22:02:02 +0000 (18:02 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Thu, 8 May 2014 22:02:02 +0000 (18:02 -0400)
29 files changed:
channels/tsmf/client/gstreamer/tsmf_gstreamer.c
client/common/cmdline.c
client/common/test/TestClientRdpFile.c
libfreerdp/codec/test/TestFreeRDPCodecPlanar.c
winpr/include/winpr/ndr.h
winpr/libwinpr/credui/test/TestCredUICmdLinePromptForCredentials.c
winpr/libwinpr/credui/test/TestCredUIParseUserName.c
winpr/libwinpr/credui/test/TestCredUIPromptForCredentials.c
winpr/libwinpr/crt/test/TestUnicodeConversion.c
winpr/libwinpr/dsparse/test/TestDsMakeSpn.c
winpr/libwinpr/error/test/TestErrorSetLastError.c
winpr/libwinpr/path/test/TestPathAllocCombine.c
winpr/libwinpr/path/test/TestPathCchAddBackslashEx.c
winpr/libwinpr/path/test/TestPathCchAddExtension.c
winpr/libwinpr/path/test/TestPathCchAppend.c
winpr/libwinpr/path/test/TestPathCchStripPrefix.c
winpr/libwinpr/pipe/test/TestPipeCreatePipe.c
winpr/libwinpr/pool/test/TestPoolWork.c
winpr/libwinpr/registry/registry_reg.c
winpr/libwinpr/rpc/ndr_private.c
winpr/libwinpr/rpc/ndr_private.h
winpr/libwinpr/sspi/test/TestInitializeSecurityContext.c
winpr/libwinpr/synch/critical.c
winpr/libwinpr/synch/test/TestSynchCritical.c
winpr/libwinpr/synch/wait.c
winpr/libwinpr/sysinfo/test/TestGetNativeSystemInfo.c
winpr/libwinpr/utils/test/TestHashTable.c
winpr/libwinpr/utils/test/TestListDictionary.c
winpr/libwinpr/utils/wlog/Layout.c

index 9ead22b..d3c477c 100644 (file)
@@ -1204,7 +1204,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, U
 
                        if (fout)
                        {
-                               fprintf(fout, "%"PRIu64"\n", start_time);
+                               fprintf(fout, "%"PRIu64"\n", (long unsigned int) start_time);
                                fclose(fout);
                        }
 
@@ -1230,7 +1230,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, U
                        if (fin)
                        {
                                UINT64 AStartTime = 0;
-                               fscanf(fin, "%"PRIu64, &AStartTime);
+                               fscanf(fin, "%"PRIu64, (long unsigned int*) &AStartTime);
                                fclose(fin);
                                if (start_time > AStartTime)
                                {
@@ -1264,7 +1264,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, U
                        if (fin)
                        {
                                UINT64 VStartTime = 0;
-                               fscanf(fin, "%"PRIu64, &VStartTime);
+                               fscanf(fin, "%"PRIu64, (long unsigned int*) &VStartTime);
                                fclose(fin);
                                if (start_time > VStartTime)
                                {
index 50c033b..d26206f 100644 (file)
@@ -1087,19 +1087,19 @@ int freerdp_client_settings_command_line_status_print(rdpSettings* settings, int
                        layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_STANDARD);
                        printf("\nKeyboard Layouts\n");
                        for (i = 0; layouts[i].code; i++)
-                               printf("0x%08lX\t%s\n", layouts[i].code, layouts[i].name);
+                               printf("0x%08X\t%s\n", layouts[i].code, layouts[i].name);
                        free(layouts);
 
                        layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_VARIANT);
                        printf("\nKeyboard Layout Variants\n");
                        for (i = 0; layouts[i].code; i++)
-                               printf("0x%08lX\t%s\n", layouts[i].code, layouts[i].name);
+                               printf("0x%08X\t%s\n", layouts[i].code, layouts[i].name);
                        free(layouts);
 
                        layouts = freerdp_keyboard_get_layouts(RDP_KEYBOARD_LAYOUT_TYPE_IME);
                        printf("\nKeyboard Input Method Editors (IMEs)\n");
                        for (i = 0; layouts[i].code; i++)
-                               printf("0x%08lX\t%s\n", layouts[i].code, layouts[i].name);
+                               printf("0x%08X\t%s\n", layouts[i].code, layouts[i].name);
                        free(layouts);
 
                        printf("\n");
index 24d138d..8d5c8fb 100644 (file)
@@ -275,19 +275,19 @@ int TestClientRdpFile(int argc, char* argv[])
 
        if (file->UseMultiMon != 0)
        {
-               printf("UseMultiMon mismatch: Actual: %ld, Expected: %d\n", file->UseMultiMon, 0);
+               printf("UseMultiMon mismatch: Actual: %d, Expected: %d\n", file->UseMultiMon, 0);
                return -1;
        }
 
        if (file->ScreenModeId != 2)
        {
-               printf("ScreenModeId mismatch: Actual: %ld, Expected: %d\n", file->ScreenModeId, 2);
+               printf("ScreenModeId mismatch: Actual: %d, Expected: %d\n", file->ScreenModeId, 2);
                return -1;
        }
 
        if (file->GatewayProfileUsageMethod != 1)
        {
-               printf("GatewayProfileUsageMethod mismatch: Actual: %ld, Expected: %d\n", file->GatewayProfileUsageMethod, 1);
+               printf("GatewayProfileUsageMethod mismatch: Actual: %d, Expected: %d\n", file->GatewayProfileUsageMethod, 1);
                return -1;
        }
 
@@ -307,19 +307,19 @@ int TestClientRdpFile(int argc, char* argv[])
 
        if (file->UseMultiMon != 0)
        {
-               printf("UseMultiMon mismatch: Actual: %ld, Expected: %d\n", file->UseMultiMon, 0);
+               printf("UseMultiMon mismatch: Actual: %d, Expected: %d\n", file->UseMultiMon, 0);
                return -1;
        }
 
        if (file->ScreenModeId != 2)
        {
-               printf("ScreenModeId mismatch: Actual: %ld, Expected: %d\n", file->ScreenModeId, 2);
+               printf("ScreenModeId mismatch: Actual: %d, Expected: %d\n", file->ScreenModeId, 2);
                return -1;
        }
 
        if (file->GatewayProfileUsageMethod != 1)
        {
-               printf("GatewayProfileUsageMethod mismatch: Actual: %ld, Expected: %d\n", file->GatewayProfileUsageMethod, 1);
+               printf("GatewayProfileUsageMethod mismatch: Actual: %d, Expected: %d\n", file->GatewayProfileUsageMethod, 1);
                return -1;
        }
 
index 6eb3265..0ce618f 100644 (file)
@@ -2997,7 +2997,7 @@ int test_individual_planes_encoding_rle()
        if (dstSizes[1] != sizeof(TEST_64X64_RED_PLANE_RLE))
        {
                printf("RedPlaneRle unexpected size: actual: %d, expected: %d\n",
-                               dstSizes[1], sizeof(TEST_64X64_RED_PLANE_RLE));
+                               dstSizes[1], (int) sizeof(TEST_64X64_RED_PLANE_RLE));
                //return -1;
        }
 
@@ -3007,7 +3007,7 @@ int test_individual_planes_encoding_rle()
        {
                printf("RedPlaneRle doesn't match expected output\n");
 
-               printf("RedPlaneRle Expected (%d):\n", sizeof(TEST_64X64_RED_PLANE_RLE));
+               printf("RedPlaneRle Expected (%d):\n", (int) sizeof(TEST_64X64_RED_PLANE_RLE));
                //winpr_HexDump((BYTE*) TEST_64X64_RED_PLANE_RLE, sizeof(TEST_64X64_RED_PLANE_RLE));
 
                printf("RedPlaneRle Actual (%d):\n", dstSizes[1]);
@@ -3033,7 +3033,7 @@ int test_individual_planes_encoding_rle()
        if (dstSizes[2] != sizeof(TEST_64X64_GREEN_PLANE_RLE))
        {
                printf("GreenPlaneRle unexpected size: actual: %d, expected: %d\n",
-                               dstSizes[1], sizeof(TEST_64X64_GREEN_PLANE_RLE));
+                               dstSizes[1], (int) sizeof(TEST_64X64_GREEN_PLANE_RLE));
                return -1;
        }
 
@@ -3043,8 +3043,8 @@ int test_individual_planes_encoding_rle()
        {
                printf("GreenPlaneRle doesn't match expected output\n");
 
-               printf("GreenPlaneRle Expected (%d):\n", sizeof(TEST_64X64_GREEN_PLANE_RLE));
-               winpr_HexDump((BYTE*) TEST_64X64_GREEN_PLANE_RLE, sizeof(TEST_64X64_GREEN_PLANE_RLE));
+               printf("GreenPlaneRle Expected (%d):\n", (int) sizeof(TEST_64X64_GREEN_PLANE_RLE));
+               winpr_HexDump((BYTE*) TEST_64X64_GREEN_PLANE_RLE, (int) sizeof(TEST_64X64_GREEN_PLANE_RLE));
 
                printf("GreenPlaneRle Actual (%d):\n", dstSizes[2]);
                winpr_HexDump(planar->rlePlanes[2], dstSizes[2]);
@@ -3069,7 +3069,7 @@ int test_individual_planes_encoding_rle()
        if (dstSizes[3] != sizeof(TEST_64X64_BLUE_PLANE_RLE))
        {
                printf("BluePlaneRle unexpected size: actual: %d, expected: %d\n",
-                               dstSizes[1], sizeof(TEST_64X64_BLUE_PLANE_RLE));
+                               dstSizes[1], (int) sizeof(TEST_64X64_BLUE_PLANE_RLE));
                return -1;
        }
 
@@ -3079,8 +3079,8 @@ int test_individual_planes_encoding_rle()
        {
                printf("BluePlaneRle doesn't match expected output\n");
 
-               printf("BluePlaneRle Expected (%d):\n", sizeof(TEST_64X64_BLUE_PLANE_RLE));
-               winpr_HexDump((BYTE*) TEST_64X64_BLUE_PLANE_RLE, sizeof(TEST_64X64_BLUE_PLANE_RLE));
+               printf("BluePlaneRle Expected (%d):\n", (int) sizeof(TEST_64X64_BLUE_PLANE_RLE));
+               winpr_HexDump((BYTE*) TEST_64X64_BLUE_PLANE_RLE, (int) sizeof(TEST_64X64_BLUE_PLANE_RLE));
 
                printf("BluePlaneRle Actual (%d):\n", dstSizes[3]);
                winpr_HexDump(planar->rlePlanes[3], dstSizes[3]);
index 12ab5c2..3584f97 100644 (file)
@@ -51,7 +51,7 @@ typedef struct _RPC_SYNTAX_IDENTIFIER
 typedef struct _RPC_MESSAGE
 {
        RPC_BINDING_HANDLE Handle;
-       unsigned long DataRepresentation;
+       ULONG DataRepresentation;
        void* Buffer;
        unsigned int BufferLength;
        unsigned int ProcNum;
@@ -60,7 +60,7 @@ typedef struct _RPC_MESSAGE
        void* ReservedForRuntime;
        RPC_MGR_EPV* ManagerEpv;
        void* ImportContext;
-       unsigned long RpcFlags;
+       ULONG RpcFlags;
 } RPC_MESSAGE, *PRPC_MESSAGE;
 
 typedef void (*RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message);
@@ -136,8 +136,8 @@ typedef struct _MIDL_STUB_MESSAGE
        unsigned char* BufferStart;
        unsigned char* BufferEnd;
        unsigned char* BufferMark;
-       unsigned long BufferLength;
-       unsigned long MemorySize;
+       ULONG BufferLength;
+       ULONG MemorySize;
        unsigned char* Memory;
        int IsClient;
        int ReuseBuffer;
@@ -149,8 +149,8 @@ typedef struct _MIDL_STUB_MESSAGE
        unsigned char uFlags;
        unsigned short Unused2;
        ULONG_PTR MaxCount;
-       unsigned long Offset;
-       unsigned long ActualCount;
+       ULONG Offset;
+       ULONG ActualCount;
        void *(*pfnAllocate)(size_t);
        void (*pfnFree)(void*);
        unsigned char* StackTop;
@@ -159,8 +159,8 @@ typedef struct _MIDL_STUB_MESSAGE
        handle_t SavedHandle;
        const struct _MIDL_STUB_DESC* StubDesc;
        struct _FULL_PTR_XLAT_TABLES* FullPtrXlatTables;
-       unsigned long FullPtrRefId;
-       unsigned long PointerLength;
+       ULONG FullPtrRefId;
+       ULONG PointerLength;
        int fInDontFree : 1;
        int fDontCallFreeInst : 1;
        int fInOnlyParam : 1;
@@ -169,17 +169,17 @@ typedef struct _MIDL_STUB_MESSAGE
        int fHasNewCorrDesc : 1;
        int fUnused : 10;
        int fUnused2 : 16;
-       unsigned long dwDestContext;
+       ULONG dwDestContext;
        void* pvDestContext;
        //NDR_SCONTEXT* SavedContextHandles;
        long ParamNumber;
        struct IRpcChannelBuffer* pRpcChannelBuffer;
        //PARRAY_INFO pArrayInfo;
-       unsigned long* SizePtrCountArray;
-       unsigned long* SizePtrOffsetArray;
-       unsigned long* SizePtrLengthArray;
+       ULONG* SizePtrCountArray;
+       ULONG* SizePtrOffsetArray;
+       ULONG* SizePtrLengthArray;
        void* pArgQueue;
-       unsigned long dwStubPhase;
+       ULONG dwStubPhase;
        void* LowStackMark;
        //PNDR_ASYNC_MESSAGE pAsyncMsg;
        //PNDR_CORRELATION_INFO pCorrInfo;
@@ -210,10 +210,10 @@ typedef struct _XMIT_ROUTINE_QUINTUPLE
        XMIT_HELPER_ROUTINE pfnFreeInst;
 } XMIT_ROUTINE_QUINTUPLE, *PXMIT_ROUTINE_QUINTUPLE;
 
-typedef unsigned long (*USER_MARSHAL_SIZING_ROUTINE)(unsigned long*, unsigned long, void*);
-typedef unsigned char* (*USER_MARSHAL_MARSHALLING_ROUTINE)(unsigned long*, unsigned char*, void*);
-typedef unsigned char* (*USER_MARSHAL_UNMARSHALLING_ROUTINE)(unsigned long*, unsigned char*, void*);
-typedef void (*USER_MARSHAL_FREEING_ROUTINE)(unsigned long*, void*);
+typedef ULONG (*USER_MARSHAL_SIZING_ROUTINE)(ULONG*, ULONG, void*);
+typedef unsigned char* (*USER_MARSHAL_MARSHALLING_ROUTINE)(ULONG*, unsigned char*, void*);
+typedef unsigned char* (*USER_MARSHAL_UNMARSHALLING_ROUTINE)(ULONG*, unsigned char*, void*);
+typedef void (*USER_MARSHAL_FREEING_ROUTINE)(ULONG*, void*);
 
 typedef struct _USER_MARSHAL_ROUTINE_QUADRUPLE
 {
@@ -258,7 +258,7 @@ struct _MIDL_STUB_DESC
         const unsigned char* pFormatTypes;
 
         int fCheckBounds;
-        unsigned long Version;
+        ULONG Version;
         MALLOC_FREE_STRUCT* pMallocFreeStruct;
 
         long MIDLVersion;
index 124d4bd..4784988 100644 (file)
@@ -26,7 +26,7 @@ int TestCredUICmdLinePromptForCredentials(int argc, char* argv[])
 
        if (status != NO_ERROR)
        {
-               printf("CredUIPromptForCredentials unexpected status: 0x%08lX\n", status);
+               printf("CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
                return -1;
        }
 
index e7f7f39..27073d3 100644 (file)
@@ -22,7 +22,7 @@ int TestCredUIParseUserName(int argc, char* argv[])
        status = CredUIParseUserName(testUserName1, User, sizeof(User) / sizeof(TCHAR),
                Domain, sizeof(Domain) / sizeof(TCHAR));
 
-       printf("CredUIParseUserName status: 0x%08lX\n", status);
+       printf("CredUIParseUserName status: 0x%08X\n", status);
 
        _tprintf(_T("UserName: %s -> Domain: %s User: %s\n"), testUserName1, Domain, User);
 
@@ -34,7 +34,7 @@ int TestCredUIParseUserName(int argc, char* argv[])
        status = CredUIParseUserName(testUserName2, User, sizeof(User) / sizeof(TCHAR),
                Domain, sizeof(Domain) / sizeof(TCHAR));
 
-       printf("CredUIParseUserName status: 0x%08lX\n", status);
+       printf("CredUIParseUserName status: 0x%08X\n", status);
 
        _tprintf(_T("UserName: %s -> Domain: %s User: %s\n"), testUserName2, Domain, User);
 
index 85e1428..aa79dc6 100644 (file)
@@ -35,7 +35,7 @@ int TestCredUIPromptForCredentials(int argc, char* argv[])
 
        if (status != NO_ERROR)
        {
-               printf("CredUIPromptForCredentials unexpected status: 0x%08lX\n", status);
+               printf("CredUIPromptForCredentials unexpected status: 0x%08X\n", status);
                return -1;
        }
 
index 594f588..399a193 100644 (file)
@@ -147,7 +147,7 @@ int convert_utf8_to_utf16(BYTE* lpMultiByteStr, BYTE* expected_lpWideCharStr, in
        if (!length)
        {
                DWORD error = GetLastError();
-               printf("MultiByteToWideChar error: 0x%08lX\n", error);
+               printf("MultiByteToWideChar error: 0x%08X\n", error);
                return -1;
        }
 
@@ -214,7 +214,7 @@ int convert_utf16_to_utf8(BYTE* lpWideCharStr, BYTE* expected_lpMultiByteStr, in
        if (!length)
        {
                DWORD error = GetLastError();
-               printf("WideCharToMultiByte error: 0x%08lX\n", error);
+               printf("WideCharToMultiByte error: 0x%08X\n", error);
                return -1;
        }
 
index e013719..80e4f6a 100644 (file)
@@ -35,7 +35,7 @@ int TestDsMakeSpn(int argc, char* argv[])
 
        if (SpnLength != 37)
        {
-               _tprintf(_T("DsMakeSpn: SpnLength mismatch: Actual: %ld, Expected: %d\n"), SpnLength, 37);
+               _tprintf(_T("DsMakeSpn: SpnLength mismatch: Actual: %d, Expected: %d\n"), SpnLength, 37);
                return -1;
        }
 
index a863837..349a61a 100644 (file)
@@ -108,7 +108,7 @@ int TestErrorSetLastError(int argc, char* argv[])
                return -1;
        }
 
-       printf("Completed %lu iterations.\n", *pLoopCount);
+       printf("Completed %d iterations.\n", *pLoopCount);
 
        return status;
 }
index f40547e..dcddb2d 100644 (file)
@@ -23,7 +23,7 @@ int TestPathAllocCombine(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathAllocCombine status: 0x%08lX\n"), status);
+               _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -41,7 +41,7 @@ int TestPathAllocCombine(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathAllocCombine status: 0x%08lX\n"), status);
+               _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -59,7 +59,7 @@ int TestPathAllocCombine(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathAllocCombine status: 0x%08lX\n"), status);
+               _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -77,7 +77,7 @@ int TestPathAllocCombine(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathAllocCombine status: 0x%08lX\n"), status);
+               _tprintf(_T("PathAllocCombine status: 0x%08X\n"), status);
                return -1;
        }
 
index 9513a31..9fe39be 100644 (file)
@@ -23,7 +23,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchAddBackslash status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAddBackslash status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -41,7 +41,7 @@ int TestPathCchAddBackslashEx(int argc, char* argv[])
 
        if (status != S_FALSE)
        {
-               _tprintf(_T("PathCchAddBackslash status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAddBackslash status: 0x%08X\n"), status);
                return -1;
        }
 
index 028ed84..ef766cf 100644 (file)
@@ -23,7 +23,7 @@ int TestPathCchAddExtension(int argc, char* argv[])
        
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchAddExtension status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -41,7 +41,7 @@ int TestPathCchAddExtension(int argc, char* argv[])
        
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchAddExtension status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -59,7 +59,7 @@ int TestPathCchAddExtension(int argc, char* argv[])
        
        if (status != S_FALSE)
        {
-               _tprintf(_T("PathCchAddExtension status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -77,7 +77,7 @@ int TestPathCchAddExtension(int argc, char* argv[])
        
        if (status != S_FALSE)
        {
-               _tprintf(_T("PathCchAddExtension status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAddExtension status: 0x%08X\n"), status);
                return -1;
        }
 
index 6827a63..76053c3 100644 (file)
@@ -24,7 +24,7 @@ int TestPathCchAppend(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchAppend status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAppend status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -42,7 +42,7 @@ int TestPathCchAppend(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchAppend status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAppend status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -60,7 +60,7 @@ int TestPathCchAppend(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchAppend status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAppend status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -78,7 +78,7 @@ int TestPathCchAppend(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchAppend status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchAppend status: 0x%08X\n"), status);
                return -1;
        }
 
index ec081eb..7163c13 100644 (file)
@@ -28,7 +28,7 @@ int TestPathCchStripPrefix(int argc, char* argv[])
 
        if (status != S_OK)
        {
-               _tprintf(_T("PathCchStripPrefix status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchStripPrefix status: 0x%08X\n"), status);
                return -1;
        }
 
@@ -46,7 +46,7 @@ int TestPathCchStripPrefix(int argc, char* argv[])
 
        if (status != S_FALSE)
        {
-               _tprintf(_T("PathCchStripPrefix status: 0x%08lX\n"), status);
+               _tprintf(_T("PathCchStripPrefix status: 0x%08X\n"), status);
                return -1;
        }
 
index 902c914..e464977 100644 (file)
@@ -36,8 +36,8 @@ int TestPipeCreatePipe(int argc, char* argv[])
 
        if (dwWrite != sizeof(writeBuffer))
        {
-               _tprintf(_T("WriteFile: unexpected number of bytes written: Actual: %ld, Expected: %ld\n"),
-                       dwWrite, (long int)sizeof(writeBuffer));
+               _tprintf(_T("WriteFile: unexpected number of bytes written: Actual: %d, Expected: %d\n"),
+                       dwWrite, (int) sizeof(writeBuffer));
                return -1;
        }
 
@@ -52,8 +52,8 @@ int TestPipeCreatePipe(int argc, char* argv[])
 
        if (dwRead != sizeof(readBuffer))
        {
-               _tprintf(_T("ReadFile: unexpected number of bytes read: Actual: %ld, Expected: %ld\n"),
-                       dwWrite, (long int)sizeof(readBuffer));
+               _tprintf(_T("ReadFile: unexpected number of bytes read: Actual: %d, Expected: %d\n"),
+                       dwWrite, (int) sizeof(readBuffer));
                return -1;
        }
 
index b830f77..2a8f311 100644 (file)
@@ -12,7 +12,7 @@ void CALLBACK test_WorkCallback(PTP_CALLBACK_INSTANCE instance, void* context, P
        BYTE b[1024];
        BYTE c[1024];
 
-       printf("Hello %s: %ld (thread: %lu)\n", (char *)context,
+       printf("Hello %s: %d (thread: %d)\n", (char*) context,
                InterlockedIncrement(&count), GetCurrentThreadId());
 
        for (index = 0; index < 100; index++)
index ea9e0f9..e7122c0 100644 (file)
@@ -425,7 +425,7 @@ void reg_print_value(Reg* reg, RegVal* value)
 
        if (value->type == REG_DWORD)
        {
-               fprintf(stderr, "dword:%08lX\n", value->data.dword);
+               fprintf(stderr, "dword:%08X\n", value->data.dword);
        }
        else if (value->type == REG_SZ)
        {
index f927a13..b7ef233 100644 (file)
 
 #include "ndr_private.h"
 
-void NdrpAlignLength(unsigned long* length, unsigned int alignment)
+void NdrpAlignLength(ULONG* length, unsigned int alignment)
 {
        *length = (*length + alignment - 1) & ~(alignment - 1);
 }
 
-void NdrpIncrementLength(unsigned long* length, unsigned int size)
+void NdrpIncrementLength(ULONG* length, unsigned int size)
 {
        *length += size;
 }
index a45f361..ed8eb9a 100644 (file)
@@ -24,8 +24,8 @@
 
 #ifndef _WIN32
 
-void NdrpAlignLength(unsigned long* length, unsigned int alignment);
-void NdrpIncrementLength(unsigned long* length, unsigned int size);
+void NdrpAlignLength(ULONG* length, unsigned int alignment);
+void NdrpIncrementLength(ULONG* length, unsigned int size);
 
 extern const NDR_TYPE_SIZE_ROUTINE pfnSizeRoutines[];
 extern const NDR_TYPE_MARSHALL_ROUTINE pfnMarshallRoutines[];
index d434234..25707d1 100644 (file)
@@ -79,11 +79,11 @@ int TestInitializeSecurityContext(int argc, char* argv[])
                return -1;
        }
 
-       printf("cBuffers: %ld ulVersion: %ld\n", output_SecBuffer_desc.cBuffers, output_SecBuffer_desc.ulVersion);
+       printf("cBuffers: %d ulVersion: %d\n", output_SecBuffer_desc.cBuffers, output_SecBuffer_desc.ulVersion);
 
        p_SecBuffer = &output_SecBuffer_desc.pBuffers[0];
 
-       printf("BufferType: 0x%04lX cbBuffer:%ld\n", p_SecBuffer->BufferType, p_SecBuffer->cbBuffer);
+       printf("BufferType: 0x%04X cbBuffer: %d\n", p_SecBuffer->BufferType, p_SecBuffer->cbBuffer);
 
        table->FreeCredentialsHandle(&credentials);
 
index 6f7ecdf..bfe4329 100644 (file)
@@ -135,7 +135,7 @@ VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
                if (InterlockedCompareExchange(&lpCriticalSection->LockCount, 0, -1) == -1)
                {
                        lpCriticalSection->RecursionCount = 1;
-                       lpCriticalSection->OwningThread = (HANDLE)GetCurrentThreadId();
+                       lpCriticalSection->OwningThread = (HANDLE) (ULONG_PTR) GetCurrentThreadId();
                        return;
                }
                /* Failed to get the lock. Let the scheduler know that we're spinning. */
@@ -156,7 +156,7 @@ VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
        if (InterlockedIncrement(&lpCriticalSection->LockCount))
        {
                /* Section is already locked. Check if it is owned by the current thread. */
-               if (lpCriticalSection->OwningThread == (HANDLE)GetCurrentThreadId())
+               if (lpCriticalSection->OwningThread == (HANDLE) (ULONG_PTR) GetCurrentThreadId())
                {
                        /* Recursion. No need to wait. */
                        lpCriticalSection->RecursionCount++;
@@ -168,12 +168,12 @@ VOID EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
        }
        /* We got the lock. Own it ... */
        lpCriticalSection->RecursionCount = 1;
-       lpCriticalSection->OwningThread = (HANDLE)GetCurrentThreadId();
+       lpCriticalSection->OwningThread = (HANDLE) (ULONG_PTR) GetCurrentThreadId();
 }
 
 BOOL TryEnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
 {
-       HANDLE current_thread = (HANDLE)GetCurrentThreadId();
+       HANDLE current_thread = (HANDLE) (ULONG_PTR) GetCurrentThreadId();
 
        /* Atomically acquire the the lock if the section is free. */
        if (InterlockedCompareExchange(&lpCriticalSection->LockCount, 0, -1 ) == -1)
index 854e242..ca6f201 100644 (file)
@@ -44,7 +44,7 @@ BOOL TestSynchCritical_TriggerAndCheckRaceCondition(HANDLE OwningThread, LONG Re
 static PVOID TestSynchCritical_Test1(PVOID arg)
 {
        int i, j, rc;
-       HANDLE hThread = (HANDLE)GetCurrentThreadId();
+       HANDLE hThread = (HANDLE) (ULONG_PTR) GetCurrentThreadId();
 
        PBOOL pbContinueRunning = (PBOOL)arg;
 
@@ -111,7 +111,7 @@ static PVOID TestSynchCritical_Main(PVOID arg)
 
        GetNativeSystemInfo(&sysinfo);
 
-       hMainThread = (HANDLE)GetCurrentThreadId();
+       hMainThread = (HANDLE) (ULONG_PTR) GetCurrentThreadId();
 
        /**
         * Test SpinCount in SetCriticalSectionSpinCount, InitializeCriticalSectionEx and InitializeCriticalSectionAndSpinCount
@@ -131,7 +131,7 @@ static PVOID TestSynchCritical_Main(PVOID arg)
 #endif
                if (dwPreviousSpinCount != dwSpinCountExpected)
                {
-                       printf("CriticalSection failure: SetCriticalSectionSpinCount returned %lu (expected: %lu)\n", dwPreviousSpinCount, dwSpinCountExpected);
+                       printf("CriticalSection failure: SetCriticalSectionSpinCount returned %u (expected: %u)\n", dwPreviousSpinCount, dwSpinCountExpected);
                        goto fail;
                }
 
@@ -156,7 +156,7 @@ static PVOID TestSynchCritical_Main(PVOID arg)
        {
                if (critical.RecursionCount != i)
                {
-                       printf("CriticalSection failure: RecursionCount field is %ld instead of %d.\n", critical.RecursionCount, i);
+                       printf("CriticalSection failure: RecursionCount field is %d instead of %d.\n", critical.RecursionCount, i);
                        goto fail;
                }
                if (i%2==0)
@@ -182,7 +182,7 @@ static PVOID TestSynchCritical_Main(PVOID arg)
                LeaveCriticalSection(&critical);
                if (critical.RecursionCount != i)
                {
-                       printf("CriticalSection failure: RecursionCount field is %ld instead of %d.\n", critical.RecursionCount, i);
+                       printf("CriticalSection failure: RecursionCount field is %d instead of %d.\n", critical.RecursionCount, i);
                        goto fail;
                }
                if (critical.OwningThread != (HANDLE)(i ? hMainThread : NULL))
@@ -229,7 +229,7 @@ static PVOID TestSynchCritical_Main(PVOID arg)
                        GetExitCodeThread(hThreads[i], &dwThreadExitCode);
                        if(dwThreadExitCode != 0)
                        {
-                               printf("CriticalSection failure: Thread #%d returned error code %lu\n", i, dwThreadExitCode);
+                               printf("CriticalSection failure: Thread #%d returned error code %u\n", i, dwThreadExitCode);
                                goto fail;
                        }
                        CloseHandle(hThreads[i]);
@@ -237,7 +237,7 @@ static PVOID TestSynchCritical_Main(PVOID arg)
 
                if (gTestValueVulnerable != gTestValueSerialized)
                {
-                       printf("CriticalSection failure: unexpected test value %ld (expected %ld)\n", gTestValueVulnerable, gTestValueSerialized);
+                       printf("CriticalSection failure: unexpected test value %d (expected %d)\n", gTestValueVulnerable, gTestValueSerialized);
                        goto fail;
                }
 
@@ -268,7 +268,7 @@ static PVOID TestSynchCritical_Main(PVOID arg)
        GetExitCodeThread(hThread, &dwThreadExitCode);
        if(dwThreadExitCode != 0)
        {
-               printf("CriticalSection failure: Thread returned error code %lu\n", dwThreadExitCode);
+               printf("CriticalSection failure: Thread returned error code %u\n", dwThreadExitCode);
                goto fail;
        }
        CloseHandle(hThread);
@@ -292,7 +292,7 @@ int TestSynchCritical(int argc, char* argv[])
 
        dwDeadLockDetectionTimeMs = 2 * TEST_SYNC_CRITICAL_TEST1_RUNTIME_MS * TEST_SYNC_CRITICAL_TEST1_RUNS;
 
-       printf("Deadlock will be assumed after %lu ms.\n", dwDeadLockDetectionTimeMs);
+       printf("Deadlock will be assumed after %u ms.\n", dwDeadLockDetectionTimeMs);
 
        hThread = CreateThread(NULL, 0,  (LPTHREAD_START_ROUTINE) TestSynchCritical_Main, &bThreadTerminated, 0, NULL);
 
index f3a6a95..f74aa15 100644 (file)
@@ -457,7 +457,7 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds)
        }
        else
        {
-               fprintf(stderr, "WaitForSingleObject: unknown handle type %lu\n", Type);
+               fprintf(stderr, "WaitForSingleObject: unknown handle type %d\n", Type);
        }
 
        return WAIT_OBJECT_0;
@@ -549,7 +549,7 @@ DWORD WaitForMultipleObjects(DWORD nCount, const HANDLE* lpHandles, BOOL bWaitAl
                }
                else
                {
-                       fprintf(stderr, "WaitForMultipleObjects: unknown handle type %lu\n", Type);
+                       fprintf(stderr, "WaitForMultipleObjects: unknown handle type %d\n", Type);
                        return WAIT_FAILED;
                }
 
index 82ae5d6..3025984 100644 (file)
@@ -11,13 +11,13 @@ int TestGetNativeSystemInfo(int argc, char* argv[])
        printf("SystemInfo:\n");
        printf("\twProcessorArchitecture: %d\n", sysinfo.wProcessorArchitecture);
        printf("\twReserved: %d\n", sysinfo.wReserved);
-       printf("\tdwPageSize: 0x%08lX\n", sysinfo.dwPageSize);
+       printf("\tdwPageSize: 0x%08X\n", sysinfo.dwPageSize);
        printf("\tlpMinimumApplicationAddress: %p\n", sysinfo.lpMinimumApplicationAddress);
        printf("\tlpMaximumApplicationAddress: %p\n", sysinfo.lpMaximumApplicationAddress);
-       printf("\tdwActiveProcessorMask: 0x%08llX\n", (unsigned long long)sysinfo.dwActiveProcessorMask);
-       printf("\tdwNumberOfProcessors: %ld\n", sysinfo.dwNumberOfProcessors);
-       printf("\tdwProcessorType: %ld\n", sysinfo.dwProcessorType);
-       printf("\tdwAllocationGranularity: %ld\n", sysinfo.dwAllocationGranularity);
+       printf("\tdwActiveProcessorMask: 0x%08X\n", (unsigned int) sysinfo.dwActiveProcessorMask);
+       printf("\tdwNumberOfProcessors: %d\n", sysinfo.dwNumberOfProcessors);
+       printf("\tdwProcessorType: %d\n", sysinfo.dwProcessorType);
+       printf("\tdwAllocationGranularity: %d\n", sysinfo.dwAllocationGranularity);
        printf("\twProcessorLevel: %d\n", sysinfo.wProcessorLevel);
        printf("\twProcessorRevision: %d\n", sysinfo.wProcessorRevision);
        printf("\n");
index e71a0eb..0fc73a5 100644 (file)
@@ -77,7 +77,7 @@ int TestHashTable(int argc, char* argv[])
 
        if (strcmp(value, val1) != 0)
        {
-               printf("HashTable_GetItemValue: Expected : %d, Actual: %d\n", val1, value);
+               printf("HashTable_GetItemValue: Expected : %s, Actual: %s\n", val1, value);
                return -1;
        }
 
@@ -85,7 +85,7 @@ int TestHashTable(int argc, char* argv[])
 
        if (strcmp(value, val2) != 0)
        {
-               printf("HashTable_GetItemValue: Expected : %d, Actual: %d\n", val2, value);
+               printf("HashTable_GetItemValue: Expected : %s, Actual: %s\n", val2, value);
                return -1;
        }
 
@@ -93,7 +93,7 @@ int TestHashTable(int argc, char* argv[])
 
        if (strcmp(value, val3) != 0)
        {
-               printf("HashTable_GetItemValue: Expected : %d, Actual: %d\n", val3, value);
+               printf("HashTable_GetItemValue: Expected : %s, Actual: %s\n", val3, value);
                return -1;
        }
 
@@ -103,7 +103,7 @@ int TestHashTable(int argc, char* argv[])
 
        if (strcmp(value, "apple") != 0)
        {
-               printf("HashTable_GetItemValue: Expected : %d, Actual: %d\n", "apple", value);
+               printf("HashTable_GetItemValue: Expected : %s, Actual: %s\n", "apple", value);
                return -1;
        }
 
index 76c42c2..152d25f 100644 (file)
@@ -77,7 +77,8 @@ int TestListDictionary(int argc, char* argv[])
 
        if (strcmp(value, val1) != 0)
        {
-               printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n", val1, value);
+               printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n",
+                               (int) (size_t) val1, (int) (size_t) value);
                return -1;
        }
 
@@ -85,7 +86,8 @@ int TestListDictionary(int argc, char* argv[])
 
        if (strcmp(value, val2) != 0)
        {
-               printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n", val2, value);
+               printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n",
+                               (int) (size_t) val2, (int) (size_t) value);
                return -1;
        }
 
@@ -93,7 +95,8 @@ int TestListDictionary(int argc, char* argv[])
 
        if (strcmp(value, val3) != 0)
        {
-               printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n", val3, value);
+               printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n",
+                               (int) (size_t) val3, (int) (size_t) value);
                return -1;
        }
 
@@ -103,7 +106,7 @@ int TestListDictionary(int argc, char* argv[])
 
        if (strcmp(value, "apple") != 0)
        {
-               printf("ListDictionary_GetItemValue: Expected : %d, Actual: %d\n", "apple", value);
+               printf("ListDictionary_GetItemValue: Expected : %s, Actual: %s\n", "apple", value);
                return -1;
        }
 
@@ -144,7 +147,7 @@ int TestListDictionary(int argc, char* argv[])
        value = ListDictionary_Remove_Head(list);
        if (value)
        {
-               printf("ListDictionary_Remove_Head: Expected : (null), Actual: %s Count: %d\n", value);
+               printf("ListDictionary_Remove_Head: Expected : (null), Actual: %s\n", value);
                return -1;
        }
 
index e34dc07..9e13e48 100644 (file)
@@ -119,7 +119,7 @@ void WLog_Layout_GetMessagePrefix(wLog* log, wLogLayout* layout, wLogMessage* me
                                }
                                else if ((*p == 'l') && (*(p + 1) == 'n')) /* line number */
                                {
-                                       args[argc++] = (void*) message->LineNumber;
+                                       args[argc++] = (void*) (size_t) message->LineNumber;
                                        format[index++] = '%';
                                        format[index++] = 'd';
                                        p++;