pdf: Silence compiler warnings

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
This commit is contained in:
Andrea Canciani 2010-11-26 13:46:31 +01:00
parent 1ab6496578
commit 063a3894d7
2 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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) {