From ca4a1d19a540c143a13d7a1e8ced66dfda99856f Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 8 May 2019 12:20:43 +0200 Subject: [PATCH 1/2] Silenced some unused parameter warnings. --- libfreerdp/codec/test/TestFreeRDPCodecClear.c | 3 + .../codec/test/TestFreeRDPCodecInterleaved.c | 2 + libfreerdp/codec/test/TestFreeRDPCodecMppc.c | 119 +++++----- .../codec/test/TestFreeRDPCodecNCrush.c | 3 + .../codec/test/TestFreeRDPCodecPlanar.c | 2 + .../codec/test/TestFreeRDPCodecProgressive.c | 2 + .../codec/test/TestFreeRDPCodecXCrush.c | 73 +++--- libfreerdp/codec/test/TestFreeRDPCodecZGfx.c | 3 + libfreerdp/codec/test/TestFreeRDPRegion.c | 2 + libfreerdp/common/test/TestCommonAssistance.c | 5 +- libfreerdp/core/test/TestConnect.c | 2 + libfreerdp/core/test/TestSettings.c | 12 +- libfreerdp/crypto/test/TestBase64.c | 44 ++-- libfreerdp/crypto/test/TestKnownHosts.c | 3 +- libfreerdp/crypto/test/Test_x509_cert_info.c | 20 +- libfreerdp/gdi/test/TestGdiBitBlt.c | 2 + libfreerdp/gdi/test/TestGdiClip.c | 6 +- libfreerdp/gdi/test/TestGdiCreate.c | 2 + libfreerdp/gdi/test/TestGdiEllipse.c | 2 + libfreerdp/gdi/test/TestGdiLine.c | 2 + libfreerdp/gdi/test/TestGdiRect.c | 3 + libfreerdp/gdi/test/TestGdiRop3.c | 2 + libfreerdp/primitives/prim_colors.c | 12 + libfreerdp/primitives/prim_internal.h | 8 + libfreerdp/primitives/primitives.c | 6 + .../primitives/test/TestPrimitivesColors.c | 5 +- .../primitives/test/TestPrimitivesCopy.c | 16 +- .../primitives/test/TestPrimitivesSet.c | 2 + .../primitives/test/TestPrimitivesShift.c | 223 ++++++++++-------- 29 files changed, 358 insertions(+), 228 deletions(-) diff --git a/libfreerdp/codec/test/TestFreeRDPCodecClear.c b/libfreerdp/codec/test/TestFreeRDPCodecClear.c index 6ff0466cb..f48fe1e00 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecClear.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecClear.c @@ -74,6 +74,9 @@ fail: int TestFreeRDPCodecClear(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + /* Example 1 needs a filled glyph cache if (!test_ClearDecompressExample(1, 8, 9, TEST_CLEAR_EXAMPLE_1, sizeof(TEST_CLEAR_EXAMPLE_1))) diff --git a/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c b/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c index 727009c23..a1834d6e4 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecInterleaved.c @@ -156,6 +156,8 @@ int TestFreeRDPCodecInterleaved(int argc, char* argv[]) { BITMAP_INTERLEAVED_CONTEXT* encoder, * decoder; int rc = -1; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); encoder = bitmap_interleaved_context_new(TRUE); decoder = bitmap_interleaved_context_new(FALSE); diff --git a/libfreerdp/codec/test/TestFreeRDPCodecMppc.c b/libfreerdp/codec/test/TestFreeRDPCodecMppc.c index f9a8c81f5..33af9361a 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecMppc.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecMppc.c @@ -694,48 +694,48 @@ static const BYTE TEST_MPPC_BELLS[] = "for.whom.the.bell.tolls,.the.bell.tolls.f /* Flags: 0x0060 Length: 33 */ static const BYTE TEST_MPPC_BELLS_RDP4[] = - "\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c" - "\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xf4\x37\x2e\x66\xfa\x1f\x19\x94" - "\x84"; + "\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c" + "\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xf4\x37\x2e\x66\xfa\x1f\x19\x94" + "\x84"; /* Flags: 0x0061 Length: 34 */ static const BYTE TEST_MPPC_BELLS_RDP5[] = - "\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c" - "\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xfa\x1b\x97\x33\x7e\x87\xe3\x32" - "\x90\x80"; + "\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c" + "\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xfa\x1b\x97\x33\x7e\x87\xe3\x32" + "\x90\x80"; static const BYTE TEST_ISLAND_DATA[] = - "No man is an island entire of itself; every man " - "is a piece of the continent, a part of the main; " - "if a clod be washed away by the sea, Europe " - "is the less, as well as if a promontory were, as" - "well as any manner of thy friends or of thine " - "own were; any man's death diminishes me, " - "because I am involved in mankind. " - "And therefore never send to know for whom " - "the bell tolls; it tolls for thee."; + "No man is an island entire of itself; every man " + "is a piece of the continent, a part of the main; " + "if a clod be washed away by the sea, Europe " + "is the less, as well as if a promontory were, as" + "well as any manner of thy friends or of thine " + "own were; any man's death diminishes me, " + "because I am involved in mankind. " + "And therefore never send to know for whom " + "the bell tolls; it tolls for thee."; static const BYTE TEST_ISLAND_DATA_RDP5[] = - "\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2\xdc\xc8" - "\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6\xca\xd8" - "\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65\x63\xfc" - "\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2\x40\xe0" - "\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b\x37\xd7" - "\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2\x10\x30" - "\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20\x45\x75" - "\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69\xcc\x81" - "\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2\xb3\x7f" - "\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96\xe6\x57" - "\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f\xd2\xb6" - "\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49\x3b\x99" - "\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96\xce\x64" - "\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30\xb6\x90" - "\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69\x6e\x64" - "\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd\xbf\x04" - "\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81\x03\xbb" - "\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec\xf3\xa7" - "\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80"; + "\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2\xdc\xc8" + "\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6\xca\xd8" + "\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65\x63\xfc" + "\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2\x40\xe0" + "\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b\x37\xd7" + "\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2\x10\x30" + "\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20\x45\x75" + "\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69\xcc\x81" + "\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2\xb3\x7f" + "\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96\xe6\x57" + "\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f\xd2\xb6" + "\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49\x3b\x99" + "\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96\xce\x64" + "\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30\xb6\x90" + "\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69\x6e\x64" + "\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd\xbf\x04" + "\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81\x03\xbb" + "\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec\xf3\xa7" + "\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80"; static int test_MppcCompressBellsRdp5(void) { @@ -750,6 +750,7 @@ static int test_MppcCompressBellsRdp5(void) UINT32 expectedSize; BYTE OutputBuffer[65536]; mppc = mppc_context_new(1, TRUE); + if (!mppc) return -1; @@ -759,13 +760,16 @@ static int test_MppcCompressBellsRdp5(void) DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); + if (status < 0) goto fail; + printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize); if (DstSize != expectedSize) { - printf("MppcCompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("MppcCompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); goto fail; } @@ -780,7 +784,6 @@ static int test_MppcCompressBellsRdp5(void) } rc = 0; - fail: mppc_context_free(mppc); return rc; @@ -798,8 +801,8 @@ static int test_MppcCompressBellsRdp4(void) MPPC_CONTEXT* mppc; UINT32 expectedSize; BYTE OutputBuffer[65536]; - mppc = mppc_context_new(0, TRUE); + if (!mppc) return -1; @@ -809,6 +812,7 @@ static int test_MppcCompressBellsRdp4(void) DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); + if (status < 0) goto fail; @@ -816,7 +820,8 @@ static int test_MppcCompressBellsRdp4(void) if (DstSize != expectedSize) { - printf("MppcCompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("MppcCompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); goto fail; } @@ -831,7 +836,6 @@ static int test_MppcCompressBellsRdp4(void) } rc = 0; - fail: mppc_context_free(mppc); return rc; @@ -848,8 +852,8 @@ static int test_MppcDecompressBellsRdp5(void) MPPC_CONTEXT* mppc; UINT32 expectedSize; BYTE* pDstData = NULL; - mppc = mppc_context_new(1, FALSE); + if (!mppc) return -1; @@ -858,6 +862,7 @@ static int test_MppcDecompressBellsRdp5(void) Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1; expectedSize = sizeof(TEST_MPPC_BELLS) - 1; status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); + if (status < 0) goto fail; @@ -865,7 +870,8 @@ static int test_MppcDecompressBellsRdp5(void) if (DstSize != expectedSize) { - printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); goto fail; } @@ -876,7 +882,6 @@ static int test_MppcDecompressBellsRdp5(void) } rc = 0; - fail: mppc_context_free(mppc); return rc; @@ -894,6 +899,7 @@ static int test_MppcDecompressBellsRdp4(void) UINT32 expectedSize; BYTE* pDstData = NULL; mppc = mppc_context_new(0, FALSE); + if (!mppc) return -1; @@ -902,6 +908,7 @@ static int test_MppcDecompressBellsRdp4(void) Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 0; expectedSize = sizeof(TEST_MPPC_BELLS) - 1; status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); + if (status < 0) goto fail; @@ -909,7 +916,8 @@ static int test_MppcDecompressBellsRdp4(void) if (DstSize != expectedSize) { - printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); goto fail; } @@ -920,7 +928,6 @@ static int test_MppcDecompressBellsRdp4(void) } rc = 0; - fail: mppc_context_free(mppc); return rc; @@ -938,8 +945,8 @@ static int test_MppcCompressIslandRdp5(void) MPPC_CONTEXT* mppc; UINT32 expectedSize; BYTE OutputBuffer[65536]; - mppc = mppc_context_new(1, TRUE); + if (!mppc) return -1; @@ -949,6 +956,7 @@ static int test_MppcCompressIslandRdp5(void) DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); + if (status < 0) goto fail; @@ -956,7 +964,8 @@ static int test_MppcCompressIslandRdp5(void) if (DstSize != expectedSize) { - printf("MppcCompressIslandRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("MppcCompressIslandRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); goto fail; } @@ -971,7 +980,6 @@ static int test_MppcCompressIslandRdp5(void) } rc = 0; - fail: mppc_context_free(mppc); return rc; @@ -989,8 +997,8 @@ static int test_MppcCompressBufferRdp5(void) MPPC_CONTEXT* mppc; UINT32 expectedSize; BYTE OutputBuffer[65536]; - mppc = mppc_context_new(1, TRUE); + if (!mppc) return -1; @@ -1000,6 +1008,7 @@ static int test_MppcCompressBufferRdp5(void) DstSize = sizeof(OutputBuffer); pDstData = OutputBuffer; status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags); + if (status < 0) goto fail; @@ -1007,7 +1016,8 @@ static int test_MppcCompressBufferRdp5(void) if (DstSize != expectedSize) { - printf("MppcCompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("MppcCompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); goto fail; } @@ -1018,7 +1028,6 @@ static int test_MppcCompressBufferRdp5(void) } rc = 0; - fail: mppc_context_free(mppc); return rc; @@ -1035,8 +1044,8 @@ static int test_MppcDecompressBufferRdp5(void) MPPC_CONTEXT* mppc; UINT32 expectedSize; BYTE* pDstData = NULL; - mppc = mppc_context_new(1, FALSE); + if (!mppc) return -1; @@ -1045,6 +1054,7 @@ static int test_MppcDecompressBufferRdp5(void) Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1; expectedSize = sizeof(TEST_RDP5_UNCOMPRESSED_DATA); status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags); + if (status < 0) goto fail; @@ -1052,7 +1062,8 @@ static int test_MppcDecompressBufferRdp5(void) if (DstSize != expectedSize) { - printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); goto fail; } @@ -1063,7 +1074,6 @@ static int test_MppcDecompressBufferRdp5(void) } rc = 0; - fail: mppc_context_free(mppc); return rc; @@ -1071,6 +1081,9 @@ fail: int TestFreeRDPCodecMppc(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + if (test_MppcCompressIslandRdp5() < 0) return -1; diff --git a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c index ec2959352..c8864ad4e 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecNCrush.c @@ -113,6 +113,9 @@ fail: int TestFreeRDPCodecNCrush(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + if (!test_NCrushCompressBells()) return -1; diff --git a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c index 7b583fc02..9ba35e29f 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecPlanar.c @@ -3052,6 +3052,8 @@ fail: int TestFreeRDPCodecPlanar(int argc, char* argv[]) { UINT32 x; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); for (x = 0; x < colorFormatCount; x++) { diff --git a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c index 8b648eeb5..76bdcc480 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecProgressive.c @@ -926,6 +926,8 @@ int TestFreeRDPCodecProgressive(int argc, char* argv[]) char* ms_sample_path; char name[8192]; SYSTEMTIME systemTime; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); GetSystemTime(&systemTime); sprintf_s(name, sizeof(name), "EGFX_PROGRESSIVE_MS_SAMPLE-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16, diff --git a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c index c831c1d64..33fa4b057 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecXCrush.c @@ -6,42 +6,42 @@ static const BYTE TEST_BELLS_DATA[] = "for.whom.the.bell.tolls,.the.bell.tolls.for.thee!"; static const BYTE TEST_BELLS_DATA_XCRUSH[] = - "\x12\x00\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62" - "\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\x2e\x74\x68\x65\x2e\x62" - "\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2e\x66\x6f\x72\x2e\x74\x68" - "\x65"; + "\x12\x00\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62" + "\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\x2e\x74\x68\x65\x2e\x62" + "\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2e\x66\x6f\x72\x2e\x74\x68" + "\x65"; static const BYTE TEST_ISLAND_DATA[] = - "No man is an island entire of itself; every man " - "is a piece of the continent, a part of the main; " - "if a clod be washed away by the sea, Europe " - "is the less, as well as if a promontory were, as" - "well as any manner of thy friends or of thine " - "own were; any man's death diminishes me, " - "because I am involved in mankind. " - "And therefore never send to know for whom " - "the bell tolls; it tolls for thee."; + "No man is an island entire of itself; every man " + "is a piece of the continent, a part of the main; " + "if a clod be washed away by the sea, Europe " + "is the less, as well as if a promontory were, as" + "well as any manner of thy friends or of thine " + "own were; any man's death diminishes me, " + "because I am involved in mankind. " + "And therefore never send to know for whom " + "the bell tolls; it tolls for thee."; static const BYTE TEST_ISLAND_DATA_XCRUSH[] = - "\x12\x61\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2" - "\xdc\xc8\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6" - "\xca\xd8\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65" - "\x63\xfc\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2" - "\x40\xe0\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b" - "\x37\xd7\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2" - "\x10\x30\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20" - "\x45\x75\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69" - "\xcc\x81\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2" - "\xb3\x7f\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96" - "\xe6\x57\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f" - "\xd2\xb6\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49" - "\x3b\x99\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96" - "\xce\x64\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30" - "\xb6\x90\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69" - "\x6e\x64\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd" - "\xbf\x04\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81" - "\x03\xbb\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec" - "\xf3\xa7\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80"; + "\x12\x61\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2" + "\xdc\xc8\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6" + "\xca\xd8\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65" + "\x63\xfc\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2" + "\x40\xe0\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b" + "\x37\xd7\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2" + "\x10\x30\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20" + "\x45\x75\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69" + "\xcc\x81\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2" + "\xb3\x7f\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96" + "\xe6\x57\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f" + "\xd2\xb6\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49" + "\x3b\x99\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96" + "\xce\x64\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30" + "\xb6\x90\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69" + "\x6e\x64\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd" + "\xbf\x04\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81" + "\x03\xbb\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec" + "\xf3\xa7\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80"; int test_XCrushCompressBells() { @@ -66,7 +66,8 @@ int test_XCrushCompressBells() if (DstSize != expectedSize) { - printf("XCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("XCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); printf("Expected\n"); @@ -111,7 +112,8 @@ int test_XCrushCompressIsland() if (DstSize != expectedSize) { - printf("XCrushCompressIsland: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize); + printf("XCrushCompressIsland: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", + DstSize, expectedSize); printf("Actual\n"); BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0); printf("Expected\n"); @@ -135,6 +137,9 @@ int test_XCrushCompressIsland() int TestFreeRDPCodecXCrush(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + //if (test_XCrushCompressBells() < 0) // return -1; if (test_XCrushCompressIsland() < 0) diff --git a/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c b/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c index e1f2170e4..7cdd91119 100644 --- a/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c +++ b/libfreerdp/codec/test/TestFreeRDPCodecZGfx.c @@ -251,6 +251,9 @@ fail: int TestFreeRDPCodecZGfx(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + if (test_ZGfxCompressFox() < 0) return -1; diff --git a/libfreerdp/codec/test/TestFreeRDPRegion.c b/libfreerdp/codec/test/TestFreeRDPRegion.c index 36f944afb..35aad8ac6 100644 --- a/libfreerdp/codec/test/TestFreeRDPRegion.c +++ b/libfreerdp/codec/test/TestFreeRDPRegion.c @@ -912,6 +912,8 @@ int TestFreeRDPRegion(int argc, char* argv[]) { int i, testNb = 0; int retCode = -1; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); for (i = 0; tests[i].func; i++) { diff --git a/libfreerdp/common/test/TestCommonAssistance.c b/libfreerdp/common/test/TestCommonAssistance.c index c52130ea5..24050fb2c 100644 --- a/libfreerdp/common/test/TestCommonAssistance.c +++ b/libfreerdp/common/test/TestCommonAssistance.c @@ -168,7 +168,10 @@ fail: int TestCommonAssistance(int argc, char* argv[]) { - wLog* log = WLog_Get(__FUNCTION__); + wLog* log; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + log = WLog_Get(__FUNCTION__); winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT); if (!test_msrsc_incident_file_type1(log)) diff --git a/libfreerdp/core/test/TestConnect.c b/libfreerdp/core/test/TestConnect.c index 83762c6e2..7142a01a4 100644 --- a/libfreerdp/core/test/TestConnect.c +++ b/libfreerdp/core/test/TestConnect.c @@ -282,6 +282,8 @@ int TestConnect(int argc, char* argv[]) { int randomPort; int random; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); winpr_RAND((BYTE*)&random, sizeof(random)); randomPort = 3389 + (random % 200); diff --git a/libfreerdp/core/test/TestSettings.c b/libfreerdp/core/test/TestSettings.c index 3bfe5aa5a..ebfc15fee 100644 --- a/libfreerdp/core/test/TestSettings.c +++ b/libfreerdp/core/test/TestSettings.c @@ -2,25 +2,29 @@ int TestSettings(int argc, char* argv[]) { - rdpSettings *settings = NULL; - rdpSettings *cloned; - + rdpSettings* settings = NULL; + rdpSettings* cloned; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); settings = freerdp_settings_new(0); + if (!settings) { printf("Couldn't create settings\n"); return -1; } + settings->Username = _strdup("abcdefg"); settings->Password = _strdup("xyz"); cloned = freerdp_settings_clone(settings); + if (!cloned) { printf("Problem cloning settings\n"); freerdp_settings_free(settings); return -1; } - + freerdp_settings_free(cloned); freerdp_settings_free(settings); return 0; diff --git a/libfreerdp/crypto/test/TestBase64.c b/libfreerdp/crypto/test/TestBase64.c index a50b6b7b0..7752bc9d0 100644 --- a/libfreerdp/crypto/test/TestBase64.c +++ b/libfreerdp/crypto/test/TestBase64.c @@ -19,22 +19,24 @@ #include -struct Encode64test { - const char *input; +struct Encode64test +{ + const char* input; int len; - const char *output; + const char* output; }; -struct Encode64test encodeTests[] = { - {"\x00", 1, "AA=="}, - {"\x00\x00", 2, "AAA="}, - {"\x00\x00\x00", 3, "AAAA"}, - {"0123456", 7, "MDEyMzQ1Ng=="}, - {"90123456", 8, "OTAxMjM0NTY="}, - {"890123456", 9, "ODkwMTIzNDU2"}, - {"7890123456", 10, "Nzg5MDEyMzQ1Ng=="}, +struct Encode64test encodeTests[] = +{ + {"\x00", 1, "AA=="}, + {"\x00\x00", 2, "AAA="}, + {"\x00\x00\x00", 3, "AAAA"}, + {"0123456", 7, "MDEyMzQ1Ng=="}, + {"90123456", 8, "OTAxMjM0NTY="}, + {"890123456", 9, "ODkwMTIzNDU2"}, + {"7890123456", 10, "Nzg5MDEyMzQ1Ng=="}, - {NULL, -1, NULL}, /* /!\ last one /!\ */ + {NULL, -1, NULL}, /* /!\ last one /!\ */ }; @@ -42,14 +44,15 @@ int TestBase64(int argc, char* argv[]) { int i, testNb = 0; int outLen; - BYTE *decoded; - + BYTE* decoded; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); testNb++; fprintf(stderr, "%d:encode base64...", testNb); for (i = 0; encodeTests[i].input; i++) { - char *encoded = crypto_base64_encode((const BYTE *)encodeTests[i].input, encodeTests[i].len); + char* encoded = crypto_base64_encode((const BYTE*)encodeTests[i].input, encodeTests[i].len); if (strcmp(encodeTests[i].output, encoded)) { @@ -59,10 +62,11 @@ int TestBase64(int argc, char* argv[]) free(encoded); } - fprintf(stderr, "ok\n"); + fprintf(stderr, "ok\n"); testNb++; fprintf(stderr, "%d:decode base64...", testNb); + for (i = 0; encodeTests[i].input; i++) { crypto_base64_decode(encodeTests[i].output, strlen(encodeTests[i].output), &decoded, &outLen); @@ -75,11 +79,12 @@ int TestBase64(int argc, char* argv[]) free(decoded); } - fprintf(stderr, "ok\n"); + fprintf(stderr, "ok\n"); testNb++; fprintf(stderr, "%d:decode base64 errors...", testNb); crypto_base64_decode("000", 3, &decoded, &outLen); + if (decoded) { fprintf(stderr, "ko, badly padded string\n"); @@ -87,6 +92,7 @@ int TestBase64(int argc, char* argv[]) } crypto_base64_decode("0=00", 4, &decoded, &outLen); + if (decoded) { fprintf(stderr, "ko, = in a wrong place\n"); @@ -94,13 +100,13 @@ int TestBase64(int argc, char* argv[]) } crypto_base64_decode("00=0", 4, &decoded, &outLen); + if (decoded) { fprintf(stderr, "ko, = in a wrong place\n"); return -1; } + fprintf(stderr, "ok\n"); - - return 0; } diff --git a/libfreerdp/crypto/test/TestKnownHosts.c b/libfreerdp/crypto/test/TestKnownHosts.c index 4bd3a3709..44ba580e0 100644 --- a/libfreerdp/crypto/test/TestKnownHosts.c +++ b/libfreerdp/crypto/test/TestKnownHosts.c @@ -102,7 +102,8 @@ int TestKnownHosts(int argc, char* argv[]) char sname[8192]; char dname[8192]; SYSTEMTIME systemTime; - + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); GetSystemTime(&systemTime); sprintf_s(sname, sizeof(sname), "TestKnownHostsCurrent-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16, diff --git a/libfreerdp/crypto/test/Test_x509_cert_info.c b/libfreerdp/crypto/test/Test_x509_cert_info.c index 4655f17ed..f02e4d402 100644 --- a/libfreerdp/crypto/test/Test_x509_cert_info.c +++ b/libfreerdp/crypto/test/Test_x509_cert_info.c @@ -6,7 +6,7 @@ typedef struct { enum { - DISABLED, ENABLED, + DISABLED, ENABLED, } status; const char* field_description; get_field_pr get_field; @@ -26,18 +26,18 @@ char* certificate_path() Assume that __FILE__ will be a valid path to this file, even from the current working directory where the tests are run. (ie. no chdir occurs between compilation and test running, or __FILE__ is an absolute path). */ - #if defined(_WIN32) static const char dirsep = '\\'; #else static const char dirsep = '/'; #endif - static const char * filename = "Test_x509_cert_info.pem"; - const char * file = __FILE__; - const char * last_dirsep = strrchr(file, dirsep); + static const char* filename = "Test_x509_cert_info.pem"; + const char* file = __FILE__; + const char* last_dirsep = strrchr(file, dirsep); + if (last_dirsep) { - char * result = malloc(last_dirsep - file + 1 + strlen(filename) + 1); + char* result = malloc(last_dirsep - file + 1 + strlen(filename) + 1); strncpy(result, file, (last_dirsep - file + 1)); strcpy(result + (last_dirsep - file + 1), filename); return result; @@ -50,7 +50,7 @@ char* certificate_path() } const certificate_test_t certificate_tests[] = - { +{ { ENABLED, @@ -150,6 +150,7 @@ int TestCertificateFile(const char* certificate_path, const certificate_test_t* certificate_tests[i].expected_result); success = -1; } + free(result); } else @@ -168,7 +169,10 @@ fail: int Test_x509_cert_info(int argc, char* argv[]) { char* cert_path = certificate_path(); - int ret = TestCertificateFile(cert_path, certificate_tests, ARRAYSIZE(certificate_tests)); + int ret; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + ret = TestCertificateFile(cert_path, certificate_tests, ARRAYSIZE(certificate_tests)); free(cert_path); return ret; } diff --git a/libfreerdp/gdi/test/TestGdiBitBlt.c b/libfreerdp/gdi/test/TestGdiBitBlt.c index c04a68cfa..b07f02afa 100644 --- a/libfreerdp/gdi/test/TestGdiBitBlt.c +++ b/libfreerdp/gdi/test/TestGdiBitBlt.c @@ -583,6 +583,8 @@ int TestGdiBitBlt(int argc, char* argv[]) PIXEL_FORMAT_XBGR32 }; const UINT32 listSize = sizeof(formatList) / sizeof(formatList[0]); + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); for (x = 0; x < listSize; x++) { diff --git a/libfreerdp/gdi/test/TestGdiClip.c b/libfreerdp/gdi/test/TestGdiClip.c index b78ada2c2..ac27836e5 100644 --- a/libfreerdp/gdi/test/TestGdiClip.c +++ b/libfreerdp/gdi/test/TestGdiClip.c @@ -159,11 +159,9 @@ static int test_gdi_ClipCoords(void) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT)rgn1); gdi_DeleteObject((HGDIOBJECT)rgn2); gdi_DeleteObject((HGDIOBJECT)bmp); - gdi_DeleteDC(hdc); return rc; } @@ -326,17 +324,17 @@ static int test_gdi_InvalidateRegion(void) rc = 0; fail: - gdi_DeleteObject((HGDIOBJECT)rgn1); gdi_DeleteObject((HGDIOBJECT)rgn2); gdi_DeleteObject((HGDIOBJECT)bmp); - gdi_DeleteDC(hdc); return 0; } int TestGdiClip(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); fprintf(stderr, "test_gdi_ClipCoords()\n"); if (test_gdi_ClipCoords() < 0) diff --git a/libfreerdp/gdi/test/TestGdiCreate.c b/libfreerdp/gdi/test/TestGdiCreate.c index 4c145ded2..14e2b93eb 100644 --- a/libfreerdp/gdi/test/TestGdiCreate.c +++ b/libfreerdp/gdi/test/TestGdiCreate.c @@ -530,6 +530,8 @@ fail: int TestGdiCreate(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); fprintf(stderr, "test_gdi_GetDC()\n"); if (test_gdi_GetDC() < 0) diff --git a/libfreerdp/gdi/test/TestGdiEllipse.c b/libfreerdp/gdi/test/TestGdiEllipse.c index b195be1ba..7a674e7b8 100644 --- a/libfreerdp/gdi/test/TestGdiEllipse.c +++ b/libfreerdp/gdi/test/TestGdiEllipse.c @@ -103,6 +103,8 @@ int TestGdiEllipse(int argc, char* argv[]) }; const UINT32 number_formats = sizeof(colorFormats) / sizeof(colorFormats[0]); gdiPalette g; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); for (i = 0; i < number_formats; i++) { diff --git a/libfreerdp/gdi/test/TestGdiLine.c b/libfreerdp/gdi/test/TestGdiLine.c index fc494c266..92185ceab 100644 --- a/libfreerdp/gdi/test/TestGdiLine.c +++ b/libfreerdp/gdi/test/TestGdiLine.c @@ -625,6 +625,8 @@ int TestGdiLine(int argc, char* argv[]) PIXEL_FORMAT_BGRX32 }; const UINT32 number_formats = sizeof(colorFormats) / sizeof(colorFormats[0]); + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); for (i = 0; i < number_formats; i++) { diff --git a/libfreerdp/gdi/test/TestGdiRect.c b/libfreerdp/gdi/test/TestGdiRect.c index e850f9ef5..8f0d04ace 100644 --- a/libfreerdp/gdi/test/TestGdiRect.c +++ b/libfreerdp/gdi/test/TestGdiRect.c @@ -155,6 +155,9 @@ fail: int TestGdiRect(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); + if (test_gdi_PtInRect() < 0) return -1; diff --git a/libfreerdp/gdi/test/TestGdiRop3.c b/libfreerdp/gdi/test/TestGdiRop3.c index d955695ca..bd4486ed2 100644 --- a/libfreerdp/gdi/test/TestGdiRop3.c +++ b/libfreerdp/gdi/test/TestGdiRop3.c @@ -207,6 +207,8 @@ static const char* test_ROP3[] = int TestGdiRop3(int argc, char* argv[]) { size_t index; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); for (index = 0; index < sizeof(test_ROP3) / sizeof(test_ROP3[0]); index++) { diff --git a/libfreerdp/primitives/prim_colors.c b/libfreerdp/primitives/prim_colors.c index 1bfb558ad..77c1850ca 100644 --- a/libfreerdp/primitives/prim_colors.c +++ b/libfreerdp/primitives/prim_colors.c @@ -299,6 +299,8 @@ static INLINE void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstForma const INT16* r, const INT16* g, const INT16* b, DWORD width) { DWORD x; + WINPR_UNUSED(formatSize); + WINPR_UNUSED(DstFormat); for (x = 0; x < width; x++) { @@ -315,6 +317,8 @@ static INLINE void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstForma const INT16* r, const INT16* g, const INT16* b, DWORD width) { DWORD x; + WINPR_UNUSED(formatSize); + WINPR_UNUSED(DstFormat); for (x = 0; x < width; x++) { @@ -331,6 +335,8 @@ static INLINE void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstForm const INT16* r, const INT16* g, const INT16* b, DWORD width) { DWORD x; + WINPR_UNUSED(formatSize); + WINPR_UNUSED(DstFormat); for (x = 0; x < width; x++) { @@ -348,6 +354,8 @@ static INLINE void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstForm const INT16* r, const INT16* g, const INT16* b, DWORD width) { DWORD x; + WINPR_UNUSED(formatSize); + WINPR_UNUSED(DstFormat); for (x = 0; x < width; x++) { @@ -365,6 +373,8 @@ static INLINE void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstForm const INT16* r, const INT16* g, const INT16* b, DWORD width) { DWORD x; + WINPR_UNUSED(formatSize); + WINPR_UNUSED(DstFormat); for (x = 0; x < width; x++) { @@ -382,6 +392,8 @@ static INLINE void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstForm const INT16* r, const INT16* g, const INT16* b, DWORD width) { DWORD x; + WINPR_UNUSED(formatSize); + WINPR_UNUSED(DstFormat); for (x = 0; x < width; x++) { diff --git a/libfreerdp/primitives/prim_internal.h b/libfreerdp/primitives/prim_internal.h index 14bea9124..b9795716c 100644 --- a/libfreerdp/primitives/prim_internal.h +++ b/libfreerdp/primitives/prim_internal.h @@ -48,6 +48,8 @@ static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { + WINPR_UNUSED(formatSize); + WINPR_UNUSED(format); *dst++ = B; *dst++ = G; *dst++ = R; @@ -58,6 +60,8 @@ static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format, static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { + WINPR_UNUSED(formatSize); + WINPR_UNUSED(format); *dst++ = R; *dst++ = G; *dst++ = B; @@ -68,6 +72,8 @@ static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format, static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { + WINPR_UNUSED(formatSize); + WINPR_UNUSED(format); *dst++ = A; *dst++ = B; *dst++ = G; @@ -78,6 +84,8 @@ static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format, static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format, BYTE R, BYTE G, BYTE B, BYTE A) { + WINPR_UNUSED(formatSize); + WINPR_UNUSED(format); *dst++ = A; *dst++ = R; *dst++ = G; diff --git a/libfreerdp/primitives/primitives.c b/libfreerdp/primitives/primitives.c index d25c5b41d..6051659d7 100644 --- a/libfreerdp/primitives/primitives.c +++ b/libfreerdp/primitives/primitives.c @@ -39,6 +39,9 @@ static INIT_ONCE primitives_InitOnce = INIT_ONCE_STATIC_INIT; /* ------------------------------------------------------------------------- */ static BOOL CALLBACK primitives_init_generic(PINIT_ONCE once, PVOID param, PVOID* context) { + WINPR_UNUSED(once); + WINPR_UNUSED(param); + WINPR_UNUSED(context); primitives_init_add(&pPrimitivesGeneric); primitives_init_andor(&pPrimitivesGeneric); primitives_init_alphaComp(&pPrimitivesGeneric); @@ -55,6 +58,9 @@ static BOOL CALLBACK primitives_init_generic(PINIT_ONCE once, PVOID param, PVOID #if defined(HAVE_OPTIMIZED_PRIMITIVES) static BOOL CALLBACK primitives_init(PINIT_ONCE once, PVOID param, PVOID* context) { + WINPR_UNUSED(once); + WINPR_UNUSED(param); + WINPR_UNUSED(context); /* Now call each section's initialization routine. */ primitives_init_add_opt(&pPrimitives); primitives_init_andor_opt(&pPrimitives); diff --git a/libfreerdp/primitives/test/TestPrimitivesColors.c b/libfreerdp/primitives/test/TestPrimitivesColors.c index 269c86ca0..2775422e4 100644 --- a/libfreerdp/primitives/test/TestPrimitivesColors.c +++ b/libfreerdp/primitives/test/TestPrimitivesColors.c @@ -102,7 +102,8 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_func(prim_size_t roi, DWORD DstFormat) } } - printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height, FreeRDPGetColorFormatName(DstFormat)); + printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height, + FreeRDPGetColorFormatName(DstFormat)); PROFILER_PRINT_HEADER PROFILER_PRINT(genericProf) PROFILER_PRINT(optProf) @@ -274,6 +275,8 @@ int TestPrimitivesColors(int argc, char* argv[]) }; DWORD x; prim_size_t roi = { 1920, 1080}; + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); prim_test_setup(FALSE); for (x = 0; x < sizeof(formats) / sizeof(formats[0]); x++) diff --git a/libfreerdp/primitives/test/TestPrimitivesCopy.c b/libfreerdp/primitives/test/TestPrimitivesCopy.c index cf19d3708..151ec03c8 100644 --- a/libfreerdp/primitives/test/TestPrimitivesCopy.c +++ b/libfreerdp/primitives/test/TestPrimitivesCopy.c @@ -28,7 +28,6 @@ static BOOL test_copy8u_func(void) BYTE ALIGN(data[COPY_TESTSIZE + 15]); int i, soff; BYTE ALIGN(dest[COPY_TESTSIZE + 15]); - winpr_RAND(data, sizeof(data)); for (soff = 0; soff < 16; ++soff) @@ -42,6 +41,7 @@ static BOOL test_copy8u_func(void) for (length = 1; length <= COPY_TESTSIZE - doff; ++length) { memset(dest, 0, sizeof(dest)); + if (prims->copy_8u(data + soff, dest + doff, length) != PRIMITIVES_SUCCESS) return FALSE; @@ -70,15 +70,15 @@ static BOOL test_copy8u_speed(void) BYTE ALIGN(dst[MAX_TEST_SIZE + 4]); if (!speed_test("copy_8u", "aligned", g_Iterations, - (speed_test_fkt)generic->copy_8u, - (speed_test_fkt)optimized->copy_8u, - src, dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->copy_8u, + (speed_test_fkt)optimized->copy_8u, + src, dst, MAX_TEST_SIZE)) return FALSE; if (!speed_test("copy_8u", "unaligned", g_Iterations, - (speed_test_fkt)generic->copy_8u, - (speed_test_fkt)optimized->copy_8u, - src+1, dst+1, MAX_TEST_SIZE)) + (speed_test_fkt)generic->copy_8u, + (speed_test_fkt)optimized->copy_8u, + src + 1, dst + 1, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -86,6 +86,8 @@ static BOOL test_copy8u_speed(void) int TestPrimitivesCopy(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); prim_test_setup(FALSE); if (!test_copy8u_func()) diff --git a/libfreerdp/primitives/test/TestPrimitivesSet.c b/libfreerdp/primitives/test/TestPrimitivesSet.c index 913bf802d..852cf9a73 100644 --- a/libfreerdp/primitives/test/TestPrimitivesSet.c +++ b/libfreerdp/primitives/test/TestPrimitivesSet.c @@ -269,6 +269,8 @@ static BOOL test_set32s_speed(void) int TestPrimitivesSet(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); prim_test_setup(FALSE); if (!test_set8u_func()) diff --git a/libfreerdp/primitives/test/TestPrimitivesShift.c b/libfreerdp/primitives/test/TestPrimitivesShift.c index e2f9b670c..16d7d5f0b 100644 --- a/libfreerdp/primitives/test/TestPrimitivesShift.c +++ b/libfreerdp/primitives/test/TestPrimitivesShift.c @@ -24,28 +24,31 @@ static BOOL test_lShift_16s_func(void) { pstatus_t status; - INT16 ALIGN(src[FUNC_TEST_SIZE+3]); - INT16 ALIGN(d1[FUNC_TEST_SIZE+3]); + INT16 ALIGN(src[FUNC_TEST_SIZE + 3]); + INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]); UINT32 val; - winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); - val = (val % (FUNC_TEST_SIZE - 1)) + 1; - /* Aligned */ - status = generic->lShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE); + status = generic->lShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->lShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE); + + status = optimized->lShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; /* Unaligned */ - status = generic->lShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE); + status = generic->lShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->lShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE); + + status = optimized->lShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; @@ -55,28 +58,31 @@ static BOOL test_lShift_16s_func(void) static BOOL test_lShift_16u_func(void) { pstatus_t status; - UINT16 ALIGN(src[FUNC_TEST_SIZE+3]); - UINT16 ALIGN(d1[FUNC_TEST_SIZE+3]); + UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]); + UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]); UINT32 val; - winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); - val = (val % (FUNC_TEST_SIZE - 1)) + 1; - /* Aligned */ - status = generic->lShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE); + status = generic->lShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->lShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE); + + status = optimized->lShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; /* Unaligned */ - status = generic->lShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE); + status = generic->lShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->lShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE); + + status = optimized->lShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; @@ -86,28 +92,31 @@ static BOOL test_lShift_16u_func(void) static BOOL test_rShift_16s_func(void) { pstatus_t status; - INT16 ALIGN(src[FUNC_TEST_SIZE+3]); - INT16 ALIGN(d1[FUNC_TEST_SIZE+3]); + INT16 ALIGN(src[FUNC_TEST_SIZE + 3]); + INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]); UINT32 val; - winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); - val = (val % (FUNC_TEST_SIZE - 1)) + 1; - /* Aligned */ - status = generic->rShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE); + status = generic->rShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->rShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE); + + status = optimized->rShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; /* Unaligned */ - status = generic->rShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE); + status = generic->rShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->rShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE); + + status = optimized->rShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; @@ -117,28 +126,31 @@ static BOOL test_rShift_16s_func(void) static BOOL test_rShift_16u_func(void) { pstatus_t status; - UINT16 ALIGN(src[FUNC_TEST_SIZE+3]); - UINT16 ALIGN(d1[FUNC_TEST_SIZE+3]); + UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]); + UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]); UINT32 val; - winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); - val = (val % (FUNC_TEST_SIZE - 1)) + 1; - /* Aligned */ - status = generic->rShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE); + status = generic->rShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->rShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE); + + status = optimized->rShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; /* Unaligned */ - status = generic->rShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE); + status = generic->rShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->rShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE); + + status = optimized->rShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; @@ -148,42 +160,52 @@ static BOOL test_rShift_16u_func(void) static BOOL test_ShiftWrapper_16s_func(void) { pstatus_t status; - INT16 ALIGN(src[FUNC_TEST_SIZE+3]); - INT16 ALIGN(d1[FUNC_TEST_SIZE+3]); + INT16 ALIGN(src[FUNC_TEST_SIZE + 3]); + INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]); UINT32 tmp; INT32 val; - winpr_RAND((BYTE*)&tmp, sizeof(tmp)); winpr_RAND((BYTE*)src, sizeof(src)); - val = (tmp % (FUNC_TEST_SIZE - 1)) + 1; - /* Aligned */ - status = generic->shiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE); - if (status != PRIMITIVES_SUCCESS) - return FALSE; - status = optimized->shiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE); + status = generic->shiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = generic->shiftC_16s(src+1, -val, d1+1, FUNC_TEST_SIZE); + status = optimized->shiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->shiftC_16s(src+1, -val, d1+1, FUNC_TEST_SIZE); + + status = generic->shiftC_16s(src + 1, -val, d1 + 1, FUNC_TEST_SIZE); + + if (status != PRIMITIVES_SUCCESS) + return FALSE; + + status = optimized->shiftC_16s(src + 1, -val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; /* Unaligned */ - status = generic->shiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE); + status = generic->shiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->shiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE); + + status = optimized->shiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = generic->shiftC_16s(src+1, -val, d1+2, FUNC_TEST_SIZE); + + status = generic->shiftC_16s(src + 1, -val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->shiftC_16s(src+1, -val, d1+2, FUNC_TEST_SIZE); + + status = optimized->shiftC_16s(src + 1, -val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; @@ -193,42 +215,52 @@ static BOOL test_ShiftWrapper_16s_func(void) static BOOL test_ShiftWrapper_16u_func(void) { pstatus_t status; - UINT16 ALIGN(src[FUNC_TEST_SIZE+3]); - UINT16 ALIGN(d1[FUNC_TEST_SIZE+3]); + UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]); + UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]); UINT32 tmp; INT32 val; - winpr_RAND((BYTE*)&tmp, sizeof(tmp)); winpr_RAND((BYTE*)src, sizeof(src)); - val = (tmp % (FUNC_TEST_SIZE - 1)) + 1; - /* Aligned */ - status = generic->shiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE); - if (status != PRIMITIVES_SUCCESS) - return FALSE; - status = optimized->shiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE); + status = generic->shiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = generic->shiftC_16u(src+1, -val, d1+1, FUNC_TEST_SIZE); + status = optimized->shiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->shiftC_16u(src+1, -val, d1+1, FUNC_TEST_SIZE); + + status = generic->shiftC_16u(src + 1, -val, d1 + 1, FUNC_TEST_SIZE); + + if (status != PRIMITIVES_SUCCESS) + return FALSE; + + status = optimized->shiftC_16u(src + 1, -val, d1 + 1, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; /* Unaligned */ - status = generic->shiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE); + status = generic->shiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->shiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE); + + status = optimized->shiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = generic->shiftC_16u(src+1, -val, d1+2, FUNC_TEST_SIZE); + + status = generic->shiftC_16u(src + 1, -val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; - status = optimized->shiftC_16u(src+1, -val, d1+2, FUNC_TEST_SIZE); + + status = optimized->shiftC_16u(src + 1, -val, d1 + 2, FUNC_TEST_SIZE); + if (status != PRIMITIVES_SUCCESS) return FALSE; @@ -239,21 +271,20 @@ static BOOL test_ShiftWrapper_16u_func(void) static BOOL test_lShift_16s_speed(void) { UINT32 val; - INT16 ALIGN(src[MAX_TEST_SIZE+1]), ALIGN(dst[MAX_TEST_SIZE+1]); - + INT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); winpr_RAND((BYTE*)src, sizeof(src)); winpr_RAND((BYTE*)&val, sizeof(val)); if (!speed_test("lShift_16s", "aligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16s, - (speed_test_fkt)optimized->lShiftC_16s, src, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->lShiftC_16s, + (speed_test_fkt)optimized->lShiftC_16s, src, val, + dst, MAX_TEST_SIZE)) return FALSE; if (!speed_test("lShift_16s", "unaligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16s, - (speed_test_fkt)optimized->lShiftC_16s, src + 1, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->lShiftC_16s, + (speed_test_fkt)optimized->lShiftC_16s, src + 1, val, + dst, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -264,20 +295,19 @@ static BOOL test_lShift_16u_speed(void) { UINT32 val; UINT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); - winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); if (!speed_test("lShift_16u", "aligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16u, - (speed_test_fkt)optimized->lShiftC_16u, src, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->lShiftC_16u, + (speed_test_fkt)optimized->lShiftC_16u, src, val, + dst, MAX_TEST_SIZE)) return FALSE; if (!speed_test("lShift_16u", "unaligned", g_Iterations, - (speed_test_fkt)generic->lShiftC_16u, - (speed_test_fkt)optimized->lShiftC_16u, src + 1, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->lShiftC_16u, + (speed_test_fkt)optimized->lShiftC_16u, src + 1, val, + dst, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -287,20 +317,20 @@ static BOOL test_lShift_16u_speed(void) static BOOL test_rShift_16s_speed(void) { UINT32 val; - INT16 ALIGN(src[MAX_TEST_SIZE+1]), ALIGN(dst[MAX_TEST_SIZE+1]); - + INT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); winpr_RAND((BYTE*)src, sizeof(src)); winpr_RAND((BYTE*)&val, sizeof(val)); + if (!speed_test("rShift_16s", "aligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16s, - (speed_test_fkt)optimized->rShiftC_16s, src, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->rShiftC_16s, + (speed_test_fkt)optimized->rShiftC_16s, src, val, + dst, MAX_TEST_SIZE)) return FALSE; if (!speed_test("rShift_16s", "unaligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16s, - (speed_test_fkt)optimized->rShiftC_16s, src + 1, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->rShiftC_16s, + (speed_test_fkt)optimized->rShiftC_16s, src + 1, val, + dst, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -311,20 +341,19 @@ static BOOL test_rShift_16u_speed(void) { UINT32 val; UINT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]); - winpr_RAND((BYTE*)&val, sizeof(val)); winpr_RAND((BYTE*)src, sizeof(src)); if (!speed_test("rShift_16u", "aligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16u, - (speed_test_fkt)optimized->rShiftC_16u, src, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->rShiftC_16u, + (speed_test_fkt)optimized->rShiftC_16u, src, val, + dst, MAX_TEST_SIZE)) return FALSE; if (!speed_test("rShift_16u", "unaligned", g_Iterations, - (speed_test_fkt)generic->rShiftC_16u, - (speed_test_fkt)optimized->rShiftC_16u, src + 1, val, - dst, MAX_TEST_SIZE)) + (speed_test_fkt)generic->rShiftC_16u, + (speed_test_fkt)optimized->rShiftC_16u, src + 1, val, + dst, MAX_TEST_SIZE)) return FALSE; return TRUE; @@ -332,6 +361,8 @@ static BOOL test_rShift_16u_speed(void) int TestPrimitivesShift(int argc, char* argv[]) { + WINPR_UNUSED(argc); + WINPR_UNUSED(argv); prim_test_setup(FALSE); if (!test_lShift_16s_func()) From 8f7e1579fd6a1a99fdbba2c6a5242cdeda61ce9d Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 8 May 2019 12:26:04 +0200 Subject: [PATCH 2/2] Silenced unused parameter warnings in smartcard trace --- .../smartcard/client/smartcard_operations.c | 5 +- channels/smartcard/client/smartcard_pack.c | 53 +++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/channels/smartcard/client/smartcard_operations.c b/channels/smartcard/client/smartcard_operations.c index fcc326200..aa3127fcc 100644 --- a/channels/smartcard/client/smartcard_operations.c +++ b/channels/smartcard/client/smartcard_operations.c @@ -1430,7 +1430,9 @@ static LONG smartcard_AccessStartedEvent_Decode(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation) { Long_Call* call; - IRP* irp = operation->irp; + IRP* irp; + WINPR_UNUSED(smartcard); + irp = operation->irp; operation->call = call = calloc(1, sizeof(Long_Call)); if (!call) @@ -1451,6 +1453,7 @@ static LONG smartcard_AccessStartedEvent_Call(SMARTCARD_DEVICE* smartcard, SMARTCARD_OPERATION* operation) { LONG status = SCARD_S_SUCCESS; + WINPR_UNUSED(operation); if (!smartcard->StartedEvent) smartcard->StartedEvent = SCardAccessStartedEvent(); diff --git a/channels/smartcard/client/smartcard_pack.c b/channels/smartcard/client/smartcard_pack.c index fa95d767d..eeff7fb9c 100644 --- a/channels/smartcard/client/smartcard_pack.c +++ b/channels/smartcard/client/smartcard_pack.c @@ -34,6 +34,7 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s UINT32 filler; UINT8 endianness; UINT16 commonHeaderLength; + WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 8) { @@ -77,6 +78,7 @@ LONG smartcard_unpack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s void smartcard_pack_common_type_header(SMARTCARD_DEVICE* smartcard, wStream* s) { + WINPR_UNUSED(smartcard); Stream_Write_UINT8(s, 1); /* Version (1 byte) */ Stream_Write_UINT8(s, 0x10); /* Endianness (1 byte) */ Stream_Write_UINT16(s, 8); /* CommonHeaderLength (2 bytes) */ @@ -87,6 +89,7 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* { UINT32 filler; UINT32 objectBufferLength; + WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 8) { @@ -118,6 +121,7 @@ LONG smartcard_unpack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* void smartcard_pack_private_type_header(SMARTCARD_DEVICE* smartcard, wStream* s, UINT32 objectBufferLength) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, objectBufferLength); /* ObjectBufferLength (4 bytes) */ Stream_Write_UINT32(s, 0x00000000); /* Filler (4 bytes), should be 0x00000000 */ } @@ -126,6 +130,7 @@ LONG smartcard_unpack_read_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, U UINT32 alignment) { UINT32 pad; + WINPR_UNUSED(smartcard); pad = size; size = (size + alignment - 1) & ~(alignment - 1); pad = size - pad; @@ -140,6 +145,7 @@ LONG smartcard_pack_write_size_align(SMARTCARD_DEVICE* smartcard, wStream* s, UI UINT32 alignment) { UINT32 pad; + WINPR_UNUSED(smartcard); pad = size; size = (size + alignment - 1) & ~(alignment - 1); pad = size - pad; @@ -162,6 +168,7 @@ SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartca REDIR_SCARDCONTEXT* context) { SCARDCONTEXT hContext = { 0 }; + WINPR_UNUSED(smartcard); if ((context->cbContext != sizeof(ULONG_PTR)) && (context->cbContext != 0)) { @@ -180,6 +187,7 @@ SCARDCONTEXT smartcard_scard_context_native_from_redir(SMARTCARD_DEVICE* smartca void smartcard_scard_context_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_SCARDCONTEXT* context, SCARDCONTEXT hContext) { + WINPR_UNUSED(smartcard); ZeroMemory(context, sizeof(REDIR_SCARDCONTEXT)); context->cbContext = sizeof(ULONG_PTR); CopyMemory(&(context->pbContext), &hContext, context->cbContext); @@ -189,6 +197,7 @@ SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard REDIR_SCARDHANDLE* handle) { SCARDHANDLE hCard = 0; + WINPR_UNUSED(smartcard); if (handle->cbHandle != sizeof(ULONG_PTR)) { @@ -207,6 +216,7 @@ SCARDHANDLE smartcard_scard_handle_native_from_redir(SMARTCARD_DEVICE* smartcard void smartcard_scard_handle_native_to_redir(SMARTCARD_DEVICE* smartcard, REDIR_SCARDHANDLE* handle, SCARDHANDLE hCard) { + WINPR_UNUSED(smartcard); ZeroMemory(handle, sizeof(REDIR_SCARDHANDLE)); handle->cbHandle = sizeof(ULONG_PTR); CopyMemory(&(handle->pbHandle), &hCard, handle->cbHandle); @@ -216,6 +226,7 @@ LONG smartcard_unpack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* REDIR_SCARDCONTEXT* context) { UINT32 pbContextNdrPtr; + WINPR_UNUSED(smartcard); ZeroMemory(context, sizeof(REDIR_SCARDCONTEXT)); if (Stream_GetRemainingLength(s) < 4) @@ -264,6 +275,7 @@ LONG smartcard_pack_redir_scard_context(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDCONTEXT* context) { UINT32 pbContextNdrPtr; + WINPR_UNUSED(smartcard); pbContextNdrPtr = (context->cbContext) ? 0x00020001 : 0; Stream_Write_UINT32(s, context->cbContext); /* cbContext (4 bytes) */ Stream_Write_UINT32(s, pbContextNdrPtr); /* pbContextNdrPtr (4 bytes) */ @@ -274,6 +286,7 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre REDIR_SCARDCONTEXT* context) { UINT32 length; + WINPR_UNUSED(smartcard); if (context->cbContext == 0) return SCARD_S_SUCCESS; @@ -318,6 +331,7 @@ LONG smartcard_unpack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStre LONG smartcard_pack_redir_scard_context_ref(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDCONTEXT* context) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, context->cbContext); /* Length (4 bytes) */ if (context->cbContext) @@ -332,6 +346,7 @@ LONG smartcard_unpack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s REDIR_SCARDHANDLE* handle) { UINT32 pbHandleNdrPtr; + WINPR_UNUSED(smartcard); ZeroMemory(handle, sizeof(REDIR_SCARDHANDLE)); if (Stream_GetRemainingLength(s) < 4) @@ -358,6 +373,7 @@ LONG smartcard_pack_redir_scard_handle(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDHANDLE* handle) { UINT32 pbHandleNdrPtr; + WINPR_UNUSED(smartcard); pbHandleNdrPtr = (handle->cbHandle) ? 0x00020002 : 0; Stream_Write_UINT32(s, handle->cbHandle); /* cbHandle (4 bytes) */ Stream_Write_UINT32(s, pbHandleNdrPtr); /* pbHandleNdrPtr (4 bytes) */ @@ -368,6 +384,7 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea REDIR_SCARDHANDLE* handle) { UINT32 length; + WINPR_UNUSED(smartcard); if (Stream_GetRemainingLength(s) < 4) { @@ -407,6 +424,7 @@ LONG smartcard_unpack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStrea LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* s, REDIR_SCARDHANDLE* handle) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, handle->cbHandle); /* Length (4 bytes) */ if (handle->cbHandle) @@ -418,6 +436,8 @@ LONG smartcard_pack_redir_scard_handle_ref(SMARTCARD_DEVICE* smartcard, wStream* LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, EstablishContext_Call* call) { + WINPR_UNUSED(smartcard); + if (Stream_GetRemainingLength(s) < 4) { WLog_WARN(TAG, "EstablishContext_Call is too short: Actual: %"PRIuz", Expected: 4", @@ -432,6 +452,8 @@ LONG smartcard_unpack_establish_context_call(SMARTCARD_DEVICE* smartcard, wStrea void smartcard_trace_establish_context_call(SMARTCARD_DEVICE* smartcard, EstablishContext_Call* call) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -462,6 +484,7 @@ void smartcard_trace_establish_context_return(SMARTCARD_DEVICE* smartcard, EstablishContext_Return* ret) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -505,6 +528,7 @@ LONG smartcard_unpack_context_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, Context_Call* call, const char* name) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -529,6 +553,8 @@ void smartcard_trace_context_call(SMARTCARD_DEVICE* smartcard, Context_Call* cal void smartcard_trace_long_return(SMARTCARD_DEVICE* smartcard, Long_Return* ret, const char* name) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -568,6 +594,7 @@ void smartcard_trace_list_reader_groups_call(SMARTCARD_DEVICE* smartcard, ListReaderGroups_Call* call, BOOL unicode) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -622,6 +649,7 @@ void smartcard_trace_list_reader_groups_return(SMARTCARD_DEVICE* smartcard, int index; int length; char* mszA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -730,6 +758,7 @@ void smartcard_trace_list_readers_call(SMARTCARD_DEVICE* smartcard, ListReaders_ { BYTE* pb; char* mszGroupsA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -807,6 +836,7 @@ void smartcard_trace_list_readers_return(SMARTCARD_DEVICE* smartcard, ListReader size_t index; size_t length; char* mszA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -926,6 +956,7 @@ LONG smartcard_unpack_connect_a_call(SMARTCARD_DEVICE* smartcard, wStream* s, Co void smartcard_trace_connect_a_call(SMARTCARD_DEVICE* smartcard, ConnectA_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -999,6 +1030,7 @@ void smartcard_trace_connect_w_call(SMARTCARD_DEVICE* smartcard, ConnectW_Call* { BYTE* pb; char* szReaderA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1060,6 +1092,7 @@ LONG smartcard_pack_connect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Conn void smartcard_trace_connect_return(SMARTCARD_DEVICE* smartcard, Connect_Return* ret) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1142,6 +1175,7 @@ LONG smartcard_unpack_reconnect_call(SMARTCARD_DEVICE* smartcard, wStream* s, Re void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, Reconnect_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1185,12 +1219,15 @@ void smartcard_trace_reconnect_call(SMARTCARD_DEVICE* smartcard, Reconnect_Call* LONG smartcard_pack_reconnect_return(SMARTCARD_DEVICE* smartcard, wStream* s, Reconnect_Return* ret) { + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, ret->dwActiveProtocol); /* dwActiveProtocol (4 bytes) */ return SCARD_S_SUCCESS; } void smartcard_trace_reconnect_return(SMARTCARD_DEVICE* smartcard, Reconnect_Return* ret) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1244,6 +1281,7 @@ void smartcard_trace_hcard_and_disposition_call(SMARTCARD_DEVICE* smartcard, HCardAndDisposition_Call* call, const char* name) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1417,6 +1455,7 @@ void smartcard_trace_get_status_change_a_call(SMARTCARD_DEVICE* smartcard, char* szEventState; char* szCurrentState; LPSCARD_READERSTATEA readerState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1584,6 +1623,7 @@ void smartcard_trace_get_status_change_w_call(SMARTCARD_DEVICE* smartcard, char* szEventState; char* szCurrentState; LPSCARD_READERSTATEW readerState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1632,6 +1672,7 @@ LONG smartcard_pack_get_status_change_return(SMARTCARD_DEVICE* smartcard, wStrea { UINT32 index; ReaderState_Return* rgReaderState; + WINPR_UNUSED(smartcard); Stream_Write_UINT32(s, ret->cReaders); /* cReaders (4 bytes) */ Stream_Write_UINT32(s, 0x00020100); /* rgReaderStatesNdrPtr (4 bytes) */ Stream_Write_UINT32(s, ret->cReaders); /* rgReaderStatesNdrCount (4 bytes) */ @@ -1657,6 +1698,7 @@ void smartcard_trace_get_status_change_return(SMARTCARD_DEVICE* smartcard, char* szEventState; char* szCurrentState; ReaderState_Return* rgReaderState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1782,6 +1824,7 @@ LONG smartcard_unpack_status_call(SMARTCARD_DEVICE* smartcard, wStream* s, Statu void smartcard_trace_status_call(SMARTCARD_DEVICE* smartcard, Status_Call* call, BOOL unicode) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1855,6 +1898,7 @@ void smartcard_trace_status_return(SMARTCARD_DEVICE* smartcard, Status_Return* r size_t length; char* pbAtr = NULL; char* mszReaderNamesA = NULL; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -1960,6 +2004,7 @@ LONG smartcard_unpack_get_attrib_call(SMARTCARD_DEVICE* smartcard, wStream* s, G void smartcard_trace_get_attrib_call(SMARTCARD_DEVICE* smartcard, GetAttrib_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2027,6 +2072,8 @@ LONG smartcard_pack_get_attrib_return(SMARTCARD_DEVICE* smartcard, wStream* s, void smartcard_trace_get_attrib_return(SMARTCARD_DEVICE* smartcard, GetAttrib_Return* ret, DWORD dwAttrId) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2129,6 +2176,7 @@ LONG smartcard_unpack_control_call(SMARTCARD_DEVICE* smartcard, wStream* s, Cont void smartcard_trace_control_call(SMARTCARD_DEVICE* smartcard, Control_Call* call) { BYTE* pb; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2210,6 +2258,8 @@ LONG smartcard_pack_control_return(SMARTCARD_DEVICE* smartcard, wStream* s, Cont void smartcard_trace_control_return(SMARTCARD_DEVICE* smartcard, Control_Return* ret) { + WINPR_UNUSED(smartcard); + if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2483,6 +2533,7 @@ void smartcard_trace_transmit_call(SMARTCARD_DEVICE* smartcard, Transmit_Call* c BYTE* pb; UINT32 cbExtraBytes; BYTE* pbExtraBytes; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2644,6 +2695,7 @@ void smartcard_trace_transmit_return(SMARTCARD_DEVICE* smartcard, Transmit_Retur { UINT32 cbExtraBytes; BYTE* pbExtraBytes; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return; @@ -2868,6 +2920,7 @@ void smartcard_trace_locate_cards_by_atr_a_call(SMARTCARD_DEVICE* smartcard, char* szCurrentState; char* rgbAtr; LPSCARD_READERSTATEA readerState; + WINPR_UNUSED(smartcard); if (!WLog_IsLevelActive(WLog_Get(TAG), WLOG_DEBUG)) return;