[Spice-commits] 14 commits - client/canvas_utils.cpp client/gdi_canvas.cpp client/gl_canvas.cpp client/glc.cpp client/gui client/lines.cpp client/lz.cpp client/Makefile.am client/marshaller.cpp client/mem.cpp client/pixman_utils.cpp client/quic.cpp client/region.cpp client/rop3.cpp client/smartcard_channel.cpp client/smartcard_channel.h client/sw_canvas.cpp client/windows client/x11 client/zlib_decoder.cpp common/canvas_base.c common/canvas_base.h common/canvas_utils.h common/draw.h common/gdi_canvas.c common/gdi_canvas.h common/gl_canvas.c common/gl_canvas.h common/glc.h common/gl_utils.h common/lines.h common/lz_common.h common/lz.h common/marshaller.h common/mem.h common/messages.h common/mutex.h common/ogl_ctx.h common/pixman_utils.h common/quic.c common/quic_config.h common/quic.h common/rect.h common/region.h common/ring.h common/rop3.c common/rop3.h common/spice_common.h common/sw_canvas.c common/sw_canvas.h configure.ac Makefile.am server/main_channel.c server/main_channel.h server/red_dispatcher.c server/red_dispatcher.h server/reds.c server/reds.h server/red_worker.c server/smartcard.c server/smartcard.h server/snd_worker.c server/snd_worker.h server/zlib_encoder.c

Christophe Fergau teuf at kemper.freedesktop.org
Mon May 2 02:27:29 PDT 2011


 Makefile.am                      |    6 ++-
 client/Makefile.am               |   12 ------
 client/canvas_utils.cpp          |   25 ------------
 client/gdi_canvas.cpp            |   24 ------------
 client/gl_canvas.cpp             |   20 ----------
 client/glc.cpp                   |   20 ----------
 client/gui/gui.cpp               |   17 ++++++++
 client/gui/gui.h                 |   17 ++++++++
 client/gui/resource_provider.cpp |   17 ++++++++
 client/gui/resource_provider.h   |   17 ++++++++
 client/gui/softrenderer.cpp      |   17 ++++++++
 client/gui/softrenderer.h        |   17 ++++++++
 client/gui/softtexture.cpp       |   17 ++++++++
 client/gui/softtexture.h         |   18 ++++++++-
 client/lines.cpp                 |   24 ------------
 client/lz.cpp                    |   20 ----------
 client/marshaller.cpp            |   24 ------------
 client/mem.cpp                   |   24 ------------
 client/pixman_utils.cpp          |   25 ------------
 client/quic.cpp                  |   20 ----------
 client/region.cpp                |   20 ----------
 client/rop3.cpp                  |   20 ----------
 client/smartcard_channel.cpp     |   16 ++++++++
 client/smartcard_channel.h       |   16 ++++++++
 client/sw_canvas.cpp             |   24 ------------
 client/windows/Makefile.am       |   29 +++++++-------
 client/windows/redc.vcproj       |   22 +++++------
 client/x11/Makefile.am           |   24 ++++++------
 client/zlib_decoder.cpp          |   16 ++++++++
 common/canvas_base.c             |    2 +
 common/canvas_base.h             |    8 ++++
 common/canvas_utils.h            |    8 ++++
 common/draw.h                    |    8 ++++
 common/gdi_canvas.c              |    2 -
 common/gdi_canvas.h              |   10 ++++-
 common/gl_canvas.c               |    2 -
 common/gl_canvas.h               |   14 ++++++-
 common/gl_utils.h                |    8 ++++
 common/glc.h                     |    8 ++++
 common/lines.h                   |    8 ++++
 common/lz.h                      |    7 +++
 common/lz_common.h               |    7 +++
 common/marshaller.h              |    8 ++++
 common/mem.h                     |    7 +++
 common/messages.h                |   10 ++++-
 common/mutex.h                   |    9 ++++
 common/ogl_ctx.h                 |    8 ++++
 common/pixman_utils.h            |    8 ++++
 common/quic.c                    |    2 -
 common/quic.h                    |   10 ++++-
 common/quic_config.h             |    8 ++++
 common/rect.h                    |    8 ++++
 common/region.h                  |    8 ++++
 common/ring.h                    |    8 ++++
 common/rop3.c                    |    2 -
 common/rop3.h                    |   11 +++++
 common/spice_common.h            |    2 -
 common/sw_canvas.c               |    2 -
 common/sw_canvas.h               |   10 ++++-
 configure.ac                     |   78 +++++++++++++++++++++------------------
 server/main_channel.c            |    2 -
 server/main_channel.h            |    2 -
 server/red_dispatcher.c          |   14 +++----
 server/red_dispatcher.h          |   10 ++---
 server/red_worker.c              |   11 ++---
 server/reds.c                    |   12 +++---
 server/reds.h                    |   12 +++---
 server/smartcard.c               |   19 +++++++++
 server/smartcard.h               |   19 +++++++++
 server/snd_worker.c              |    6 +--
 server/snd_worker.h              |    2 -
 server/zlib_encoder.c            |   17 ++++++++
 72 files changed, 556 insertions(+), 429 deletions(-)

New commits:
commit da584a5e2da499820940beaf3dfc46a1e7918338
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Apr 21 12:35:42 2011 +0200

    add missing "LGPLv2.1 or later" header to source files

diff --git a/client/gui/gui.cpp b/client/gui/gui.cpp
index d8513c6..eba241f 100644
--- a/client/gui/gui.cpp
+++ b/client/gui/gui.cpp
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include "common.h"
 
 #include <limits.h>
diff --git a/client/gui/gui.h b/client/gui/gui.h
index 3b76b68..457c351 100644
--- a/client/gui/gui.h
+++ b/client/gui/gui.h
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #ifndef _H_GUI
 #define _H_GUI
 
diff --git a/client/gui/resource_provider.cpp b/client/gui/resource_provider.cpp
index 52e3381..2b5c44f 100644
--- a/client/gui/resource_provider.cpp
+++ b/client/gui/resource_provider.cpp
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include "common.h"
 
 #include "resource_provider.h"
diff --git a/client/gui/resource_provider.h b/client/gui/resource_provider.h
index c313688..6f59cb8 100644
--- a/client/gui/resource_provider.h
+++ b/client/gui/resource_provider.h
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #ifndef _H_RESOURCE_PROVIDER
 #define _H_RESOURCE_PROVIDER
 
diff --git a/client/gui/softrenderer.cpp b/client/gui/softrenderer.cpp
index 87fffb8..bdc7a6c 100644
--- a/client/gui/softrenderer.cpp
+++ b/client/gui/softrenderer.cpp
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include "common.h"
 #ifdef HAVE_CONFIG_H
 #include "config.h"
diff --git a/client/gui/softrenderer.h b/client/gui/softrenderer.h
index f5155ad..f25f79e 100644
--- a/client/gui/softrenderer.h
+++ b/client/gui/softrenderer.h
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #ifndef _directfbrenderer_h_
 #define _directfbrenderer_h_
 
diff --git a/client/gui/softtexture.cpp b/client/gui/softtexture.cpp
index 562edea..a633f24 100644
--- a/client/gui/softtexture.cpp
+++ b/client/gui/softtexture.cpp
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include "common.h"
 
 #ifdef HAVE_CONFIG_H
diff --git a/client/gui/softtexture.h b/client/gui/softtexture.h
index 788795f..65a4ece 100644
--- a/client/gui/softtexture.h
+++ b/client/gui/softtexture.h
@@ -1,4 +1,20 @@
-
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #ifndef _softtexture_h_
 #define _softtexture_h_
 
diff --git a/client/smartcard_channel.cpp b/client/smartcard_channel.cpp
index 272d29d..32b6d8d 100644
--- a/client/smartcard_channel.cpp
+++ b/client/smartcard_channel.cpp
@@ -1,3 +1,19 @@
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include <spice/enums.h>
 
 #include "client/red_client.h"
diff --git a/client/smartcard_channel.h b/client/smartcard_channel.h
index 752713b..a84cbfd 100644
--- a/client/smartcard_channel.h
+++ b/client/smartcard_channel.h
@@ -1,3 +1,19 @@
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #ifndef __SMART_CARD_H__
 #define __SMART_CARD_H__
 
diff --git a/client/zlib_decoder.cpp b/client/zlib_decoder.cpp
index 68b1b33..9cdadb3 100644
--- a/client/zlib_decoder.cpp
+++ b/client/zlib_decoder.cpp
@@ -1,3 +1,19 @@
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include "common.h"
 #include "zlib_decoder.h"
 #include "debug.h"
diff --git a/server/smartcard.c b/server/smartcard.c
index 892500b..d201f5f 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include <arpa/inet.h>
 
 #include "server/char_device.h"
diff --git a/server/smartcard.h b/server/smartcard.h
index bb2f0b6..cc74d9b 100644
--- a/server/smartcard.h
+++ b/server/smartcard.h
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #ifndef __SMART_CARD_H__
 #define __SMART_CARD_H__
 
diff --git a/server/zlib_encoder.c b/server/zlib_encoder.c
index e0d8d83..214180e 100644
--- a/server/zlib_encoder.c
+++ b/server/zlib_encoder.c
@@ -1,3 +1,20 @@
+/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+   Copyright (C) 2010 Red Hat, Inc.
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
 #include "red_common.h"
 #include "zlib_encoder.h"
 #include <zlib.h>
commit 9496a7864e6d456977cc9f6c18768d59cfe0d9ba
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Thu Apr 21 12:05:19 2011 +0200

    common: don't try to redefine PANIC if it already exists
    
    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 frameword, and these
    macros would only be defined once instead of being defined in
    several places.

diff --git a/common/canvas_base.c b/common/canvas_base.c
index 796bda3..4dedfcf 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -53,10 +53,12 @@
 #define WARN(x) printf("warning: %s\n", x)
 #endif
 
+#ifndef PANIC
 #define PANIC(str) {                                \
     printf("%s: panic: %s", __FUNCTION__, str);     \
     abort();                                        \
 }
+#endif
 
 #ifndef DBG
 #define DBG(level, format, ...) printf("%s: debug: " format "\n", __FUNCTION__, ## __VA_ARGS__);
commit 2f187d5a71341747a076bf0e1addc3462572c466
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 23:34:08 2011 +0200

    server: s/desable/disable
    
    This fixes a typo in some function names, there should be no
    functional change.

diff --git a/server/reds.c b/server/reds.c
index f417738..fe4c603 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3148,7 +3148,7 @@ void reds_enable_mm_timer(void)
     main_channel_push_multi_media_time(reds->main_channel, reds_get_mm_time() - MM_TIME_DELTA);
 }
 
-void reds_desable_mm_timer(void)
+void reds_disable_mm_timer(void)
 {
     core->timer_cancel(reds->mm_timer);
 }
diff --git a/server/reds.h b/server/reds.h
index 2c0e692..b286471 100644
--- a/server/reds.h
+++ b/server/reds.h
@@ -118,7 +118,7 @@ ssize_t reds_stream_write(RedsStream *s, const void *buf, size_t nbyte);
 ssize_t reds_stream_writev(RedsStream *s, const struct iovec *iov, int iovcnt);
 void reds_stream_free(RedsStream *s);
 
-void reds_desable_mm_timer(void);
+void reds_disable_mm_timer(void);
 void reds_enable_mm_timer(void);
 void reds_update_mm_timer(uint32_t mm_time);
 uint32_t reds_get_mm_time(void);
diff --git a/server/snd_worker.c b/server/snd_worker.c
index 9ecd382..c8e9d12 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -829,7 +829,7 @@ __visible__ void spice_server_playback_start(SpicePlaybackInstance *sin)
     if (!channel)
         return;
     ASSERT(!playback_channel->base.active);
-    reds_desable_mm_timer();
+    reds_disable_mm_timer();
     playback_channel->base.active = TRUE;
     if (!playback_channel->base.client_active) {
         snd_set_command(&playback_channel->base, SND_PLAYBACK_CTRL_MASK);
@@ -917,7 +917,7 @@ static void on_new_playback_channel(SndWorker *worker)
         snd_set_command((SndChannel *)playback_channel, SND_PLAYBACK_CTRL_MASK);
     }
     if (playback_channel->base.active) {
-        reds_desable_mm_timer();
+        reds_disable_mm_timer();
     }
 }
 
commit 8a1ceb65faedb182d4e274833d72d0862a46a876
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 23:23:18 2011 +0200

    use foo(void) instead of foo() in prototypes
    
    In C, the latter isn't a prototype for a function with no arg,
    but declares a function with an undefined number of args.

diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index d57aafc..360e6bf 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -1828,7 +1828,7 @@ SpiceCanvas *gdi_canvas_create(int width, int height,
     return (SpiceCanvas *)canvas;
 }
 
-void gdi_canvas_init() //unsafe global function
+void gdi_canvas_init(void) //unsafe global function
 {
     if (!need_init) {
         return;
diff --git a/common/gdi_canvas.h b/common/gdi_canvas.h
index 5cdffb3..86be9e1 100644
--- a/common/gdi_canvas.h
+++ b/common/gdi_canvas.h
@@ -38,7 +38,7 @@ SpiceCanvas *gdi_canvas_create(int width, int height,
                                SpiceJpegDecoder *jpeg_decoder,
                                SpiceZlibDecoder *zlib_decoder);
 
-void gdi_canvas_init();
+void gdi_canvas_init(void);
 
 #ifdef __cplusplus
 }
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index 3edb2c7..9867c4f 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -870,7 +870,7 @@ static void gl_canvas_destroy(SpiceCanvas *spice_canvas)
     free(canvas);
 }
 
-void gl_canvas_init() //unsafe global function
+void gl_canvas_init(void) //unsafe global function
 {
     if (!need_init) {
         return;
diff --git a/common/gl_canvas.h b/common/gl_canvas.h
index 4a15668..6776379 100644
--- a/common/gl_canvas.h
+++ b/common/gl_canvas.h
@@ -40,7 +40,7 @@ SpiceCanvas *gl_canvas_create(int width, int height, uint32_t format
                            , SpiceZlibDecoder *zlib_decoder
                            );
 void gl_canvas_set_textures_lost(SpiceCanvas *canvas, int textures_lost);
-void gl_canvas_init();
+void gl_canvas_init(void);
 
 #ifdef __cplusplus
 }
diff --git a/common/quic.c b/common/quic.c
index e2c211d..cd3aee8 100644
--- a/common/quic.c
+++ b/common/quic.c
@@ -1690,7 +1690,7 @@ void quic_destroy(QuicContext *quic)
     encoder->usr->free(encoder->usr, encoder);
 }
 
-void quic_init()
+void quic_init(void)
 {
     if (!need_init) {
         return;
diff --git a/common/quic.h b/common/quic.h
index d031777..6047da8 100644
--- a/common/quic.h
+++ b/common/quic.h
@@ -63,7 +63,7 @@ int quic_decode(QuicContext *quic, QuicImageType type, uint8_t *buf, int stride)
 QuicContext *quic_create(QuicUsrContext *usr);
 void quic_destroy(QuicContext *quic);
 
-void quic_init();
+void quic_init(void);
 
 #ifdef __cplusplus
 }
diff --git a/common/rop3.c b/common/rop3.c
index 77f0a71..83880fe 100644
--- a/common/rop3.c
+++ b/common/rop3.c
@@ -381,7 +381,7 @@ ROP3_HANDLERS(DPSoo, *src | *pat | *dest, 0xfe);
     rop3_test_handlers_32[index] = rop3_test32_##op;             \
     rop3_test_handlers_16[index] = rop3_test16_##op;
 
-void rop3_init()
+void rop3_init(void)
 {
     static int need_init = 1;
     int i;
diff --git a/common/rop3.h b/common/rop3.h
index 549b02c..3307649 100644
--- a/common/rop3.h
+++ b/common/rop3.h
@@ -33,7 +33,7 @@ void do_rop3_with_pattern(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, Sp
 void do_rop3_with_color(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos,
                         uint32_t rgb);
 
-void rop3_init();
+void rop3_init(void);
 
 #ifdef __cplusplus
 }
diff --git a/common/spice_common.h b/common/spice_common.h
index bacd24a..75ebda7 100644
--- a/common/spice_common.h
+++ b/common/spice_common.h
@@ -60,7 +60,7 @@
     }                                                               \
 }
 
-static inline uint64_t get_time_stamp()
+static inline uint64_t get_time_stamp(void)
 {
     struct timespec time_space;
     clock_gettime(CLOCK_MONOTONIC, &time_space);
diff --git a/common/sw_canvas.c b/common/sw_canvas.c
index f17bc58..95ec292 100644
--- a/common/sw_canvas.c
+++ b/common/sw_canvas.c
@@ -1276,7 +1276,7 @@ SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format,
                                 );
 }
 
-void sw_canvas_init() //unsafe global function
+void sw_canvas_init(void) //unsafe global function
 {
     if (!need_init) {
         return;
diff --git a/common/sw_canvas.h b/common/sw_canvas.h
index 42f2573..5465526 100644
--- a/common/sw_canvas.h
+++ b/common/sw_canvas.h
@@ -57,7 +57,7 @@ SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format, uint
                            );
 
 
-void sw_canvas_init();
+void sw_canvas_init(void);
 
 #ifdef __cplusplus
 }
diff --git a/server/main_channel.h b/server/main_channel.h
index db95dc2..2776f01 100644
--- a/server/main_channel.h
+++ b/server/main_channel.h
@@ -43,7 +43,7 @@ struct MainMigrateData {
     uint32_t write_queue_size;
 };
 
-Channel *main_channel_init();
+Channel *main_channel_init(void);
 void main_channel_close(Channel *channel); // not destroy, just socket close
 int main_channel_push_ping(Channel *channel, int size);
 void main_channel_push_mouse_mode(Channel *channel, int current_mode, int is_client_mouse_allowed);
diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index 75e0670..0692458 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -170,12 +170,12 @@ int red_dispatcher_add_renderer(const char *name)
     return TRUE;
 }
 
-int red_dispatcher_qxl_count()
+int red_dispatcher_qxl_count(void)
 {
     return num_active_workers;
 }
 
-static void update_client_mouse_allowed()
+static void update_client_mouse_allowed(void)
 {
     static int allowed = FALSE;
     int allow_now = FALSE;
@@ -408,7 +408,7 @@ void red_dispatcher_set_mm_time(uint32_t mm_time)
     }
 }
 
-static inline int calc_compression_level()
+static inline int calc_compression_level(void)
 {
     ASSERT(streaming_video != STREAM_VIDEO_INVALID);
     if ((streaming_video != STREAM_VIDEO_OFF) ||
@@ -419,7 +419,7 @@ static inline int calc_compression_level()
     }
 }
 
-void red_dispatcher_on_ic_change()
+void red_dispatcher_on_ic_change(void)
 {
     int compression_level = calc_compression_level();
     RedDispatcher *now = dispatchers;
@@ -432,7 +432,7 @@ void red_dispatcher_on_ic_change()
     }
 }
 
-void red_dispatcher_on_sv_change()
+void red_dispatcher_on_sv_change(void)
 {
     int compression_level = calc_compression_level();
     RedDispatcher *now = dispatchers;
@@ -456,7 +456,7 @@ void red_dispatcher_set_mouse_mode(uint32_t mode)
     }
 }
 
-int red_dispatcher_count()
+int red_dispatcher_count(void)
 {
     RedDispatcher *now = dispatchers;
     int ret = 0;
@@ -468,7 +468,7 @@ int red_dispatcher_count()
     return ret;
 }
 
-uint32_t red_dispatcher_qxl_ram_size()
+uint32_t red_dispatcher_qxl_ram_size(void)
 {
     QXLDevInitInfo qxl_info;
     if (!dispatchers) {
diff --git a/server/red_dispatcher.h b/server/red_dispatcher.h
index 7f8973a..3f3c1ae 100644
--- a/server/red_dispatcher.h
+++ b/server/red_dispatcher.h
@@ -22,12 +22,12 @@
 struct RedDispatcher *red_dispatcher_init(QXLInstance *qxl);
 
 void red_dispatcher_set_mm_time(uint32_t);
-void red_dispatcher_on_ic_change();
-void red_dispatcher_on_sv_change();
+void red_dispatcher_on_ic_change(void);
+void red_dispatcher_on_sv_change(void);
 void red_dispatcher_set_mouse_mode(uint32_t mode);
-int red_dispatcher_count();
+int red_dispatcher_count(void);
 int red_dispatcher_add_renderer(const char *name);
-uint32_t red_dispatcher_qxl_ram_size();
-int red_dispatcher_qxl_count();
+uint32_t red_dispatcher_qxl_ram_size(void);
+int red_dispatcher_qxl_count(void);
 #endif
 
diff --git a/server/reds.c b/server/reds.c
index cd86ab9..f417738 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1008,7 +1008,7 @@ void reds_fill_channels(SpiceMsgChannels *channels_info)
     }
 }
 
