[cairo-commit] 4 commits - src/cairo.c src/cairo-shape-mask-compositor.c test/cairo-test-runner.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Feb 5 15:00:06 UTC 2023


 src/cairo-shape-mask-compositor.c |    6 +--
 src/cairo.c                       |    2 -
 test/cairo-test-runner.c          |   60 --------------------------------------
 3 files changed, 4 insertions(+), 64 deletions(-)

New commits:
commit 23e2718bd72ad5cb43abb853ef46ac0a1427f121
Merge: 338eca434 7980301fe
Author: Uli Schlachter <psychon at znc.in>
Date:   Sun Feb 5 15:00:05 2023 +0000

    Merge branch 'unused-code' into 'master'
    
    Drop some unused or dead code
    
    See merge request cairo/cairo!443

commit 7980301fe472586bd9d9dd66daaf101f207f7619
Author: Khaled Hosny <khaled at aliftype.com>
Date:   Sat Feb 4 10:59:41 2023 +0200

    Remove dead code
    
    This is no-op as the functions always return TRUE and the code is never
    executed.

diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index cfaea2360..72aa1ff9b 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -726,45 +726,6 @@ _has_required_cairo_version (const char *str)
 			     CAIRO_VERSION_ENCODE (major, minor, micro));
 }
 
-static cairo_bool_t
-_has_required_ghostscript_version (const char *str)
-{
-#if ! CAIRO_CAN_TEST_PS_SURFACE
-    (void)str;
-    return TRUE;
-#endif
-
-    str += 2; /* advance over "gs" */
-
-    return TRUE;
-}
-
-static cairo_bool_t
-_has_required_poppler_version (const char *str)
-{
-#if ! CAIRO_CAN_TEST_PDF_SURFACE
-    (void)str;
-    return TRUE;
-#endif
-
-    str += 7; /* advance over "poppler" */
-
-    return TRUE;
-}
-
-static cairo_bool_t
-_has_required_rsvg_version (const char *str)
-{
-#if ! CAIRO_CAN_TEST_SVG_SURFACE
-    (void)str;
-    return TRUE;
-#endif
-
-    str += 4; /* advance over "rsvg" */
-
-    return TRUE;
-}
-
 #define TEST_SIMILAR	0x1
 #define TEST_OFFSET	0x2
 #define TEST_SCALE	0x4
@@ -908,30 +869,6 @@ main (int argc, char **argv)
 		else
 		    goto TEST_SKIPPED;
 	    }
-
-	    str = strstr (requirements, "gs");
-	    if (str != NULL && ! _has_required_ghostscript_version (str)) {
-		if (runner.list_only)
-		    goto TEST_NEXT;
-		else
-		    goto TEST_SKIPPED;
-	    }
-
-	    str = strstr (requirements, "poppler");
-	    if (str != NULL && ! _has_required_poppler_version (str)) {
-		if (runner.list_only)
-		    goto TEST_NEXT;
-		else
-		    goto TEST_SKIPPED;
-	    }
-
-	    str = strstr (requirements, "rsvg");
-	    if (str != NULL && ! _has_required_rsvg_version (str)) {
-		if (runner.list_only)
-		    goto TEST_NEXT;
-		else
-		    goto TEST_SKIPPED;
-	    }
 	}
 
 	if (runner.list_only) {
commit c1564baf61b8294757a200a39c9de6e029a80edd
Author: Khaled Hosny <khaled at aliftype.com>
Date:   Fri Feb 3 17:55:54 2023 +0200

    Fix -Wunused-but-set-parameter
    
    ../test/cairo-test-runner.c:730:48: warning: parameter 'str' set but not used [-Wunused-but-set-parameter]
    _has_required_ghostscript_version (const char *str)

diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 7e8b10cd7..cfaea2360 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -730,6 +730,7 @@ static cairo_bool_t
 _has_required_ghostscript_version (const char *str)
 {
 #if ! CAIRO_CAN_TEST_PS_SURFACE
+    (void)str;
     return TRUE;
 #endif
 
@@ -742,6 +743,7 @@ static cairo_bool_t
 _has_required_poppler_version (const char *str)
 {
 #if ! CAIRO_CAN_TEST_PDF_SURFACE
+    (void)str;
     return TRUE;
 #endif
 
@@ -754,6 +756,7 @@ static cairo_bool_t
 _has_required_rsvg_version (const char *str)
 {
 #if ! CAIRO_CAN_TEST_SVG_SURFACE
+    (void)str;
     return TRUE;
 #endif
 
commit c2ce4d421dd7014fb90f589465a028a1c61aa423
Author: Khaled Hosny <khaled at aliftype.com>
Date:   Thu Jan 26 13:17:09 2023 +0200

    Fix -Wparentheses-equality warnings
    
    warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

diff --git a/src/cairo-shape-mask-compositor.c b/src/cairo-shape-mask-compositor.c
index 3117267cc..0f4918603 100644
--- a/src/cairo-shape-mask-compositor.c
+++ b/src/cairo-shape-mask-compositor.c
@@ -116,7 +116,7 @@ _cairo_shape_mask_compositor_stroke (const cairo_compositor_t *_compositor,
 				      &_cairo_pattern_white.base,
 				      &pattern.base,
 				      clip);
-	if ((status == CAIRO_INT_STATUS_SUCCESS)) {
+	if (status == CAIRO_INT_STATUS_SUCCESS) {
 	    status = _cairo_surface_mask (extents->surface,
 					  CAIRO_OPERATOR_ADD,
 					  &extents->source_pattern.base,
@@ -210,7 +210,7 @@ _cairo_shape_mask_compositor_fill (const cairo_compositor_t *_compositor,
 				      &_cairo_pattern_white.base,
 				      &pattern.base,
 				      clip);
-	if ((status == CAIRO_INT_STATUS_SUCCESS)) {
+	if (status == CAIRO_INT_STATUS_SUCCESS) {
 	    status = _cairo_surface_mask (extents->surface,
 					  CAIRO_OPERATOR_ADD,
 					  &extents->source_pattern.base,
@@ -303,7 +303,7 @@ _cairo_shape_mask_compositor_glyphs (const cairo_compositor_t *_compositor,
 				      &_cairo_pattern_white.base,
 				      &pattern.base,
 				      clip);
-	if ((status == CAIRO_INT_STATUS_SUCCESS)) {
+	if (status == CAIRO_INT_STATUS_SUCCESS) {
 	    status = _cairo_surface_mask (extents->surface,
 					  CAIRO_OPERATOR_ADD,
 					  &extents->source_pattern.base,
diff --git a/src/cairo.c b/src/cairo.c
index 55e7103ea..bff1b86af 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -3360,7 +3360,7 @@ cairo_set_scaled_font (cairo_t                   *cr,
     if (unlikely (cr->status))
 	return;
 
-    if ((scaled_font == NULL)) {
+    if (scaled_font == NULL) {
 	_cairo_set_error (cr, _cairo_error (CAIRO_STATUS_NULL_POINTER));
 	return;
     }


More information about the cairo-commit mailing list