msvcrt: Use _ARGMAX from public header.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-12-01 13:52:05 +01:00 committed by Alexandre Julliard
parent 480e25a5f6
commit 45ac135519
4 changed files with 7 additions and 8 deletions

View File

@ -5108,7 +5108,7 @@ static int puts_clbk_file_w(void *file, int len, const wchar_t *str)
static int vfprintf_helper(DWORD options, FILE* file, const char *format, static int vfprintf_helper(DWORD options, FILE* file, const char *format,
_locale_t locale, __ms_va_list valist) _locale_t locale, __ms_va_list valist)
{ {
printf_arg args_ctx[MSVCRT__ARGMAX+1]; printf_arg args_ctx[_ARGMAX+1];
BOOL tmp_buf; BOOL tmp_buf;
int ret; int ret;
@ -5140,7 +5140,7 @@ static int vfprintf_helper(DWORD options, FILE* file, const char *format,
static int vfwprintf_helper(DWORD options, FILE* file, const wchar_t *format, static int vfwprintf_helper(DWORD options, FILE* file, const wchar_t *format,
_locale_t locale, __ms_va_list valist) _locale_t locale, __ms_va_list valist)
{ {
printf_arg args_ctx[MSVCRT__ARGMAX+1]; printf_arg args_ctx[_ARGMAX+1];
BOOL tmp_buf; BOOL tmp_buf;
int ret; int ret;

View File

@ -886,7 +886,6 @@ int fpnum_double(struct fpnum*, double*) DECLSPEC_HIDDEN;
#define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE)) #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))
#define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), EINVAL) #define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), EINVAL)
#define MSVCRT__ARGMAX 100
typedef int (*puts_clbk_a)(void*, int, const char*); typedef int (*puts_clbk_a)(void*, int, const char*);
typedef int (*puts_clbk_w)(void*, int, const wchar_t*); typedef int (*puts_clbk_w)(void*, int, const wchar_t*);
typedef union _printf_arg typedef union _printf_arg

View File

@ -1225,7 +1225,7 @@ static printf_arg arg_clbk_type(void *ctx, int pos, int type, __ms_va_list *vali
} else } else
args[0].get_int |= TYPE_CLBK_POSITIONAL; args[0].get_int |= TYPE_CLBK_POSITIONAL;
if(pos<1 || pos>MSVCRT__ARGMAX) if(pos<1 || pos>_ARGMAX)
args[0].get_int |= TYPE_CLBK_ERROR_POS; args[0].get_int |= TYPE_CLBK_ERROR_POS;
else if(args[pos].get_int && args[pos].get_int!=type) else if(args[pos].get_int && args[pos].get_int!=type)
args[0].get_int |= TYPE_CLBK_ERROR_TYPE; args[0].get_int |= TYPE_CLBK_ERROR_TYPE;
@ -1252,7 +1252,7 @@ int FUNC_NAME(create_positional_ctx)(void *args_ctx, const APICHAR *format, __ms
if(args[0].get_int != TYPE_CLBK_POSITIONAL) if(args[0].get_int != TYPE_CLBK_POSITIONAL)
return -1; return -1;
for(i=MSVCRT__ARGMAX; i>0; i--) for(i=_ARGMAX; i>0; i--)
if(args[i].get_int) if(args[i].get_int)
break; break;

View File

@ -1159,7 +1159,7 @@ int CDECL MSVCRT__vscprintf_l(const char *format,
int CDECL MSVCRT__vscprintf_p_l(const char *format, int CDECL MSVCRT__vscprintf_p_l(const char *format,
_locale_t locale, __ms_va_list args) _locale_t locale, __ms_va_list args)
{ {
printf_arg args_ctx[MSVCRT__ARGMAX+1]; printf_arg args_ctx[_ARGMAX+1];
struct _str_ctx_a puts_ctx = {INT_MAX, NULL}; struct _str_ctx_a puts_ctx = {INT_MAX, NULL};
int ret; int ret;
@ -1337,7 +1337,7 @@ int CDECL MSVCRT_vswprintf_c(wchar_t *str, size_t len,
static int MSVCRT_vswprintf_p_l_opt(wchar_t *buffer, size_t length, static int MSVCRT_vswprintf_p_l_opt(wchar_t *buffer, size_t length,
const wchar_t *format, DWORD options, _locale_t locale, __ms_va_list args) const wchar_t *format, DWORD options, _locale_t locale, __ms_va_list args)
{ {
printf_arg args_ctx[MSVCRT__ARGMAX+1]; printf_arg args_ctx[_ARGMAX+1];
struct _str_ctx_w puts_ctx = {length, buffer}; struct _str_ctx_w puts_ctx = {length, buffer};
int ret; int ret;
@ -1716,7 +1716,7 @@ static int MSVCRT_vsprintf_p_l_opt(char *buffer, size_t length, const char *form
DWORD options, _locale_t locale, __ms_va_list args) DWORD options, _locale_t locale, __ms_va_list args)
{ {
static const char nullbyte = '\0'; static const char nullbyte = '\0';
printf_arg args_ctx[MSVCRT__ARGMAX+1]; printf_arg args_ctx[_ARGMAX+1];
struct _str_ctx_a puts_ctx = {length, buffer}; struct _str_ctx_a puts_ctx = {length, buffer};
int ret; int ret;