-void reds_on_main_agent_start()
+void reds_on_main_agent_start(void)
 {
     if (!vdagent) {
         return;
@@ -1057,14 +1057,14 @@ void reds_on_main_agent_data(void *message, size_t size)
     write_to_vdi_port();
 }
 
-void reds_on_main_migrate_connected()
+void reds_on_main_migrate_connected(void)
 {
     if (reds->mig_wait_connect) {
         reds_mig_cleanup();
     }
 }
 
-void reds_on_main_migrate_connect_error()
+void reds_on_main_migrate_connect_error(void)
 {
     if (reds->mig_wait_connect) {
         reds_mig_cleanup();
@@ -3127,7 +3127,7 @@ static void migrate_timout(void *opaque)
     reds_mig_disconnect();
 }
 
-uint32_t reds_get_mm_time()
+uint32_t reds_get_mm_time(void)
 {
     struct timespec time_space;
     clock_gettime(CLOCK_MONOTONIC, &time_space);
@@ -3139,7 +3139,7 @@ void reds_update_mm_timer(uint32_t mm_time)
     red_dispatcher_set_mm_time(mm_time);
 }
 
-void reds_enable_mm_timer()
+void reds_enable_mm_timer(void)
 {
     core->timer_start(reds->mm_timer, MM_TIMER_GRANULARITY_MS);
     if (!reds_main_channel_connected()) {
@@ -3148,7 +3148,7 @@ void reds_enable_mm_timer()
     main_channel_push_multi_media_time(reds->main_channel, reds_get_mm_time() - MM_TIME_DELTA);
 }
 
-void reds_desable_mm_timer()
+void reds_desable_mm_timer(void)
 {
     core->timer_cancel(reds->mm_timer);
 }
diff --git a/server/reds.h b/server/reds.h
index 485d9eb..2c0e692 100644
--- a/server/reds.h
+++ b/server/reds.h
@@ -118,10 +118,10 @@ ssize_t reds_stream_write(RedsStream *s, const void *buf, size_t nbyte);
 ssize_t reds_stream_writev(RedsStream *s, const struct iovec *iov, int iovcnt);
 void reds_stream_free(RedsStream *s);
 
-void reds_desable_mm_timer();
-void reds_enable_mm_timer();
+void reds_desable_mm_timer(void);
+void reds_enable_mm_timer(void);
 void reds_update_mm_timer(uint32_t mm_time);
-uint32_t reds_get_mm_time();
+uint32_t reds_get_mm_time(void);
 void reds_set_client_mouse_allowed(int is_client_mouse_allowed,
                                    int x_res, int y_res);
 void reds_register_channel(Channel *channel);
@@ -151,10 +151,10 @@ void reds_update_stat_value(uint32_t value);
 #endif
 
 // callbacks from main channel messages
-void reds_on_main_agent_start();
+void reds_on_main_agent_start(void);
 void reds_on_main_agent_data(void *message, size_t size);
-void reds_on_main_migrate_connected();
-void reds_on_main_migrate_connect_error();
+void reds_on_main_migrate_connected(void);
+void reds_on_main_migrate_connect_error(void);
 void reds_on_main_receive_migrate_data(MainMigrateData *data, uint8_t *end);
 void reds_on_main_mouse_mode_request(void *message, size_t size);
 
diff --git a/server/smartcard.c b/server/smartcard.c
index 941c632..892500b 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -507,7 +507,7 @@ static void smartcard_migrate(Channel *channel)
 {
 }
 
-void smartcard_channel_init()
+void smartcard_channel_init(void)
 {
     Channel *channel;
 
diff --git a/server/smartcard.h b/server/smartcard.h
index 790eb87..bb2f0b6 100644
--- a/server/smartcard.h
+++ b/server/smartcard.h
@@ -12,7 +12,7 @@
 int smartcard_device_connect(SpiceCharDeviceInstance *char_device);
 void smartcard_device_disconnect(SpiceCharDeviceInstance *char_device);
 
-void smartcard_channel_init();
+void smartcard_channel_init(void);
 
 #endif // __SMART_CARD_H__
 
diff --git a/server/snd_worker.c b/server/snd_worker.c
index 1a4840c..9ecd382 100644
--- a/server/snd_worker.c
+++ b/server/snd_worker.c
@@ -1271,7 +1271,7 @@ void snd_set_playback_compression(int on)
     }
 }
 
-int snd_get_playback_compression()
+int snd_get_playback_compression(void)
 {
     return (playback_compression == SPICE_AUDIO_DATA_MODE_RAW) ? FALSE : TRUE;
 }
diff --git a/server/snd_worker.h b/server/snd_worker.h
index 4d5a1b4..7659cb2 100644
--- a/server/snd_worker.h
+++ b/server/snd_worker.h
@@ -27,7 +27,7 @@ void snd_attach_record(SpiceRecordInstance *sin);
 void snd_detach_record(SpiceRecordInstance *sin);
 
 void snd_set_playback_compression(int on);
-int snd_get_playback_compression();
+int snd_get_playback_compression(void);
 
 #endif
 
commit fa6956fff50ced22c20bd7a4f06a8fa00a0cd28c
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Apr 20 10:06:16 2011 +0200

    server: remove extra arg in reds_on_main_agent_start call

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(RedChannel *channel, uint32_t size, uint16
         if (!main_chan) {
             return FALSE;
         }
-        reds_on_main_agent_start(main_chan);
+        reds_on_main_agent_start();
         break;
     case SPICE_MSGC_MAIN_AGENT_DATA: {
         reds_on_main_agent_data(message, size);
commit 04780d699685c227be9edd4a06f0c738f8d8022b
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 22:37:53 2011 +0200

    client: remove c++ wrappers
    
    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.

diff --git a/client/Makefile.am b/client/Makefile.am
index a5effed..bbea61f 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -19,8 +19,6 @@ generated_marshallers1.cpp: $(top_srcdir)/spice1.proto
 
 if SUPPORT_GL
 GL_SRCS =				\
-	gl_canvas.cpp			\
-	glc.cpp				\
 	red_gl_canvas.cpp		\
 	red_gl_canvas.h			\
 	red_pixmap_gl.h
@@ -42,12 +40,8 @@ RED_COMMON_SRCS =			\
 	audio_channels.h		\
 	audio_devices.h			\
 	cache.hpp			\
-	sw_canvas.cpp			\
-	pixman_utils.cpp		\
-	lines.cpp			\
 	canvas.cpp			\
 	canvas.h			\
-	canvas_utils.cpp		\
 	red_sw_canvas.cpp		\
 	red_sw_canvas.h			\
 	client_net_socket.cpp		\
@@ -59,7 +53,6 @@ RED_COMMON_SRCS =			\
 	marshallers.h			\
 	generated_demarshallers.cpp	\
 	generated_demarshallers1.cpp	\
-	marshaller.cpp			\
 	generated_marshallers.cpp	\
 	generated_marshallers1.cpp	\
 	controller.cpp			\
@@ -85,7 +78,6 @@ RED_COMMON_SRCS =			\
 	inputs_handler.h		\
 	jpeg_decoder.cpp		\
 	jpeg_decoder.h			\
-	lz.cpp				\
 	monitor.cpp			\
 	monitor.h			\
 	mem.cpp				\
@@ -99,7 +91,6 @@ RED_COMMON_SRCS =			\
 	playback_channel.cpp		\
 	process_loop.cpp		\
 	process_loop.h			\
-	quic.cpp			\
 	read_write_mutex.h		\
 	record_channel.cpp		\
 	red_channel.cpp			\
@@ -114,8 +105,6 @@ RED_COMMON_SRCS =			\
 	red_pixmap.h			\
 	red_types.h			\
 	red_window.h			\
-	region.cpp			\
-	rop3.cpp			\
 	screen.cpp			\
 	screen.h			\
 	screen_layer.cpp		\
@@ -134,7 +123,6 @@ RED_COMMON_SRCS =			\
 	$(NULL)
 
 GDI_FILES =				\
-	gdi_canvas.cpp			\
 	red_gdi_canvas.cpp		\
 	red_gdi_canvas.h		\
 	red_pixmap_gdi.h		\
diff --git a/client/canvas_utils.cpp b/client/canvas_utils.cpp
deleted file mode 100644
index 237c45c..0000000
--- a/client/canvas_utils.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "utils.h"
-
-
-#define CANVAS_ERROR(format, ...) THROW(format, ## __VA_ARGS__)
-
-#include "../common/canvas_utils.c"
-
diff --git a/client/gdi_canvas.cpp b/client/gdi_canvas.cpp
deleted file mode 100644
index 9a6e6f7..0000000
--- a/client/gdi_canvas.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "utils.h"
-
-#define CANVAS_ERROR(format, ...) THROW(format, ## __VA_ARGS__)
-
-#include "../common/gdi_canvas.c"
-
diff --git a/client/gl_canvas.cpp b/client/gl_canvas.cpp
deleted file mode 100644
index 45fa32e..0000000
--- a/client/gl_canvas.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "../common/gl_canvas.c"
-
diff --git a/client/glc.cpp b/client/glc.cpp
deleted file mode 100644
index a040c7e..0000000
--- a/client/glc.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "../common/glc.c"
-
diff --git a/client/lines.cpp b/client/lines.cpp
deleted file mode 100644
index 40769c1..0000000
--- a/client/lines.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "utils.h"
-
-
-#define CANVAS_ERROR(format, ...) THROW(format, ## __VA_ARGS__)
-
-#include "../common/lines.c"
diff --git a/client/lz.cpp b/client/lz.cpp
deleted file mode 100644
index 69f5af4..0000000
--- a/client/lz.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "../common/lz.c"
-
diff --git a/client/marshaller.cpp b/client/marshaller.cpp
deleted file mode 100644
index 14bd096..0000000
--- a/client/marshaller.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "utils.h"
-
-
-#define CANVAS_ERROR(format, ...) THROW(format, ## __VA_ARGS__)
-
-#include "../common/marshaller.c"
diff --git a/client/mem.cpp b/client/mem.cpp
deleted file mode 100644
index 9e8b7d9..0000000
--- a/client/mem.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "utils.h"
-
-#define MALLOC_ERROR(format, ...) THROW(format, ## __VA_ARGS__)
-
-#include "../common/mem.c"
-
diff --git a/client/pixman_utils.cpp b/client/pixman_utils.cpp
deleted file mode 100644
index 83acf87..0000000
--- a/client/pixman_utils.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "utils.h"
-
-
-#define CANVAS_ERROR(format, ...) THROW(format, ## __VA_ARGS__)
-
-#include "../common/pixman_utils.c"
-
diff --git a/client/quic.cpp b/client/quic.cpp
deleted file mode 100644
index 6ecee35..0000000
--- a/client/quic.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "../common/quic.c"
-
diff --git a/client/region.cpp b/client/region.cpp
deleted file mode 100644
index 415e843..0000000
--- a/client/region.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "../common/region.c"
-
diff --git a/client/rop3.cpp b/client/rop3.cpp
deleted file mode 100644
index e48bfc3..0000000
--- a/client/rop3.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "../common/rop3.c"
-
diff --git a/client/sw_canvas.cpp b/client/sw_canvas.cpp
deleted file mode 100644
index 33ec272..0000000
--- a/client/sw_canvas.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-   Copyright (C) 2009 Red Hat, Inc.
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "common.h"
-#include "utils.h"
-
-#define CANVAS_ERROR(format, ...) THROW(format, ## __VA_ARGS__)
-
-#include "../common/sw_canvas.c"
-
diff --git a/client/windows/Makefile.am b/client/windows/Makefile.am
index 6d69511..eae0bbe 100644
--- a/client/windows/Makefile.am
+++ b/client/windows/Makefile.am
@@ -34,15 +34,15 @@ RED_COMMON_SRCS =					\
 	$(CLIENT_DIR)/demarshallers.h			\
 	$(CLIENT_DIR)/generated_demarshallers.cpp	\
 	$(CLIENT_DIR)/generated_demarshallers1.cpp	\
-	$(CLIENT_DIR)/marshaller.cpp			\
+	$(COMMON_DIR)/marshaller.c			\
 	$(CLIENT_DIR)/marshallers.h			\
 	$(CLIENT_DIR)/generated_marshallers.cpp		\
 	$(CLIENT_DIR)/generated_marshallers1.cpp	\
-	$(CLIENT_DIR)/sw_canvas.cpp			\
+	$(COMMON_DIR)/sw_canvas.c			\
 	$(CLIENT_DIR)/canvas.cpp			\
-	$(CLIENT_DIR)/gdi_canvas.cpp			\
+	$(COMMON_DIR)/gdi_canvas.c			\
 	$(CLIENT_DIR)/canvas.h				\
-	$(CLIENT_DIR)/canvas_utils.cpp			\
+	$(COMMON_DIR)/canvas_utils.c			\
 	$(CLIENT_DIR)/red_sw_canvas.cpp			\
 	$(CLIENT_DIR)/red_sw_canvas.h			\
 	$(CLIENT_DIR)/cmd_line_parser.cpp		\
@@ -72,21 +72,21 @@ RED_COMMON_SRCS =					\
 	$(CLIENT_DIR)/inputs_handler.h			\
 	$(CLIENT_DIR)/jpeg_decoder.cpp			\
 	$(CLIENT_DIR)/jpeg_decoder.h			\
-	$(CLIENT_DIR)/lz.cpp				\
-	$(CLIENT_DIR)/lines.cpp				\
+	$(COMMON_DIR)/lz.c				\
+	$(COMMON_DIR)/lines.c				\
 	$(CLIENT_DIR)/monitor.cpp			\
 	$(CLIENT_DIR)/monitor.h				\
-	$(CLIENT_DIR)/mem.cpp				\
+	$(COMMON_DIR)/mem.c				\
 	$(CLIENT_DIR)/menu.cpp				\
 	$(CLIENT_DIR)/menu.h				\
 	$(CLIENT_DIR)/mjpeg_decoder.h			\
 	$(CLIENT_DIR)/mjpeg_decoder.cpp			\
 	$(CLIENT_DIR)/pixels_source.h			\
-	$(CLIENT_DIR)/pixman_utils.cpp			\
+	$(COMMON_DIR)/pixman_utils.c			\
 	$(CLIENT_DIR)/platform.h			\
 	$(CLIENT_DIR)/playback_channel.cpp		\
 	$(CLIENT_DIR)/process_loop.cpp			\
-	$(CLIENT_DIR)/quic.cpp				\
+	$(COMMON_DIR)/quic.c				\
 	$(CLIENT_DIR)/record_channel.cpp		\
 	$(CLIENT_DIR)/red_channel.cpp			\
 	$(CLIENT_DIR)/red_channel.h			\
@@ -101,8 +101,8 @@ RED_COMMON_SRCS =					\
 	$(CLIENT_DIR)/red_pixmap.h			\
 	$(CLIENT_DIR)/red_types.h			\
 	$(CLIENT_DIR)/red_window.h			\
-	$(CLIENT_DIR)/region.cpp			\
-	$(CLIENT_DIR)/rop3.cpp				\
+	$(COMMON_DIR)/region.c				\
+	$(COMMON_DIR)/rop3.c				\
 	$(CLIENT_DIR)/screen.cpp			\
 	$(CLIENT_DIR)/screen.h				\
 	$(CLIENT_DIR)/screen_layer.cpp			\
@@ -137,8 +137,8 @@ endif
 
 if SUPPORT_GL
 RED_OGL_SRCS =						\
-	$(CLIENT_DIR)/gl_canvas.cpp			\
-	$(CLIENT_DIR)/glc.cpp				\
+	$(COMMON_DIR)/gl_canvas.c			\
+	$(COMMON_DIR)/glc.c				\
 	$(CLIENT_DIR)/red_gl_canvas.cpp			\
 	$(CLIENT_DIR)/red_gl_canvas.h			\
 	$(CLIENT_DIR)/red_pixmap_gl.h
diff --git a/client/windows/redc.vcproj b/client/windows/redc.vcproj
index b1b7341..0b1ecbf 100644
--- a/client/windows/redc.vcproj
+++ b/client/windows/redc.vcproj
@@ -377,7 +377,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\canvas_utils.cpp"
+				RelativePath="..\..\common\canvas_utils.c"
 				>
 			</File>
 			<File
@@ -413,7 +413,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\gdi_canvas.cpp"
+				RelativePath="..\..\common\gdi_canvas.c"
 				>
 			</File>
 			<File
@@ -457,11 +457,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\lines.cpp"
+				RelativePath="..\..\common\lines.c"
 				>
 			</File>
 			<File
-				RelativePath="..\lz.cpp"
+				RelativePath="..\..\common\lz.c"
 				>
 			</File>
 			<File
@@ -469,7 +469,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\mem.cpp"
+				RelativePath="..\..\common\mem.c"
 				>
 			</File>
 			<File
@@ -533,7 +533,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\pixman_utils.cpp"
+				RelativePath="..\..\common\pixman_utils.c"
 				>
 			</File>
 			<File
@@ -557,7 +557,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\quic.cpp"
+				RelativePath="..\..\common\quic.c"
 				>
 			</File>
 			<File
@@ -609,7 +609,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\region.cpp"
+				RelativePath="..\..\common\region.c"
 				>
 			</File>
 			<File
@@ -617,7 +617,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\rop3.cpp"
+				RelativePath="..\..\common\rop3.c"
 				>
 			</File>
 			<File
@@ -637,7 +637,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\sw_canvas.cpp"
+				RelativePath="..\..\common\sw_canvas.c"
 				>
 			</File>
 			<File
@@ -767,7 +767,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\marshaller.cpp"
+				RelativePath="..\..\common\marshaller.c"
 				>
 			</File>
 			<File
diff --git a/client/x11/Makefile.am b/client/x11/Makefile.am
index 7504833..54d05ce 100644
--- a/client/x11/Makefile.am
+++ b/client/x11/Makefile.am
@@ -41,14 +41,14 @@ RED_COMMON_SRCS =					\
 	$(CLIENT_DIR)/demarshallers.h			\
 	$(CLIENT_DIR)/generated_demarshallers.cpp	\
 	$(CLIENT_DIR)/generated_demarshallers1.cpp	\
-	$(CLIENT_DIR)/marshaller.cpp			\
+	$(COMMON_DIR)/marshaller.c			\
 	$(CLIENT_DIR)/marshallers.h			\
 	$(CLIENT_DIR)/generated_marshallers.cpp		\
 	$(CLIENT_DIR)/generated_marshallers1.cpp	\
-	$(CLIENT_DIR)/sw_canvas.cpp			\
+	$(COMMON_DIR)/sw_canvas.c			\
 	$(CLIENT_DIR)/canvas.cpp			\
 	$(CLIENT_DIR)/canvas.h				\
-	$(CLIENT_DIR)/canvas_utils.cpp			\
+	$(COMMON_DIR)/canvas_utils.c			\
 	$(CLIENT_DIR)/red_sw_canvas.cpp			\
 	$(CLIENT_DIR)/red_sw_canvas.h			\
 	$(CLIENT_DIR)/cmd_line_parser.cpp		\
@@ -78,21 +78,21 @@ RED_COMMON_SRCS =					\
 	$(CLIENT_DIR)/inputs_handler.h			\
 	$(CLIENT_DIR)/jpeg_decoder.cpp			\
 	$(CLIENT_DIR)/jpeg_decoder.h			\
-	$(CLIENT_DIR)/lz.cpp				\
-	$(CLIENT_DIR)/lines.cpp				\
+	$(COMMON_DIR)/lz.c				\
+	$(COMMON_DIR)/lines.c				\
 	$(CLIENT_DIR)/monitor.cpp			\
 	$(CLIENT_DIR)/monitor.h				\
-	$(CLIENT_DIR)/mem.cpp				\
+	$(COMMON_DIR)/mem.c				\
 	$(CLIENT_DIR)/menu.cpp				\
 	$(CLIENT_DIR)/menu.h				\
 	$(CLIENT_DIR)/mjpeg_decoder.h			\
 	$(CLIENT_DIR)/mjpeg_decoder.cpp			\
 	$(CLIENT_DIR)/pixels_source.h			\
-	$(CLIENT_DIR)/pixman_utils.cpp			\
+	$(COMMON_DIR)/pixman_utils.c			\
 	$(CLIENT_DIR)/platform.h			\
 	$(CLIENT_DIR)/playback_channel.cpp		\
 	$(CLIENT_DIR)/process_loop.cpp			\
-	$(CLIENT_DIR)/quic.cpp				\
+	$(COMMON_DIR)/quic.c				\
 	$(CLIENT_DIR)/record_channel.cpp		\
 	$(CLIENT_DIR)/red_channel.cpp			\
 	$(CLIENT_DIR)/red_channel.h			\
@@ -106,8 +106,8 @@ RED_COMMON_SRCS =					\
 	$(CLIENT_DIR)/red_pixmap.h			\
 	$(CLIENT_DIR)/red_types.h			\
 	$(CLIENT_DIR)/red_window.h			\
-	$(CLIENT_DIR)/region.cpp			\
-	$(CLIENT_DIR)/rop3.cpp				\
+	$(COMMON_DIR)/region.c				\
+	$(COMMON_DIR)/rop3.c				\
 	$(CLIENT_DIR)/screen.cpp			\
 	$(CLIENT_DIR)/screen.h				\
 	$(CLIENT_DIR)/screen_layer.cpp			\
@@ -150,8 +150,8 @@ endif
 
 if SUPPORT_GL
 RED_OGL_SRCS =						\
-	$(CLIENT_DIR)/gl_canvas.cpp			\
-	$(CLIENT_DIR)/glc.cpp				\
+	$(COMMON_DIR)/gl_canvas.c			\
+	$(COMMON_DIR)/glc.c				\
 	$(CLIENT_DIR)/red_gl_canvas.cpp			\
 	$(CLIENT_DIR)/red_gl_canvas.h			\
 	$(CLIENT_DIR)/red_pixmap_gl.h			\
commit 9605351863d395e9aa1aa7d3080124dcfdd9d3e2
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 23:37:12 2011 +0200

    common: add missing header guards to gl_canvas.h

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__GL_CANVAS
+#define _H__GL_CANVAS
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -42,3 +45,5 @@ void gl_canvas_init();
 #ifdef __cplusplus
 }
 #endif
+
+#endif
commit 60373e01fa9273751b037998329645072e21e837
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 22:58:36 2011 +0200

    common: add extern "C" guards to headers
    
    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.

diff --git a/common/canvas_base.h b/common/canvas_base.h
index 2166dcf..ff0f972 100644
--- a/common/canvas_base.h
+++ b/common/canvas_base.h
@@ -25,6 +25,10 @@
 #include "region.h"
 #include "draw.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef void (*spice_destroy_fn_t)(void *data);
 
 typedef struct _SpiceImageCache SpiceImageCache;
@@ -310,4 +314,8 @@ struct _SpiceCanvas {
   SpiceCanvasOps *ops;
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/common/canvas_utils.h b/common/canvas_utils.h
index b87b816..ffed927 100644
--- a/common/canvas_utils.h
+++ b/common/canvas_utils.h
@@ -24,6 +24,10 @@
 #include "pixman_utils.h"
 #include "lz.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct PixmanData {
 #ifdef WIN32
     HBITMAP bitmap;
@@ -65,4 +69,8 @@ typedef struct LzDecodeUsrData {
 pixman_image_t *alloc_lz_image_surface(LzDecodeUsrData *canvas_data,
                                        pixman_format_code_t pixman_format, int width,
                                        int height, int gross_pixels, int top_down);
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/common/draw.h b/common/draw.h
index cb15672..793169f 100644
--- a/common/draw.h
+++ b/common/draw.h
@@ -35,6 +35,10 @@
 #include <spice/enums.h>
 #include "mem.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define SPICE_GET_ADDRESS(addr) ((void *)(unsigned long)(addr))
 #define SPICE_SET_ADDRESS(addr, val) ((addr) = (unsigned long)(val))
 
@@ -270,4 +274,8 @@ typedef struct SpiceCursorHeader {
     uint16_t hot_spot_y;
 } SpiceCursorHeader;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _H_SPICE_DRAW */
diff --git a/common/gdi_canvas.h b/common/gdi_canvas.h
index b3d4b15..5cdffb3 100644
--- a/common/gdi_canvas.h
+++ b/common/gdi_canvas.h
@@ -21,6 +21,10 @@
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "pixman_utils.h"
 #include "canvas_base.h"
 #include "region.h"
@@ -36,4 +40,8 @@ SpiceCanvas *gdi_canvas_create(int width, int height,
 
 void gdi_canvas_init();
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/common/gl_canvas.h b/common/gl_canvas.h
index d7125e6..ff3fba0 100644
--- a/common/gl_canvas.h
+++ b/common/gl_canvas.h
@@ -20,6 +20,10 @@
 #include "canvas_base.h"
 #include "region.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 SpiceCanvas *gl_canvas_create(int width, int height, uint32_t format
 #ifdef SW_CANVAS_CACHE
                            , SpiceImageCache *bits_cache
@@ -35,3 +39,6 @@ SpiceCanvas *gl_canvas_create(int width, int height, uint32_t format
 void gl_canvas_set_textures_lost(SpiceCanvas *canvas, int textures_lost);
 void gl_canvas_init();
 
+#ifdef __cplusplus
+}
+#endif
diff --git a/common/gl_utils.h b/common/gl_utils.h
index eecff26..175f131 100644
--- a/common/gl_utils.h
+++ b/common/gl_utils.h
@@ -21,6 +21,10 @@
 #ifndef GL_UTILS_H
 #define GL_UTILS_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef RED_DEBUG
 #define GLC_ERROR_TEST_FLUSH {                                        \
     GLenum gl_err;  glFlush();                                        \
@@ -102,4 +106,8 @@ static inline int gl_get_to_power_two(unsigned int val)
     return 1 << find_msb(val);
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/common/glc.h b/common/glc.h
index a6b8579..d77f003 100644
--- a/common/glc.h
+++ b/common/glc.h
@@ -23,6 +23,10 @@
 
 #include <stdint.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef void * GLCCtx;
 typedef void * GLCPattern;
 typedef void * GLCPath;
@@ -156,4 +160,8 @@ void glc_clear(GLCCtx glc);
 GLCCtx glc_create(int width, int height);
 void glc_destroy(GLCCtx glc, int textures_lost);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/common/lines.h b/common/lines.h
index 1d092f0..73eef9b 100644
--- a/common/lines.h
+++ b/common/lines.h
@@ -54,6 +54,10 @@ SOFTWARE.
 #include <string.h>
 #include "draw.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct lineGC lineGC;
 
 typedef struct {
@@ -127,4 +131,8 @@ extern int spice_canvas_clip_spans(pixman_region32_t *clip_region,
                                    int *new_widths,
                                    int sorted);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LINES_H */
diff --git a/common/lz.h b/common/lz.h
index 993609f..472e34d 100644
--- a/common/lz.h
+++ b/common/lz.h
@@ -10,6 +10,10 @@
 #include "lz_config.h"
 #include "draw.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef void *LzContext;
 
 typedef struct LzUsrContext LzUsrContext;
@@ -71,5 +75,8 @@ LzContext *lz_create(LzUsrContext *usr);
 
 void lz_destroy(LzContext *lz);
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif  // __LZ_H
diff --git a/common/lz_common.h b/common/lz_common.h
index 34276af..4156cff 100644
--- a/common/lz_common.h
+++ b/common/lz_common.h
@@ -23,6 +23,10 @@
 #ifndef _LZ_COMMON_H
 #define _LZ_COMMON_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 //#define DEBUG
 
 /* change the max window size will require change in the encoding format*/
@@ -58,5 +62,8 @@ static const int RGB_BYTES_PER_PIXEL[] = {0, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4};
 #define LZ_VERSION_MINOR 1U
 #define LZ_VERSION ((LZ_VERSION_MAJOR << 16) | (LZ_VERSION_MINOR & 0xffff))
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif  // _LZ_COMMON_H
diff --git a/common/marshaller.h b/common/marshaller.h
index 4d77140..0a61fef 100644
--- a/common/marshaller.h
+++ b/common/marshaller.h
@@ -25,6 +25,10 @@
 #include <sys/uio.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct SpiceMarshaller SpiceMarshaller;
 typedef void (*spice_marshaller_item_free_func)(uint8_t *data, void *opaque);
 
@@ -63,4 +67,8 @@ void *spice_marshaller_add_int8(SpiceMarshaller *m, int8_t v);
 
 void  spice_marshaller_set_uint32(SpiceMarshaller *m, void *ref, uint32_t v);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/common/mem.h b/common/mem.h
index 797bba0..8ba6586 100644
--- a/common/mem.h
+++ b/common/mem.h
@@ -22,6 +22,10 @@
 #include <stdlib.h>
 #include <spice/macros.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct SpiceChunk {
     uint8_t *data;
     uint32_t len;
@@ -120,4 +124,7 @@ void spice_buffer_append(SpiceBuffer *buffer, const void *data, size_t len);
 size_t spice_buffer_copy(SpiceBuffer *buffer, void *dest, size_t len);
 size_t spice_buffer_remove(SpiceBuffer *buffer, size_t len);
 
+#ifdef __cplusplus
+}
+#endif
 #endif
diff --git a/common/messages.h b/common/messages.h
index 1a60a9f..6fcd8be 100644
--- a/common/messages.h
+++ b/common/messages.h
@@ -34,6 +34,10 @@
 #include <spice/protocol.h>
 #include "draw.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct SpiceMsgData {
     uint32_t data_size;
     uint8_t data[0];
@@ -494,6 +498,8 @@ typedef struct SpiceMsgcTunnelSocketTokens {
     uint32_t num_tokens;
 } SpiceMsgcTunnelSocketTokens;
 
-#endif /* _H_SPICE_PROTOCOL */
-
+#ifdef __cplusplus
+}
+#endif
 
+#endif /* _H_SPICE_PROTOCOL */
diff --git a/common/mutex.h b/common/mutex.h
index a2d35de..6789b8f 100644
--- a/common/mutex.h
+++ b/common/mutex.h
@@ -18,6 +18,11 @@
 
 #ifndef _H_MUTEX
 #define _H_MUTEX
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef _WIN32
 #include <windows.h>
 typedef CRITICAL_SECTION mutex_t;
@@ -32,4 +37,8 @@ typedef pthread_mutex_t mutex_t;
 #define MUTEX_UNLOCK(mutex) pthread_mutex_unlock(&mutex)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif // _H_MUTEX
diff --git a/common/ogl_ctx.h b/common/ogl_ctx.h
index 3abe6d7..ae2ce7e 100644
--- a/common/ogl_ctx.h
+++ b/common/ogl_ctx.h
@@ -19,6 +19,10 @@
 #ifndef _H_GLCTX
 #define _H_GLCTX
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct OGLCtx OGLCtx;
 
 const char *oglctx_type_str(OGLCtx *ctx);
@@ -27,5 +31,9 @@ OGLCtx *pbuf_create(int width, int heigth);
 OGLCtx *pixmap_create(int width, int heigth);
 void oglctx_destroy(OGLCtx *ctx);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
diff --git a/common/pixman_utils.h b/common/pixman_utils.h
index e15b682..61eaddd 100644
--- a/common/pixman_utils.h
+++ b/common/pixman_utils.h
@@ -26,6 +26,10 @@
 
 #include "draw.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* This lists all possible 2 argument binary raster ops.
  * This enum has the same values as the X11 GXcopy type
  * and same as the GL constants (GL_AND etc) if you
@@ -125,4 +129,8 @@ void spice_pixman_copy_rect(pixman_image_t *image,
                             int w, int h,
                             int dest_x, int dest_y);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _H__PIXMAN_UTILS */
diff --git a/common/quic.h b/common/quic.h
index f4ef854..d031777 100644
--- a/common/quic.h
+++ b/common/quic.h
@@ -21,6 +21,10 @@
 
 #include "quic_config.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef enum {
     QUIC_IMAGE_TYPE_INVALID,
     QUIC_IMAGE_TYPE_GRAY,
@@ -61,5 +65,9 @@ void quic_destroy(QuicContext *quic);
 
 void quic_init();
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
diff --git a/common/quic_config.h b/common/quic_config.h
index 1273dbc..da5e51c 100644
--- a/common/quic_config.h
+++ b/common/quic_config.h
@@ -21,6 +21,10 @@
 
 #include <spice/types.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __GNUC__
 
 #include <string.h>
@@ -47,5 +51,9 @@
 
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
diff --git a/common/rect.h b/common/rect.h
index cdd4335..6d7c446 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -22,6 +22,10 @@
 #include "draw.h"
 #include <spice/macros.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 static inline void rect_sect(SpiceRect* r, const SpiceRect* bounds)
 {
     r->left = MAX(r->left, bounds->left);
@@ -73,6 +77,10 @@ static inline int rect_is_same_size(const SpiceRect *r1, const SpiceRect *r2)
 }
 
 #ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
 
 static inline void rect_sect(SpiceRect& r, const SpiceRect& bounds)
 {
diff --git a/common/region.h b/common/region.h
index bad7494..16ec6eb 100644
--- a/common/region.h
+++ b/common/region.h
@@ -23,6 +23,10 @@
 #include "draw.h"
 #include <pixman_utils.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef pixman_region32_t QRegion;
 
 #define REGION_TEST_LEFT_EXCLUSIVE (1 << 0)
@@ -59,5 +63,9 @@ void region_offset(QRegion *rgn, int32_t dx, int32_t dy);
 
 void region_dump(const QRegion *rgn, const char *prefix);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
diff --git a/common/ring.h b/common/ring.h
index a013a2f..ff4ef6d 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -21,6 +21,10 @@
 
 #include "spice_common.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct Ring RingItem;
 typedef struct Ring {
     RingItem *prev;
@@ -150,5 +154,9 @@ static inline RingItem *ring_prev(Ring *ring, RingItem *pos)
             (var) = ring_prev(ring, var))
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
diff --git a/common/rop3.h b/common/rop3.h
index 0211130..549b02c 100644
--- a/common/rop3.h
+++ b/common/rop3.h
@@ -24,11 +24,20 @@
 #include "draw.h"
 #include "pixman_utils.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void do_rop3_with_pattern(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos,
                           pixman_image_t *p, SpicePoint *pat_pos);
 void do_rop3_with_color(uint8_t rop3, pixman_image_t *d, pixman_image_t *s, SpicePoint *src_pos,
                         uint32_t rgb);
 
 void rop3_init();
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
diff --git a/common/sw_canvas.h b/common/sw_canvas.h
index 99deac8..42f2573 100644
--- a/common/sw_canvas.h
+++ b/common/sw_canvas.h
@@ -26,6 +26,10 @@
 #include "canvas_base.h"
 #include "region.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 SpiceCanvas *canvas_create(int width, int height, uint32_t format
 #ifdef SW_CANVAS_CACHE
                            , SpiceImageCache *bits_cache
@@ -55,4 +59,8 @@ SpiceCanvas *canvas_create_for_data(int width, int height, uint32_t format, uint
 
 void sw_canvas_init();
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
commit 06c83ca99458f611d871936c9d1bf433703a8f05
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 17:21:48 2011 +0200

    client: make building client optional

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 server python_modules
+
+if SUPPORT_CLIENT
+SUBDIRS += client
+endif
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = spice-server.pc
diff --git a/configure.ac b/configure.ac
index c5f3534..a972470 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,6 +123,12 @@ if test "x$enable_smartcard" = "xyes"; then
    AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying])
 fi
 
+AC_ARG_ENABLE(client,
+[  --enable-client         Enable spice client],,
+[enable_client="yes"])
+AS_IF([test x"$enable_client" != "xno"], [enable_client="yes"])
+AM_CONDITIONAL(SUPPORT_CLIENT, test "x$enable_client" = "xyes")
+
 dnl =========================================================================
 dnl Check deps
 
@@ -517,6 +523,8 @@ echo "
         c compiler:               ${CC}
         c++ compiler:             ${CXX}
 
+        Build Spice client:       ${enable_client}
+
         Have XRANDR 1.2:          ${have_xrandr12}
 
         Support tunneling:        ${enable_tunnel}
commit afffe11e66f8848ad88952e509aca936dc272d75
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Apr 20 10:06:36 2011 +0200

    configure.ac: replace tab with spaces
    
    This makes the "C++ Compiler:     ...." status output nicely
    aligned with the other messages.

diff --git a/configure.ac b/configure.ac
index eff0e07..c5f3534 100644
--- a/configure.ac
+++ b/configure.ac
@@ -515,7 +515,7 @@ echo "
 
         prefix:                   ${prefix}
         c compiler:               ${CC}
-        c++ compiler:	          ${CXX}
+        c++ compiler:             ${CXX}
 
         Have XRANDR 1.2:          ${have_xrandr12}
 
commit ae0a9fc1d30665271e527c7cec84a006474e4b0a
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 18:49:56 2011 +0200

    configure.ac: remove unused dynamic linkage flag
    
    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.

diff --git a/configure.ac b/configure.ac
index 78a1f46..eff0e07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -272,8 +272,7 @@ AC_ARG_ENABLE(static-linkage,
 [  --enable-static-linkage will generate spice client binary with static linkage to external libraries ],,
 [enable_static_linkage="no"])
 AS_IF([test x"$enable_static_linkage" != "xno"],
-[SPICEC_STATIC_LINKAGE_BSTATIC=["-Wl,-Bstatic"]],
-[SPICEC_STATIC_LINKAGE_BDYNAMIC=["-Wl,-Bdynamic"]])
+[SPICEC_STATIC_LINKAGE_BSTATIC=["-Wl,-Bstatic"]])
 
 
 AS_IF([test "$_cflags_is_set" = "yes"], [], [
@@ -489,7 +488,6 @@ AC_SUBST(SPICE_NONPKGCONFIG_CFLAGS)
 AC_SUBST(SPICE_NONPKGCONFIG_LIBS)
 
 AC_SUBST([SPICEC_STATIC_LINKAGE_BSTATIC])
-AC_SUBST([SPICEC_STATIC_LINKAGE_BDYNAMIC])
 
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
commit 36292b07408b72c7b8afd4758e19cd1f9471cd2e
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 18:42:32 2011 +0200

    configure.ac: fix use of AC_ARG_ENABLE
    
    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 2 issues.

diff --git a/configure.ac b/configure.ac
index 0a4e734..78a1f46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,33 +93,33 @@ AM_CONDITIONAL(OS_LINUX, test "$os_linux" = "yes")
 
 dnl =========================================================================
 dnl Chek optional features
-have_tunnel=no
 AC_ARG_ENABLE(tunnel,
-[  --enable-tunnel         Enable network redirection],
-[  have_tunnel=yes])
-AM_CONDITIONAL(SUPPORT_TUNNEL, test "x$have_tunnel" = "xyes")
-if test "x$have_tunnel" = "xyes"; then
+[  --enable-tunnel         Enable network redirection],,
+[enable_tunnel="no"])
+AS_IF([test x"$enable_tunnel" != "xno"], [enable_tunnel="yes"])
+AM_CONDITIONAL(SUPPORT_TUNNEL, test "x$enable_tunnel" != "xno")
+if test "x$enable_tunnel" != "xno"; then
    AC_DEFINE(USE_TUNNEL, [1], [Define if supporting tunnel proxying])
 fi
 
-use_gui=no
 AC_ARG_ENABLE(gui,
-[  --enable-gui         Enable start dialog with CEGUI],
-[  use_gui=yes])
-AM_CONDITIONAL(SUPPORT_GUI, test "x$use_gui" = "xyes")
+[  --enable-gui         Enable start dialog with CEGUI],,
+[enable_gui="no"])
+AS_IF([test x"$enable_gui" != "xno"], [enable_gui="yes"])
+AM_CONDITIONAL(SUPPORT_GUI, test "x$enable_gui" != "xno")
 
-have_opengl=no
 AC_ARG_ENABLE(opengl,
-[  --enable-opengl         Enable opengl requirement / support (not recommended)],
-[  have_opengl=yes])
-AM_CONDITIONAL(SUPPORT_GL, test "x$have_opengl" = "xyes")
+[  --enable-opengl         Enable opengl requirement / support (not recommended)],,
+[enable_opengl="no"])
+AS_IF([test x"$enable_opengl" != "xno"], [enable_opengl="yes"])
+AM_CONDITIONAL(SUPPORT_GL, test "x$enable_opengl" = "xyes")
 
-have_smartcard=no
 AC_ARG_ENABLE(smartcard,
-[  --enable-smartcard         Enable network redirection],
-[  have_smartcard=yes])
-AM_CONDITIONAL(SUPPORT_SMARTCARD, test "x$have_smartcard" = "xyes")
-if test "x$have_smartcard" = "xyes"; then
+[  --enable-smartcard         Enable network redirection],,
+[enable_smartcard="no"])
+AS_IF([test x"$enable_smartcard" != "xno"], [enable_smartcard="yes"])
+AM_CONDITIONAL(SUPPORT_SMARTCARD, test "x$enable_smartcard" != "xno")
+if test "x$enable_smartcard" = "xyes"; then
    AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying])
 fi
 
