Edje_Part_Collection *pc;
Code *cd;
- if (current_de != NULL && current_de->entry == NULL)
+ if (current_de && !current_de->entry)
{
ERR("%p: Error. A collection without a name was detected, that's not allowed.", progname);
exit(-1);
p = data;
end = data + size;
line = 1;
- while ((token = next_token(p, end, &p, &delim)) != NULL)
+ while ((token = next_token(p, end, &p, &delim)))
{
/* if we are in param mode, the only delimiter
* we'll accept is the semicolon
_edje_collection_program_add(&edc->programs.nocmp,
&edc->programs.nocmp_count,
pg);
- else if (pg->signal && strpbrk(pg->signal, "*?[\\") == NULL
- && pg->source && strpbrk(pg->source, "*?[\\") == NULL)
+ else if (pg->signal && !strpbrk(pg->signal, "*?[\\")
+ && pg->source && !strpbrk(pg->source, "*?[\\"))
_edje_collection_program_add(&edc->programs.strcmp,
&edc->programs.strcmp_count,
pg);
snprintf(buf, sizeof (buf), "%s/", base);
strcat(buf, "%i");
- for (i = 0; i < count && match != NULL; ++i)
+ for (i = 0; i < count && match; ++i)
{
char name[1024];
int id;
snprintf(buf, sizeof (buf), "%s/", base);
strcat(buf, "%s");
- for (i = 0; i < count && match != NULL; ++i)
+ for (i = 0; i < count && match; ++i)
{
char name[1024];
char id[1024];
}
}
- for (itr = _slave_mode_commands; itr->cmd != NULL; itr++)
+ for (itr = _slave_mode_commands; itr->cmd; itr++)
{
if (strcmp(itr->cmd, buf) == 0)
{
epdi = (Edje_Part_Description_Image*) epd2;
/* There is an animation if both description are different or if description is an image with tweens */
- if (epd2 != NULL && (epd1 != epd2 || (ep->part->type == EDJE_PART_TYPE_IMAGE && epdi->image.tweens_count)))
+ if (epd2 && (epd1 != epd2 || (ep->part->type == EDJE_PART_TYPE_IMAGE && epdi->image.tweens_count)))
{
if (!ep->param2)
{
_edje_collection_program_add(&edc->programs.nocmp,
&edc->programs.nocmp_count,
pg);
- else if (pg->signal && strpbrk(pg->signal, "*?[\\") == NULL
- && pg->source && strpbrk(pg->source, "*?[\\") == NULL)
+ else if (pg->signal && !strpbrk(pg->signal, "*?[\\")
+ && pg->source && !strpbrk(pg->source, "*?[\\"))
_edje_collection_program_add(&edc->programs.strcmp,
&edc->programs.strcmp_count,
pg);
GETSTR(class, params[1]);
if (!class) return 0;
c_class = _edje_color_class_find(ed, class);
- if (c_class == NULL) return 0;
+ if (!c_class) return 0;
SETINT(c_class->r, params[2]);
SETINT(c_class->g, params[3]);
SETINT(c_class->b, params[4]);
GETSTR(class, params[1]);
if (!class) return 0;
t_class = _edje_text_class_find(ed, class);
- if (t_class == NULL) return 0;
+ if (!t_class) return 0;
SETSTR((char *)t_class->font, params[2]);
SETFLOAT(t_class->size, params[3]);
return 0;
_edje_emit(ed, "focus,in", "");
#ifdef HAVE_ECORE_IMF
rp = ed->focused_part;
- if (rp == NULL) return;
+ if (!rp) return;
en = rp->entry_data;
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
type->module_name);
return EDJE_EXTERNAL_PARAM_TYPE_MAX;
}
- for (info = type->parameters_info; info->name != NULL; info++)
+ for (info = type->parameters_info; info->name; info++)
if (strcmp(info->name, param) == 0)
return info->type;
if ((!file) || (!*file)) return NULL;
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
- if (edf != NULL)
+ if (edf)
{
Eina_Iterator *i;
const char *key;
if ((!file) || (!*file)) return EINA_FALSE;
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
- if (edf != NULL)
+ if (edf)
{
Edje_Patterns *patterns;
if (key)
{
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
- if (edf != NULL)
+ if (edf)
{
str = (char*) edje_string_get(eina_hash_find(edf->data, key));
void
_edje_file_add(Edje *ed)
{
- if (_edje_edd_edje_file == NULL) return;
+ if (!_edje_edd_edje_file) return;
ed->file = _edje_cache_file_coll_open(ed->path, ed->group,
&(ed->load_error),
&(ed->collection));
{
int n = 0;
_edje_lua_new_metatable(L, class);
- while (class && (class[n] != NULL))
+ while (class && (class[n]))
{
luaL_register(L, NULL, class[n]->mt);
lua_pushstring(L, "hands off, it's none of your business!");
void
_edje_lua_init()
{
- if (Ledje != NULL) return;
+ if (Ledje) return;
/*
* create main Lua state with the custom memory allocation function
*/
void
_edje_lua_shutdown()
{
- if (Ledje == NULL) return;
+ if (!Ledje) return;
lua_close(Ledje);
Ledje = NULL;
}
for (i = 0; i < count; ++i)
{
- if (programs[i]->signal && strpbrk(programs[i]->signal, "*?[\\") == NULL
- && programs[i]->source && strpbrk(programs[i]->source, "*?[\\") == NULL)
+ if (programs[i]->signal && !strpbrk(programs[i]->signal, "*?[\\")
+ && programs[i]->source && !strpbrk(programs[i]->source, "*?[\\"))
{
Edje_Signal_Source_Char *item;
EINA_LIST_FOREACH(callbacks, l, callback)
{
- if (callback->signal && strpbrk(callback->signal, "*?[\\") == NULL
- && callback->source && strpbrk(callback->source, "*?[\\") == NULL)
+ if (callback->signal && !strpbrk(callback->signal, "*?[\\")
+ && callback->source && !strpbrk(callback->source, "*?[\\"))
{
Edje_Signal_Source_Char *item;
{
int i;
- if (msgq == NULL) return;
+ if (!msgq) return;
/* allow the message queue to feed itself up to 8 times before forcing */
/* us to go back to normal processing and let a 0 timeout deal with it */
{
if (*str != '*' && *str != '?')
return EINA_FALSE;
- if (strpbrk(str + 1, "*?[\\") != NULL)
+ if (strpbrk(str + 1, "*?[\\"))
return EINA_FALSE;
return EINA_TRUE;
}
#ifdef LUA2
_edje_lua2_script_init(ed);
#else
- if (ed->L == NULL) /* private state does not yet exist, create it */
+ if (!ed->L) /* private state does not yet exist, create it */
{
ed->L = _edje_lua_new_thread(ed, _edje_lua_state_get());
}
/* The part contain a [index], retrieve it */
idx = strchr(sig, EDJE_PART_PATH_SEPARATOR_INDEXL);
- if (idx == NULL || sep < idx) newsig = part + (sep - sig);
+ if (!idx || sep < idx) newsig = part + (sep - sig);
else newsig = part + (idx - sig);
*newsig = '\0';
type = evas_object_data_get(obj, "Edje_External_Type");
if (!type) return NULL;
- for (info = type->parameters_info; info->name != NULL; info++)
+ for (info = type->parameters_info; info->name; info++)
if (!strcmp(info->name, name)) return info;
return NULL;
{
const char **itr = info->info.c.choices;
if (!itr) return EINA_FALSE;
- for (; *itr != NULL; itr++)
+ for (; *itr; itr++)
if (!strcmp(*itr, param->s))
return EINA_TRUE;
return EINA_FALSE;
if (ep->text.cache.in_str) eina_stringshare_del(ep->text.cache.in_str);
ep->text.cache.in_str = eina_stringshare_add(text);
ep->text.cache.in_size = size;
- if (chosen_desc->text.fit_x && (ep->text.cache.in_str != NULL && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
+ if (chosen_desc->text.fit_x && (ep->text.cache.in_str && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
{
if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
else evas_object_text_font_source_set(ep->object, NULL);
}
}
}
- if (chosen_desc->text.fit_y && (ep->text.cache.in_str != NULL && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
+ if (chosen_desc->text.fit_y && (ep->text.cache.in_str && eina_stringshare_strlen(ep->text.cache.in_str) > 0))
{
/* if we fit in the x axis, too, size already has a somewhat
* meaningful value, so don't overwrite it with the starting
return NULL;
}
- for (; (base->name != NULL) && (base->name[0] == name[0]); base++)
+ for (; (base->name) && (base->name[0] == name[0]); base++)
if (strcmp(base->name, name) == 0)
return base->cb;
if (alias)
{
rp = _edje_real_part_recursive_get(ed, alias);
- if (path[1] == NULL) return rp;
+ if (!path[1]) return rp;
if (!rp) return NULL;
}
else
{
rp = _edje_real_part_get(ed, path[0]);
- if (path[1] == NULL) return rp;
+ if (!path[1]) return rp;
if (!rp) return NULL;
}
array = &edc->programs.nocmp;
count = &edc->programs.nocmp_count;
}
- else if (p->signal && strpbrk(p->signal, "*?[\\") == NULL
- && p->source && strpbrk(p->source, "*?[\\") == NULL)
+ else if (p->signal && !strpbrk(p->signal, "*?[\\")
+ && p->source && !strpbrk(p->source, "*?[\\"))
{
array = &edc->programs.strcmp;
count = &edc->programs.strcmp_count;
array = &edc->programs.nocmp;
count = &edc->programs.nocmp_count;
}
- else if (p->signal && strpbrk(p->signal, "*?[\\") == NULL
- && p->source && strpbrk(p->source, "*?[\\") == NULL)
+ else if (p->signal && !strpbrk(p->signal, "*?[\\")
+ && p->source && !strpbrk(p->source, "*?[\\"))
{
array = &edc->programs.strcmp;
count = &edc->programs.strcmp_count;