[cairo-commit] src/cairo-cache-private.h src/cairo-font.c src/cairo-ft-font.c src/cairo-hash-private.h src/cairo-scaled-font.c

Carl Worth cworth at kemper.freedesktop.org
Wed Mar 22 23:14:55 PST 2006


 src/cairo-cache-private.h |    2 +-
 src/cairo-font.c          |   12 ++++++------
 src/cairo-ft-font.c       |   12 ++++++------
 src/cairo-hash-private.h  |    2 +-
 src/cairo-scaled-font.c   |   14 +++++++-------
 5 files changed, 21 insertions(+), 21 deletions(-)

New commits:
diff-tree cabe94a15c277bb8a5f0c71f25cc8bc9e22ecb41 (from a193f70b94667808f573caa5b82a1bf50281555e)
Author: Carl Worth <cworth at raht.cworth.org>
Date:   Wed Mar 22 23:12:23 2006 -0800

    Make all hash/cache keys_equal function accept const pointers.

diff --git a/src/cairo-cache-private.h b/src/cairo-cache-private.h
index a75e8c0..566dbe2 100644
--- a/src/cairo-cache-private.h
+++ b/src/cairo-cache-private.h
@@ -88,7 +88,7 @@ typedef struct _cairo_cache_entry {
 } cairo_cache_entry_t;
 
 typedef cairo_bool_t
-(*cairo_cache_keys_equal_func_t) (void *key_a, void *key_b);
+(*cairo_cache_keys_equal_func_t) (const void *key_a, const void *key_b);
 
 typedef void
 (*cairo_cache_callback_func_t) (void *entry,
diff --git a/src/cairo-font.c b/src/cairo-font.c
index 6512480..425021a 100644
--- a/src/cairo-font.c
+++ b/src/cairo-font.c
@@ -210,8 +210,8 @@ cairo_font_face_set_user_data (cairo_fon
 static const cairo_font_face_backend_t _cairo_toy_font_face_backend;
 
 static int
-_cairo_toy_font_face_keys_equal (void *key_a,
-				 void *key_b);
+_cairo_toy_font_face_keys_equal (const void *key_a,
+				 const void *key_b);
 
 /* We maintain a hash table from family/weight/slant =>
  * cairo_font_face_t for cairo_toy_font_t. The primary purpose of
@@ -312,11 +312,11 @@ _cairo_toy_font_face_fini (cairo_toy_fon
 }
 
 static int
-_cairo_toy_font_face_keys_equal (void *key_a,
-				 void *key_b)
+_cairo_toy_font_face_keys_equal (const void *key_a,
+				 const void *key_b)
 {
-    cairo_toy_font_face_t *face_a = key_a;
-    cairo_toy_font_face_t *face_b = key_b;
+    const cairo_toy_font_face_t *face_a = key_a;
+    const cairo_toy_font_face_t *face_b = key_b;
 
     return (strcmp (face_a->family, face_b->family) == 0 &&
 	    face_a->slant == face_b->slant &&
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 092838a..a23388a 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -103,8 +103,8 @@ struct _cairo_ft_unscaled_font {
 };
 
 static int
-_cairo_ft_unscaled_font_keys_equal (void *key_a,
-				    void *key_b);
+_cairo_ft_unscaled_font_keys_equal (const void *key_a,
+				    const void *key_b);
 
 static void
 _cairo_ft_unscaled_font_fini (cairo_ft_unscaled_font_t *unscaled);
@@ -365,11 +365,11 @@ _cairo_ft_unscaled_font_fini (cairo_ft_u
 }
 
 static int
-_cairo_ft_unscaled_font_keys_equal (void *key_a,
-				    void *key_b)
+_cairo_ft_unscaled_font_keys_equal (const void *key_a,
+				    const void *key_b)
 {
-    cairo_ft_unscaled_font_t *unscaled_a = key_a;
-    cairo_ft_unscaled_font_t *unscaled_b = key_b;
+    const cairo_ft_unscaled_font_t *unscaled_a = key_a;
+    const cairo_ft_unscaled_font_t *unscaled_b = key_b;
 
     return (strcmp (unscaled_a->filename, unscaled_b->filename) == 0 &&
 	    unscaled_a->id == unscaled_b->id);
diff --git a/src/cairo-hash-private.h b/src/cairo-hash-private.h
index 6dc9c90..617b841 100644
--- a/src/cairo-hash-private.h
+++ b/src/cairo-hash-private.h
@@ -85,7 +85,7 @@ typedef struct _cairo_hash_entry {
 } cairo_hash_entry_t;
 
 typedef cairo_bool_t
-(*cairo_hash_keys_equal_func_t) (void *key_a, void *key_b);
+(*cairo_hash_keys_equal_func_t) (const void *key_a, const void *key_b);
 
 typedef cairo_bool_t
 (*cairo_hash_predicate_func_t) (void *entry);
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index a046904..afefac4 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -39,10 +39,10 @@
 #include "cairoint.h"
 
 static cairo_bool_t
-_cairo_scaled_glyph_keys_equal (void *abstract_key_a, void *abstract_key_b)
+_cairo_scaled_glyph_keys_equal (const void *abstract_key_a, const void *abstract_key_b)
 {
-    cairo_scaled_glyph_t *key_a = abstract_key_a;
-    cairo_scaled_glyph_t *key_b = abstract_key_b;
+    const cairo_scaled_glyph_t *key_a = abstract_key_a;
+    const cairo_scaled_glyph_t *key_b = abstract_key_b;
 
     return (_cairo_scaled_glyph_index (key_a) ==
 	    _cairo_scaled_glyph_index (key_b));
@@ -180,7 +180,7 @@ static cairo_scaled_font_map_t *cairo_sc
 CAIRO_MUTEX_DECLARE (cairo_scaled_font_map_mutex);
 
 static int
-_cairo_scaled_font_keys_equal (void *abstract_key_a, void *abstract_key_b);
+_cairo_scaled_font_keys_equal (const void *abstract_key_a, const void *abstract_key_b);
 
 static cairo_scaled_font_map_t *
 _cairo_scaled_font_map_lock (void)
@@ -298,10 +298,10 @@ _cairo_scaled_font_init_key (cairo_scale
 }
 
 static cairo_bool_t
-_cairo_scaled_font_keys_equal (void *abstract_key_a, void *abstract_key_b)
+_cairo_scaled_font_keys_equal (const void *abstract_key_a, const void *abstract_key_b)
 {
-    cairo_scaled_font_t *key_a = abstract_key_a;
-    cairo_scaled_font_t *key_b = abstract_key_b;
+    const cairo_scaled_font_t *key_a = abstract_key_a;
+    const cairo_scaled_font_t *key_b = abstract_key_b;
 
     return (key_a->font_face == key_b->font_face &&
 	    memcmp ((unsigned char *)(&key_a->font_matrix.xx),


More information about the cairo-commit mailing list