[PATCH 1/6] include: Support wine_dbgstr_longlong in tests

Michael Stefaniuc mstefani at winehq.org
Thu Jun 29 05:09:46 CDT 2017


Hello Alistair,

On 06/29/2017 02:43 AM, Alistair Leslie-Hughes wrote:
> Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
> ---
>  include/wine/test.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/wine/test.h b/include/wine/test.h
> index af602c0..d8e5490 100644
> --- a/include/wine/test.h
> +++ b/include/wine/test.h
> @@ -68,6 +68,7 @@ extern const char *wine_dbgstr_wn( const WCHAR *str, int n );
>  extern const char *wine_dbgstr_guid( const GUID *guid );
>  extern const char *wine_dbgstr_rect( const RECT *rect );
>  static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
> +extern const char *wine_dbgstr_longlong( ULONGLONG ll );
>  
>  /* strcmpW is available for tests compiled under Wine, but not in standalone
>   * builds under Windows, so we reimplement it under a different name. */
> @@ -541,6 +542,17 @@ const char *wine_dbgstr_rect( const RECT *rect )
>      return res;
>  }
>  
> +const char *wine_dbgstr_longlong( ULONGLONG ll )
> +{
> +    char *res;
The other functions have an empty line after the variable declarations.

> +    res = get_temp_buffer( 17 );
> +    if (sizeof(ll) > sizeof(unsigned long) && ll >> 32)
> +        sprintf(res, "%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll);
Either place a space after the opening parenthesis and before the
closing one or don't but please stay consistent inside a function.
The file prefers the variant with the spaces.

> +    else
> +        sprintf(res, "%lx", (unsigned long)ll);
> +    return res;
The other debug functions with variable length output release the unused
part of the temp buffer. You can waste up to 15 bytes here.

> +}
> +
>  /* Find a test by name */
>  static const struct test *find_test( const char *name )
>  {
> 

thanks
bye
	michael



More information about the wine-devel mailing list