Commit c302397c authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Remove MSVCRT_wchar_t type.

parent b0b63aec
......@@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
static HANDLE MSVCRT_console_in = INVALID_HANDLE_VALUE;
static HANDLE MSVCRT_console_out= INVALID_HANDLE_VALUE;
static int __MSVCRT_console_buffer = MSVCRT_EOF;
static MSVCRT_wchar_t __MSVCRT_console_buffer_w = MSVCRT_WEOF;
static wchar_t __MSVCRT_console_buffer_w = MSVCRT_WEOF;
/* INTERNAL: Initialise console handles */
void msvcrt_init_console(void)
......@@ -86,7 +86,7 @@ int CDECL _cputs(const char* str)
/*********************************************************************
* _cputws (MSVCRT.@)
*/
int CDECL _cputws(const MSVCRT_wchar_t* str)
int CDECL _cputws(const wchar_t* str)
{
DWORD count;
int len, retval = -1;
......@@ -220,9 +220,9 @@ int CDECL _getch(void)
/*********************************************************************
* _getwch_nolock (MSVCR80.@)
*/
MSVCRT_wchar_t CDECL _getwch_nolock(void)
wchar_t CDECL _getwch_nolock(void)
{
MSVCRT_wchar_t retval = MSVCRT_WEOF;
wchar_t retval = MSVCRT_WEOF;
if (__MSVCRT_console_buffer_w != MSVCRT_WEOF)
{
......@@ -274,9 +274,9 @@ MSVCRT_wchar_t CDECL _getwch_nolock(void)
/*********************************************************************
* _getwch (MSVCRT.@)
*/
MSVCRT_wchar_t CDECL _getwch(void)
wchar_t CDECL _getwch(void)
{
MSVCRT_wchar_t ret;
wchar_t ret;
LOCK_CONSOLE;
ret = _getwch_nolock();
......@@ -309,7 +309,7 @@ int CDECL _putch(int c)
/*********************************************************************
* _putwch_nolock (MSVCR80.@)
*/
MSVCRT_wchar_t CDECL _putwch_nolock(MSVCRT_wchar_t c)
wchar_t CDECL _putwch_nolock(wchar_t c)
{
DWORD count;
if (WriteConsoleW(MSVCRT_console_out, &c, 1, &count, NULL) && count==1)
......@@ -320,7 +320,7 @@ MSVCRT_wchar_t CDECL _putwch_nolock(MSVCRT_wchar_t c)
/*********************************************************************
* _putwch (MSVCRT.@)
*/
MSVCRT_wchar_t CDECL _putwch(MSVCRT_wchar_t c)
wchar_t CDECL _putwch(wchar_t c)
{
LOCK_CONSOLE;
c = _putwch_nolock(c);
......@@ -356,9 +356,9 @@ int CDECL _getche(void)
/*********************************************************************
* _getwche_nolock (MSVCR80.@)
*/
MSVCRT_wchar_t CDECL _getwche_nolock(void)
wchar_t CDECL _getwche_nolock(void)
{
MSVCRT_wchar_t wch;
wchar_t wch;
wch = _getch_nolock();
if (wch == MSVCRT_WEOF)
return wch;
......@@ -368,9 +368,9 @@ MSVCRT_wchar_t CDECL _getwche_nolock(void)
/*********************************************************************
* _getwche (MSVCRT.@)
*/
MSVCRT_wchar_t CDECL _getwche(void)
wchar_t CDECL _getwche(void)
{
MSVCRT_wchar_t ret;
wchar_t ret;
LOCK_CONSOLE;
ret = _getwche_nolock();
......@@ -441,9 +441,9 @@ int CDECL _ungetch(int c)
/*********************************************************************
* _ungetwch_nolock (MSVCR80.@)
*/
MSVCRT_wchar_t CDECL _ungetwch_nolock(MSVCRT_wchar_t c)
wchar_t CDECL _ungetwch_nolock(wchar_t c)
{
MSVCRT_wchar_t retval = MSVCRT_WEOF;
wchar_t retval = MSVCRT_WEOF;
if (c != MSVCRT_WEOF && __MSVCRT_console_buffer_w == MSVCRT_WEOF)
retval = __MSVCRT_console_buffer_w = c;
return retval;
......@@ -452,7 +452,7 @@ MSVCRT_wchar_t CDECL _ungetwch_nolock(MSVCRT_wchar_t c)
/*********************************************************************
* _ungetwch (MSVCRT.@)
*/
MSVCRT_wchar_t CDECL _ungetwch(MSVCRT_wchar_t c)
wchar_t CDECL _ungetwch(wchar_t c)
{
LOCK_CONSOLE;
c = _ungetwch_nolock(c);
......@@ -505,7 +505,7 @@ static int puts_clbk_console_a(void *ctx, int len, const char *str)
return len;
}
static int puts_clbk_console_w(void *ctx, int len, const MSVCRT_wchar_t *str)
static int puts_clbk_console_w(void *ctx, int len, const wchar_t *str)
{
LOCK_CONSOLE;
if(!WriteConsoleW(MSVCRT_console_out, str, len, NULL, NULL))
......@@ -541,7 +541,7 @@ int WINAPIV _cprintf(const char* format, ...)
/*********************************************************************
* _vcwprintf (MSVCRT.@)
*/
int CDECL _vcwprintf(const MSVCRT_wchar_t* format, __ms_va_list valist)
int CDECL _vcwprintf(const wchar_t* format, __ms_va_list valist)
{
return pf_printf_w(puts_clbk_console_w, NULL, format, NULL, 0, arg_clbk_valist, NULL, &valist);
}
......@@ -549,7 +549,7 @@ int CDECL _vcwprintf(const MSVCRT_wchar_t* format, __ms_va_list valist)
/*********************************************************************
* _cwprintf (MSVCRT.@)
*/
int WINAPIV _cwprintf(const MSVCRT_wchar_t* format, ...)
int WINAPIV _cwprintf(const wchar_t* format, ...)
{
int retval;
__ms_va_list valist;
......@@ -578,7 +578,7 @@ int CDECL MSVCRT__conio_common_vcprintf(unsigned __int64 options, const char* fo
/*********************************************************************
* __conio_common_vcwprintf (UCRTBASE.@)
*/
int CDECL MSVCRT__conio_common_vcwprintf(unsigned __int64 options, const MSVCRT_wchar_t* format,
int CDECL MSVCRT__conio_common_vcwprintf(unsigned __int64 options, const wchar_t* format,
_locale_t locale, __ms_va_list valist)
{
if (options & ~UCRTBASE_PRINTF_MASK)
......
......@@ -411,7 +411,7 @@ int CDECL MSVCRT___toascii(int c)
* iswascii (MSVCRT.@)
*
*/
int CDECL MSVCRT_iswascii(MSVCRT_wchar_t c)
int CDECL MSVCRT_iswascii(wchar_t c)
{
return ((unsigned)c < 0x80);
}
......
......@@ -47,14 +47,14 @@ unsigned int MSVCRT___setlc_active = 0;
unsigned int MSVCRT___unguarded_readlc_active = 0;
double MSVCRT__HUGE = 0;
char **MSVCRT___argv = NULL;
MSVCRT_wchar_t **MSVCRT___wargv = NULL;
static MSVCRT_wchar_t **wargv_expand;
wchar_t **MSVCRT___wargv = NULL;
static wchar_t **wargv_expand;
char *MSVCRT__acmdln = NULL;
MSVCRT_wchar_t *MSVCRT__wcmdln = NULL;
wchar_t *MSVCRT__wcmdln = NULL;
char **MSVCRT__environ = NULL;
MSVCRT_wchar_t **MSVCRT__wenviron = NULL;
wchar_t **MSVCRT__wenviron = NULL;
char **MSVCRT___initenv = NULL;
MSVCRT_wchar_t **MSVCRT___winitenv = NULL;
wchar_t **MSVCRT___winitenv = NULL;
int MSVCRT_app_type = 0;
char* MSVCRT__pgmptr = NULL;
WCHAR* MSVCRT__wpgmptr = NULL;
......@@ -102,11 +102,11 @@ char ** msvcrt_SnapshotOfEnvironmentA(char **blk)
return blk;
}
MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **wblk)
wchar_t ** msvcrt_SnapshotOfEnvironmentW(wchar_t **wblk)
{
MSVCRT_wchar_t* wenviron_strings = GetEnvironmentStringsW();
wchar_t* wenviron_strings = GetEnvironmentStringsW();
int count = 1, len = 1, i = 0; /* keep space for the trailing NULLS */
MSVCRT_wchar_t *wptr;
wchar_t *wptr;
for (wptr = wenviron_strings; *wptr; wptr += MSVCRT_wcslen(wptr) + 1)
{
......@@ -115,15 +115,15 @@ MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **wblk)
len += MSVCRT_wcslen(wptr) + 1;
}
if (wblk)
wblk = HeapReAlloc( GetProcessHeap(), 0, wblk, count* sizeof(MSVCRT_wchar_t*) + len * sizeof(MSVCRT_wchar_t));
wblk = HeapReAlloc( GetProcessHeap(), 0, wblk, count* sizeof(wchar_t*) + len * sizeof(wchar_t));
else
wblk = HeapAlloc(GetProcessHeap(), 0, count* sizeof(MSVCRT_wchar_t*) + len * sizeof(MSVCRT_wchar_t));
wblk = HeapAlloc(GetProcessHeap(), 0, count* sizeof(wchar_t*) + len * sizeof(wchar_t));
if (wblk)
{
if (count)
{
memcpy(&wblk[count],wenviron_strings,len * sizeof(MSVCRT_wchar_t));
for (wptr = (MSVCRT_wchar_t*)&wblk[count]; *wptr; wptr += MSVCRT_wcslen(wptr) + 1)
memcpy(&wblk[count],wenviron_strings,len * sizeof(wchar_t));
for (wptr = (wchar_t*)&wblk[count]; *wptr; wptr += MSVCRT_wcslen(wptr) + 1)
{
/* Skip special environment strings set by the command shell */
if (*wptr != '=') wblk[i++] = wptr;
......@@ -323,7 +323,7 @@ char** CDECL MSVCRT___p__acmdln(void) { return &MSVCRT__acmdln; }
/*********************************************************************
* __p__wcmdln (MSVCRT.@)
*/
MSVCRT_wchar_t** CDECL MSVCRT___p__wcmdln(void) { return &MSVCRT__wcmdln; }
wchar_t** CDECL MSVCRT___p__wcmdln(void) { return &MSVCRT__wcmdln; }
/*********************************************************************
* __p___argv (MSVCRT.@)
......@@ -333,7 +333,7 @@ char*** CDECL MSVCRT___p___argv(void) { return &MSVCRT___argv; }
/*********************************************************************
* __p___wargv (MSVCRT.@)
*/
MSVCRT_wchar_t*** CDECL MSVCRT___p___wargv(void) { return &MSVCRT___wargv; }
wchar_t*** CDECL MSVCRT___p___wargv(void) { return &MSVCRT___wargv; }
/*********************************************************************
* __p__environ (MSVCRT.@)
......@@ -346,7 +346,7 @@ char*** CDECL MSVCRT___p__environ(void)
/*********************************************************************
* __p__wenviron (MSVCRT.@)
*/
MSVCRT_wchar_t*** CDECL MSVCRT___p__wenviron(void)
wchar_t*** CDECL MSVCRT___p__wenviron(void)
{
return &MSVCRT__wenviron;
}
......@@ -359,7 +359,7 @@ char*** CDECL __p___initenv(void) { return &MSVCRT___initenv; }
/*********************************************************************
* __p___winitenv (MSVCRT.@)
*/
MSVCRT_wchar_t*** CDECL __p___winitenv(void) { return &MSVCRT___winitenv; }
wchar_t*** CDECL __p___winitenv(void) { return &MSVCRT___winitenv; }
/*********************************************************************
* _get_osplatform (MSVCRT.@)
......@@ -372,10 +372,10 @@ int CDECL MSVCRT__get_osplatform(int *pValue)
}
/* INTERNAL: Create a wide string from an ascii string */
MSVCRT_wchar_t *msvcrt_wstrdupa(const char *str)
wchar_t *msvcrt_wstrdupa(const char *str)
{
const unsigned int len = strlen(str) + 1 ;
MSVCRT_wchar_t *wstr = MSVCRT_malloc(len* sizeof (MSVCRT_wchar_t));
wchar_t *wstr = MSVCRT_malloc(len* sizeof (wchar_t));
if (!wstr)
return NULL;
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,str,len,wstr,len);
......@@ -474,7 +474,7 @@ void msvcrt_free_args(void)
HeapFree(GetProcessHeap(), 0, wargv_expand);
}
static int build_expanded_wargv(int *argc, MSVCRT_wchar_t **argv)
static int build_expanded_wargv(int *argc, wchar_t **argv)
{
int i, size=0, args_no=0, path_len;
BOOL is_expandable;
......@@ -507,9 +507,9 @@ static int build_expanded_wargv(int *argc, MSVCRT_wchar_t **argv)
len = MSVCRT_wcslen(data.cFileName)+1;
if(argv) {
argv[args_no] = (MSVCRT_wchar_t*)(argv+*argc+1)+size;
memcpy(argv[args_no], initial_wargv[i], path_len*sizeof(MSVCRT_wchar_t));
memcpy(argv[args_no]+path_len, data.cFileName, len*sizeof(MSVCRT_wchar_t));
argv[args_no] = (wchar_t*)(argv+*argc+1)+size;
memcpy(argv[args_no], initial_wargv[i], path_len*sizeof(wchar_t));
memcpy(argv[args_no]+path_len, data.cFileName, len*sizeof(wchar_t));
}
args_no++;
size += len+path_len;
......@@ -520,8 +520,8 @@ static int build_expanded_wargv(int *argc, MSVCRT_wchar_t **argv)
if(!len) {
len = MSVCRT_wcslen(initial_wargv[i])+1;
if(argv) {
argv[args_no] = (MSVCRT_wchar_t*)(argv+*argc+1)+size;
memcpy(argv[args_no], initial_wargv[i], len*sizeof(MSVCRT_wchar_t));
argv[args_no] = (wchar_t*)(argv+*argc+1)+size;
memcpy(argv[args_no], initial_wargv[i], len*sizeof(wchar_t));
}
args_no++;
size += len;
......@@ -530,8 +530,8 @@ static int build_expanded_wargv(int *argc, MSVCRT_wchar_t **argv)
if(argv)
argv[args_no] = NULL;
size *= sizeof(MSVCRT_wchar_t);
size += (args_no+1)*sizeof(MSVCRT_wchar_t*);
size *= sizeof(wchar_t);
size += (args_no+1)*sizeof(wchar_t*);
*argc = args_no;
return size;
}
......@@ -539,7 +539,7 @@ static int build_expanded_wargv(int *argc, MSVCRT_wchar_t **argv)
/*********************************************************************
* __wgetmainargs (MSVCRT.@)
*/
int CDECL __wgetmainargs(int *argc, MSVCRT_wchar_t** *wargv, MSVCRT_wchar_t** *wenvp,
int CDECL __wgetmainargs(int *argc, wchar_t** *wargv, wchar_t** *wenvp,
int expand_wildcards, int *new_mode)
{
TRACE("(%p,%p,%p,%d,%p).\n", argc, wargv, wenvp, expand_wildcards, new_mode);
......@@ -703,7 +703,7 @@ int CDECL _initialize_narrow_environment(void)
/*********************************************************************
* _get_initial_wide_environment (UCRTBASE.@)
*/
MSVCRT_wchar_t** CDECL _get_initial_wide_environment(void)
wchar_t** CDECL _get_initial_wide_environment(void)
{
return MSVCRT___winitenv;
}
......@@ -756,10 +756,10 @@ char* CDECL _get_narrow_winmain_command_line(void)
/*********************************************************************
* _get_wide_winmain_command_line (UCRTBASE.@)
*/
MSVCRT_wchar_t* CDECL _get_wide_winmain_command_line(void)
wchar_t* CDECL _get_wide_winmain_command_line(void)
{
static MSVCRT_wchar_t *wide_command_line;
MSVCRT_wchar_t *s;
static wchar_t *wide_command_line;
wchar_t *s;
if (wide_command_line)
return wide_command_line;
......
......@@ -49,9 +49,9 @@ char * CDECL MSVCRT_getenv(const char *name)
/*********************************************************************
* _wgetenv (MSVCRT.@)
*/
MSVCRT_wchar_t * CDECL MSVCRT__wgetenv(const MSVCRT_wchar_t *name)
wchar_t * CDECL MSVCRT__wgetenv(const wchar_t *name)
{
MSVCRT_wchar_t **environ;
wchar_t **environ;
unsigned int length=MSVCRT_wcslen(name);
/* Initialize the _wenviron array if it's not already created. */
......@@ -60,8 +60,8 @@ MSVCRT_wchar_t * CDECL MSVCRT__wgetenv(const MSVCRT_wchar_t *name)
for (environ = MSVCRT__wenviron; *environ; environ++)
{
MSVCRT_wchar_t *str = *environ;
MSVCRT_wchar_t *pos = MSVCRT_wcschr(str,'=');
wchar_t *str = *environ;
wchar_t *pos = MSVCRT_wcschr(str,'=');
if (pos && ((pos - str) == length) && !MSVCRT__wcsnicmp(str,name,length))
{
TRACE("(%s): got %s\n", debugstr_w(name), debugstr_w(pos + 1));
......@@ -120,17 +120,17 @@ finish:
/*********************************************************************
* _wputenv (MSVCRT.@)
*/
int CDECL _wputenv(const MSVCRT_wchar_t *str)
int CDECL _wputenv(const wchar_t *str)
{
MSVCRT_wchar_t *name, *value;
MSVCRT_wchar_t *dst;
wchar_t *name, *value;
wchar_t *dst;
int ret;
TRACE("%s\n", debugstr_w(str));
if (!str)
return -1;
name = HeapAlloc(GetProcessHeap(), 0, (MSVCRT_wcslen(str) + 1) * sizeof(MSVCRT_wchar_t));
name = HeapAlloc(GetProcessHeap(), 0, (MSVCRT_wcslen(str) + 1) * sizeof(wchar_t));
if (!name)
return -1;
dst = name;
......@@ -186,7 +186,7 @@ int CDECL _putenv_s(const char *name, const char *value)
/*********************************************************************
* _wputenv_s (MSVCRT.@)
*/
int CDECL _wputenv_s(const MSVCRT_wchar_t *name, const MSVCRT_wchar_t *value)
int CDECL _wputenv_s(const wchar_t *name, const wchar_t *value)
{
int ret;
......@@ -235,10 +235,10 @@ int CDECL _dupenv_s(char **buffer, MSVCRT_size_t *numberOfElements, const char *
/******************************************************************
* _wdupenv_s (MSVCR80.@)
*/
int CDECL _wdupenv_s(MSVCRT_wchar_t **buffer, MSVCRT_size_t *numberOfElements,
const MSVCRT_wchar_t *varname)
int CDECL _wdupenv_s(wchar_t **buffer, MSVCRT_size_t *numberOfElements,
const wchar_t *varname)
{
MSVCRT_wchar_t* e;
wchar_t* e;
MSVCRT_size_t sz;
if (!MSVCRT_CHECK_PMT(buffer != NULL)) return MSVCRT_EINVAL;
......@@ -247,7 +247,7 @@ int CDECL _wdupenv_s(MSVCRT_wchar_t **buffer, MSVCRT_size_t *numberOfElements,
if (!(e = MSVCRT__wgetenv(varname))) return *MSVCRT__errno() = MSVCRT_EINVAL;
sz = MSVCRT_wcslen(e) + 1;
if (!(*buffer = MSVCRT_malloc(sz * sizeof(MSVCRT_wchar_t))))
if (!(*buffer = MSVCRT_malloc(sz * sizeof(wchar_t))))
{
if (numberOfElements) *numberOfElements = 0;
return *MSVCRT__errno() = MSVCRT_ENOMEM;
......@@ -287,10 +287,10 @@ int CDECL getenv_s(MSVCRT_size_t *pReturnValue, char* buffer, MSVCRT_size_t numb
/******************************************************************
* _wgetenv_s (MSVCRT.@)
*/
int CDECL _wgetenv_s(MSVCRT_size_t *pReturnValue, MSVCRT_wchar_t *buffer, MSVCRT_size_t numberOfElements,
const MSVCRT_wchar_t *varname)
int CDECL _wgetenv_s(MSVCRT_size_t *pReturnValue, wchar_t *buffer, MSVCRT_size_t numberOfElements,
const wchar_t *varname)
{
MSVCRT_wchar_t* e;
wchar_t* e;
if (!MSVCRT_CHECK_PMT(pReturnValue != NULL)) return MSVCRT_EINVAL;
if (!MSVCRT_CHECK_PMT(!(buffer == NULL && numberOfElements > 0))) return MSVCRT_EINVAL;
......@@ -321,7 +321,7 @@ void CDECL MSVCRT__get_environ(char ***ptr)
/*********************************************************************
* _get_wenviron (MSVCRT.@)
*/
void CDECL MSVCRT__get_wenviron(MSVCRT_wchar_t ***ptr)
void CDECL MSVCRT__get_wenviron(wchar_t ***ptr)
{
*ptr = MSVCRT__wenviron;
}
......@@ -350,7 +350,7 @@ void CDECL MSVCRT_perror(const char* str)
/*********************************************************************
* _wperror (MSVCRT.@)
*/
void CDECL MSVCRT__wperror(const MSVCRT_wchar_t* str)
void CDECL MSVCRT__wperror(const wchar_t* str)
{
MSVCRT_size_t size;
char *buffer = NULL;
......@@ -375,7 +375,7 @@ void CDECL MSVCRT__wperror(const MSVCRT_wchar_t* str)
/*********************************************************************
* _wcserror_s (MSVCRT.@)
*/
int CDECL MSVCRT__wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, int err)
int CDECL MSVCRT__wcserror_s(wchar_t* buffer, MSVCRT_size_t nc, int err)
{
if (!MSVCRT_CHECK_PMT(buffer != NULL)) return MSVCRT_EINVAL;
if (!MSVCRT_CHECK_PMT(nc > 0)) return MSVCRT_EINVAL;
......@@ -388,12 +388,12 @@ int CDECL MSVCRT__wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, int err)
/*********************************************************************
* _wcserror (MSVCRT.@)
*/
MSVCRT_wchar_t* CDECL MSVCRT__wcserror(int err)
wchar_t* CDECL MSVCRT__wcserror(int err)
{
thread_data_t *data = msvcrt_get_thread_data();
if (!data->wcserror_buffer)
if (!(data->wcserror_buffer = MSVCRT_malloc(256 * sizeof(MSVCRT_wchar_t)))) return NULL;
if (!(data->wcserror_buffer = MSVCRT_malloc(256 * sizeof(wchar_t)))) return NULL;
MSVCRT__wcserror_s(data->wcserror_buffer, 256, err);
return data->wcserror_buffer;
}
......@@ -401,7 +401,7 @@ MSVCRT_wchar_t* CDECL MSVCRT__wcserror(int err)
/**********************************************************************
* __wcserror_s (MSVCRT.@)
*/
int CDECL MSVCRT___wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, const MSVCRT_wchar_t* str)
int CDECL MSVCRT___wcserror_s(wchar_t* buffer, MSVCRT_size_t nc, const wchar_t* str)
{
int err;
static const WCHAR colonW[] = {':', ' ', '\0'};
......@@ -434,13 +434,13 @@ int CDECL MSVCRT___wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, const MS
/**********************************************************************
* __wcserror (MSVCRT.@)
*/
MSVCRT_wchar_t* CDECL MSVCRT___wcserror(const MSVCRT_wchar_t* str)
wchar_t* CDECL MSVCRT___wcserror(const wchar_t* str)
{
thread_data_t *data = msvcrt_get_thread_data();
int err;
if (!data->wcserror_buffer)
if (!(data->wcserror_buffer = MSVCRT_malloc(256 * sizeof(MSVCRT_wchar_t)))) return NULL;
if (!(data->wcserror_buffer = MSVCRT_malloc(256 * sizeof(wchar_t)))) return NULL;
err = MSVCRT___wcserror_s(data->wcserror_buffer, 256, str);
if (err) FIXME("bad wcserror call (%d)\n", err);
......@@ -459,8 +459,8 @@ void CDECL _seterrormode(int mode)
/******************************************************************************
* _invalid_parameter (MSVCRT.@)
*/
void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func,
const MSVCRT_wchar_t *file, unsigned int line, uintptr_t arg)
void __cdecl MSVCRT__invalid_parameter(const wchar_t *expr, const wchar_t *func,
const wchar_t *file, unsigned int line, uintptr_t arg)
{
#if _MSVCR_VER >= 140
thread_data_t *data = msvcrt_get_thread_data();
......
......@@ -46,7 +46,7 @@ static CRITICAL_SECTION_DEBUG MSVCRT_onexit_cs_debug =
static CRITICAL_SECTION MSVCRT_onexit_cs = { &MSVCRT_onexit_cs_debug, -1, 0, 0, 0, 0 };
extern int MSVCRT_app_type;
extern MSVCRT_wchar_t *MSVCRT__wpgmptr;
extern wchar_t *MSVCRT__wpgmptr;
static unsigned int MSVCRT_abort_behavior = MSVCRT__WRITE_ABORT_MSG | MSVCRT__CALL_REPORTFAULT;
static int MSVCRT_error_mode = MSVCRT__OUT_TO_DEFAULT;
......@@ -185,9 +185,9 @@ void CDECL MSVCRT__exit(int exitcode)
}
/* Print out an error message with an option to debug */
static void DoMessageBoxW(const MSVCRT_wchar_t *lead, const MSVCRT_wchar_t *message)
static void DoMessageBoxW(const wchar_t *lead, const wchar_t *message)
{
static const MSVCRT_wchar_t message_format[] = {'%','l','s','\n','\n','P','r','o','g','r','a','m',':',' ','%','l','s','\n',
static const wchar_t message_format[] = {'%','l','s','\n','\n','P','r','o','g','r','a','m',':',' ','%','l','s','\n',
'%','l','s','\n','\n','P','r','e','s','s',' ','O','K',' ','t','o',' ','e','x','i','t',' ','t','h','e',' ',
'p','r','o','g','r','a','m',',',' ','o','r',' ','C','a','n','c','e','l',' ','t','o',' ','s','t','a','r','t',' ',
't','h','e',' ','W','i','n','e',' ','d','e','b','u','g','g','e','r','.','\n',0};
......@@ -195,7 +195,7 @@ static void DoMessageBoxW(const MSVCRT_wchar_t *lead, const MSVCRT_wchar_t *mess
{'W','i','n','e',' ','C','+','+',' ','R','u','n','t','i','m','e',' ','L','i','b','r','a','r','y',0};
MSGBOXPARAMSW msgbox;
MSVCRT_wchar_t text[2048];
wchar_t text[2048];
INT ret;
MSVCRT__snwprintf(text, ARRAY_SIZE(text), message_format, lead, MSVCRT__wpgmptr, message);
......@@ -218,7 +218,7 @@ static void DoMessageBoxW(const MSVCRT_wchar_t *lead, const MSVCRT_wchar_t *mess
static void DoMessageBox(const char *lead, const char *message)
{
MSVCRT_wchar_t leadW[1024], messageW[1024];
wchar_t leadW[1024], messageW[1024];
MSVCRT_mbstowcs(leadW, lead, 1024);
MSVCRT_mbstowcs(messageW, message, 1024);
......@@ -287,12 +287,12 @@ unsigned int CDECL MSVCRT__set_abort_behavior(unsigned int flags, unsigned int m
/*********************************************************************
* _wassert (MSVCRT.@)
*/
void CDECL MSVCRT__wassert(const MSVCRT_wchar_t* str, const MSVCRT_wchar_t* file, unsigned int line)
void CDECL MSVCRT__wassert(const wchar_t* str, const wchar_t* file, unsigned int line)
{
static const MSVCRT_wchar_t assertion_failed[] = {'A','s','s','e','r','t','i','o','n',' ','f','a','i','l','e','d','!',0};
static const MSVCRT_wchar_t format_msgbox[] = {'F','i','l','e',':',' ','%','l','s','\n','L','i','n','e',':',' ','%','d',
static const wchar_t assertion_failed[] = {'A','s','s','e','r','t','i','o','n',' ','f','a','i','l','e','d','!',0};
static const wchar_t format_msgbox[] = {'F','i','l','e',':',' ','%','l','s','\n','L','i','n','e',':',' ','%','d',
'\n','\n','E','x','p','r','e','s','s','i','o','n',':',' ','\"','%','l','s','\"',0};
static const MSVCRT_wchar_t format_console[] = {'A','s','s','e','r','t','i','o','n',' ','f','a','i','l','e','d',':',' ',
static const wchar_t format_console[] = {'A','s','s','e','r','t','i','o','n',' ','f','a','i','l','e','d',':',' ',
'%','l','s',',',' ','f','i','l','e',' ','%','l','s',',',' ','l','i','n','e',' ','%','d','\n','\n',0};
TRACE("(%s,%s,%d)\n", debugstr_w(str), debugstr_w(file), line);
......@@ -300,7 +300,7 @@ void CDECL MSVCRT__wassert(const MSVCRT_wchar_t* str, const MSVCRT_wchar_t* file
if ((MSVCRT_error_mode == MSVCRT__OUT_TO_MSGBOX) ||
((MSVCRT_error_mode == MSVCRT__OUT_TO_DEFAULT) && (MSVCRT_app_type == 2)))
{
MSVCRT_wchar_t text[2048];
wchar_t text[2048];
MSVCRT__snwprintf(text, sizeof(text), format_msgbox, file, line, str);
DoMessageBoxW(assertion_failed, text);
}
......@@ -316,7 +316,7 @@ void CDECL MSVCRT__wassert(const MSVCRT_wchar_t* str, const MSVCRT_wchar_t* file
*/
void CDECL _assert(const char* str, const char* file, unsigned int line)
{
MSVCRT_wchar_t strW[1024], fileW[1024];
wchar_t strW[1024], fileW[1024];
MSVCRT_mbstowcs(strW, str, 1024);
MSVCRT_mbstowcs(fileW, file, 1024);
......
......@@ -751,8 +751,8 @@ int CDECL MSVCRT_memmove_s(void *dest, MSVCRT_size_t numberOfElements, const voi
/*********************************************************************
* wmemmove_s (MSVCR100.@)
*/
int CDECL wmemmove_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements,
const MSVCRT_wchar_t *src, MSVCRT_size_t count)
int CDECL wmemmove_s(wchar_t *dest, MSVCRT_size_t numberOfElements,
const wchar_t *src, MSVCRT_size_t count)
{
TRACE("(%p %Iu %p %Iu)\n", dest, numberOfElements, src, count);
......@@ -767,7 +767,7 @@ int CDECL wmemmove_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements,
if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
if (!MSVCRT_CHECK_PMT_ERR(count <= numberOfElements, MSVCRT_ERANGE)) return MSVCRT_ERANGE;
memmove(dest, src, sizeof(MSVCRT_wchar_t)*count);
memmove(dest, src, sizeof(wchar_t)*count);
return 0;
}
#endif
......@@ -802,8 +802,8 @@ int CDECL MSVCRT_memcpy_s(void *dest, MSVCRT_size_t numberOfElements, const void
/*********************************************************************
* wmemcpy_s (MSVCR100.@)
*/
int CDECL wmemcpy_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements,
const MSVCRT_wchar_t *src, MSVCRT_size_t count)
int CDECL wmemcpy_s(wchar_t *dest, MSVCRT_size_t numberOfElements,
const wchar_t *src, MSVCRT_size_t count)
{
TRACE("(%p %Iu %p %Iu)\n", dest, numberOfElements, src, count);
......@@ -813,15 +813,15 @@ int CDECL wmemcpy_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements,
if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
if (!MSVCRT_CHECK_PMT(src != NULL)) {
memset(dest, 0, numberOfElements*sizeof(MSVCRT_wchar_t));
memset(dest, 0, numberOfElements*sizeof(wchar_t));
return MSVCRT_EINVAL;
}
if (!MSVCRT_CHECK_PMT_ERR(count <= numberOfElements, MSVCRT_ERANGE)) {
memset(dest, 0, numberOfElements*sizeof(MSVCRT_wchar_t));
memset(dest, 0, numberOfElements*sizeof(wchar_t));
return MSVCRT_ERANGE;
}
memmove(dest, src, sizeof(MSVCRT_wchar_t)*count);
memmove(dest, src, sizeof(wchar_t)*count);
return 0;
}
#endif
......
......@@ -86,10 +86,10 @@ static const unsigned char mbctombb_932_kana[] = {
0xd2,0xd3,0xac,0xd4,0xad,0xd5,0xae,0xd6,0xd7,0xd8,0xd9,0xda,0xdb,0xdc,0xdc,0xb2,
0xb4,0xa6,0xdd,0xb3,0xb6,0xb9};
static MSVCRT_wchar_t msvcrt_mbc_to_wc_l(unsigned int ch, _locale_t locale)
static wchar_t msvcrt_mbc_to_wc_l(unsigned int ch, _locale_t locale)
{
pthreadmbcinfo mbcinfo;
MSVCRT_wchar_t chW;
wchar_t chW;
char mbch[2];
int n_chars;
......@@ -114,7 +114,7 @@ static MSVCRT_wchar_t msvcrt_mbc_to_wc_l(unsigned int ch, _locale_t locale)
return chW;
}
static MSVCRT_wchar_t msvcrt_mbc_to_wc(unsigned int ch)
static wchar_t msvcrt_mbc_to_wc(unsigned int ch)
{
return msvcrt_mbc_to_wc_l(ch, NULL);
}
......@@ -1534,7 +1534,7 @@ int CDECL _ismbcupper(unsigned int ch)
*/
int CDECL _ismbcsymbol(unsigned int ch)
{
MSVCRT_wchar_t wch = msvcrt_mbc_to_wc( ch );
wchar_t wch = msvcrt_mbc_to_wc( ch );
WORD ctype;
if (!GetStringTypeW(CT_CTYPE3, &wch, 1, &ctype))
{
......@@ -2394,10 +2394,10 @@ MSVCRT_size_t CDECL _mbstrlen(const char* str)
/*********************************************************************
* _mbtowc_l(MSVCRT.@)
*/
int CDECL MSVCRT_mbtowc_l(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n, _locale_t locale)
int CDECL MSVCRT_mbtowc_l(wchar_t *dst, const char* str, MSVCRT_size_t n, _locale_t locale)
{
pthreadlocinfo locinfo;
MSVCRT_wchar_t tmpdst = '\0';
wchar_t tmpdst = '\0';
if(!locale)
locinfo = get_locinfo();
......@@ -2431,7 +2431,7 @@ int CDECL MSVCRT_mbtowc_l(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n,
/*********************************************************************
* mbtowc(MSVCRT.@)
*/
int CDECL MSVCRT_mbtowc(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n)
int CDECL MSVCRT_mbtowc(wchar_t *dst, const char* str, MSVCRT_size_t n)
{
return MSVCRT_mbtowc_l(dst, str, n, NULL);
}
......@@ -2442,7 +2442,7 @@ int CDECL MSVCRT_mbtowc(MSVCRT_wchar_t *dst, const char* str, MSVCRT_size_t n)
MSVCRT_wint_t CDECL btowc(int c)
{
unsigned char letter = c;
MSVCRT_wchar_t ret;
wchar_t ret;
if(c == MSVCRT_EOF)
return MSVCRT_WEOF;
......@@ -2458,7 +2458,7 @@ MSVCRT_wint_t CDECL btowc(int c)
/*********************************************************************
* mbrtowc(MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT_mbrtowc(MSVCRT_wchar_t *dst, const char *str,
MSVCRT_size_t CDECL MSVCRT_mbrtowc(wchar_t *dst, const char *str,
MSVCRT_size_t n, MSVCRT_mbstate_t *state)
{
pthreadlocinfo locinfo = get_locinfo();
......@@ -2505,7 +2505,7 @@ MSVCRT_size_t CDECL MSVCRT_mbrtowc(MSVCRT_wchar_t *dst, const char *str,
/*********************************************************************
* _mbstowcs_l(MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT__mbstowcs_l(MSVCRT_wchar_t *wcstr, const char *mbstr,
MSVCRT_size_t CDECL MSVCRT__mbstowcs_l(wchar_t *wcstr, const char *mbstr,
MSVCRT_size_t count, _locale_t locale)
{
pthreadlocinfo locinfo;
......@@ -2569,7 +2569,7 @@ MSVCRT_size_t CDECL MSVCRT__mbstowcs_l(MSVCRT_wchar_t *wcstr, const char *mbstr,
/*********************************************************************
* mbstowcs(MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT_mbstowcs(MSVCRT_wchar_t *wcstr,
MSVCRT_size_t CDECL MSVCRT_mbstowcs(wchar_t *wcstr,
const char *mbstr, MSVCRT_size_t count)
{
return MSVCRT__mbstowcs_l(wcstr, mbstr, count, NULL);
......@@ -2578,7 +2578,7 @@ MSVCRT_size_t CDECL MSVCRT_mbstowcs(MSVCRT_wchar_t *wcstr,
/*********************************************************************
* _mbstowcs_s_l(MSVCRT.@)
*/
int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr,
int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, wchar_t *wcstr,
MSVCRT_size_t size, const char *mbstr,
MSVCRT_size_t count, _locale_t locale)
{
......@@ -2624,7 +2624,7 @@ int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr,
/*********************************************************************
* mbstowcs_s(MSVCRT.@)
*/
int CDECL MSVCRT__mbstowcs_s(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr,
int CDECL MSVCRT__mbstowcs_s(MSVCRT_size_t *ret, wchar_t *wcstr,
MSVCRT_size_t size, const char *mbstr, MSVCRT_size_t count)
{
return MSVCRT__mbstowcs_s_l(ret, wcstr, size, mbstr, count, NULL);
......@@ -2633,11 +2633,11 @@ int CDECL MSVCRT__mbstowcs_s(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr,
/*********************************************************************
* mbsrtowcs(MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT_mbsrtowcs(MSVCRT_wchar_t *wcstr,
MSVCRT_size_t CDECL MSVCRT_mbsrtowcs(wchar_t *wcstr,
const char **pmbstr, MSVCRT_size_t count, MSVCRT_mbstate_t *state)
{
MSVCRT_mbstate_t s = (state ? *state : 0);
MSVCRT_wchar_t tmpdst;
wchar_t tmpdst;
MSVCRT_size_t ret = 0;
const char *p;
......@@ -2668,7 +2668,7 @@ MSVCRT_size_t CDECL MSVCRT_mbsrtowcs(MSVCRT_wchar_t *wcstr,
/*********************************************************************
* mbsrtowcs_s(MSVCRT.@)
*/
int CDECL MSVCRT_mbsrtowcs_s(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr, MSVCRT_size_t len,
int CDECL MSVCRT_mbsrtowcs_s(MSVCRT_size_t *ret, wchar_t *wcstr, MSVCRT_size_t len,
const char **mbstr, MSVCRT_size_t count, MSVCRT_mbstate_t *state)
{
MSVCRT_size_t tmp;
......
......@@ -19,12 +19,12 @@
#include "bnum.h"
#ifdef PRINTF_WIDE
#define APICHAR MSVCRT_wchar_t
#define APICHAR wchar_t
#define CONVCHAR char
#define FUNC_NAME(func) func ## _w
#else
#define APICHAR char
#define CONVCHAR MSVCRT_wchar_t
#define CONVCHAR wchar_t
#define FUNC_NAME(func) func ## _a
#endif
......@@ -108,7 +108,7 @@ static inline int FUNC_NAME(pf_fill)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ct
#ifndef PRINTF_HELPERS
#define PRINTF_HELPERS
static inline int wcstombs_len(char *mbstr, const MSVCRT_wchar_t *wcstr,
static inline int wcstombs_len(char *mbstr, const wchar_t *wcstr,
int len, _locale_t locale)
{
char buf[MSVCRT_MB_LEN_MAX];
......@@ -122,7 +122,7 @@ static inline int wcstombs_len(char *mbstr, const MSVCRT_wchar_t *wcstr,
return mblen;
}
static inline int mbstowcs_len(MSVCRT_wchar_t *wcstr, const char *mbstr,
static inline int mbstowcs_len(wchar_t *wcstr, const char *mbstr,
int len, _locale_t locale)
{
int i, r, wlen = 0;
......@@ -138,7 +138,7 @@ static inline int mbstowcs_len(MSVCRT_wchar_t *wcstr, const char *mbstr,
#endif
static inline int FUNC_NAME(pf_output_wstr)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx,
const MSVCRT_wchar_t *str, int len, _locale_t locale)
const wchar_t *str, int len, _locale_t locale)
{
#ifdef PRINTF_WIDE
return pf_puts(puts_ctx, len, str);
......@@ -182,7 +182,7 @@ static inline int FUNC_NAME(pf_output_str)(FUNC_NAME(puts_clbk) pf_puts, void *p
}
static inline int FUNC_NAME(pf_output_format_wstr)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx,
const MSVCRT_wchar_t *str, int len, pf_flags *flags, _locale_t locale)
const wchar_t *str, int len, pf_flags *flags, _locale_t locale)
{
int r, ret;
......@@ -244,10 +244,10 @@ static inline int FUNC_NAME(pf_output_format_str)(FUNC_NAME(puts_clbk) pf_puts,
static inline int FUNC_NAME(pf_handle_string)(FUNC_NAME(puts_clbk) pf_puts, void *puts_ctx,
const void *str, int len, pf_flags *flags, _locale_t locale, BOOL legacy_wide)
{
BOOL api_is_wide = sizeof(APICHAR) == sizeof(MSVCRT_wchar_t);
BOOL api_is_wide = sizeof(APICHAR) == sizeof(wchar_t);
BOOL complement_is_narrow = legacy_wide ? api_is_wide : FALSE;
#ifdef PRINTF_WIDE
static const MSVCRT_wchar_t nullW[] = {'(','n','u','l','l',')',0};
static const wchar_t nullW[] = {'(','n','u','l','l',')',0};
if(!str)
return FUNC_NAME(pf_output_format_wstr)(pf_puts, puts_ctx, nullW, 6, flags, locale);
......
......@@ -24,7 +24,7 @@
*/
#ifdef WIDE_SCANF
#define _CHAR_ MSVCRT_wchar_t
#define _CHAR_ wchar_t
#define _EOF_ MSVCRT_WEOF
#define _EOF_RET (short)MSVCRT_WEOF
#define _ISSPACE_(c) MSVCRT_iswspace(c)
......@@ -52,9 +52,9 @@
#define _UNLOCK_FILE_(file) MSVCRT__unlock_file(MSVCRT_stdin)
#ifdef WIDE_SCANF
#ifdef SECURE
#define _FUNCTION_ static int MSVCRT_vcwscanf_s_l(const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vcwscanf_s_l(const wchar_t *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int MSVCRT_vcwscanf_l(const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vcwscanf_l(const wchar_t *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */
#ifdef SECURE
......@@ -84,9 +84,9 @@
#define _UNLOCK_FILE_(file) do {} while(0)
#ifdef WIDE_SCANF
#ifdef SECURE
#define _FUNCTION_ static int MSVCRT_vsnwscanf_s_l(const MSVCRT_wchar_t *file, MSVCRT_size_t length, const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vsnwscanf_s_l(const wchar_t *file, MSVCRT_size_t length, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int MSVCRT_vsnwscanf_l(const MSVCRT_wchar_t *file, MSVCRT_size_t length, const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vsnwscanf_l(const wchar_t *file, MSVCRT_size_t length, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */
#ifdef SECURE
......@@ -106,9 +106,9 @@
#define _UNLOCK_FILE_(file) do {} while(0)
#ifdef WIDE_SCANF
#ifdef SECURE
#define _FUNCTION_ static int MSVCRT_vswscanf_s_l(const MSVCRT_wchar_t *file, const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vswscanf_s_l(const wchar_t *file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int MSVCRT_vswscanf_l(const MSVCRT_wchar_t *file, const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vswscanf_l(const wchar_t *file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */
#ifdef SECURE
......@@ -127,9 +127,9 @@
#define _LOCK_FILE_(file) MSVCRT__lock_file(file)
#define _UNLOCK_FILE_(file) MSVCRT__unlock_file(file)
#ifdef SECURE
#define _FUNCTION_ static int MSVCRT_vfwscanf_s_l(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vfwscanf_s_l(MSVCRT_FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#else /* SECURE */
#define _FUNCTION_ static int MSVCRT_vfwscanf_l(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, _locale_t locale, __ms_va_list ap)
#define _FUNCTION_ static int MSVCRT_vfwscanf_l(MSVCRT_FILE* file, const wchar_t *format, _locale_t locale, __ms_va_list ap)
#endif /* SECURE */
#else /* WIDE_SCANF */
#define _GETC_FUNC_(file) MSVCRT_fgetc(file)
......@@ -162,7 +162,7 @@ struct _STRTOD_NAME_(strtod_scanf_ctx) {
BOOL err;
};
static MSVCRT_wchar_t _STRTOD_NAME_(strtod_scanf_get)(void *ctx)
static wchar_t _STRTOD_NAME_(strtod_scanf_get)(void *ctx)
{
struct _STRTOD_NAME_(strtod_scanf_ctx) *context = ctx;
......@@ -482,8 +482,8 @@ _FUNCTION_ {
}
break;
widecharstring: { /* read a word into a wchar_t* */
MSVCRT_wchar_t *sptr = suppress ? NULL : va_arg(ap, MSVCRT_wchar_t*);
MSVCRT_wchar_t *sptr_beg = sptr;
wchar_t *sptr = suppress ? NULL : va_arg(ap, wchar_t*);
wchar_t *sptr_beg = sptr;
#ifdef SECURE
unsigned size = suppress ? UINT_MAX : va_arg(ap, unsigned);
#else
......@@ -563,8 +563,8 @@ _FUNCTION_ {
}
break;
widecharacter: { /* read single character into a wchar_t */
MSVCRT_wchar_t *str = suppress ? NULL : va_arg(ap, MSVCRT_wchar_t*);
MSVCRT_wchar_t *pstr = str;
wchar_t *str = suppress ? NULL : va_arg(ap, wchar_t*);
wchar_t *pstr = str;
#ifdef SECURE
unsigned size = suppress ? UINT_MAX : va_arg(ap, unsigned);
#else
......
......@@ -606,12 +606,12 @@ static inline int hex2int(char c)
return -1;
}
static struct fpnum fpnum_parse16(MSVCRT_wchar_t get(void *ctx), void unget(void *ctx),
static struct fpnum fpnum_parse16(wchar_t get(void *ctx), void unget(void *ctx),
void *ctx, int sign, pthreadlocinfo locinfo)
{
BOOL found_digit = FALSE, found_dp = FALSE;
enum fpmod round = FP_ROUND_ZERO;
MSVCRT_wchar_t nch;
wchar_t nch;
ULONGLONG m = 0;
int val, exp = 0;
......@@ -737,19 +737,19 @@ static inline BOOL bnum_to_mant(struct bnum *b, ULONGLONG *m)
return TRUE;
}
static struct fpnum fpnum_parse_bnum(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
static struct fpnum fpnum_parse_bnum(wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
void *ctx, pthreadlocinfo locinfo, BOOL ldouble, struct bnum *b)
{
#if _MSVCR_VER >= 140
MSVCRT_wchar_t _infinity[] = { 'i', 'n', 'f', 'i', 'n', 'i', 't', 'y', 0 };
MSVCRT_wchar_t _nan[] = { 'n', 'a', 'n', 0 };
MSVCRT_wchar_t *str_match = NULL;
wchar_t _infinity[] = { 'i', 'n', 'f', 'i', 'n', 'i', 't', 'y', 0 };
wchar_t _nan[] = { 'n', 'a', 'n', 0 };
wchar_t *str_match = NULL;
int matched=0;
#endif
BOOL found_digit = FALSE, found_dp = FALSE, found_sign = FALSE;
int e2 = 0, dp=0, sign=1, off, limb_digits = 0, i;
enum fpmod round = FP_ROUND_ZERO;
MSVCRT_wchar_t nch;
wchar_t nch;
ULONGLONG m;
nch = get(ctx);
......@@ -969,7 +969,7 @@ static struct fpnum fpnum_parse_bnum(MSVCRT_wchar_t (*get)(void *ctx), void (*un
return fpnum(sign, e2, m, round);
}
struct fpnum fpnum_parse(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
struct fpnum fpnum_parse(wchar_t (*get)(void *ctx), void (*unget)(void *ctx),
void *ctx, pthreadlocinfo locinfo, BOOL ldouble)
{
if(!ldouble) {
......@@ -987,7 +987,7 @@ struct fpnum fpnum_parse(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *c
}
}
static MSVCRT_wchar_t strtod_str_get(void *ctx)
static wchar_t strtod_str_get(void *ctx)
{
const char **p = ctx;
if (!**p) return MSVCRT_WEOF;
......@@ -1930,12 +1930,12 @@ int CDECL MSVCRT__ltoa_s(MSVCRT_long value, char *str, MSVCRT_size_t size, int r
/*********************************************************************
* _ltow_s (MSVCRT.@)
*/
int CDECL MSVCRT__ltow_s(MSVCRT_long value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix)
int CDECL MSVCRT__ltow_s(MSVCRT_long value, wchar_t *str, MSVCRT_size_t size, int radix)
{
MSVCRT_ulong val;
unsigned int digit;
BOOL is_negative;
MSVCRT_wchar_t buffer[33], *pos;
wchar_t buffer[33], *pos;
size_t len;
if (!MSVCRT_CHECK_PMT(str != NULL)) return MSVCRT_EINVAL;
......@@ -1979,7 +1979,7 @@ int CDECL MSVCRT__ltow_s(MSVCRT_long value, MSVCRT_wchar_t *str, MSVCRT_size_t s
if (len > size)
{
size_t i;
MSVCRT_wchar_t *p = str;
wchar_t *p = str;
/* Copy the temporary buffer backwards up to the available number of
* characters. Don't copy the negative sign if present. */
......@@ -1998,7 +1998,7 @@ int CDECL MSVCRT__ltow_s(MSVCRT_long value, MSVCRT_wchar_t *str, MSVCRT_size_t s
return MSVCRT_ERANGE;
}
memcpy(str, pos, len * sizeof(MSVCRT_wchar_t));
memcpy(str, pos, len * sizeof(wchar_t));
return 0;
}
......@@ -2021,7 +2021,7 @@ char* CDECL MSVCRT__itoa(int value, char *str, int radix)
/*********************************************************************
* _itow_s (MSVCRT.@)
*/
int CDECL MSVCRT__itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix)
int CDECL MSVCRT__itow_s(int value, wchar_t *str, MSVCRT_size_t size, int radix)
{
return MSVCRT__ltow_s(value, str, size, radix);
}
......@@ -2068,10 +2068,10 @@ int CDECL MSVCRT__ui64toa_s(unsigned __int64 value, char *str,
/*********************************************************************
* _ui64tow_s (MSVCRT.@)
*/
int CDECL MSVCRT__ui64tow_s( unsigned __int64 value, MSVCRT_wchar_t *str,
int CDECL MSVCRT__ui64tow_s( unsigned __int64 value, wchar_t *str,
MSVCRT_size_t size, int radix )
{
MSVCRT_wchar_t buffer[65], *pos;
wchar_t buffer[65], *pos;
int digit;
if (!MSVCRT_CHECK_PMT(str != NULL)) return MSVCRT_EINVAL;
......@@ -2099,7 +2099,7 @@ int CDECL MSVCRT__ui64tow_s( unsigned __int64 value, MSVCRT_wchar_t *str,
return MSVCRT_EINVAL;
}
memcpy(str, pos, (buffer-pos+65)*sizeof(MSVCRT_wchar_t));
memcpy(str, pos, (buffer-pos+65)*sizeof(wchar_t));
return 0;
}
......@@ -2160,7 +2160,7 @@ int CDECL MSVCRT__ultoa_s(MSVCRT_ulong value, char *str, MSVCRT_size_t size, int
/*********************************************************************
* _ultow_s (MSVCRT.@)
*/
int CDECL MSVCRT__ultow_s(MSVCRT_ulong value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix)
int CDECL MSVCRT__ultow_s(MSVCRT_ulong value, wchar_t *str, MSVCRT_size_t size, int radix)
{
MSVCRT_ulong digit;
WCHAR buffer[33], *pos;
......@@ -2207,7 +2207,7 @@ int CDECL MSVCRT__ultow_s(MSVCRT_ulong value, MSVCRT_wchar_t *str, MSVCRT_size_t
return MSVCRT_ERANGE;
}
memcpy(str, pos, len * sizeof(MSVCRT_wchar_t));
memcpy(str, pos, len * sizeof(wchar_t));
return 0;
}
......@@ -2289,12 +2289,12 @@ int CDECL MSVCRT__i64toa_s(__int64 value, char *str, MSVCRT_size_t size, int rad
/*********************************************************************
* _i64tow_s (MSVCRT.@)
*/
int CDECL MSVCRT__i64tow_s(__int64 value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix)
int CDECL MSVCRT__i64tow_s(__int64 value, wchar_t *str, MSVCRT_size_t size, int radix)
{
unsigned __int64 val;
unsigned int digit;
BOOL is_negative;
MSVCRT_wchar_t buffer[65], *pos;
wchar_t buffer[65], *pos;
size_t len;
if (!MSVCRT_CHECK_PMT(str != NULL)) return MSVCRT_EINVAL;
......@@ -2338,7 +2338,7 @@ int CDECL MSVCRT__i64tow_s(__int64 value, MSVCRT_wchar_t *str, MSVCRT_size_t siz
if (len > size)
{
size_t i;
MSVCRT_wchar_t *p = str;
wchar_t *p = str;
/* Copy the temporary buffer backwards up to the available number of
* characters. Don't copy the negative sign if present. */
......@@ -2357,7 +2357,7 @@ int CDECL MSVCRT__i64tow_s(__int64 value, MSVCRT_wchar_t *str, MSVCRT_size_t siz
return MSVCRT_ERANGE;
}
memcpy(str, pos, len * sizeof(MSVCRT_wchar_t));
memcpy(str, pos, len * sizeof(wchar_t));
return 0;
}
......
......@@ -623,7 +623,7 @@ int CDECL _strdate_s(char* date, MSVCRT_size_t size)
/**********************************************************************
* _wstrdate (MSVCRT.@)
*/
MSVCRT_wchar_t* CDECL MSVCRT__wstrdate(MSVCRT_wchar_t* date)
wchar_t* CDECL MSVCRT__wstrdate(wchar_t* date)
{
static const WCHAR format[] = { 'M','M','\'','/','\'','d','d','\'','/','\'','y','y',0 };
......@@ -635,7 +635,7 @@ MSVCRT_wchar_t* CDECL MSVCRT__wstrdate(MSVCRT_wchar_t* date)
/**********************************************************************
* _wstrdate_s (MSVCRT.@)
*/
int CDECL _wstrdate_s(MSVCRT_wchar_t* date, MSVCRT_size_t size)
int CDECL _wstrdate_s(wchar_t* date, MSVCRT_size_t size)
{
if(date && size)
date[0] = '\0';
......@@ -691,7 +691,7 @@ int CDECL _strtime_s(char* time, MSVCRT_size_t size)
/*********************************************************************
* _wstrtime (MSVCRT.@)
*/
MSVCRT_wchar_t* CDECL MSVCRT__wstrtime(MSVCRT_wchar_t* time)
wchar_t* CDECL MSVCRT__wstrtime(wchar_t* time)
{
static const WCHAR format[] = { 'H','H','\'',':','\'','m','m','\'',':','\'','s','s',0 };
......@@ -703,7 +703,7 @@ MSVCRT_wchar_t* CDECL MSVCRT__wstrtime(MSVCRT_wchar_t* time)
/*********************************************************************
* _wstrtime_s (MSVCRT.@)
*/
int CDECL _wstrtime_s(MSVCRT_wchar_t* time, MSVCRT_size_t size)
int CDECL _wstrtime_s(wchar_t* time, MSVCRT_size_t size)
{
if(time && size)
time[0] = '\0';
......@@ -963,7 +963,7 @@ char ** CDECL __p__tzname(void)
#define STRFTIME_CHAR char
#define STRFTIME_TD(td, name) td->str.names.name
#else
#define STRFTIME_CHAR MSVCRT_wchar_t
#define STRFTIME_CHAR wchar_t
#define STRFTIME_TD(td, name) td->wstr.names.name
#endif
......@@ -1549,7 +1549,7 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f
TRACE("(%p %Iu %s %p %p %p)\n", str, max, format, mstm, time_data, loc);
return strftime_impl(str, max, format, mstm, time_data, loc);
#else
MSVCRT_wchar_t *s, *fmt;
wchar_t *s, *fmt;
MSVCRT_size_t len;
TRACE("(%p %Iu %s %p %p %p)\n", str, max, format, mstm, time_data, loc);
......@@ -1560,10 +1560,10 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f
if (!MSVCRT_CHECK_PMT(format != NULL)) return 0;
len = MSVCRT__mbstowcs_l( NULL, format, 0, loc ) + 1;
if (!len || !(fmt = MSVCRT_malloc( len*sizeof(MSVCRT_wchar_t) ))) return 0;
if (!len || !(fmt = MSVCRT_malloc( len*sizeof(wchar_t) ))) return 0;
MSVCRT__mbstowcs_l(fmt, format, len, loc);
if ((s = MSVCRT_malloc( max*sizeof(MSVCRT_wchar_t) )))
if ((s = MSVCRT_malloc( max*sizeof(wchar_t) )))
{
len = strftime_impl( s, max, fmt, mstm, time_data, loc );
if (len)
......@@ -1606,8 +1606,8 @@ MSVCRT_size_t CDECL MSVCRT_strftime( char *str, MSVCRT_size_t max, const char *f
return strftime_helper(str, max, format, mstm, NULL, NULL);
}
static MSVCRT_size_t wcsftime_helper( MSVCRT_wchar_t *str, MSVCRT_size_t max,
const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm,
static MSVCRT_size_t wcsftime_helper( wchar_t *str, MSVCRT_size_t max,
const wchar_t *format, const struct MSVCRT_tm *mstm,
__lc_time_data *time_data, _locale_t loc )
{
#if _MSVCR_VER <= 90
......@@ -1639,8 +1639,8 @@ static MSVCRT_size_t wcsftime_helper( MSVCRT_wchar_t *str, MSVCRT_size_t max,
/*********************************************************************
* _wcsftime_l (MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT__wcsftime_l( MSVCRT_wchar_t *str, MSVCRT_size_t max,
const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm, _locale_t loc )
MSVCRT_size_t CDECL MSVCRT__wcsftime_l( wchar_t *str, MSVCRT_size_t max,
const wchar_t *format, const struct MSVCRT_tm *mstm, _locale_t loc )
{
return wcsftime_helper(str, max, format, mstm, NULL, loc);
}
......@@ -1648,8 +1648,8 @@ MSVCRT_size_t CDECL MSVCRT__wcsftime_l( MSVCRT_wchar_t *str, MSVCRT_size_t max,
/*********************************************************************
* wcsftime (MSVCRT.@)
*/
MSVCRT_size_t CDECL MSVCRT_wcsftime( MSVCRT_wchar_t *str, MSVCRT_size_t max,
const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm )
MSVCRT_size_t CDECL MSVCRT_wcsftime( wchar_t *str, MSVCRT_size_t max,
const wchar_t *format, const struct MSVCRT_tm *mstm )
{
return wcsftime_helper(str, max, format, mstm, NULL, NULL);
}
......@@ -1658,8 +1658,8 @@ MSVCRT_size_t CDECL MSVCRT_wcsftime( MSVCRT_wchar_t *str, MSVCRT_size_t max,
/*********************************************************************
* _Wcsftime (MSVCR110.@)
*/
MSVCRT_size_t CDECL _Wcsftime(MSVCRT_wchar_t *str, MSVCRT_size_t max,
const MSVCRT_wchar_t *format, const struct MSVCRT_tm *mstm,
MSVCRT_size_t CDECL _Wcsftime(wchar_t *str, MSVCRT_size_t max,
const wchar_t *format, const struct MSVCRT_tm *mstm,
__lc_time_data *time_data)
{
return wcsftime_helper(str, max, format, mstm, time_data, NULL);
......@@ -1740,13 +1740,13 @@ int CDECL MSVCRT_asctime_s(char* time, MSVCRT_size_t size, const struct MSVCRT_t
/*********************************************************************
* _wasctime (MSVCRT.@)
*/
MSVCRT_wchar_t * CDECL MSVCRT__wasctime(const struct MSVCRT_tm *mstm)
wchar_t * CDECL MSVCRT__wasctime(const struct MSVCRT_tm *mstm)
{
thread_data_t *data = msvcrt_get_thread_data();
char buffer[26];
if(!data->wasctime_buffer) {
data->wasctime_buffer = MSVCRT_malloc(26*sizeof(MSVCRT_wchar_t));
data->wasctime_buffer = MSVCRT_malloc(26*sizeof(wchar_t));
if(!data->wasctime_buffer) {
*MSVCRT__errno() = MSVCRT_ENOMEM;
return NULL;
......@@ -1763,7 +1763,7 @@ MSVCRT_wchar_t * CDECL MSVCRT__wasctime(const struct MSVCRT_tm *mstm)
/*********************************************************************
* _wasctime_s (MSVCRT.@)
*/
int CDECL MSVCRT__wasctime_s(MSVCRT_wchar_t* time, MSVCRT_size_t size, const struct MSVCRT_tm *mstm)
int CDECL MSVCRT__wasctime_s(wchar_t* time, MSVCRT_size_t size, const struct MSVCRT_tm *mstm)
{
char buffer[26];
int ret;
......@@ -1856,7 +1856,7 @@ char * CDECL MSVCRT_ctime(const MSVCRT___time32_t *time)
/*********************************************************************
* _wctime64 (MSVCRT.@)
*/
MSVCRT_wchar_t * CDECL MSVCRT__wctime64(const MSVCRT___time64_t *time)
wchar_t * CDECL MSVCRT__wctime64(const MSVCRT___time64_t *time)
{
return MSVCRT__wasctime( MSVCRT__localtime64(time) );
}
......@@ -1864,7 +1864,7 @@ MSVCRT_wchar_t * CDECL MSVCRT__wctime64(const MSVCRT___time64_t *time)
/*********************************************************************
* _wctime32 (MSVCRT.@)
*/
MSVCRT_wchar_t * CDECL MSVCRT__wctime32(const MSVCRT___time32_t *time)
wchar_t * CDECL MSVCRT__wctime32(const MSVCRT___time32_t *time)
{
return MSVCRT__wasctime( MSVCRT__localtime32(time) );
}
......@@ -1873,12 +1873,12 @@ MSVCRT_wchar_t * CDECL MSVCRT__wctime32(const MSVCRT___time32_t *time)
* _wctime (MSVCRT.@)
*/
#ifdef _WIN64
MSVCRT_wchar_t * CDECL MSVCRT__wctime(const MSVCRT___time64_t *time)
wchar_t * CDECL MSVCRT__wctime(const MSVCRT___time64_t *time)
{
return MSVCRT__wctime64( time );
}
#else
MSVCRT_wchar_t * CDECL MSVCRT__wctime(const MSVCRT___time32_t *time)
wchar_t * CDECL MSVCRT__wctime(const MSVCRT___time32_t *time)
{
return MSVCRT__wctime32( time );
}
......@@ -1887,7 +1887,7 @@ MSVCRT_wchar_t * CDECL MSVCRT__wctime(const MSVCRT___time32_t *time)
/*********************************************************************
* _wctime64_s (MSVCRT.@)
*/
int CDECL MSVCRT__wctime64_s(MSVCRT_wchar_t *buf,
int CDECL MSVCRT__wctime64_s(wchar_t *buf,
MSVCRT_size_t size, const MSVCRT___time64_t *time)
{
struct MSVCRT_tm tm;
......@@ -1910,7 +1910,7 @@ int CDECL MSVCRT__wctime64_s(MSVCRT_wchar_t *buf,
/*********************************************************************
* _wctime32_s (MSVCRT.@)
*/
int CDECL MSVCRT__wctime32_s(MSVCRT_wchar_t *buf, MSVCRT_size_t size,
int CDECL MSVCRT__wctime32_s(wchar_t *buf, MSVCRT_size_t size,
const MSVCRT___time32_t *time)
{
struct MSVCRT_tm tm;
......
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