From 45ac13551966f7a89ad4678fbc0f76f858663bcb Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Tue, 1 Dec 2020 13:52:05 +0100 Subject: [PATCH] msvcrt: Use _ARGMAX from public header. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/file.c | 4 ++-- dlls/msvcrt/msvcrt.h | 1 - dlls/msvcrt/printf.h | 4 ++-- dlls/msvcrt/wcs.c | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 3ab18e8ac8e..bc1305e5228 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -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, _locale_t locale, __ms_va_list valist) { - printf_arg args_ctx[MSVCRT__ARGMAX+1]; + printf_arg args_ctx[_ARGMAX+1]; BOOL tmp_buf; 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, _locale_t locale, __ms_va_list valist) { - printf_arg args_ctx[MSVCRT__ARGMAX+1]; + printf_arg args_ctx[_ARGMAX+1]; BOOL tmp_buf; int ret; diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index bfa01e21901..5b1e5ac40b0 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -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(x) MSVCRT_CHECK_PMT_ERR((x), EINVAL) -#define MSVCRT__ARGMAX 100 typedef int (*puts_clbk_a)(void*, int, const char*); typedef int (*puts_clbk_w)(void*, int, const wchar_t*); typedef union _printf_arg diff --git a/dlls/msvcrt/printf.h b/dlls/msvcrt/printf.h index 72dffb30e37..826e8e76805 100644 --- a/dlls/msvcrt/printf.h +++ b/dlls/msvcrt/printf.h @@ -1225,7 +1225,7 @@ static printf_arg arg_clbk_type(void *ctx, int pos, int type, __ms_va_list *vali } else 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; else if(args[pos].get_int && args[pos].get_int!=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) return -1; - for(i=MSVCRT__ARGMAX; i>0; i--) + for(i=_ARGMAX; i>0; i--) if(args[i].get_int) break; diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c index b36d832a10a..8b43dcadf95 100644 --- a/dlls/msvcrt/wcs.c +++ b/dlls/msvcrt/wcs.c @@ -1159,7 +1159,7 @@ int CDECL MSVCRT__vscprintf_l(const char *format, int CDECL MSVCRT__vscprintf_p_l(const char *format, _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}; 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, 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}; 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) { 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}; int ret;