[cairo-commit] 2 commits - src/cairo-misc.c test/cairo-test.c test/cairo-test.h test/cairo-test-runner.c test/cairo-test-trace.c test/svg2png.c util/cairo-trace util/meson.build

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Sep 2 10:29:13 UTC 2020


 src/cairo-misc.c         |    3 +++
 test/cairo-test-runner.c |    8 +++++---
 test/cairo-test-trace.c  |    7 ++++---
 test/cairo-test.c        |   10 ++++++----
 test/cairo-test.h        |    3 ++-
 test/svg2png.c           |    3 ---
 util/cairo-trace/trace.c |    2 +-
 util/meson.build         |    3 +--
 8 files changed, 22 insertions(+), 17 deletions(-)

New commits:
commit c8d82cffdfba9c7c380fbdf120b3f6dd81e28d24
Author: George Matsumura <gmmatsumura01 at bvsd.org>
Date:   Sun Aug 30 20:57:04 2020 -0600

    svg2png: Remove deprecated handle closing function call
    
    rsvg_handle_close is no longer required after creating a handle with
    rsvg_handle_new_from_file. It causes a deprecation warning during
    compilation as well. This change removes it.
    
    Signed-off-by: George Matsumura <gmmatsumura01 at bvsd.org>

diff --git a/test/svg2png.c b/test/svg2png.c
index 52f52d08f..92c6366aa 100644
--- a/test/svg2png.c
+++ b/test/svg2png.c
@@ -80,9 +80,6 @@ int main (int argc, char *argv[])
     if (status)
 	FAIL (cairo_status_to_string (status));
 
-    if (!rsvg_handle_close (handle, &error))
-	FAIL (error->message);
-
     g_object_unref (handle);
     return 0;
 }
commit f2cb9ba49a222c6e17603f5fb8cbb02f82d0bbf7
Author: George Matsumura <gmmatsumura01 at bvsd.org>
Date:   Sun Aug 30 18:29:05 2020 -0600

    meson: Fix musl build
    
    This constitutes few fixes that are necessary to compile correctly
    and reduce errors when using musl libc.
    
    Signed-off-by: George Matsumura <gmmatsumura01 at bvsd.org>

diff --git a/src/cairo-misc.c b/src/cairo-misc.c
index 2f551ee27..81f9325ca 100644
--- a/src/cairo-misc.c
+++ b/src/cairo-misc.c
@@ -38,10 +38,13 @@
  *      Adrian Johnson <ajohnson at redneon.com>
  */
 
+#define _GNU_SOURCE 1	/* strtod_l() */
+
 #include "cairoint.h"
 #include "cairo-error-private.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <locale.h>
 #ifdef HAVE_XLOCALE_H
diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index b1f77b358..6d4134ad9 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -164,11 +164,13 @@ static cairo_bool_t
 is_running_under_debugger (void)
 {
 #if HAVE_UNISTD_H && HAVE_LIBGEN_H && __linux__
-    char buf[1024];
+    char buf[1024] = { 0 };
+    char buf2[1024] = { 0 };
 
     sprintf (buf, "/proc/%d/exe", getppid ());
-    if (readlink (buf, buf, sizeof (buf)) != -1 &&
-	strncmp (basename (buf), "gdb", 3) == 0)
+    if (readlink (buf, buf2, sizeof (buf2)) != -1 &&
+	buf2[1023] == 0 &&
+	strncmp (basename (buf2), "gdb", 3) == 0)
     {
 	return TRUE;
     }
diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index 5badc4377..6b7e00afc 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -83,6 +83,7 @@
 #include <sys/un.h>
 #include <errno.h>
 #include <assert.h>
+#include <unistd.h>
 #if CAIRO_HAS_REAL_PTHREAD
 #include <pthread.h>
 #endif
@@ -906,7 +907,7 @@ write_result (const char *trace, struct slave *slave)
     static int index;
     char *filename;
 
-    xasprintf (&filename, "%s-%s-pass-%d-%d-%d.png",
+    xasprintf (&filename, "%s-%s-pass-%d-%ld-%ld.png",
 	       trace, slave->target->name, ++index,
 	       slave->start_line, slave->end_line);
     cairo_surface_write_to_png (slave->image, filename);
@@ -1175,7 +1176,7 @@ test_run (void *base,
 	    if (write_results) write_result (trace, &slaves[1]);
 	    if (write_traces && slaves[0].is_recording) {
 		char buf[80];
-		snprintf (buf, sizeof (buf), "%d", slaves[0].image_serial);
+		snprintf (buf, sizeof (buf), "%ld", slaves[0].image_serial);
 		write_trace (trace, buf, &slaves[0]);
 	    }
 
@@ -1203,7 +1204,7 @@ test_run (void *base,
 	    image = 0;
 	}
     }
-done:
+
     ret = TRUE;
 
 out:
diff --git a/test/cairo-test.c b/test/cairo-test.c
index bab952603..230579f6e 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1663,11 +1663,13 @@ cairo_test_get_context (cairo_t *cr)
 }
 
 cairo_t *
-cairo_test_create (cairo_surface_t *surface, cairo_test_context_t *ctx)
+cairo_test_create (cairo_surface_t *surface,
+		   const cairo_test_context_t *ctx)
 {
-  cairo_t *cr = cairo_create(surface);
-  cairo_set_user_data(cr, &_cairo_test_context_key, ctx, NULL);
-  return cr;
+    cairo_t *cr = cairo_create (surface);
+    cairo_set_user_data (cr, &_cairo_test_context_key,
+			 (void*) ctx, NULL);
+    return cr;
 }
 
 cairo_surface_t *
diff --git a/test/cairo-test.h b/test/cairo-test.h
index 6d423ba01..6169c5371 100644
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -320,7 +320,8 @@ cairo_bool_t
 cairo_test_mkdir (const char *path);
 
 cairo_t *
-cairo_test_create (cairo_surface_t *surface, cairo_test_context_t *ctx);
+cairo_test_create (cairo_surface_t *surface,
+		   const cairo_test_context_t *ctx);
 
 CAIRO_END_DECLS
 
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 28ec11941..bb618b5d9 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -784,7 +784,7 @@ static cairo_bool_t
 _init_logfile (void)
 {
     static cairo_bool_t initialized;
-    char buf[4096];
+    char buf[4105];
     const char *filename;
     const char *env;
 
diff --git a/util/meson.build b/util/meson.build
index 3f16d7c78..6982ad758 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -58,8 +58,7 @@ foreach util : cairo_utils
   )
 endforeach
 
-# This is useless and doesn't build on Windows
-if host_machine.system() != 'windows'
+if cc.has_header_symbol('malloc.h', '__malloc_hook')
   libmallocstats = library('malloc-stats', 'malloc-stats.c')
 endif
 


More information about the cairo-commit mailing list