Re: [Spice-devel] [PATCH 09/15] client: remove c++ wrappers

2011-04-21 Thread Uri Lublin
On 04/21/2011 02:53 PM, Christophe Fergeau wrote: client/ contains several .cpp file which only #include a .c file of the same name. This is unusual and seems to only be done to get C++ name mangling on the symbols defined in the C file. Now that all headers files in common/ use extern "C", these

Re: [Spice-devel] [PATCH 09/15] client: remove c++ wrappers

2011-04-21 Thread Alon Levy
On Thu, Apr 21, 2011 at 01:53:34PM +0200, Christophe Fergeau wrote: > client/ contains several .cpp file which only #include a .c file > of the same name. This is unusual and seems to only be done to > get C++ name mangling on the symbols defined in the C file. > Now that all headers files in commo

Re: [Spice-devel] [PATCH 14/15] server: add missing GPL header to source files

2011-04-21 Thread Hans de Goede
Hi, On 04/21/2011 02:09 PM, Christophe Fergeau wrote: On Thu, Apr 21, 2011 at 02:03:10PM +0200, Hans de Goede wrote: Nitpick: you're adding a LGPL header, might be good to reflect that in the commit message. Indeed, will fix before pushing. For the record, I used the same licence as most of s

Re: [Spice-devel] [PATCH 14/15] server: add missing GPL header to source files

2011-04-21 Thread Christophe Fergeau
On Thu, Apr 21, 2011 at 02:03:10PM +0200, Hans de Goede wrote: > Nitpick: you're adding a LGPL header, might be good to reflect > that in the commit message. Indeed, will fix before pushing. For the record, I used the same licence as most of spice (a few files are under more permissive licences).

Re: [Spice-devel] [PATCH 00/15] Misc cleanup and fixes

2011-04-21 Thread Hans de Goede
Ack series (with one minor nitpick for 14/15). On 04/21/2011 01:53 PM, Christophe Fergeau wrote: Hi, Here are more cleanup and fixes I did while looking at spice code. The main changes are fixes for --enable/--disable in configure.ac, and the removal of the .cpp wrappers for files from common/

Re: [Spice-devel] [PATCH 14/15] server: add missing GPL header to source files

2011-04-21 Thread Hans de Goede
Nitpick: you're adding a LGPL header, might be good to reflect that in the commit message. On 04/21/2011 01:53 PM, Christophe Fergeau wrote: --- server/smartcard.c| 17 + server/smartcard.h| 17 + server/zlib_encoder.c | 17 + 3

[Spice-devel] [PATCH 8/8] add comment to beginning of autogenerated files

2011-04-21 Thread Christophe Fergeau
--- spice_codegen.py |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/spice_codegen.py b/spice_codegen.py index 4dad06c..05b47f6 100755 --- a/spice_codegen.py +++ b/spice_codegen.py @@ -142,6 +142,8 @@ writer.set_option("source", os.path.basename(proto_file)) writer.pub

[Spice-devel] [PATCH 7/8] s/USE_OGL/USE_OPENGL

2011-04-21 Thread Christophe Fergeau
This is more explicit about what it does, and not much longer --- client/application.cpp |6 ++-- client/application.h |2 +- client/common.h |2 +- client/display_channel.cpp | 40 +++--- client/display_cha

[Spice-devel] [PATCH 6/8] use AC_DEFINE instead of hardcoding preprocessor flags

2011-04-21 Thread Christophe Fergeau
Now that all source files include config.h, we can use AC_DEFINE to enable/disable optional features (opengl, cegui). This is cleaner than directly appending -Dxxx directives to the preprocessor flags. This also guarantees that everything will be appropriately rebuilt when using the same source tre

[Spice-devel] [PATCH 5/8] add config.h to autogenerated files too

2011-04-21 Thread Christophe Fergeau
Modify the python (de)marshaller generator to add #include at the beginning of the C files it generates --- spice_codegen.py |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/spice_codegen.py b/spice_codegen.py index 3a9989d..4dad06c 100755 --- a/spice_codegen.py +++ b/s

[Spice-devel] [PATCH 4/8] add #include to all source files

2011-04-21 Thread Christophe Fergeau
When using config.h, it must be the very first include in all source files since it contains #define that may change the compilation process (eg libc structure layout changes when it's used to enable large file support on 32 bit x86 archs). This commit adds it at the beginning of all .c and .cpp fi

