[cairo-commit] 6 commits - configure.ac test/any2ppm.c test/paint-with-alpha-group-clip.c test/ps-eps.c test/rotate-stroke-box.c util/cairo-script util/cairo-trace

Bryce Harrington bryce at kemper.freedesktop.org
Fri Jan 31 11:28:03 PST 2014


 configure.ac                                 |    2 +-
 test/any2ppm.c                               |    1 -
 test/paint-with-alpha-group-clip.c           |    2 --
 test/ps-eps.c                                |    6 +++++-
 test/rotate-stroke-box.c                     |    2 --
 util/cairo-script/cairo-script-file.c        |    8 ++++----
 util/cairo-script/cairo-script-interpreter.c |    2 +-
 util/cairo-script/cairo-script-operators.c   |   16 ++++++++--------
 util/cairo-trace/trace.c                     |    1 +
 9 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 39b7d5138eb83cc2d4f3ab6039894cc61c7fe4c7
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Wed Jan 29 17:07:04 2014 -0800

    cairo-script: Compare status with CSI enums
    
    CSI_STATUS_SUCCESS is defined as equivalent to CAIRO_STATUS_SUCCESS.
    We should prefer the former when comparing against csi_status_t
    variables, else we'll get a warning:
    
    cairo-script-interpreter.c:637:23: warning: comparison between
    ‘csi_status_t’ and ‘enum _cairo_status’ [-Wenum-compare]
    
    Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/util/cairo-script/cairo-script-interpreter.c b/util/cairo-script/cairo-script-interpreter.c
index bdd5255..50170fc 100644
--- a/util/cairo-script/cairo-script-interpreter.c
+++ b/util/cairo-script/cairo-script-interpreter.c
@@ -634,7 +634,7 @@ cairo_script_interpreter_finish (csi_t *ctx)
     if (! ctx->finished) {
 	_csi_finish (ctx);
 	ctx->finished = 1;
-    } else if (status == CAIRO_STATUS_SUCCESS) {
+    } else if (status == CSI_STATUS_SUCCESS) {
 	status = ctx->status = CSI_STATUS_INTERPRETER_FINISHED;
     }
 
commit 18d66c88a2f1068fb490efa33ead93d0e2d71c41
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Wed Jan 29 10:22:51 2014 -0800

    cairo-script: Error if asked to decompress with missing compression lib
    
    This quells the following warning:
    
    warning: enumeration value ‘LZO’ not handled in switch [-Wswitch-enum]
    
    The LZO enum value is defined and used elsewhere, even if lzo support
    isn't available.
    
    This situation might arise if cairo scripts were generated on one system
    with lzo, and then replayed on a system without it.  For now simply
    error out if this occurs.
    
    Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/util/cairo-script/cairo-script-file.c b/util/cairo-script/cairo-script-file.c
index 85d292c..c962fce 100644
--- a/util/cairo-script/cairo-script-file.c
+++ b/util/cairo-script/cairo-script-file.c
@@ -176,21 +176,21 @@ csi_file_new_from_string (csi_t *ctx,
 	    status = _csi_error (CAIRO_STATUS_NO_MEMORY);
 	    break;
 
-#if HAVE_ZLIB
 	case ZLIB:
+#if HAVE_ZLIB
 	    if (uncompress ((Bytef *) tmp_str->string, &len,
 			    (Bytef *) src->string, src->len) != Z_OK)
+#endif
 		status = _csi_error (CAIRO_STATUS_NO_MEMORY);
 	    break;
-#endif
-#if HAVE_LZO
 	case LZO:
+#if HAVE_LZO
 	    if (lzo2a_decompress ((lzo_bytep) src->string, src->len,
 				  (lzo_bytep) tmp_str->string, &len,
 				  NULL))
+#endif
 		status = _csi_error (CAIRO_STATUS_NO_MEMORY);
 	    break;
-#endif
 	}
 	if (_csi_unlikely (status)) {
 	    csi_string_free (ctx, tmp_str);
diff --git a/util/cairo-script/cairo-script-operators.c b/util/cairo-script/cairo-script-operators.c
index aae6bea..d4af312 100644
--- a/util/cairo-script/cairo-script-operators.c
+++ b/util/cairo-script/cairo-script-operators.c
@@ -1769,28 +1769,28 @@ inflate_string (csi_t *ctx, csi_string_t *src)
 	free (bytes);
 	return NULL;
 
-#if HAVE_ZLIB
     case ZLIB:
+#if HAVE_ZLIB
 	if (uncompress ((Bytef *) bytes, &len,
 			(Bytef *) src->string, src->len) != Z_OK)
+#endif
 	{
 	    _csi_free (ctx, bytes);
 	    return NULL;
 	}
 	break;
-#endif
 
-#if HAVE_LZO
     case LZO:
+#if HAVE_LZO
 	if (lzo2a_decompress ((Bytef *) src->string, src->len,
 			      (Bytef *) bytes, &len,
 			      NULL))
+#endif
 	{
 	    _csi_free (ctx, bytes);
 	    return NULL;
 	}
 	break;
-#endif
     }
 
     bytes[len] = '\0';
