Sync to Wine-20050628:
[reactos.git] / reactos / tools / unicode / mbtowc.c
index dd3c924..71c74fd 100644 (file)
 
 #include "wine/unicode.h"
 
+typedef unsigned char uchar;
+
 /* get the decomposition of a Unicode char */
-int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen )
+static int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen )
 {
     extern const WCHAR unicode_decompose_table[];
     const WCHAR *ptr = unicode_decompose_table;
@@ -256,25 +258,25 @@ int wine_cp_mbstowcs( const union cptable *table, int flags,
     {
         if (flags & MB_ERR_INVALID_CHARS)
         {
-            if (check_invalid_chars_sbcs( &table->sbcs, src, srclen )) return -2;
+            if (check_invalid_chars_sbcs( &table->sbcs, (const uchar*)src, srclen )) return -2;
         }
         if (!(flags & MB_COMPOSITE))
         {
             if (!dstlen) return srclen;
-            return mbstowcs_sbcs( &table->sbcs, src, srclen, dst, dstlen );
+            return mbstowcs_sbcs( &table->sbcs, (const uchar*)src, srclen, dst, dstlen );
         }
-        return mbstowcs_sbcs_decompose( &table->sbcs, src, srclen, dst, dstlen );
+        return mbstowcs_sbcs_decompose( &table->sbcs, (const uchar*)src, srclen, dst, dstlen );
     }
     else /* mbcs */
     {
         if (flags & MB_ERR_INVALID_CHARS)
         {
-            if (check_invalid_chars_dbcs( &table->dbcs, src, srclen )) return -2;
+            if (check_invalid_chars_dbcs( &table->dbcs, (const uchar*)src, srclen )) return -2;
         }
         if (!(flags & MB_COMPOSITE))
-            return mbstowcs_dbcs( &table->dbcs, src, srclen, dst, dstlen );
+            return mbstowcs_dbcs( &table->dbcs, (const uchar*)src, srclen, dst, dstlen );
         else
-            return mbstowcs_dbcs_decompose( &table->dbcs, src, srclen, dst, dstlen );
+            return mbstowcs_dbcs_decompose( &table->dbcs, (const uchar*)src, srclen, dst, dstlen );
     }
 }