[Spice-devel] [PATCH spice-common 3/3] canvas_base: Allow to specify constant operations

Christophe de Dinechin christophe.de.dinechin at gmail.com
Tue Nov 7 11:38:18 UTC 2017


Frediano Ziglio writes:

> There's no need for the canvas operations to be changed.
> This allows without casts to have the operation structures
> constants in the code.
> This potentially allows to reduce attach surface having some

Typo: "attack surface". And you are really talking about the compiler
complaining, so I'm not sure "attack surface" is the right term.

> more data constant instead or read/write.

>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  common/canvas_base.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/common/canvas_base.h b/common/canvas_base.h
> index 78e6368..2d3c35b 100644
> --- a/common/canvas_base.h
> +++ b/common/canvas_base.h
> @@ -60,7 +60,7 @@ typedef struct {
>  } SpiceImageCacheOps;
>
>  struct _SpiceImageCache {
> -  SpiceImageCacheOps *ops;
> +  const SpiceImageCacheOps *ops;
>  };
>
>  typedef struct {
> @@ -69,7 +69,7 @@ typedef struct {
>  } SpiceImageSurfacesOps;
>
>  struct _SpiceImageSurfaces {
> - SpiceImageSurfacesOps *ops;
> + const SpiceImageSurfacesOps *ops;
>  };
>
>  typedef struct {


--
Cheers,
Christophe de Dinechin (IRC c3d)


More information about the Spice-devel mailing list