Re: [Spice-devel] [PATCH spice-common 2/2] log: Force format in log macro to be a string

2017-06-19 Thread Marc-André Lureau
Hi

- Original Message -
> Make sure format is a string and not a pointer.
> 
> Signed-off-by: Frediano Ziglio 

Reviewed-by: Marc-André Lureau 

> ---
>  common/log.h | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/common/log.h b/common/log.h
> index ed701ca..c6d260c 100644
> --- a/common/log.h
> +++ b/common/log.h
> @@ -62,23 +62,23 @@ void spice_log(GLogLevelFlags log_level,
>  } G_STMT_END
>  
>  #define spice_info(format, ...) G_STMT_START { \
> -spice_log(G_LOG_LEVEL_INFO, SPICE_STRLOC, __FUNCTION__, format, ##
> __VA_ARGS__); \
> +spice_log(G_LOG_LEVEL_INFO, SPICE_STRLOC, __FUNCTION__, "" format, ##
> __VA_ARGS__); \
>  } G_STMT_END
>  
>  #define spice_debug(format, ...) G_STMT_START { \
> -spice_log(G_LOG_LEVEL_DEBUG, SPICE_STRLOC, __FUNCTION__, format, ##
> __VA_ARGS__); \
> +spice_log(G_LOG_LEVEL_DEBUG, SPICE_STRLOC, __FUNCTION__, "" format, ##
> __VA_ARGS__); \
>  } G_STMT_END
>  
>  #define spice_warning(format, ...) G_STMT_START {   \
> -spice_log(G_LOG_LEVEL_WARNING, SPICE_STRLOC, __FUNCTION__, format, ##
> __VA_ARGS__); \
> +spice_log(G_LOG_LEVEL_WARNING, SPICE_STRLOC, __FUNCTION__, "" format, ##
> __VA_ARGS__); \
>  } G_STMT_END
>  
>  #define spice_critical(format, ...) G_STMT_START {
>  \
> -spice_log(G_LOG_LEVEL_CRITICAL, SPICE_STRLOC, __FUNCTION__, format, ##
> __VA_ARGS__); \
> +spice_log(G_LOG_LEVEL_CRITICAL, SPICE_STRLOC, __FUNCTION__, "" format,
> ## __VA_ARGS__); \
>  } G_STMT_END
>  
>  #define spice_error(format, ...) G_STMT_START { \
> -spice_log(G_LOG_LEVEL_ERROR, SPICE_STRLOC, __FUNCTION__, format, ##
> __VA_ARGS__); \
> +spice_log(G_LOG_LEVEL_ERROR, SPICE_STRLOC, __FUNCTION__, "" format, ##
> __VA_ARGS__); \
>  } G_STMT_END
>  
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH spice-common 2/2] log: Force format in log macro to be a string

2017-06-19 Thread Frediano Ziglio
Make sure format is a string and not a pointer.

Signed-off-by: Frediano Ziglio 
---
 common/log.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/log.h b/common/log.h
index ed701ca..c6d260c 100644
--- a/common/log.h
+++ b/common/log.h
@@ -62,23 +62,23 @@ void spice_log(GLogLevelFlags log_level,
 } G_STMT_END
 
 #define spice_info(format, ...) G_STMT_START { \
-spice_log(G_LOG_LEVEL_INFO, SPICE_STRLOC, __FUNCTION__, format, ## 
__VA_ARGS__); \
+spice_log(G_LOG_LEVEL_INFO, SPICE_STRLOC, __FUNCTION__, "" format, ## 
__VA_ARGS__); \
 } G_STMT_END
 
 #define spice_debug(format, ...) G_STMT_START { \
-spice_log(G_LOG_LEVEL_DEBUG, SPICE_STRLOC, __FUNCTION__, format, ## 
__VA_ARGS__); \
+spice_log(G_LOG_LEVEL_DEBUG, SPICE_STRLOC, __FUNCTION__, "" format, ## 
__VA_ARGS__); \
 } G_STMT_END
 
 #define spice_warning(format, ...) G_STMT_START {   \
-spice_log(G_LOG_LEVEL_WARNING, SPICE_STRLOC, __FUNCTION__, format, ## 
__VA_ARGS__); \
+spice_log(G_LOG_LEVEL_WARNING, SPICE_STRLOC, __FUNCTION__, "" format, ## 
__VA_ARGS__); \
 } G_STMT_END
 
 #define spice_critical(format, ...) G_STMT_START {  \
-spice_log(G_LOG_LEVEL_CRITICAL, SPICE_STRLOC, __FUNCTION__, format, ## 
__VA_ARGS__); \
+spice_log(G_LOG_LEVEL_CRITICAL, SPICE_STRLOC, __FUNCTION__, "" format, ## 
__VA_ARGS__); \
 } G_STMT_END
 
 #define spice_error(format, ...) G_STMT_START { \
-spice_log(G_LOG_LEVEL_ERROR, SPICE_STRLOC, __FUNCTION__, format, ## 
__VA_ARGS__); \
+spice_log(G_LOG_LEVEL_ERROR, SPICE_STRLOC, __FUNCTION__, "" format, ## 
__VA_ARGS__); \
 } G_STMT_END
 
 #define spice_warn_if_fail(x) G_STMT_START {\
-- 
2.9.4

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel