Commit 6ca76dc5 authored by Alexandre Julliard's avatar Alexandre Julliard

include: Remove some no longer used Unicode functions.

parent 1514c54c
...@@ -293,9 +293,11 @@ static inline UINT16 get_char_script(WCHAR c) ...@@ -293,9 +293,11 @@ static inline UINT16 get_char_script(WCHAR c)
static DWRITE_SCRIPT_ANALYSIS get_char_sa(WCHAR c) static DWRITE_SCRIPT_ANALYSIS get_char_sa(WCHAR c)
{ {
DWRITE_SCRIPT_ANALYSIS sa; DWRITE_SCRIPT_ANALYSIS sa;
WORD type;
GetStringTypeW(CT_CTYPE1, &c, 1, &type);
sa.script = get_char_script(c); sa.script = get_char_script(c);
sa.shapes = iscntrlW(c) || c == 0x2028 /* LINE SEPARATOR */ || c == 0x2029 /* PARAGRAPH SEPARATOR */ ? sa.shapes = (type & C1_CNTRL) || c == 0x2028 /* LINE SEPARATOR */ || c == 0x2029 /* PARAGRAPH SEPARATOR */ ?
DWRITE_SCRIPT_SHAPES_NO_VISUAL : DWRITE_SCRIPT_SHAPES_DEFAULT; DWRITE_SCRIPT_SHAPES_NO_VISUAL : DWRITE_SCRIPT_SHAPES_DEFAULT;
return sa; return sa;
} }
......
...@@ -2086,7 +2086,7 @@ static void create_port_devices( DRIVER_OBJECT *driver ) ...@@ -2086,7 +2086,7 @@ static void create_port_devices( DRIVER_OBJECT *driver )
if (type != REG_SZ || strncmpiW( port, port_prefix, 3 )) if (type != REG_SZ || strncmpiW( port, port_prefix, 3 ))
continue; continue;
n = atolW( port + 3 ); n = atoiW( port + 3 );
if (n < 1 || n >= MAX_PORTS) if (n < 1 || n >= MAX_PORTS)
continue; continue;
......
...@@ -3621,7 +3621,7 @@ DWORD WINAPI DavGetUNCFromHTTPPath(const WCHAR *http_path, WCHAR *buf, DWORD *bu ...@@ -3621,7 +3621,7 @@ DWORD WINAPI DavGetUNCFromHTTPPath(const WCHAR *http_path, WCHAR *buf, DWORD *bu
if (*p == ':') if (*p == ':')
{ {
port = ++p; port = ++p;
while (*p && isdigitW(*p)) { p++; len_port++; }; while (*p >= '0' && *p <= '9') { p++; len_port++; };
if (len_port == 2 && !ssl && !memcmp( port, port80W, sizeof(port80W) )) port = NULL; if (len_port == 2 && !ssl && !memcmp( port, port80W, sizeof(port80W) )) port = NULL;
else if (len_port == 3 && ssl && !memcmp( port, port443W, sizeof(port443W) )) port = NULL; else if (len_port == 3 && ssl && !memcmp( port, port443W, sizeof(port443W) )) port = NULL;
path = p; path = p;
......
...@@ -799,7 +799,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ...@@ -799,7 +799,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
This->no_fwd_char = '\0'; This->no_fwd_char = '\0';
/* Don't autocomplete at all on most control characters */ /* Don't autocomplete at all on most control characters */
if (iscntrlW(wParam) && !(wParam >= '\b' && wParam <= '\r')) if (wParam < 32 && !(wParam >= '\b' && wParam <= '\r'))
break; break;
ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam); ret = CallWindowProcW(This->wpOrigEditProc, hwnd, uMsg, wParam, lParam);
......
...@@ -1242,7 +1242,7 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size) ...@@ -1242,7 +1242,7 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size)
0, &deadKeyState, size - 1, &len, (UniChar*)buffer); 0, &deadKeyState, size - 1, &len, (UniChar*)buffer);
if (status != noErr) if (status != noErr)
len = 0; len = 0;
if (len && isgraphW(buffer[0])) if (len && buffer[0] > 32)
buffer[len] = 0; buffer[len] = 0;
vkey = thread_data->keyc2vkey[keyc]; vkey = thread_data->keyc2vkey[keyc];
......
...@@ -28,18 +28,10 @@ ...@@ -28,18 +28,10 @@
#include <winnls.h> #include <winnls.h>
#include <winternl.h> #include <winternl.h>
#ifdef __WINE_WINE_TEST_H
#error This file should not be used in Wine tests
#endif
#ifdef __WINE_USE_MSVCRT #ifdef __WINE_USE_MSVCRT
#error This file should not be used with msvcrt headers #error This file should not be used with msvcrt headers
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef WINE_UNICODE_INLINE #ifndef WINE_UNICODE_INLINE
#define WINE_UNICODE_INLINE static FORCEINLINE #define WINE_UNICODE_INLINE static FORCEINLINE
#endif #endif
...@@ -54,72 +46,13 @@ WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch ) ...@@ -54,72 +46,13 @@ WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch )
return RtlUpcaseUnicodeChar( ch ); return RtlUpcaseUnicodeChar( ch );
} }
/* the character type contains the C1_* flags in the low 12 bits */
/* and the C2_* type in the high 4 bits */
WINE_UNICODE_INLINE unsigned short get_char_typeW( WCHAR ch )
{
unsigned short type;
GetStringTypeW( CT_CTYPE1, &ch, 1, &type );
return type;
}
WINE_UNICODE_INLINE int iscntrlW( WCHAR wc )
{
return get_char_typeW(wc) & C1_CNTRL;
}
WINE_UNICODE_INLINE int ispunctW( WCHAR wc )
{
return get_char_typeW(wc) & C1_PUNCT;
}
WINE_UNICODE_INLINE int isspaceW( WCHAR wc ) WINE_UNICODE_INLINE int isspaceW( WCHAR wc )
{ {
return get_char_typeW(wc) & C1_SPACE; unsigned short type;
} GetStringTypeW( CT_CTYPE1, &wc, 1, &type );
return type & C1_SPACE;
WINE_UNICODE_INLINE int isdigitW( WCHAR wc )
{
return get_char_typeW(wc) & C1_DIGIT;
}
WINE_UNICODE_INLINE int isxdigitW( WCHAR wc )
{
return get_char_typeW(wc) & C1_XDIGIT;
}
WINE_UNICODE_INLINE int islowerW( WCHAR wc )
{
return get_char_typeW(wc) & C1_LOWER;
}
WINE_UNICODE_INLINE int isupperW( WCHAR wc )
{
return get_char_typeW(wc) & C1_UPPER;
}
WINE_UNICODE_INLINE int isalnumW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
}
WINE_UNICODE_INLINE int isalphaW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
}
WINE_UNICODE_INLINE int isgraphW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
}
WINE_UNICODE_INLINE int isprintW( WCHAR wc )
{
return get_char_typeW(wc) & (C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
} }
/* some useful string manipulation routines */
WINE_UNICODE_INLINE unsigned int strlenW( const WCHAR *str ) WINE_UNICODE_INLINE unsigned int strlenW( const WCHAR *str )
{ {
const WCHAR *s = str; const WCHAR *s = str;
...@@ -134,9 +67,6 @@ WINE_UNICODE_INLINE WCHAR *strcpyW( WCHAR *dst, const WCHAR *src ) ...@@ -134,9 +67,6 @@ WINE_UNICODE_INLINE WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
return dst; return dst;
} }
/* strncpy doesn't do what you think, don't use it */
#define strncpyW(d,s,n) error do_not_use_strncpyW_use_lstrcpynW_or_memcpy_instead
WINE_UNICODE_INLINE int strcmpW( const WCHAR *str1, const WCHAR *str2 ) WINE_UNICODE_INLINE int strcmpW( const WCHAR *str1, const WCHAR *str2 )
{ {
while (*str1 && (*str1 == *str2)) { str1++; str2++; } while (*str1 && (*str1 == *str2)) { str1++; str2++; }
...@@ -175,20 +105,6 @@ WINE_UNICODE_INLINE WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept ) ...@@ -175,20 +105,6 @@ WINE_UNICODE_INLINE WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
return NULL; return NULL;
} }
WINE_UNICODE_INLINE size_t strspnW( const WCHAR *str, const WCHAR *accept )
{
const WCHAR *ptr;
for (ptr = str; *ptr; ptr++) if (!strchrW( accept, *ptr )) break;
return ptr - str;
}
WINE_UNICODE_INLINE size_t strcspnW( const WCHAR *str, const WCHAR *reject )
{
const WCHAR *ptr;
for (ptr = str; *ptr; ptr++) if (strchrW( reject, *ptr )) break;
return ptr - str;
}
WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str ) WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str )
{ {
WCHAR *ret; WCHAR *ret;
...@@ -196,13 +112,6 @@ WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str ) ...@@ -196,13 +112,6 @@ WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str )
return ret; return ret;
} }
WINE_UNICODE_INLINE WCHAR *struprW( WCHAR *str )
{
WCHAR *ret;
for (ret = str; *str; str++) *str = toupperW(*str);
return ret;
}
WINE_UNICODE_INLINE WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n ) WINE_UNICODE_INLINE WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{ {
const WCHAR *end; const WCHAR *end;
...@@ -210,14 +119,6 @@ WINE_UNICODE_INLINE WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n ) ...@@ -210,14 +119,6 @@ WINE_UNICODE_INLINE WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
return NULL; return NULL;
} }
WINE_UNICODE_INLINE WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
{
const WCHAR *end;
WCHAR *ret = NULL;
for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) ret = (WCHAR *)(ULONG_PTR)ptr;
return ret;
}
WINE_UNICODE_INLINE int strcmpiW( const WCHAR *str1, const WCHAR *str2 ) WINE_UNICODE_INLINE int strcmpiW( const WCHAR *str1, const WCHAR *str2 )
{ {
for (;;) for (;;)
...@@ -237,14 +138,6 @@ WINE_UNICODE_INLINE int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n ) ...@@ -237,14 +138,6 @@ WINE_UNICODE_INLINE int strncmpiW( const WCHAR *str1, const WCHAR *str2, int n )
return ret; return ret;
} }
WINE_UNICODE_INLINE int memicmpW( const WCHAR *str1, const WCHAR *str2, int n )
{
int ret = 0;
for ( ; n > 0; n--, str1++, str2++)
if ((ret = tolowerW(*str1) - tolowerW(*str2))) break;
return ret;
}
WINE_UNICODE_INLINE WCHAR *strstrW( const WCHAR *str, const WCHAR *sub ) WINE_UNICODE_INLINE WCHAR *strstrW( const WCHAR *str, const WCHAR *sub )
{ {
while (*str) while (*str)
...@@ -350,14 +243,9 @@ WINE_UNICODE_INLINE ULONG strtoulW( LPCWSTR s, LPWSTR *end, INT base ) ...@@ -350,14 +243,9 @@ WINE_UNICODE_INLINE ULONG strtoulW( LPCWSTR s, LPWSTR *end, INT base )
return negative ? -ret : ret; return negative ? -ret : ret;
} }
WINE_UNICODE_INLINE long int atolW( const WCHAR *str )
{
return strtolW( str, (WCHAR **)0, 10 );
}
WINE_UNICODE_INLINE int atoiW( const WCHAR *str ) WINE_UNICODE_INLINE int atoiW( const WCHAR *str )
{ {
return (int)atolW( str ); return (int)strtolW( str, (WCHAR **)0, 10 );
} }
NTSYSAPI int __cdecl _vsnwprintf(WCHAR*,size_t,const WCHAR*,__ms_va_list); NTSYSAPI int __cdecl _vsnwprintf(WCHAR*,size_t,const WCHAR*,__ms_va_list);
...@@ -384,8 +272,4 @@ static inline int WINAPIV sprintfW( WCHAR *str, const WCHAR *format, ...) ...@@ -384,8 +272,4 @@ static inline int WINAPIV sprintfW( WCHAR *str, const WCHAR *format, ...)
#undef WINE_UNICODE_INLINE #undef WINE_UNICODE_INLINE
#ifdef __cplusplus
}
#endif
#endif /* __WINE_WINE_UNICODE_H */ #endif /* __WINE_WINE_UNICODE_H */
...@@ -394,15 +394,9 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue) ...@@ -394,15 +394,9 @@ static void print_typed_basic(const struct dbg_lvalue* lvalue)
*/ */
if (!dbg_curr_process->be_cpu->fetch_integer(lvalue, size, TRUE, &val_int)) return; if (!dbg_curr_process->be_cpu->fetch_integer(lvalue, size, TRUE, &val_int)) return;
print_char: print_char:
if (size == 1 && isprint((char)val_int)) if ((size == 1 && isprint((char)val_int)) ||
(size == 2 && val_int < 127 && isprint((char)val_int)))
dbg_printf("'%c'", (char)val_int); dbg_printf("'%c'", (char)val_int);
else if (size == 2 && isprintW((WCHAR)val_int))
{
WCHAR wch = (WCHAR)val_int;
dbg_printf("'");
dbg_outputW(&wch, 1);
dbg_printf("'");
}
else else
dbg_printf("%d", (int)val_int); dbg_printf("%d", (int)val_int);
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment