summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-06-03 16:22:26 +0000
committerCarl Worth <cworth@cworth.org>2005-06-03 16:22:26 +0000
commit7c47633b2c74e329f04b9f1ebde4c05c409d73c0 (patch)
tree7f47a900a68d7671e95987a4ab4443dfe95cfd04
parent756e991b91465c6da933368d66f19e54849815dd (diff)
Remove unused cache->refcount and _cairo_cache_reference().
Remove gratuitous nesting as recommended in CODING_STYLE.
-rw-r--r--ChangeLog9
-rw-r--r--src/cairo-cache.c28
-rw-r--r--src/cairo-hash.c28
-rw-r--r--src/cairoint.h1
4 files changed, 25 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index d35e02f34..fe23fcd3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2005-06-03 Carl Worth <cworth@cworth.org>
+ * src/cairoint.h:
+ * src/cairo-cache.c: (_cairo_cache_init), (_cairo_cache_destroy):
+ Remove unused cache->refcount and _cairo_cache_reference().
+
+ * src/cairo-cache.c: (_cairo_cache_destroy): Remove gratuitous
+ nesting as recommended in CODING_STYLE.
+
+2005-06-03 Carl Worth <cworth@cworth.org>
+
* src/cairoint.h:
* src/cairo-array.c: (_cairo_user_data_array_fini):
* src/cairo-font.c: (cairo_font_face_destroy):
diff --git a/src/cairo-cache.c b/src/cairo-cache.c
index 950f983b4..e7547bc29 100644
--- a/src/cairo-cache.c
+++ b/src/cairo-cache.c
@@ -345,7 +345,6 @@ _cairo_cache_init (cairo_cache_t *cache,
if (cache != NULL){
cache->arrangement = &cache_arrangements[0];
- cache->refcount = 1;
cache->max_memory = max_memory;
cache->used_memory = 0;
cache->live_entries = 0;
@@ -368,31 +367,20 @@ _cairo_cache_init (cairo_cache_t *cache,
}
void
-_cairo_cache_reference (cairo_cache_t *cache)
-{
- _cache_sane_state (cache);
- cache->refcount++;
-}
-
-void
_cairo_cache_destroy (cairo_cache_t *cache)
{
unsigned long i;
- if (cache != NULL) {
+ if (cache == NULL)
+ return;
- _cache_sane_state (cache);
+ _cache_sane_state (cache);
- if (--cache->refcount > 0)
- return;
-
- for (i = 0; i < cache->arrangement->size; ++i) {
- _entry_destroy (cache, i);
- }
+ for (i = 0; i < cache->arrangement->size; ++i)
+ _entry_destroy (cache, i);
- free (cache->entries);
- cache->entries = NULL;
- cache->backend->destroy_cache (cache);
- }
+ free (cache->entries);
+ cache->entries = NULL;
+ cache->backend->destroy_cache (cache);
}
cairo_status_t
diff --git a/src/cairo-hash.c b/src/cairo-hash.c
index 950f983b4..e7547bc29 100644
--- a/src/cairo-hash.c
+++ b/src/cairo-hash.c
@@ -345,7 +345,6 @@ _cairo_cache_init (cairo_cache_t *cache,
if (cache != NULL){
cache->arrangement = &cache_arrangements[0];
- cache->refcount = 1;
cache->max_memory = max_memory;
cache->used_memory = 0;
cache->live_entries = 0;
@@ -368,31 +367,20 @@ _cairo_cache_init (cairo_cache_t *cache,
}
void
-_cairo_cache_reference (cairo_cache_t *cache)
-{
- _cache_sane_state (cache);
- cache->refcount++;
-}
-
-void
_cairo_cache_destroy (cairo_cache_t *cache)
{
unsigned long i;
- if (cache != NULL) {
+ if (cache == NULL)
+ return;
- _cache_sane_state (cache);
+ _cache_sane_state (cache);
- if (--cache->refcount > 0)
- return;
-
- for (i = 0; i < cache->arrangement->size; ++i) {
- _entry_destroy (cache, i);
- }
+ for (i = 0; i < cache->arrangement->size; ++i)
+ _entry_destroy (cache, i);
- free (cache->entries);
- cache->entries = NULL;
- cache->backend->destroy_cache (cache);
- }
+ free (cache->entries);
+ cache->entries = NULL;
+ cache->backend->destroy_cache (cache);
}
cairo_status_t
diff --git a/src/cairoint.h b/src/cairoint.h
index b9b8b8309..6919af39e 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -356,7 +356,6 @@ typedef struct {
#undef CAIRO_MEASURE_CACHE_PERFORMANCE
typedef struct {
- unsigned long refcount;
const cairo_cache_backend_t *backend;
const cairo_cache_arrangement_t *arrangement;
cairo_cache_entry_base_t **entries;