@@ -2970,22 +2970,22 @@ err_decompress:
 	    cairo_surface_destroy (image);
 	    return _csi_error (CSI_STATUS_READ_ERROR);
 
-#if HAVE_ZLIB
 	case ZLIB:
+#if HAVE_ZLIB
 	    if (uncompress ((Bytef *) data, &out,
 			    (Bytef *) s->string, s->len) != Z_OK)
+#endif
 		goto err_decompress;
 	    break;
-#endif
 
-#if HAVE_LZO
 	case LZO:
+#if HAVE_LZO
 	    if (lzo2a_decompress ((Bytef *) s->string, s->len,
 				  (Bytef *) data, &out,
 				  NULL))
+#endif
 		goto err_decompress;
 	    break;
-#endif
 	}
     }
     else
commit 1ce452db4ca348944ca88edfdadb6c53a4d55733
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Wed Jan 29 10:10:24 2014 -0800

    cairo-trace:  Stringify CAIRO_STATUS_JBIG2_GLOBAL_MISSING
    
    This error enum was added last September when JBIG2 support was added.
    Support it as well in the tracing code.  This fixes this warning:
    
    trace.c:1544:5: warning: enumeration value
    ‘CAIRO_STATUS_JBIG2_GLOBAL_MISSING’ not handled in switch [-Wswitch]
    
    Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 0188d77..ebfc81a 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -1580,6 +1580,7 @@ _status_to_string (cairo_status_t status)
 	f(DEVICE_ERROR);
 	f(INVALID_MESH_CONSTRUCTION);
 	f(DEVICE_FINISHED);
+	f(JBIG2_GLOBAL_MISSING);
     case CAIRO_STATUS_LAST_STATUS:
 	break;
     }
commit 9a29805f4e666577e5fe72fec62ecc76719862d9
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Wed Jan 29 10:04:41 2014 -0800

    test:  Drop unused path variable in two recently added tests
    
    Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/paint-with-alpha-group-clip.c b/test/paint-with-alpha-group-clip.c
index 7be47b2..e1e4383 100644
--- a/test/paint-with-alpha-group-clip.c
+++ b/test/paint-with-alpha-group-clip.c
@@ -35,8 +35,6 @@
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_path_t *path;
-
     cairo_set_source_rgb (cr, 1, 1, 1);
     cairo_paint (cr);
 
diff --git a/test/rotate-stroke-box.c b/test/rotate-stroke-box.c
index ebbd795..862abc9 100644
--- a/test/rotate-stroke-box.c
+++ b/test/rotate-stroke-box.c
@@ -29,8 +29,6 @@
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
 {
-    cairo_path_t *path;
-
     cairo_save (cr);
     cairo_set_source_rgb (cr, 1, 1, 1);
     cairo_paint (cr);
commit 0723290a6f7261be51312d0c53a7d4188a31bb1c
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Wed Jan 29 10:01:50 2014 -0800

    test:  Handle error in fgets call in ps-eps test
    
    Most likely this is just a theoretical problem since we just checked
    feof, but this quells the following warning:
    
    ps-eps.c:216:8: warning: ignoring return value of ‘fgets’, declared with
    attribute warn_unused_result [-Wunused-result]
    
    Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/ps-eps.c b/test/ps-eps.c
index 66224e2..de1248d 100644
--- a/test/ps-eps.c
+++ b/test/ps-eps.c
@@ -213,7 +213,11 @@ check_bbox (cairo_test_context_t *ctx,
     bbox_pass = FALSE;
     page_bbox_pass = FALSE;
     while (!feof(f)) {
-	fgets (buf, sizeof(buf), f);
+	if (fgets (buf, sizeof(buf), f) == (char *)EOF) {
+	    cairo_test_log (ctx, "Error: Unexpected EOF in %s\n",
+			    filename);
+	    break;
+	}
 
 	if (strncmp (buf, DOCUMENT_BBOX, strlen (DOCUMENT_BBOX)) == 0) {
 	    ret = sscanf (buf+strlen (DOCUMENT_BBOX), "%d %d %d %d", &llx, &lly, &urx, &ury);
commit 1b522f81e22fd320e6962ffb54121c10ece39275
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Wed Jan 29 09:57:24 2014 -0800

    test:  Replace deprecated rsvg_init() in any2ppm test
    
    As of libsvg 2.35 calling g_type_init() is sufficient.
    
    Signed-off-by: Bryce Harrington <b.harrington at samsung.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index eb1f2a3..fdcb2dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -627,7 +627,7 @@ CAIRO_ENABLE_SURFACE_BACKEND(svg, SVG, yes, [
   fi
 ])
 
-LIBRSVG_VERSION_REQUIRED=2.15.0
+LIBRSVG_VERSION_REQUIRED=2.35.0
 test_svg=no
 any2ppm_svg=no
 if test "x$use_svg" = "xyes"; then
diff --git a/test/any2ppm.c b/test/any2ppm.c
index 2403347..e698e57 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -865,7 +865,6 @@ main (int argc, char **argv)
 #endif
 
 #if CAIRO_CAN_TEST_SVG_SURFACE
-    rsvg_init ();
     rsvg_set_default_dpi (72.0);
 #endif
 


More information about the cairo-commit mailing list