[Spice-devel] [PATCH v2 1/2] Style adjustment
Frediano Ziglio
fziglio at redhat.com
Thu May 18 10:36:31 UTC 2017
>
> From: Christophe de Dinechin <dinechin at redhat.com>
>
> Fixing a piece of code that does not match the style for the
> rest of the source files
>
> Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
> ---
> common/sw_canvas.c | 96
> +++++++++++++++++++++++++-----------------------------
> 1 file changed, 45 insertions(+), 51 deletions(-)
>
> diff --git a/common/sw_canvas.c b/common/sw_canvas.c
> index 959421f..531d608 100644
> --- a/common/sw_canvas.c
> +++ b/common/sw_canvas.c
> @@ -1189,16 +1189,15 @@ static void canvas_destroy(SpiceCanvas *spice_canvas)
> static SpiceCanvasOps sw_canvas_ops;
>
> static SpiceCanvas *canvas_create_common(pixman_image_t *image,
> - uint32_t format
> - , SpiceImageCache *bits_cache
> + uint32_t format,
> + SpiceImageCache *bits_cache,
> #ifdef SW_CANVAS_CACHE
> - , SpicePaletteCache *palette_cache
> + SpicePaletteCache *palette_cache,
> #endif
> - , SpiceImageSurfaces *surfaces
> - , SpiceGlzDecoder *glz_decoder
> - , SpiceJpegDecoder *jpeg_decoder
> - , SpiceZlibDecoder *zlib_decoder
> - )
> + SpiceImageSurfaces *surfaces,
> + SpiceGlzDecoder *glz_decoder,
> + SpiceJpegDecoder *jpeg_decoder,
> + SpiceZlibDecoder *zlib_decoder)
> {
> SwCanvas *canvas;
>
> @@ -1207,18 +1206,17 @@ static SpiceCanvas
> *canvas_create_common(pixman_image_t *image,
>
> canvas = spice_new0(SwCanvas, 1);
> canvas_base_init(&canvas->base, &sw_canvas_ops,
> - pixman_image_get_width (image),
> - pixman_image_get_height (image),
> - format
> - , bits_cache
> + pixman_image_get_width (image),
> + pixman_image_get_height (image),
I would remove the space before "(", not really much used in our code.
> + format,
> + bits_cache,
> #ifdef SW_CANVAS_CACHE
> - , palette_cache
> + palette_cache,
> #endif
> - , surfaces
> - , glz_decoder
> - , jpeg_decoder
> - , zlib_decoder
> - );
> + surfaces,
> + glz_decoder,
> + jpeg_decoder,
> + zlib_decoder);
> canvas->private_data = NULL;
> canvas->private_data_size = 0;
>
> @@ -1227,61 +1225,57 @@ static SpiceCanvas
> *canvas_create_common(pixman_image_t *image,
> return (SpiceCanvas *)canvas;
> }
>
> -SpiceCanvas *canvas_create(int width, int height, uint32_t format
> - , SpiceImageCache *bits_cache
> +SpiceCanvas *canvas_create(int width, int height, uint32_t format,
> + SpiceImageCache *bits_cache,
> #ifdef SW_CANVAS_CACHE
> - , SpicePaletteCache *palette_cache
> + SpicePaletteCache *palette_cache,
> #endif
> - , SpiceImageSurfaces *surfaces
> - , SpiceGlzDecoder *glz_decoder
> - , SpiceJpegDecoder *jpeg_decoder
> - , SpiceZlibDecoder *zlib_decoder
> - )
> + SpiceImageSurfaces *surfaces,
> + SpiceGlzDecoder *glz_decoder,
> + SpiceJpegDecoder *jpeg_decoder,
> + SpiceZlibDecoder *zlib_decoder)
> {
> pixman_image_t *image;
>
> image = pixman_image_create_bits(spice_surface_format_to_pixman
> (format),
> width, height, NULL, 0);
>
> - return canvas_create_common(image, format
> - , bits_cache
> + return canvas_create_common(image, format,
> + bits_cache,
> #ifdef SW_CANVAS_CACHE
> - , palette_cache
> + palette_cache,
> #endif
> - , surfaces
> - , glz_decoder
> - , jpeg_decoder
> - , zlib_decoder
> - );
> + surfaces,
> + glz_decoder,
> + jpeg_decoder,
> + zlib_decoder);
> }
>
> SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format,
> - uint8_t *data, int stride
> - , SpiceImageCache *bits_cache
> + uint8_t *data, int stride,
> + SpiceImageCache *bits_cache,
> #ifdef SW_CANVAS_CACHE
> - , SpicePaletteCache *palette_cache
> + SpicePaletteCache *palette_cache,
> #endif
> - , SpiceImageSurfaces *surfaces
> - , SpiceGlzDecoder *glz_decoder
> - , SpiceJpegDecoder *jpeg_decoder
> - , SpiceZlibDecoder *zlib_decoder
> - )
> + SpiceImageSurfaces *surfaces,
> + SpiceGlzDecoder *glz_decoder,
> + SpiceJpegDecoder *jpeg_decoder,
> + SpiceZlibDecoder *zlib_decoder)
> {
> pixman_image_t *image;
>
> image = pixman_image_create_bits(spice_surface_format_to_pixman
> (format),
> - width, height, (uint32_t *)data,
> stride);
> + width, height, (uint32 *) data,
> stride);
>
> - return canvas_create_common(image, format
> - , bits_cache
> + return canvas_create_common(image, format,
> + bits_cache,
> #ifdef SW_CANVAS_CACHE
> - , palette_cache
> + palette_cache,
> #endif
> - , surfaces
> - , glz_decoder
> - , jpeg_decoder
> - , zlib_decoder
> - );
> + surfaces,
> + glz_decoder,
> + jpeg_decoder,
> + zlib_decoder);
> }
>
> SPICE_CONSTRUCTOR_FUNC(sw_canvas_global_init) //unsafe global function
Otherwise,
Acked-by: Frediano Ziglio <fziglio at redhat.com>
Frediano
More information about the Spice-devel
mailing list