[PATCH 1/5] crypt32/tests: Fix signed integral cast warning.

Rémi Bernon rbernon at codeweavers.com
Wed Jun 3 04:50:32 CDT 2020


First cast to int, then to DWORD.

Reported by MinGW GCC 10 with -Woverflow.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/crypt32/tests/cert.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/crypt32/tests/cert.c b/dlls/crypt32/tests/cert.c
index 880ae720a4b..7d6d07fe025 100644
--- a/dlls/crypt32/tests/cert.c
+++ b/dlls/crypt32/tests/cert.c
@@ -2909,7 +2909,7 @@ static void testGetValidUsages(void)
     ret = pCertGetValidUsages(0, NULL, NULL, NULL, &size);
      */
     contexts[0] = NULL;
-    numOIDs = size = 0xdeadbeef;
+    size = numOIDs = 0xdeadbeef;
     SetLastError(0xdeadbeef);
     ret = pCertGetValidUsages(1, &contexts[0], &numOIDs, NULL, &size);
     ok(ret, "CertGetValidUsages failed: %d\n", GetLastError());
@@ -2921,12 +2921,12 @@ static void testGetValidUsages(void)
      sizeof(certWithUsage));
     contexts[2] = CertCreateCertificateContext(X509_ASN_ENCODING,
      cert2WithUsage, sizeof(cert2WithUsage));
-    numOIDs = size = 0xdeadbeef;
+    size = numOIDs = 0xdeadbeef;
     ret = pCertGetValidUsages(0, NULL, &numOIDs, NULL, &size);
     ok(ret, "CertGetValidUsages failed: %08x\n", GetLastError());
     ok(numOIDs == -1, "Expected -1, got %d\n", numOIDs);
     ok(size == 0, "Expected size 0, got %d\n", size);
-    numOIDs = size = 0xdeadbeef;
+    size = numOIDs = 0xdeadbeef;
     ret = pCertGetValidUsages(1, contexts, &numOIDs, NULL, &size);
     ok(ret, "CertGetValidUsages failed: %08x\n", GetLastError());
     ok(numOIDs == -1, "Expected -1, got %d\n", numOIDs);
-- 
2.27.0.rc2




More information about the wine-devel mailing list