[Spice-devel] #include "canvas_base.c" ?

Christophe Fergeau cfergeau at redhat.com
Mon Feb 19 13:15:41 UTC 2018


On Thu, Feb 15, 2018 at 03:28:42PM +0100, Christophe de Dinechin wrote:
> While looking at some warnings, I came across this in sw_canvas.c:
> 
> #include “canvas_base.c"
> 
> So we include a .c in another one. Apparently, this was inherited from some Cairo canvas. Is that something we care to keep as is?

There used to be gdi_canvas.c and gl_canvas.c in addition to
sw_canvas.c, they all included base_canvas.c after setting a few #define
to tweak its behaviour. Now gdi_canvas.c and gl_canvas.c are gone, so
it's probably possible to get rid of that #include "canvas_base.c".

Note that these files are special though,
spice-common/common/Makefile.am has:

# These 2 files are not build as part of spice-common
# build system, but modules using spice-common will build
# them with the appropriate options. We need to let automake
# know that these are source files so that it can properly
# track these files dependencies


and spice-gtk/src/client_sw_canvas.c includes sw_canvas.c after
#define'ing SW_CANVAS_CACHE.
spice-server uses spice-server/server/sw-canvas.c, but does not define
SW_CANVAS_CACHE.

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


More information about the Spice-devel mailing list