[PATCH] msvcrt: Remove CDECL on static functions where not needed.

Piotr Caban piotr.caban at gmail.com
Fri Sep 10 14:48:33 CDT 2021


Hi Francois,

The patch is already in wine but it breaks Rémi's change:

commit a24ad51e3f2515c1970b56f8dfe2206e2b282dc9
Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Tue Nov 10 16:58:37 2020 +0100

     msvcrt: Make locale and thread helper functions CDECL.

     This prevent callers from having to save SSE registers to the stack.

     It is for instance the case in MSVCRT__towlower_l, which is called on
     every character by MSVCRT__wcsicmp_l.

Maybe it's better to use CDECL on all internal static functions instead? 
This change probably deserves a comment so it's not removed in future.

Thanks,
Piotr

On 9/3/21 11:50 AM, Francois Gouget wrote:
> Signed-off-by: Francois Gouget <fgouget at free.fr>
> ---
>   dlls/msvcrt/locale.c | 4 ++--
>   dlls/msvcrt/math.c   | 4 ++--
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c
> index 5a4a701dfc6..4c0fce194bd 100644
> --- a/dlls/msvcrt/locale.c
> +++ b/dlls/msvcrt/locale.c
> @@ -556,7 +556,7 @@ void CDECL _unlock_locales(void)
>       _unlock(_SETLOCALE_LOCK);
>   }
>   
> -static void CDECL grab_locinfo(pthreadlocinfo locinfo)
> +static void grab_locinfo(pthreadlocinfo locinfo)
>   {
>       int i;
>   
> @@ -578,7 +578,7 @@ static void CDECL grab_locinfo(pthreadlocinfo locinfo)
>       InterlockedIncrement(&locinfo->lc_time_curr->refcount);
>   }
>   
> -static void CDECL update_thread_locale(thread_data_t *data)
> +static void update_thread_locale(thread_data_t *data)
>   {
>       if((data->locale_flags & LOCALE_FREE) && ((data->locale_flags & LOCALE_THREAD) ||
>                   (data->locinfo == MSVCRT_locale->locinfo && data->mbcinfo == MSVCRT_locale->mbcinfo)))
> diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
> index efdde8e4afb..7f59a4d20d4 100644
> --- a/dlls/msvcrt/math.c
> +++ b/dlls/msvcrt/math.c
> @@ -90,7 +90,7 @@ static inline double fp_barrier(double x)
>       return y;
>   }
>   
> -static inline double CDECL ret_nan( BOOL update_sw )
> +static inline double ret_nan( BOOL update_sw )
>   {
>       double x = 1.0;
>       if (!update_sw) return -NAN;
> @@ -2663,7 +2663,7 @@ double CDECL cos( double x )
>   }
>   
>   /* Copied from musl: src/math/expm1.c */
> -static double CDECL __expm1(double x)
> +static double __expm1(double x)
>   {
>       static const double o_threshold = 7.09782712893383973096e+02,
>           ln2_hi = 6.93147180369123816490e-01,
> 




More information about the wine-devel mailing list