[cairo-commit] 3 commits - test/any2ppm.c test/svg2png.c util/cairo-gobject

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 27 16:24:30 UTC 2021


 test/any2ppm.c                             |    1 +
 test/svg2png.c                             |    3 +++
 util/cairo-gobject/cairo-gobject-structs.c |   13 ++++++++++---
 3 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 47770fc2b7df8d078ac6d421822e850927cddf7d
Merge: 14385eeff 0bbb9de80
Author: Uli Schlachter <psychon at znc.in>
Date:   Tue Apr 27 16:24:29 2021 +0000

    Merge branch 'ebassi/deprecations' into 'master'
    
    Use g_memdup2() with newer versions of GLib
    
    See merge request cairo/cairo!167

commit 0bbb9de8069fca5685568b9cf475da45da9fc554
Author: Emmanuele Bassi <ebassi at gnome.org>
Date:   Sun Apr 18 11:18:10 2021 +0100

    Disable deprecation warnings from librsvg
    
    This is a test utility, we don't really care about deprecations.

diff --git a/test/any2ppm.c b/test/any2ppm.c
index 8d8d2f2cf..b3f1308ea 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -69,6 +69,7 @@
 #endif
 
 #if CAIRO_CAN_TEST_SVG_SURFACE
+#define RSVG_DISABLE_DEPRECATION_WARNINGS
 #include <librsvg/rsvg.h>
 #ifndef RSVG_CAIRO_H
 #include <librsvg/rsvg-cairo.h>
diff --git a/test/svg2png.c b/test/svg2png.c
index 92c6366aa..5dfbf62ec 100644
--- a/test/svg2png.c
+++ b/test/svg2png.c
@@ -27,6 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+
+/* Disable deprecation warnings coming from librsvg */
+#define RSVG_DISABLE_DEPRECATION_WARNINGS
 #include <librsvg/rsvg.h>
 
 #define FAIL(msg)							\
commit b7d38e048fb44f60e3a4d0f9d49fdd21259afc4a
Author: Emmanuele Bassi <ebassi at gnome.org>
Date:   Sun Apr 18 11:08:27 2021 +0100

    Use g_memdup2() with newer versions of GLib
    
    The g_memdup() function has been deprecated, as it takes the size of the
    memory area as an unsigned integer. The g_memdup2() replacement uses the
    more appropriate size_t type, instead.

diff --git a/util/cairo-gobject/cairo-gobject-structs.c b/util/cairo-gobject/cairo-gobject-structs.c
index 4bbf11baa..95e4a44f4 100644
--- a/util/cairo-gobject/cairo-gobject-structs.c
+++ b/util/cairo-gobject/cairo-gobject-structs.c
@@ -71,12 +71,19 @@ CAIRO_DEFINE_BOXED ("CairoFontOptions", cairo_gobject_font_options,
 CAIRO_DEFINE_BOXED ("CairoRegion", cairo_gobject_region, 
                     cairo_region_reference, cairo_region_destroy);
 
+#if GLIB_CHECK_VERSION(2, 68, 0)
 #define COPY_FUNC(name) \
 static gpointer \
-cairo_gobject_cairo_ ## name ## _copy (gpointer src) \
-{ \
-    return g_memdup (src, sizeof (cairo_ ## name ## _t)); \
+cairo_gobject_cairo_ ## name ## _copy (gpointer src) { \
+  return g_memdup2 (src, sizeof (cairo_ ## name ## _t)); \
 }
+#else
+#define COPY_FUNC(name) \
+static gpointer \
+cairo_gobject_cairo_ ## name ## _copy (gpointer src) { \
+  return g_memdup (src, sizeof (cairo_ ## name ## _t)); \
+}
+#endif
 
 COPY_FUNC (matrix)
 CAIRO_DEFINE_BOXED ("CairoMatrix", cairo_gobject_matrix, 


More information about the cairo-commit mailing list