[PATCH 1/2] msvcrt/tests: Fix 2 MSVC warnings about result.
Serge Gautherie
winehq-git_serge_180711 at gautherie.fr
Sat Nov 2 21:51:05 CDT 2019
Signed-off-by: Serge Gautherie <winehq-git_serge_180711 at gautherie.fr>
---
"...\scanf.c(204): warning C4477: 'sscanf' : format string '%hd' requires an argument of type 'short *', but variadic argument 1 has type 'int *'"
"...\scanf.c(209): warning C4477: 'sscanf' : format string '%hhd' requires an argument of type 'signed char *', but variadic argument 1 has type 'int *'"
---
dlls/msvcrt/tests/scanf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c
index 5db9d43..07132e4 100644
--- a/dlls/msvcrt/tests/scanf.c
+++ b/dlls/msvcrt/tests/scanf.c
@@ -201,12 +201,12 @@ static void test_sscanf( void )
result = 0xdeadbeef;
strcpy(buffer,"12345678");
- ret = p_sscanf(buffer, "%hd", &result);
+ ret = p_sscanf(buffer, "%hd", (short *)&result);
ok(ret == 1, "Wrong number of arguments read: %d\n", ret);
ok(result == 0xdead614e, "Wrong number read (%x)\n", result);
result = 0xdeadbeef;
- ret = p_sscanf(buffer, "%hhd", &result);
+ ret = p_sscanf(buffer, "%hhd", (char *)&result);
ok(ret == 1, "Wrong number of arguments read: %d\n", ret);
ok(result == 0xbc614e, "Wrong number read (%x)\n", result);
--
2.10.0.windows.1
More information about the wine-devel
mailing list