First cast to int, then to DWORD.
Reported by MinGW GCC 10 with -Woverflow.
Signed-off-by: Rémi Bernon rbernon@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);
First cast to LONG, then to DWORD.
Reported by MinGW GCC 10 with -Woverflow.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/dxgi/tests/dxgi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dxgi/tests/dxgi.c b/dlls/dxgi/tests/dxgi.c index e8dfa036e08..8f52e1d9e72 100644 --- a/dlls/dxgi/tests/dxgi.c +++ b/dlls/dxgi/tests/dxgi.c @@ -1103,7 +1103,7 @@ static void test_check_interface_support(void)
hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D11Device, NULL); ok(hr == DXGI_ERROR_UNSUPPORTED, "Got unexpected hr %#x.\n", hr); - driver_version.HighPart = driver_version.LowPart = 0xdeadbeef; + driver_version.LowPart = driver_version.HighPart = 0xdeadbeef; hr = IDXGIAdapter_CheckInterfaceSupport(adapter, &IID_ID3D11Device, &driver_version); ok(hr == DXGI_ERROR_UNSUPPORTED, "Got unexpected hr %#x.\n", hr); ok(driver_version.HighPart == 0xdeadbeef, "Got unexpected driver version %#x.\n", driver_version.HighPart);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Assign the char field separately.
Reported by MinGW GCC 10 with -Woverflow.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/msvcirt/tests/msvcirt.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcirt/tests/msvcirt.c b/dlls/msvcirt/tests/msvcirt.c index 70fbb6afb4f..6440bc0dab7 100644 --- a/dlls/msvcirt/tests/msvcirt.c +++ b/dlls/msvcirt/tests/msvcirt.c @@ -7373,16 +7373,20 @@ static void test_std_streams(void) ok(*p_ios_sunk_with_stdio == 0, "expected 0 got %d\n", *p_ios_sunk_with_stdio); p_cin->extract_delim = p_cin->count = 0xabababab; p_cin->base_ios.state = 0xabababab; - p_cin->base_ios.precision = p_cin->base_ios.fill = p_cin->base_ios.width = 0xabababab; + p_cin->base_ios.fill = 0xab; + p_cin->base_ios.precision = p_cin->base_ios.width = 0xabababab; p_cout->unknown = 0xabababab; p_cout->base_ios.state = 0xabababab; - p_cout->base_ios.precision = p_cout->base_ios.fill = p_cout->base_ios.width = 0xabababab; + p_cout->base_ios.fill = 0xab; + p_cout->base_ios.precision = p_cout->base_ios.width = 0xabababab; p_cerr->unknown = 0xabababab; p_cerr->base_ios.state = 0xabababab; - p_cerr->base_ios.precision = p_cerr->base_ios.fill = p_cerr->base_ios.width = 0xabababab; + p_cerr->base_ios.fill = 0xab; + p_cerr->base_ios.precision = p_cerr->base_ios.width = 0xabababab; p_clog->unknown = 0xabababab; p_clog->base_ios.state = 0xabababab; - p_clog->base_ios.precision = p_clog->base_ios.fill = p_clog->base_ios.width = 0xabababab; + p_clog->base_ios.fill = 0xab; + p_clog->base_ios.precision = p_clog->base_ios.width = 0xabababab; p_ios_sync_with_stdio(); ok(*p_ios_sunk_with_stdio == 1, "expected 1 got %d\n", *p_ios_sunk_with_stdio);
Signed-off-by: Piotr Caban piotr@codeweavers.com
First cast to int, then to enum file_type.
Reported by MinGW GCC 10 with -Woverflow.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/msvcp120/tests/msvcp120.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c index 7a382ac6faa..ed632a27df2 100644 --- a/dlls/msvcp120/tests/msvcp120.c +++ b/dlls/msvcp120/tests/msvcp120.c @@ -1774,7 +1774,7 @@ static void test_tr2_sys__dir_operation(void)
memset(first_file_name, 0xff, MAX_PATH); memset(dest, 0, MAX_PATH); - err = type = 0xdeadbeef; + type = err = 0xdeadbeef; result_handle = NULL; result_handle = p_tr2_sys__Open_dir(first_file_name, "tr2_test_dir", &err, &type); ok(result_handle != NULL, "tr2_sys__Open_dir(): expect: not NULL, got %p\n", result_handle); @@ -1804,7 +1804,7 @@ static void test_tr2_sys__dir_operation(void) ok(num_of_other_files == 0, "found %d other files\n", num_of_other_files);
memset(first_file_name, 0xff, MAX_PATH); - err = type = 0xdeadbeef; + type = err = 0xdeadbeef; result_handle = file; result_handle = p_tr2_sys__Open_dir(first_file_name, "not_exist", &err, &type); ok(result_handle == NULL, "tr2_sys__Open_dir(): expect: NULL, got %p\n", result_handle); @@ -1814,7 +1814,7 @@ static void test_tr2_sys__dir_operation(void)
CreateDirectoryA("empty_dir", NULL); memset(first_file_name, 0xff, MAX_PATH); - err = type = 0xdeadbeef; + type = err = 0xdeadbeef; result_handle = file; result_handle = p_tr2_sys__Open_dir(first_file_name, "empty_dir", &err, &type); ok(result_handle == NULL, "tr2_sys__Open_dir(): expect: NULL, got %p\n", result_handle);
Signed-off-by: Piotr Caban piotr@codeweavers.com
Reported by MinGW GCC 10 with -Wmaybe-uninitialized, this seems to be a typo.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/sxs/name.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/sxs/name.c b/dlls/sxs/name.c index a76510a9fee..6b3ae5197ac 100644 --- a/dlls/sxs/name.c +++ b/dlls/sxs/name.c @@ -135,7 +135,6 @@ static HRESULT WINAPI name_GetDisplayName( { static const WCHAR fmtW[] = {',','%','s','=','"','%','s','"',0}; struct name *name = impl_from_IAssemblyName( iface ); - WCHAR version[30]; unsigned int len;
TRACE("%p, %p, %p, 0x%08x\n", iface, buffer, buflen, flags); @@ -146,7 +145,7 @@ static HRESULT WINAPI name_GetDisplayName( if (name->arch) len += lstrlenW( archW ) + lstrlenW( name->arch ) + 4; if (name->token) len += lstrlenW( tokenW ) + lstrlenW( name->token ) + 4; if (name->type) len += lstrlenW( typeW ) + lstrlenW( name->type ) + 4; - if (name->version) len += lstrlenW( versionW ) + lstrlenW( version ) + 4; + if (name->version) len += lstrlenW( versionW ) + lstrlenW( name->version ) + 4; if (len > *buflen) { *buflen = len;