@@ -166,7 +166,7 @@ AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield functi
 
 SPICE_REQUIRES=""
 
-if test "x$use_gui" = "xyes"; then
+if test "x$enable_gui" = "xyes"; then
     PKG_CHECK_MODULES(CEGUI06, CEGUI-0.6 >= 0.6.0 CEGUI-0.6 < 0.7.0,
     [
         AC_SUBST(CEGUI06_CFLAGS)
@@ -181,7 +181,7 @@ if test "x$use_gui" = "xyes"; then
     ])
 fi
 
-if test "x$have_tunnel" = "xyes"; then
+if test "x$enable_tunnel" = "xyes"; then
 	PKG_CHECK_MODULES(SLIRP, slirp)
 	AC_SUBST(SLIRP_CFLAGS)
 	AC_SUBST(SLIRP_LIBS)
@@ -189,7 +189,7 @@ if test "x$have_tunnel" = "xyes"; then
 	AC_DEFINE([HAVE_SLIRP], [], [Define if we have slirp])
 fi
 
-if test "x$have_smartcard" = "xyes"; then
+if test "x$enable_smartcard" = "xyes"; then
     PKG_CHECK_MODULES(CAC_CARD, libcacard >= 0.1.2)
     SMARTCARD_LIBS="$CAC_CARD_LIBS"
     SMARTCARD_CFLAGS="$CAC_CARD_CFLAGS"
