Add casts to some printfs in debug.h and test.h to avoid warnings
during the move of DWORD/LONG/ULONG from long to int.
Michael Stefaniuc
mstefani at redhat.de
Tue Sep 26 16:10:05 CDT 2006
---
Alexandre pointed out that we cannot change the LONG variables in test.h
to int due to InterlockedIncrement() being called on them. Here is a
different approach using casts temporary.
This patch fixes 153 printf format warnings generated by test.h on Win64
compiles and 9800 generated by debug.h .
bye
michael
include/wine/debug.h | 7 ++++---
include/wine/test.h | 6 +++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/wine/debug.h b/include/wine/debug.h
index 18de451..704ed9d 100644
--- a/include/wine/debug.h
+++ b/include/wine/debug.h
@@ -196,19 +196,20 @@ static inline const char *wine_dbgstr_gu
static inline const char *wine_dbgstr_point( const POINT *pt )
{
if (!pt) return "(null)";
- return wine_dbg_sprintf( "(%ld,%ld)", pt->x, pt->y );
+ return wine_dbg_sprintf( "(%d,%d)", (int)pt->x, (int)pt->y );
}
static inline const char *wine_dbgstr_size( const SIZE *size )
{
if (!size) return "(null)";
- return wine_dbg_sprintf( "(%ld,%ld)", size->cx, size->cy );
+ return wine_dbg_sprintf( "(%d,%d)", (int)size->cx, (int)size->cy );
}
static inline const char *wine_dbgstr_rect( const RECT *rect )
{
if (!rect) return "(null)";
- return wine_dbg_sprintf( "(%ld,%ld)-(%ld,%ld)", rect->left, rect->top, rect->right, rect->bottom );
+ return wine_dbg_sprintf( "(%d,%d)-(%d,%d)", (int)rect->left, (int)rect->top,
+ (int)rect->right, (int)rect->bottom );
}
static inline const char *wine_dbgstr_longlong( ULONGLONG ll )
diff --git a/include/wine/test.h b/include/wine/test.h
index 8e2bc62..5bfb80d 100644
--- a/include/wine/test.h
+++ b/include/wine/test.h
@@ -371,9 +371,9 @@ static int run_test( const char *name )
if (winetest_debug)
{
- fprintf( stdout, "%s: %ld tests executed, %ld marked as todo, %ld %s.\n",
- name, successes + failures + todo_successes + todo_failures,
- todo_successes, failures + todo_failures,
+ fprintf( stdout, "%s: %d tests executed, %d marked as todo, %d %s.\n",
+ name, (int)(successes + failures + todo_successes + todo_failures),
+ (int)todo_successes, (int)(failures + todo_failures),
(failures + todo_failures != 1) ? "failures" : "failure" );
}
status = (failures + todo_failures < 255) ? failures + todo_failures : 255;
--
1.4.2.1
--
Michael Stefaniuc Tel.: +49-711-96437-199
Sr. Network Engineer Fax.: +49-711-96437-111
Red Hat GmbH Email: mstefani at redhat.com
Hauptstaetterstr. 58 http://www.redhat.de/
D-70178 Stuttgart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060926/23eb9e17/attachment.pgp
More information about the wine-patches
mailing list