Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
07ca8f4f
Commit
07ca8f4f
authored
Jan 02, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Convert all the printf functions to use MS ABI varargs.
parent
34f24871
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
40 deletions
+40
-40
console.c
dlls/msvcrt/console.c
+4
-4
file.c
dlls/msvcrt/file.c
+16
-16
msvcrt.h
dlls/msvcrt/msvcrt.h
+2
-2
wcs.c
dlls/msvcrt/wcs.c
+18
-18
No files found.
dlls/msvcrt/console.c
View file @
07ca8f4f
...
...
@@ -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
;
...
...
dlls/msvcrt/file.c
View file @
07ca8f4f
...
...
@@ -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
;
}
...
...
dlls/msvcrt/msvcrt.h
View file @
07ca8f4f
...
...
@@ -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
...
...
dlls/msvcrt/wcs.c
View file @
07ca8f4f
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment