[Spice-devel] [PATCH spice-server 2/2] Add some debugging for GlzDictItem structure

Christophe Fergeau cfergeau at redhat.com
Wed Dec 14 13:34:05 UTC 2016


On Tue, Dec 13, 2016 at 02:31:51PM +0000, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/image-encoders.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/server/image-encoders.c b/server/image-encoders.c
> index b23cdf0..a529968 100644
> --- a/server/image-encoders.c
> +++ b/server/image-encoders.c
> @@ -20,6 +20,7 @@
>  #endif
>  
>  #include <glib.h>
> +#include <common/log.h>
>  
>  #include "image-encoders.h"
>  #include "spice-bitmap-utils.h"
> @@ -65,6 +66,23 @@ static void encoder_data_init(EncoderData *data);
>  static void encoder_data_reset(EncoderData *data);
>  static void image_encoders_release_glz(ImageEncoders *enc);
>  
> +#if GLZ_DEBUG
> +static void glz_dict_item_check(GlzDictItem *glz_item)
> +{
> +    spice_assert(glz_item != NULL);
> +    spice_assert(ring_item_is_linked(&glz_item->glz_context_link));
> +    spice_assert(ring_item_is_linked(&glz_item->retention_link));
> +    spice_assert(glz_item->enc != NULL);
> +    spice_assert(glz_item->red_drawable != NULL);
> +    if (ring_item_is_linked(&glz_item->free_link)) {
> +        spice_assert(glz_item->dict_image_context == NULL);
> +    }
> +}
> +#else
> +static inline void glz_dict_item_check(G_GNUC_UNUSED GlzDictItem *glz_item)

I don't think there's a good reason for the inline, gcc should be able
to kill that function just fine.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161214/eded30a5/attachment.sig>


More information about the Spice-devel mailing list