@@ -227,12 +227,12 @@ SPICE_REQUIRES+=" openssl"
 # AC_SUBST(GL_LIBS)
 # SPICE_REQUIRES+=" gl glu"
 
-if test "x$have_opengl" = "xyes"; then
-   AC_CHECK_LIB(GL, glBlendFunc, GL_LIBS="$GL_LIBS -lGL", have_opengl=no)
-   AC_CHECK_LIB(GLU, gluSphere, GL_LIBS="$GL_LIBS -lGLU", have_opengl=no)
+if test "x$enable_opengl" = "xyes"; then
+   AC_CHECK_LIB(GL, glBlendFunc, GL_LIBS="$GL_LIBS -lGL", enable_opengl=no)
+   AC_CHECK_LIB(GLU, gluSphere, GL_LIBS="$GL_LIBS -lGLU", enable_opengl=no)
    GL_CFLAGS="-DGL_GLEXT_PROTOTYPES -DUSE_OGL"
 
-   if test "x$have_opengl" = "xno"; then
+   if test "x$enable_opengl" = "xno"; then
       AC_MSG_ERROR([GL libraries not available])
    fi
 fi
@@ -268,10 +268,12 @@ fi
 
 # Add parameter for (partial) static linkage of spice client.
 # this is used to achive single binary package for all (?) distros.
