winelib: Add a few casts

Andrew Talbot Andrew.Talbot at talbotville.com
Mon Jun 26 13:26:51 CDT 2006


Changelog:
    winelib: Add a few casts.

diff -urN a/include/wine/unicode.h b/include/wine/unicode.h
--- a/include/wine/unicode.h	2006-05-26 11:35:15.000000000 +0100
+++ b/include/wine/unicode.h	2006-06-26 19:23:45.000000000 +0100
@@ -201,7 +201,7 @@
 {
     const WCHAR *s = str;
     while (*s) s++;
-    return s - str;
+    return (unsigned int) (s - str);
 }
 
 extern inline WCHAR *strcpyW( WCHAR *dst, const WCHAR *src );
@@ -219,7 +219,7 @@
 extern inline int strcmpW( const WCHAR *str1, const WCHAR *str2 )
 {
     while (*str1 && (*str1 == *str2)) { str1++; str2++; }
-    return *str1 - *str2;
+    return (int) (*str1 - *str2);
 }
 
 extern inline int strncmpW( const WCHAR *str1, const WCHAR *str2, int n );
@@ -227,13 +227,13 @@
 {
     if (n <= 0) return 0;
     while ((--n > 0) && *str1 && (*str1 == *str2)) { str1++; str2++; }
-    return *str1 - *str2;
+    return (int) (*str1 - *str2);
 }
 
 extern inline WCHAR *strcatW( WCHAR *dst, const WCHAR *src );
 extern inline WCHAR *strcatW( WCHAR *dst, const WCHAR *src )
 {
-    strcpyW( dst + strlenW(dst), src );
+    (void) strcpyW( dst + strlenW(dst), src );
     return dst;
 }
 
@@ -264,7 +264,7 @@
 {
     const WCHAR *ptr;
     for (ptr = str; *ptr; ptr++) if (!strchrW( accept, *ptr )) break;
-    return ptr - str;
+    return (size_t) (ptr - str);
 }
 
 extern inline size_t strcspnW( const WCHAR *str, const WCHAR *reject );
@@ -272,7 +272,7 @@
 {
     const WCHAR *ptr;
     for (ptr = str; *ptr; ptr++) if (strchrW( reject, *ptr )) break;
-    return ptr - str;
+    return (size_t) (ptr - str);
 }
 
 extern inline WCHAR *strlwrW( WCHAR *str );



More information about the wine-patches mailing list