From 063a3894d7ed98ba36f416a285acc88c50d3bb34 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Fri, 26 Nov 2010 13:46:31 +0100 Subject: [PATCH] pdf: Silence compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compiler complains about a const pointer being free'd and memcpy'd to: cairo-pdf-surface.c: In function ‘_cairo_pdf_surface_add_source_surface’: cairo-pdf-surface.c:1208: warning: passing argument 1 of ‘__builtin___memcpy_chk’ discards qualifiers from pointer target type cairo-pdf-surface.c:1208: warning: passing argument 1 of ‘__inline_memcpy_chk’ discards qualifiers from pointer target type cairo-pdf-surface.c: In function ‘_cairo_pdf_source_surface_entry_pluck’: cairo-pdf-surface.c:1666: warning: passing argument 1 of ‘free’ discards qualifiers from pointer target type --- src/cairo-pdf-surface-private.h | 2 +- src/cairo-pdf-surface.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h index 5c70ef973..11e026bb9 100644 --- a/src/cairo-pdf-surface-private.h +++ b/src/cairo-pdf-surface-private.h @@ -67,7 +67,7 @@ typedef struct _cairo_pdf_group_resources { typedef struct _cairo_pdf_source_surface_entry { cairo_hash_entry_t base; unsigned int id; - const unsigned char *unique_id; + unsigned char *unique_id; unsigned long unique_id_length; cairo_bool_t interpolate; cairo_pdf_resource_t surface_res; diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c index 35315c1f9..e0321a9fb 100644 --- a/src/cairo-pdf-surface.c +++ b/src/cairo-pdf-surface.c @@ -1177,7 +1177,8 @@ _cairo_pdf_surface_add_source_surface (cairo_pdf_surface_t *surface, surface_key.id = source->unique_id; surface_key.interpolate = interpolate; cairo_surface_get_mime_data (source, CAIRO_MIME_TYPE_UNIQUE_ID, - &surface_key.unique_id, &surface_key.unique_id_length); + (const unsigned char **) &surface_key.unique_id, + &surface_key.unique_id_length); _cairo_pdf_source_surface_init_key (&surface_key); surface_entry = _cairo_hash_table_lookup (surface->all_surfaces, &surface_key.base); if (surface_entry) {