diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-01-18 12:10:26 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-01-18 14:30:23 -0500 |
commit | a5530caec3648c8cfe3e86e0e2183faf2b073068 (patch) | |
tree | b609e07d1996c6ad7728d3ad7c207f40f73841da /gtk/gtkcssvalue.c | |
parent | 92cfc0382197cced245a8461191f87b9d9e2fb80 (diff) | |
download | gtk+-a5530caec3648c8cfe3e86e0e2183faf2b073068.tar.gz |
Actually turn of css value accounting
We need an #undef here. While doing so, make sure
it compiles without warnings when disabled.
Diffstat (limited to 'gtk/gtkcssvalue.c')
-rw-r--r-- | gtk/gtkcssvalue.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c index f4a1b27d10..2ce73c2cf1 100644 --- a/gtk/gtkcssvalue.c +++ b/gtk/gtkcssvalue.c @@ -29,7 +29,9 @@ struct _GtkCssValue { G_DEFINE_BOXED_TYPE (GtkCssValue, _gtk_css_value, _gtk_css_value_ref, _gtk_css_value_unref) -#define CSS_VALUE_ACCOUNTING 0 +#undef CSS_VALUE_ACCOUNTING + +#ifdef CSS_VALUE_ACCOUNTING static GHashTable *counters; typedef struct @@ -132,13 +134,13 @@ get_accounting_data (const char *class) return c; } +#endif GtkCssValue * _gtk_css_value_alloc (const GtkCssValueClass *klass, gsize size) { GtkCssValue *value; - ValueAccounting *c; value = g_slice_alloc0 (size); @@ -146,9 +148,13 @@ _gtk_css_value_alloc (const GtkCssValueClass *klass, value->ref_count = 1; #ifdef CSS_VALUE_ACCOUNTING - c = get_accounting_data (klass->type_name); - c->all++; - c->alive++; + { + ValueAccounting *c; + + c = get_accounting_data (klass->type_name); + c->all++; + c->alive++; + } #endif return value; @@ -167,8 +173,6 @@ gtk_css_value_ref (GtkCssValue *value) void gtk_css_value_unref (GtkCssValue *value) { - ValueAccounting *c; - if (value == NULL) return; @@ -177,8 +181,12 @@ gtk_css_value_unref (GtkCssValue *value) return; #ifdef CSS_VALUE_ACCOUNTING - c = get_accounting_data (value->class->type_name); - c->alive--; + { + ValueAccounting *c; + + c = get_accounting_data (value->class->type_name); + c->alive--; + } #endif value->class->free (value); |