[Spice-devel] [PATCH 3/8] autotools: correctly build canvas-related code

2011-04-21 Thread Christophe Fergeau
spice client and spice server shares code from common/{gdi,gl,sw}_canvas.[ch]. However, while most of the code is shared, the server code wants a canvas compiled with SW_CANVAS_IMAGE_CACHE defined while the client code wants a canvas compiled with SW_CANVAS_CACHE. The initial autotools refactoring

[Spice-devel] [PATCH 2/8] configure.ac: remove unused AC_SUBST

2011-04-21 Thread Christophe Fergeau
--- configure.ac |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 92957fa..7e77672 100644 --- a/configure.ac +++ b/configure.ac @@ -13,9 +13,6 @@ AC_CONFIG_AUX_DIR(.) AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip subdir-objects]) AM_MAINTA

[Spice-devel] [PATCH 1/8] autotools: refactor the whole build machinery

2011-04-21 Thread Christophe Fergeau
spice Makefile.am setup is a bit confusing, with source file names being listed several times in different Makefile.am (generally, once in EXTRA_DIST and another time in another Makefile.am in _SOURCES). The client binaries are built by client/x11/Makefile.am, which means recursing into client, the

[Spice-devel] [PATCH 0/8] Rework autotools build system

2011-04-21 Thread Christophe Fergeau
Hi, The autotools build system looked a bit convoluted when I looked at it, and after toying a bit with it when preparing the earlier patchset, it seemed more fragile than autotools build systems generally are. This patchseries rework the Makefile.am to get something more "standard". make distche

[Spice-devel] [PATCH 15/15] add missing licence headers to source files

2011-04-21 Thread Christophe Fergeau
A few files didn't have a licence header at the beginning. --- client/gui/gui.cpp | 17 + client/gui/gui.h | 17 + client/gui/resource_provider.cpp | 17 + client/gui/resource_provider.h | 17 +

[Spice-devel] [PATCH 14/15] server: add missing GPL header to source files

2011-04-21 Thread Christophe Fergeau
--- server/smartcard.c| 17 + server/smartcard.h| 17 + server/zlib_encoder.c | 17 + 3 files changed, 51 insertions(+), 0 deletions(-) diff --git a/server/smartcard.c b/server/smartcard.c index 892500b..d201f5f 100644 --- a/server/sma

[Spice-devel] [PATCH 11/15] use foo(void) instead of foo() in prototypes

2011-04-21 Thread Christophe Fergeau
In C, the latter isn't a prototype for a function with no arg, but declares a function with an undefined number of args. --- common/gdi_canvas.c |2 +- common/gdi_canvas.h |2 +- common/gl_canvas.c |2 +- common/gl_canvas.h |2 +- common/quic.c |2 +-

[Spice-devel] [PATCH 13/15] common: don't try to redefine PANIC if it already exists

2011-04-21 Thread Christophe Fergeau
canvas_base.c tries to define PANIC, but it might already be set if eg client/debug.h has been included before. All the other macros in this file are guarded by #ifndef, this commit adds the missing #ifndef to PANIC. Note that this is just a bandaid, ideally common/ would contain a logging framewor

[Spice-devel] [PATCH 12/15] server: s/desable/disable

2011-04-21 Thread Christophe Fergeau
This fixes a typo in some function names, there should be no functional change. --- server/reds.c |2 +- server/reds.h |2 +- server/snd_worker.c |4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/reds.c b/server/reds.c index f417738..fe4c603 100

[Spice-devel] [PATCH 10/15] server: remove extra arg in reds_on_main_agent_start call

