Commit 07ca8f4f authored by Alexandre Julliard's avatar Alexandre Julliard

msvcrt: Convert all the printf functions to use MS ABI varargs.

parent 34f24871
......@@ -289,9 +289,9 @@ int CDECL _cprintf(const char* format, ...)
{
char buf[2048], *mem = buf;
int written, resize = sizeof(buf), retval;
va_list valist;
__ms_va_list valist;
va_start( valist, format );
__ms_va_start( valist, format );
/* There are two conventions for snprintf failing:
* Return -1 if we truncated, or
* Return the number of bytes that would have been written
......@@ -305,9 +305,9 @@ int CDECL _cprintf(const char* format, ...)
MSVCRT_free (mem);
if (!(mem = MSVCRT_malloc(resize)))
return MSVCRT_EOF;
va_start( valist, format );
__ms_va_start( valist, format );
}
va_end(valist);
__ms_va_end(valist);
LOCK_CONSOLE;
retval = _cputs( mem );
UNLOCK_CONSOLE;
......
......@@ -3018,7 +3018,7 @@ MSVCRT_FILE* CDECL MSVCRT_tmpfile(void)
/*********************************************************************
* vfprintf (MSVCRT.@)
*/
int CDECL MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, va_list valist)
int CDECL MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, __ms_va_list valist)
{
char buf[2048], *mem = buf;
int written, resize = sizeof(buf), retval;
......@@ -3048,7 +3048,7 @@ int CDECL MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, va_list valist)
* Is final char included in written (then resize is too big) or not
* (then we must test for equality too)?
*/
int CDECL MSVCRT_vfwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, va_list valist)
int CDECL MSVCRT_vfwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, __ms_va_list valist)
{
MSVCRT_wchar_t buf[2048], *mem = buf;
int written, resize = sizeof(buf) / sizeof(MSVCRT_wchar_t), retval;
......@@ -3071,7 +3071,7 @@ int CDECL MSVCRT_vfwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, va_l
/*********************************************************************
* vprintf (MSVCRT.@)
*/
int CDECL MSVCRT_vprintf(const char *format, va_list valist)
int CDECL MSVCRT_vprintf(const char *format, __ms_va_list valist)
{
return MSVCRT_vfprintf(MSVCRT_stdout,format,valist);
}
......@@ -3079,7 +3079,7 @@ int CDECL MSVCRT_vprintf(const char *format, va_list valist)
/*********************************************************************
* vwprintf (MSVCRT.@)
*/
int CDECL MSVCRT_vwprintf(const MSVCRT_wchar_t *format, va_list valist)
int CDECL MSVCRT_vwprintf(const MSVCRT_wchar_t *format, __ms_va_list valist)
{
return MSVCRT_vfwprintf(MSVCRT_stdout,format,valist);
}
......@@ -3089,11 +3089,11 @@ int CDECL MSVCRT_vwprintf(const MSVCRT_wchar_t *format, va_list valist)
*/
int CDECL MSVCRT_fprintf(MSVCRT_FILE* file, const char *format, ...)
{
va_list valist;
__ms_va_list valist;
int res;
va_start(valist, format);
__ms_va_start(valist, format);
res = MSVCRT_vfprintf(file, format, valist);
va_end(valist);
__ms_va_end(valist);
return res;
}
......@@ -3102,11 +3102,11 @@ int CDECL MSVCRT_fprintf(MSVCRT_FILE* file, const char *format, ...)
*/
int CDECL MSVCRT_fwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, ...)
{
va_list valist;
__ms_va_list valist;
int res;
va_start(valist, format);
__ms_va_start(valist, format);
res = MSVCRT_vfwprintf(file, format, valist);
va_end(valist);
__ms_va_end(valist);
return res;
}
......@@ -3115,11 +3115,11 @@ int CDECL MSVCRT_fwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, ...)
*/
int CDECL MSVCRT_printf(const char *format, ...)
{
va_list valist;
__ms_va_list valist;
int res;
va_start(valist, format);
__ms_va_start(valist, format);
res = MSVCRT_vfprintf(MSVCRT_stdout, format, valist);
va_end(valist);
__ms_va_end(valist);
return res;
}
......@@ -3164,11 +3164,11 @@ MSVCRT_wint_t CDECL MSVCRT_ungetwc(MSVCRT_wint_t wc, MSVCRT_FILE * file)
*/
int CDECL MSVCRT_wprintf(const MSVCRT_wchar_t *format, ...)
{
va_list valist;
__ms_va_list valist;
int res;
va_start(valist, format);
__ms_va_start(valist, format);
res = MSVCRT_vwprintf(format, valist);
va_end(valist);
__ms_va_end(valist);
return res;
}
......
......@@ -665,9 +665,9 @@ double __cdecl MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t time2);
MSVCRT_time_t __cdecl MSVCRT_time(MSVCRT_time_t*);
MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *);
MSVCRT_FILE* __cdecl MSVCRT__wfdopen(int, const MSVCRT_wchar_t *);
int __cdecl MSVCRT_vsnprintf(char *str, unsigned int len, const char *format, va_list valist);
int __cdecl MSVCRT_vsnprintf(char *str, unsigned int len, const char *format, __ms_va_list valist);
int __cdecl MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, unsigned int len,
const MSVCRT_wchar_t *format, va_list valist );
const MSVCRT_wchar_t *format, __ms_va_list valist );
int __cdecl MSVCRT_raise(int sig);
#ifndef __WINE_MSVCRT_TEST
......
......@@ -525,7 +525,7 @@ static void pf_fixup_exponent( char *buf )
*
* implements both A and W vsnprintf functions
*/
static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valist )
{
int r;
LPCWSTR q, p = format;
......@@ -769,7 +769,7 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, va_list valist )
* _vsnprintf (MSVCRT.@)
*/
int CDECL MSVCRT_vsnprintf( char *str, unsigned int len,
const char *format, va_list valist )
const char *format, __ms_va_list valist )
{
DWORD sz;
LPWSTR formatW = NULL;
......@@ -798,7 +798,7 @@ int CDECL MSVCRT_vsnprintf( char *str, unsigned int len,
/*********************************************************************
* vsprintf (MSVCRT.@)
*/
int CDECL MSVCRT_vsprintf( char *str, const char *format, va_list valist)
int CDECL MSVCRT_vsprintf( char *str, const char *format, __ms_va_list valist)
{
return MSVCRT_vsnprintf(str, INT_MAX, format, valist);
}
......@@ -809,10 +809,10 @@ int CDECL MSVCRT_vsprintf( char *str, const char *format, va_list valist)
int CDECL MSVCRT__snprintf(char *str, unsigned int len, const char *format, ...)
{
int retval;
va_list valist;
va_start(valist, format);
__ms_va_list valist;
__ms_va_start(valist, format);
retval = MSVCRT_vsnprintf(str, len, format, valist);
va_end(valist);
__ms_va_end(valist);
return retval;
}
......@@ -820,7 +820,7 @@ int CDECL MSVCRT__snprintf(char *str, unsigned int len, const char *format, ...)
* _vsnwsprintf (MSVCRT.@)
*/
int CDECL MSVCRT_vsnwprintf( MSVCRT_wchar_t *str, unsigned int len,
const MSVCRT_wchar_t *format, va_list valist )
const MSVCRT_wchar_t *format, __ms_va_list valist )
{
pf_output out;
......@@ -838,10 +838,10 @@ int CDECL MSVCRT_vsnwprintf( MSVCRT_wchar_t *str, unsigned int len,
int CDECL MSVCRT__snwprintf( MSVCRT_wchar_t *str, unsigned int len, const MSVCRT_wchar_t *format, ...)
{
int retval;
va_list valist;
va_start(valist, format);
__ms_va_list valist;
__ms_va_start(valist, format);
retval = MSVCRT_vsnwprintf(str, len, format, valist);
va_end(valist);
__ms_va_end(valist);
return retval;
}
......@@ -850,12 +850,12 @@ int CDECL MSVCRT__snwprintf( MSVCRT_wchar_t *str, unsigned int len, const MSVCRT
*/
int CDECL MSVCRT_sprintf( char *str, const char *format, ... )
{
va_list ap;
__ms_va_list ap;
int r;
va_start( ap, format );
__ms_va_start( ap, format );
r = MSVCRT_vsnprintf( str, INT_MAX, format, ap );
va_end( ap );
__ms_va_end( ap );
return r;
}
......@@ -864,19 +864,19 @@ int CDECL MSVCRT_sprintf( char *str, const char *format, ... )
*/
int CDECL MSVCRT_swprintf( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *format, ... )
{
va_list ap;
__ms_va_list ap;
int r;
va_start( ap, format );
__ms_va_start( ap, format );
r = MSVCRT_vsnwprintf( str, INT_MAX, format, ap );
va_end( ap );
__ms_va_end( ap );
return r;
}
/*********************************************************************
* vswprintf (MSVCRT.@)
*/
int CDECL MSVCRT_vswprintf( MSVCRT_wchar_t* str, const MSVCRT_wchar_t* format, va_list args )
int CDECL MSVCRT_vswprintf( MSVCRT_wchar_t* str, const MSVCRT_wchar_t* format, __ms_va_list args )
{
return MSVCRT_vsnwprintf( str, INT_MAX, format, args );
}
......@@ -884,7 +884,7 @@ int CDECL MSVCRT_vswprintf( MSVCRT_wchar_t* str, const MSVCRT_wchar_t* format, v
/*********************************************************************
* vswprintf_s (MSVCRT.@)
*/
int CDECL MSVCRT_vswprintf_s( MSVCRT_wchar_t* str, MSVCRT_size_t num, const MSVCRT_wchar_t* format, va_list args )
int CDECL MSVCRT_vswprintf_s( MSVCRT_wchar_t* str, MSVCRT_size_t num, const MSVCRT_wchar_t* format, __ms_va_list args )
{
/* FIXME: must handle positional arguments */
return MSVCRT_vsnwprintf( str, num, format, args );
......
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