From 8ada2841d000ec3247198471bf389ecac954a62e Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Thu, 1 Apr 2010 16:03:23 +0000 Subject: [PATCH] convert annoying debug into eina log so it is disabled by default. SVN revision: 47651 --- legacy/evas/src/lib/canvas/evas_smart.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_smart.c b/legacy/evas/src/lib/canvas/evas_smart.c index dae37c3237..8aefc2115e 100644 --- a/legacy/evas/src/lib/canvas/evas_smart.c +++ b/legacy/evas/src/lib/canvas/evas_smart.c @@ -351,13 +351,18 @@ evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) { unsigned int i, j; + if (!a) + { + ERR("no array to fix!"); + return; + } + qsort(a->array, a->size, sizeof(Evas_Smart_Cb_Description *), _evas_smart_cb_description_cmp_sort); - fprintf(stderr, "\nDEBUG: %u callbacks\n", a->size); + DBG("%u callbacks", a->size); if (a->size) - fprintf(stderr, "DEBUG: %20.20s [%s]\n", - a->array[0]->name, a->array[0]->type); + DBG("%s [type=%s]", a->array[0]->name, a->array[0]->type); for (i = 0, j = 1; j < a->size; j++) { @@ -366,7 +371,7 @@ evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) cur = a->array[j]; prev = a->array[i]; - fprintf(stderr, "DEBUG: %20.20s [%s]\n", cur->name, cur->type); + DBG("%s [type=%s]", cur->name, cur->type); if (strcmp(cur->name, prev->name) != 0) { @@ -377,12 +382,12 @@ evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) else { if (strcmp(cur->type, prev->type) == 0) - fprintf(stderr, "WARNING: duplicated smart callback description" - " with name '%s' and type '%s'\n", cur->name, cur->type); + WRN("duplicated smart callback description" + " with name '%s' and type '%s'", cur->name, cur->type); else - fprintf(stderr, "ERROR: callback descriptions named '%s' differ" - " in type, keeping '%s', ignoring '%s'\n", cur->name, - prev->type, cur->type); + ERR("callback descriptions named '%s' differ" + " in type, keeping '%s', ignoring '%s'", + cur->name, prev->type, cur->type); } }