[Spice-devel] Minor fix to the SpiceClip/type field

Submitted by Jeremy White on April 26, 2012, 2:46 p.m.

Details

Message ID 4F995FD9.4090800@codeweavers.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Jeremy White April 26, 2012, 2:46 p.m.
This patch should make it reflect the on wire size.

This one cost me an hour and some hair; hopefully it'll save someone
else in the future.

Cheers,

Jeremy

Patch hide | download patch | download mbox

From e60d4d40b806647f3f59f36ff98a7fcbc3854c3d Mon Sep 17 00:00:00 2001
From: Jeremy White <jwhite@codeweavers.com>
Date: Thu, 26 Apr 2012 09:43:38 -0500
Subject: [PATCH] Set the clip type to reflect the on wire type.

---
 common/draw.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/draw.h b/common/draw.h
index cdd57e9..8fad0e5 100644
--- a/common/draw.h
+++ b/common/draw.h
@@ -82,7 +82,7 @@  typedef struct SpiceClipRects {
 } SpiceClipRects;
 
 typedef struct SpiceClip {
-    uint32_t type;
+    uint8_t type;
     SpiceClipRects *rects;
 } SpiceClip;
 
-- 
1.7.9.5


Comments

On Thu, Apr 26, 2012 at 09:46:49AM -0500, Jeremy White wrote:
> This patch should make it reflect the on wire size.
> 
> This one cost me an hour and some hair; hopefully it'll save someone
> else in the future.

Thanks, ACK.

In general the on wire format is defined by spice.proto :


enum8 clip_type {
    NONE,
    RECTS
};


struct Clip {
    clip_type type;
    switch (type) {
    case RECTS:
        ClipRects rects @outvar(cliprects) @to_ptr;
    } u @anon;
};

> 
> Cheers,
> 
> Jeremy

> From e60d4d40b806647f3f59f36ff98a7fcbc3854c3d Mon Sep 17 00:00:00 2001
> From: Jeremy White <jwhite@codeweavers.com>
> Date: Thu, 26 Apr 2012 09:43:38 -0500
> Subject: [PATCH] Set the clip type to reflect the on wire type.
> 
> ---
>  common/draw.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/draw.h b/common/draw.h
> index cdd57e9..8fad0e5 100644
> --- a/common/draw.h
> +++ b/common/draw.h
> @@ -82,7 +82,7 @@ typedef struct SpiceClipRects {
>  } SpiceClipRects;
>  
>  typedef struct SpiceClip {
> -    uint32_t type;
> +    uint8_t type;
>      SpiceClipRects *rects;
>  } SpiceClip;
>  
> -- 
> 1.7.9.5
> 

> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
----- Original Message -----
> This patch should make it reflect the on wire size.
> 
> This one cost me an hour and some hair; hopefully it'll save someone
> else in the future.

I suggest taking a look at the Wireshark Spice dissector, which is more aligned with the wire format than the Spice code (and certainly its documentation) is, surprisingly.
Y.

> 
> Cheers,
> 
> Jeremy
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>