-AC_ARG_ENABLE(static-linkage, 
-	[  --enable-static-linkage will generate spice client binary with static linkage to external libraries ],
-	[SPICEC_STATIC_LINKAGE_BSTATIC=["-Wl,-Bstatic"];
-	SPICEC_STATIC_LINKAGE_BDYNAMIC=["-Wl,-Bdynamic"]])
+AC_ARG_ENABLE(static-linkage,
+[  --enable-static-linkage will generate spice client binary with static linkage to external libraries ],,
+[enable_static_linkage="no"])
+AS_IF([test x"$enable_static_linkage" != "xno"],
+[SPICEC_STATIC_LINKAGE_BSTATIC=["-Wl,-Bstatic"]],
+[SPICEC_STATIC_LINKAGE_BDYNAMIC=["-Wl,-Bdynamic"]])
 
 
 AS_IF([test "$_cflags_is_set" = "yes"], [], [
@@ -519,15 +521,15 @@ echo "
 
         Have XRANDR 1.2:          ${have_xrandr12}
 
-        Support tunneling:        ${have_tunnel}
+        Support tunneling:        ${enable_tunnel}
 
         Red target:               ${red_target}
 
-        OpenGL:                   ${have_opengl}
+        OpenGL:                   ${enable_opengl}
 
-        GUI:                      ${use_gui}
+        GUI:                      ${enable_gui}
 
-        Smartcard:                ${have_smartcard}
+        Smartcard:                ${enable_smartcard}
 
         SASL support:             ${enable_sasl}
 "
commit 8a3f1e8e7a2e6cb1aa560f6f03c44a1d951af139
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 17:27:02 2011 +0200

    configure.ac: fix make dist

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 =						\
 	$(CLIENT_DIR)/glc.cpp				\
 	$(CLIENT_DIR)/red_gl_canvas.cpp			\
 	$(CLIENT_DIR)/red_gl_canvas.h			\
-	$(CLIENT_DIR)/red_pixmap_gl.h			\
-	red_pixmap_gl.cpp
+	$(CLIENT_DIR)/red_pixmap_gl.h
 else
 RED_OGL_SRCS =
 endif
commit 7b0de32423026e2e8238c66a2ab0e19545d1710b
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Tue Apr 19 17:27:25 2011 +0200

    server: use is_primary_surface
    
    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

diff --git a/server/red_worker.c b/server/red_worker.c
index 83f1798..49dffb4 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1368,7 +1368,7 @@ static inline void red_destroy_surface(RedWorker *worker, uint32_t surface_id)
 
     if (!--surface->refs) {
         // only primary surface streams are supported
-        if (surface_id == 0) {
+        if (is_primary_surface(worker, surface_id)) {
             red_reset_stream_trace(worker);
         }
         ASSERT(surface->context.canvas);
@@ -2284,8 +2284,7 @@ static void red_streams_update_clip(RedWorker *worker, Drawable *drawable)
         return;
     }
 
-    // only primary surface streams are supported
-    if (drawable->surface_id != 0) {
+    if (!is_primary_surface(worker, drawable->surface_id)) {
         return;
     }
 
@@ -2965,8 +2964,7 @@ static inline int red_current_add_with_shadow(RedWorker *worker, Ring *ring, Dra
     // item and his shadow must initially be placed in the same container.
     // for now putting them on root.
 
-    // only primary surface streams are supported
-    if (item->surface_id == 0) {
+    if (is_primary_surface(worker, item->surface_id)) {
         red_detach_streams_behind(worker, &shadow->base.rgn);
     }
     ring_add(ring, &shadow->base.siblings_link);
@@ -3000,8 +2998,7 @@ static inline void red_update_streamable(RedWorker *worker, Drawable *drawable,
         return;
     }
 
-    // only primary surface streams are supported
-    if (drawable->surface_id != 0) {
+    if (!is_primary_surface(worker, drawable->surface_id)) {
         return;
     }
 


More information about the Spice-commits mailing list