2011-04-21 Thread Christophe Fergeau
--- server/main_channel.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/server/main_channel.c b/server/main_channel.c index 1f407e2..4ddd38b 100644 --- a/server/main_channel.c +++ b/server/main_channel.c @@ -677,7 +677,7 @@ static int main_channel_handle_parsed(RedChann

[Spice-devel] [PATCH 09/15] client: remove c++ wrappers

2011-04-21 Thread Christophe Fergeau
client/ contains several .cpp file which only #include a .c file of the same name. This is unusual and seems to only be done to get C++ name mangling on the symbols defined in the C file. Now that all headers files in common/ use extern "C", these wrappers are no longer useful. --- client/Makefile

[Spice-devel] [PATCH 08/15] common: add missing header guards to gl_canvas.h

2011-04-21 Thread Christophe Fergeau
--- common/gl_canvas.h |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/common/gl_canvas.h b/common/gl_canvas.h index ff3fba0..4a15668 100644 --- a/common/gl_canvas.h +++ b/common/gl_canvas.h @@ -20,6 +20,9 @@ #include "canvas_base.h" #include "region.h" +#ifndef _H

[Spice-devel] [PATCH 07/15] common: add extern "C" guards to headers

2011-04-21 Thread Christophe Fergeau
Since some spice C++ code is using code from common/, the C functions need to be marked as such for the C++ compiler, otherwise we'll get linkage issues. --- common/canvas_base.h |8 common/canvas_utils.h |8 common/draw.h |8 common/gdi_canvas.h |

[Spice-devel] [PATCH 06/15] client: make building client optional

2011-04-21 Thread Christophe Fergeau
--- Makefile.am |6 +- configure.ac |8 2 files changed, 13 insertions(+), 1 deletions(-) diff --git a/Makefile.am b/Makefile.am index d90357f..853ffea 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,8 @@ -SUBDIRS = common server client python_modules +SUBDIRS = common

[Spice-devel] [PATCH 05/15] configure.ac: replace tab with spaces

2011-04-21 Thread Christophe Fergeau
This makes the "C++ Compiler: " status output nicely aligned with the other messages. --- configure.ac |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index eff0e07..c5f3534 100644 --- a/configure.ac +++ b/configure.ac @@ -515,7 +515,7

[Spice-devel] [PATCH 04/15] configure.ac: remove unused dynamic linkage flag

2011-04-21 Thread Christophe Fergeau
configure.ac defines a SPICEC_STATIC_LINKAGE_BDYNAMIC variable when --enable-static-linkage is not set, but it's never used. SPICEC_STATIC_LINKAGE_BSTATIC is used in client/, but since we are using libtool, it might be more appropriate to use 'make LDFLAGS="-all-static"' to achieve static link. ---

[Spice-devel] [PATCH 03/15] configure.ac: fix use of AC_ARG_ENABLE

2011-04-21 Thread Christophe Fergeau
Most uses of AC_ARG_ENABLE were buggy: - when passing --disable-xxx, configure.ac would behave as if it was passed --enable-xxx - passing --enable-xxx=foo would "leak" into the summary, ie the summary (at the end of configure) would say "xxx: foo" instead of "xxx: yes" This patch fixes these

[Spice-devel] [PATCH 02/15] configure.ac: fix make dist

2011-04-21 Thread Christophe Fergeau
--- client/windows/Makefile.am |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/client/windows/Makefile.am b/client/windows/Makefile.am index 041f57b..6d69511 100644 --- a/client/windows/Makefile.am +++ b/client/windows/Makefile.am @@ -141,8 +141,7 @@ RED_OGL_SRCS =

[Spice-devel] [PATCH 01/15] server: use is_primary_surface

2011-04-21 Thread Christophe Fergeau
red_worker.c has an is_primary_surface helper function, but there were some places in the file not using it. This patch fixes that --- server/red_worker.c | 11 --- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index 83f1798..49d

[Spice-devel] [PATCH 00/15] Misc cleanup and fixes

2011-04-21 Thread Christophe Fergeau
Hi, Here are more cleanup and fixes I did while looking at spice code. The main changes are fixes for --enable/--disable in configure.ac, and the removal of the .cpp wrappers for files from common/ in client/ I assume these wrappers were present to avoid linking issues between C/C++ code, adding e

Re: [Spice-devel] Streaming video command line

2011-04-21 Thread Alon Levy
On Thu, Apr 21, 2011 at 10:22:15AM +0200, Andrea Celestino wrote: > Thanks. > Now I am trying to study the code I am interested in. > Unfortunately, the file red_worker.c is very huge and there are not any > comments that can help me. > > I would like to know: > 1- which parts/functions of red_wor

Re: [Spice-devel] Streaming video command line

2011-04-21 Thread Andrea Celestino
Thanks. Now I am trying to study the code I am interested in. Unfortunately, the file red_worker.c is very huge and there are not any comments that can help me. I would like to know: 1- which parts/functions of red_worker.c are video related stuff? 2- You said: "determine if a given draw operatio