evas / evas_smart - removed white spaces

SVN revision: 58305
This commit is contained in:
ChunEon Park 2011-04-03 16:15:21 +00:00
parent 73e540f6d6
commit 099d9e4a7f
1 changed files with 40 additions and 40 deletions

View File

@ -233,24 +233,24 @@ evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned i
if (size == 0) if (size == 0)
{ {
free(a->array); free(a->array);
a->array = NULL; a->array = NULL;
a->size = 0; a->size = 0;
return 1; return 1;
} }
tmp = realloc(a->array, (size + 1) * sizeof(Evas_Smart_Cb_Description *)); tmp = realloc(a->array, (size + 1) * sizeof(Evas_Smart_Cb_Description *));
if (tmp) if (tmp)
{ {
a->array = tmp; a->array = tmp;
a->size = size; a->size = size;
a->array[size] = NULL; a->array[size] = NULL;
return 1; return 1;
} }
else else
{ {
ERR("realloc failed!"); ERR("realloc failed!");
return 0; return 0;
} }
} }
@ -269,12 +269,12 @@ evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a)
if (!a) if (!a)
{ {
ERR("no array to fix!"); ERR("no array to fix!");
return; return;
} }
qsort(a->array, a->size, sizeof(Evas_Smart_Cb_Description *), qsort(a->array, a->size, sizeof(Evas_Smart_Cb_Description *),
_evas_smart_cb_description_cmp_sort); _evas_smart_cb_description_cmp_sort);
DBG("%u callbacks", a->size); DBG("%u callbacks", a->size);
if (a->size) if (a->size)
@ -282,29 +282,29 @@ evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a)
for (i = 0, j = 1; j < a->size; j++) for (i = 0, j = 1; j < a->size; j++)
{ {
const Evas_Smart_Cb_Description *cur, *prev; const Evas_Smart_Cb_Description *cur, *prev;
cur = a->array[j]; cur = a->array[j];
prev = a->array[i]; prev = a->array[i];
DBG("%s [type=%s]", cur->name, cur->type); DBG("%s [type=%s]", cur->name, cur->type);
if (strcmp(cur->name, prev->name) != 0) if (strcmp(cur->name, prev->name) != 0)
{ {
i++; i++;
if (i != j) if (i != j)
a->array[i] = a->array[j]; a->array[i] = a->array[j];
} }
else else
{ {
if (strcmp(cur->type, prev->type) == 0) if (strcmp(cur->type, prev->type) == 0)
WRN("duplicated smart callback description" WRN("duplicated smart callback description"
" with name '%s' and type '%s'", cur->name, cur->type); " with name '%s' and type '%s'", cur->name, cur->type);
else else
ERR("callback descriptions named '%s' differ" ERR("callback descriptions named '%s' differ"
" in type, keeping '%s', ignoring '%s'", " in type, keeping '%s', ignoring '%s'",
cur->name, prev->type, cur->type); cur->name, prev->type, cur->type);
} }
} }
evas_smart_cb_descriptions_resize(a, i + 1); evas_smart_cb_descriptions_resize(a, i + 1);
@ -318,18 +318,18 @@ _evas_smart_class_callbacks_create(Evas_Smart *s)
for (sc = s->smart_class; sc; sc = sc->parent) for (sc = s->smart_class; sc; sc = sc->parent)
{ {
const Evas_Smart_Cb_Description *d; const Evas_Smart_Cb_Description *d;
for (d = sc->callbacks; d && d->name; d++) for (d = sc->callbacks; d && d->name; d++)
n++; n++;
} }
if (n == 0) return; if (n == 0) return;
if (!evas_smart_cb_descriptions_resize(&s->callbacks, n)) return; if (!evas_smart_cb_descriptions_resize(&s->callbacks, n)) return;
for (n = 0, sc = s->smart_class; sc; sc = sc->parent) for (n = 0, sc = s->smart_class; sc; sc = sc->parent)
{ {
const Evas_Smart_Cb_Description *d; const Evas_Smart_Cb_Description *d;
for (d = sc->callbacks; d && d->name; d++) for (d = sc->callbacks; d && d->name; d++)
s->callbacks.array[n++] = d; s->callbacks.array[n++] = d;
} }
evas_smart_cb_descriptions_fix(&s->callbacks); evas_smart_cb_descriptions_fix(&s->callbacks);
} }
@ -349,5 +349,5 @@ evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const c
{ {
if (!a->array) return NULL; if (!a->array) return NULL;
return bsearch(name, a->array, a->size, sizeof(Evas_Smart_Cb_Description *), return bsearch(name, a->array, a->size, sizeof(Evas_Smart_Cb_Description *),
_evas_smart_cb_description_cmp_search); _evas_smart_cb_description_cmp_search);
} }