[Spice-commits] 3 commits - client/cmd_line_parser.cpp client/x11 common/canvas_base.c configure.ac

Alon Levy alon at kemper.freedesktop.org
Fri Jan 7 07:46:43 PST 2011


 client/cmd_line_parser.cpp |    7 +++++--
 client/x11/Makefile.am     |    2 ++
 common/canvas_base.c       |    2 +-
 configure.ac               |   19 ++++++++++++++-----
 4 files changed, 22 insertions(+), 8 deletions(-)

New commits:
commit 4b81a8c2a5ba4cf93f5be8481cc4d8e73838e96e
Author: Alon Levy <alevy at redhat.com>
Date:   Thu Jan 6 12:54:28 2011 +0200

    client/cmd_line_parser: fix wrong reporting of bad argument in --bla=val case
    
    We use get_opt_long, which allows non ambiguous abbreviations, but
    since we didn't like that we have code that checks for abbreviations and
    issues an error. But that code only handled separate argument and key like:
    --bla value
    and didn't handle them in the same arguemnts, like:
    --bla=value
    This patch fixes that, and gives a slightly better error report (it still
    contains the =value part though)

diff --git a/client/cmd_line_parser.cpp b/client/cmd_line_parser.cpp
index 963250b..da4af05 100644
--- a/client/cmd_line_parser.cpp
+++ b/client/cmd_line_parser.cpp
@@ -346,10 +346,13 @@ int CmdLineParser::get_option(char** val)
         }
 
 #ifdef DISABLE_ABBREVIATE
-        int name_pos = (opt_obj->type == REQUIRED_ARGUMENT) ? optind - 2 : optind - 1;
+        int name_pos =
+            (opt_obj->type == REQUIRED_ARGUMENT && optarg[-1] != '=')
+            ? optind - 2
+            : optind - 1;
         std::string cmd_name(_argv[name_pos] + 2);
         if (cmd_name.find(opt_obj->name) != 0) {
-            Platform::term_printf("%s: invalid option '--%s'\n", _argv[0], cmd_name.c_str());
+            Platform::term_printf("%s: invalid abbreviated option '--%s'\n", _argv[0], cmd_name.c_str());
             return OPTION_ERROR;
         }
 #endif
commit 8480f32db596ea7177d732bc91790e1b6c673048
Author: Alon Levy <alevy at redhat.com>
Date:   Wed Jan 5 15:31:46 2011 +0200

    common, canvas_get_jpeg_alpha: let top_down be any value
    
    Allow top_down flag to have any value, only ASSERT it is positive
    when needs to be positive and zero otherwise. Allows older server
    bug of sending 4 instead of 1 in top down flag to not affect newer
    clients (previous patch fixes server).

diff --git a/common/canvas_base.c b/common/canvas_base.c
index db83245..3b0f801 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -612,7 +612,7 @@ static pixman_image_t *canvas_get_jpeg_alpha(CanvasBase *canvas,
                     &lz_alpha_width, &lz_alpha_height, &n_comp_pixels,
                     &lz_alpha_top_down, NULL);
     ASSERT(lz_alpha_type == LZ_IMAGE_TYPE_XXXA);
-    ASSERT(lz_alpha_top_down == alpha_top_down);
+    ASSERT(!!lz_alpha_top_down == !!alpha_top_down);
     ASSERT(lz_alpha_width == width);
     ASSERT(lz_alpha_height == height);
     ASSERT(n_comp_pixels == width * height);
commit 64c330793eb9e00faa79acb5a58eab2e592283d6
Author: Alon Levy <alevy at redhat.com>
Date:   Wed Jan 5 15:02:30 2011 +0200

    client: CEGUI: search for CEGUI-0.6 to work in F15 (rawhide)

diff --git a/client/x11/Makefile.am b/client/x11/Makefile.am
index 42b8b0a..7504833 100644
--- a/client/x11/Makefile.am
+++ b/client/x11/Makefile.am
@@ -25,6 +25,7 @@ INCLUDES = \
 	$(XFIXES_CFLAGS)				\
 	$(MISC_X_CFLAGS)				\
 	$(CEGUI_CFLAGS)					\
+	$(CEGUI06_CFLAGS)					\
 	$(WARN_CFLAGS)                                  \
 	$(SPICE_NONPKGCONFIG_CFLAGS)			\
 	$(SMARTCARD_CFLAGS)				\
@@ -206,6 +207,7 @@ spicec_LDFLAGS = \
 	$(CELT051_LIBS)					\
 	$(SSL_LIBS)					\
 	$(CEGUI_LIBS)					\
+	$(CEGUI06_LIBS)					\
 	$(JPEG_LIBS)					\
 	$(Z_LIBS)					\
 	$(SMARTCARD_LIBS)				\
diff --git a/configure.ac b/configure.ac
index 511d94e..e6ca48d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,11 +167,20 @@ AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield functi
 SPICE_REQUIRES=""
 
 if test "x$use_gui" = "xyes"; then
-    PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.6.0 CEGUI < 0.7.0)
-    AC_SUBST(CEGUI_CFLAGS)
-    AC_SUBST(CEGUI_LIBS)
-    SPICE_REQUIRES+=" CEGUI"
-    CEGUI_CFLAGS+="-DUSE_GUI"
+    PKG_CHECK_MODULES(CEGUI06, CEGUI-0.6 >= 0.6.0 CEGUI-0.6 < 0.7.0,
+    [
+        AC_SUBST(CEGUI06_CFLAGS)
+        AC_SUBST(CEGUI06_LIBS)
+        SPICE_REQUIRES+=" CEGUI-0.6"
+        CEGUI06_CFLAGS+="-DUSE_GUI"
+    ],
+    [
+        PKG_CHECK_MODULES(CEGUI, CEGUI >= 0.6.0 CEGUI < 0.7.0)
+        AC_SUBST(CEGUI_CFLAGS)
+        AC_SUBST(CEGUI_LIBS)
+        SPICE_REQUIRES+=" CEGUI"
+        CEGUI_CFLAGS+="-DUSE_GUI"
+    ])
 fi
 
 if test "x$have_tunnel" = "xyes"; then


More information about the Spice-commits mailing list