[cairo-commit] 2 commits - src/cairo-cff-subset.c src/cairo-pdf-surface.c src/cairo-pdf-surface-private.h src/cairo-type1-fallback.c

Andrea Canciani ranma42 at kemper.freedesktop.org
Fri Nov 26 05:23:19 PST 2010


 src/cairo-cff-subset.c          |    2 +-
 src/cairo-pdf-surface-private.h |    2 +-
 src/cairo-pdf-surface.c         |    7 ++++---
 src/cairo-type1-fallback.c      |    4 ++--
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 063a3894d7ed98ba36f416a285acc88c50d3bb34
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Fri Nov 26 13:46:31 2010 +0100

    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

diff --git a/src/cairo-pdf-surface-private.h b/src/cairo-pdf-surface-private.h
index 5c70ef9..11e026b 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 35315c1..e0321a9 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) {
commit 1ab64965786208b94ed40aa5f7f9be59d58fbf96
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Fri Nov 26 13:13:16 2010 +0100

    array: Silence warnings
    
    493aaf0f15bfedc88371ffab07d862a400b0da38 made all cairo_array
    functions use unsigned int for indexes and sizes.
    
    This commit fixes the compiler warnings about those values being
    compared to signed int's.

diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 1e6724f..44d1f5e 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -420,7 +420,7 @@ static void
 cff_index_fini (cairo_array_t *index)
 {
     cff_index_element_t *element;
-    int i;
+    unsigned int i;
 
     for (i = 0; i < _cairo_array_num_elements (index); i++) {
         element = _cairo_array_index (index, i);
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 7835642..35315c1 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -5201,7 +5201,7 @@ _cairo_pdf_surface_write_patterns_and_smask_groups (cairo_pdf_surface_t *surface
     cairo_pdf_pattern_t pattern;
     cairo_pdf_smask_group_t *group;
     cairo_pdf_source_surface_t src_surface;
-    int pattern_index, group_index, surface_index;
+    unsigned int pattern_index, group_index, surface_index;
     cairo_status_t status;
 
     /* Writing out PDF_MASK groups will cause additional smask groups
@@ -5248,7 +5248,7 @@ _cairo_pdf_surface_write_page (cairo_pdf_surface_t *surface)
 {
     cairo_pdf_resource_t page, knockout, res;
     cairo_status_t status;
-    int i, len;
+    unsigned int i, len;
 
     _cairo_pdf_group_resources_clear (&surface->resources);
     if (surface->has_fallback_images) {
diff --git a/src/cairo-type1-fallback.c b/src/cairo-type1-fallback.c
index 212a45b..62ffe92 100644
--- a/src/cairo-type1-fallback.c
+++ b/src/cairo-type1-fallback.c
@@ -146,7 +146,7 @@ static void
 charstring_encode_command (cairo_array_t *data, int command)
 {
     cairo_status_t status;
-    int orig_size;
+    unsigned int orig_size;
     unsigned char buf[5];
     unsigned char *p = buf;
 
@@ -173,7 +173,7 @@ charstring_encode_integer (cairo_array_t *data,
                            cairo_charstring_type_t type)
 {
     cairo_status_t status;
-    int orig_size;
+    unsigned int orig_size;
     unsigned char buf[10];
     unsigned char *p = buf;
 


More information about the cairo-commit mailing list