EAPI int
evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache)
{
- assert(cache != NULL);
+ assert(!!cache);
return cache->usage;
}
EAPI int
evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache)
{
- assert(cache != NULL);
+ assert(!!cache);
return cache->limit;
}
EAPI void
evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit)
{
- assert(cache != NULL);
+ assert(!!cache);
cache->limit = limit;
}
EAPI void
evas_cache_engine_image_flush(Evas_Cache_Engine_Image *cache)
{
- assert(cache != NULL);
+ assert(!!cache);
while ((cache->lru) && (cache->limit < cache->usage))
{
Engine_Image_Entry *eim;
Eina_List *delete_list = NULL;
- assert(cache != NULL);
+ assert(!!cache);
if (cache->func.debug) cache->func.debug("shutdown-engine", NULL);
Image_Entry *im;
const char *ekey;
- assert(cache != NULL);
+ assert(!!cache);
*error = EVAS_LOAD_ERROR_NONE;
{
/* FIXME: Handle case when image is being processed anyway and don't do a double decode. */
im->cache_key = key;
- if (key != NULL)
+ if (key)
{
im->flags.cached = 1;
im->flags.activ = 1;
}
}
- if (ie->targets == NULL && ie->preload && !ie->flags.pending)
+ if (!ie->targets && ie->preload && !ie->flags.pending)
{
ie->cache->preload = eina_list_remove(ie->cache->preload, ie);
ie->cache->pending = eina_list_append(ie->cache->pending, ie);
EAPI int
evas_cache_image_usage_get(Evas_Cache_Image *cache)
{
- assert(cache != NULL);
+ assert(!!cache);
return cache->usage;
}
EAPI int
evas_cache_image_get(Evas_Cache_Image *cache)
{
- assert(cache != NULL);
+ assert(!!cache);
return cache->limit;
}
EAPI void
evas_cache_image_set(Evas_Cache_Image *cache, int limit)
{
- assert(cache != NULL);
+ assert(!!cache);
#ifdef EVAS_FRAME_QUEUING
LKL(cache->lock);
#endif
size_t key_length;
struct stat st;
- assert(cache != NULL);
+ assert(!!cache);
if ((!file) || ((!file) && (!key)))
{
assert(im);
assert(im->cache);
- if (target == NULL) return;
+ if (!target) return;
_evas_cache_image_entry_preload_remove(im, target);
#else
(void)im;
obj->cur.clipper = NULL;
}
/* clip me */
- if ((clip->clip.clipees == NULL) && (clip->cur.visible))
+ if ((!clip->clip.clipees) && (clip->cur.visible))
{
/* Basically it just went invisible */
clip->changed = 1;
if (!key) return;
evas_object_data_del(obj, key);
- if (data == NULL) return;
+ if (!data) return;
node = malloc(sizeof(Evas_Data_Node) + strlen(key) + 1);
node->key = (char *)node + sizeof(Evas_Data_Node);
strcpy(node->key, key);
return new_opt;
}
- for (l = priv->children, i = 0; l != NULL; l = l->next, i++)
+ for (l = priv->children, i = 0; l; l = l->next, i++)
{
Evas_Object_Box_Option *opt = l->data;
int off_y = 0, max_h = 0, n_rows = 0;
Eina_List *l;
- for (i = 0, l = priv->children; l != NULL; i++, l = l->next)
+ for (i = 0, l = priv->children; l; i++, l = l->next)
{
Evas_Object_Box_Option *opt = l->data;
int padding_l, padding_r, padding_t, padding_b;
int off_x = 0, max_w = 0, n_cols = 0;
Eina_List *l;
- for (i = 0, l = priv->children; l != NULL; i++, l = l->next)
+ for (i = 0, l = priv->children; l; i++, l = l->next)
{
Evas_Object_Box_Option *opt = l->data;
int padding_l, padding_r, padding_t, padding_b;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->show.func) != NULL);
+ ret = !!(obj->interceptors->show.func);
if (obj->interceptors->show.func)
obj->interceptors->show.func(obj->interceptors->show.data, obj);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->hide.func) != NULL);
+ ret = !!(obj->interceptors->hide.func);
if (obj->interceptors->hide.func)
obj->interceptors->hide.func(obj->interceptors->hide.data, obj);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->move.func) != NULL);
+ ret = !!(obj->interceptors->move.func);
if (obj->interceptors->move.func)
obj->interceptors->move.func(obj->interceptors->move.data, obj, x, y);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->resize.func) != NULL);
+ ret = !!(obj->interceptors->resize.func);
if (obj->interceptors->resize.func)
obj->interceptors->resize.func(obj->interceptors->resize.data, obj, w, h);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->raise.func) != NULL);
+ ret = !!(obj->interceptors->raise.func);
if (obj->interceptors->raise.func)
obj->interceptors->raise.func(obj->interceptors->raise.data, obj);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->lower.func) != NULL);
+ ret = !!(obj->interceptors->lower.func);
if (obj->interceptors->lower.func)
obj->interceptors->lower.func(obj->interceptors->lower.data, obj);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->stack_above.func) != NULL);
+ ret = !!(obj->interceptors->stack_above.func);
if (obj->interceptors->stack_above.func)
obj->interceptors->stack_above.func(obj->interceptors->stack_above.data, obj, above);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->stack_below.func) != NULL);
+ ret = !!(obj->interceptors->stack_below.func);
if (obj->interceptors->stack_below.func)
obj->interceptors->stack_below.func(obj->interceptors->stack_below.data, obj, below);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->layer_set.func) != NULL);
+ ret = !!(obj->interceptors->layer_set.func);
if (obj->interceptors->layer_set.func)
obj->interceptors->layer_set.func(obj->interceptors->layer_set.data, obj, l);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->color_set.func) != NULL);
+ ret = !!(obj->interceptors->color_set.func);
if (obj->interceptors->color_set.func)
obj->interceptors->color_set.func(obj->interceptors->color_set.data, obj, r, g, b, a);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->clip_set.func) != NULL);
+ ret = !!(obj->interceptors->clip_set.func);
if (obj->interceptors->clip_set.func)
obj->interceptors->clip_set.func(obj->interceptors->clip_set.data, obj, clip);
obj->intercepted = 0;
if (!obj->interceptors) return 0;
if (obj->intercepted) return 0;
obj->intercepted = 1;
- ret = ((obj->interceptors->clip_unset.func) != NULL);
+ ret = !!(obj->interceptors->clip_unset.func);
if (obj->interceptors->clip_unset.func)
obj->interceptors->clip_unset.func(obj->interceptors->clip_unset.data, obj);
obj->intercepted = 0;
return 1;
}
- for (count = 0, d = descriptions; d->name != NULL; d++)
+ for (count = 0, d = descriptions; d->name; d++)
count++;
evas_smart_cb_descriptions_resize(&o->callbacks_descriptions, count);
_layout_walk_back_to_item_word_redo(c, it);
goto end;
}
- if (c->ln->items != NULL)
+ if (c->ln->items)
{
white_stripped = _layout_item_abort(c, fmt, it);
empty_item = 1;
goto end;
}
}
- if (c->ln->items != NULL)
+ if (c->ln->items)
{
white_stripped = _layout_item_abort(c, fmt, it);
empty_item = 1;
const Evas_Smart_Class *sc;
unsigned int n = 0;
- for (sc = s->smart_class; sc != NULL; sc = sc->parent)
+ for (sc = s->smart_class; sc; sc = sc->parent)
{
const Evas_Smart_Cb_Description *d;
- for (d = sc->callbacks; d && d->name != NULL; d++)
+ for (d = sc->callbacks; d && d->name; d++)
n++;
}
if (n == 0) return;
if (!evas_smart_cb_descriptions_resize(&s->callbacks, n)) return;
- for (n = 0, sc = s->smart_class; sc != NULL; sc = sc->parent)
+ for (n = 0, sc = s->smart_class; sc; sc = sc->parent)
{
const Evas_Smart_Cb_Description *d;
- for (d = sc->callbacks; d->name != NULL; d++)
+ for (d = sc->callbacks; d->name; d++)
s->callbacks.array[n++] = d;
}
evas_smart_cb_descriptions_fix(&s->callbacks);
ie->data1 = rep->handle;
}
if (rep) free(rep);
- if (ie->data1 == NULL) return 0;
+ if (!ie->data1) return 0;
ie->connect_num = connect_num;
if (cserve)
ie->server_id = cserve->server_id;
if (csrve_init > 0) server_reinit();
else return 0;
if (!cserve) return 0;
- if (ie->data1 == NULL) return 0;
+ if (!ie->data1) return 0;
if (cserve->server_id != ie->server_id)
{
ie->data1 = NULL;
if (csrve_init > 0) server_reinit();
else return;
if (!cserve) return;
- if (ie->data1 == NULL) return;
+ if (!ie->data1) return;
memset(&msg, 0, sizeof(msg));
msg.handle = ie->data1;
msg.server_id = cserve->server_id;
if (csrve_init > 0) server_reinit();
else return;
if (!cserve) return;
- if (ie->data1 == NULL) return;
+ if (!ie->data1) return;
if (ie->connect_num != connect_num) return;
memset(&msg, 0, sizeof(msg));
msg.handle = ie->data1;
if (csrve_init > 0) server_reinit();
else return;
if (!cserve) return;
- if (ie->data1 == NULL) return;
+ if (!ie->data1) return;
if (ie->connect_num != connect_num) return;
memset(&msg, 0, sizeof(msg));
msg.handle = ie->data1;
int error;
RGBA_Font_Source *fs;
- assert(name != NULL);
+ assert(!!name);
fs = calloc(1, sizeof(RGBA_Font_Source) + data_size);
if (!fs) return NULL;
{
RGBA_Font_Source *fs;
- assert(name != NULL);
+ assert(!!name);
fs = calloc(1, sizeof(RGBA_Font_Source));
if (!fs) return NULL;
if (im->image.data) free(im->image.data);
im->image.data = malloc(siz);
- if (im->image.data == NULL) return -1;
+ if (!im->image.data) return -1;
#ifdef HAVE_VALGRIND
# ifdef VALGRIND_MAKE_READABLE
EAPI void
evas_common_image_set_cache(int size)
{
- if (eci != NULL)
+ if (eci)
evas_cache_image_set(eci, size);
}
EAPI RGBA_Image *
evas_common_load_image_from_file(const char *file, const char *key, RGBA_Image_Loadopts *lo, int *error)
{
- if (file == NULL)
+ if (!file)
{
*error = EVAS_LOAD_ERROR_GENERIC;
return NULL;
/* 1. pick a frame to draw */
LKL(frameq->mutex);
- while(frame == NULL)
+ while(!frame)
{
EINA_INLIST_FOREACH(EINA_INLIST_GET(frameq->frames), frame)
{
static long long
tv_to_long_long(struct timeval *tv)
{
- if (tv == NULL)
+ if (!tv)
{
return 0;
}
int diff;
diff = list_node_pool.len - max;
- for (; diff > 0 && list_node_pool.node != NULL; diff--)
+ for (; diff > 0 && list_node_pool.node; diff--)
{
list_node_t *node;
int len;
len = 0;
- for (node = rects.head; node != NULL; node = node->next) len++;
+ for (node = rects.head; node; node = node->next) len++;
putchar('[');
- for (node = rects.head; node != NULL; node = node->next)
+ for (node = rects.head; node; node = node->next)
{
rect_print(((rect_node_t *)node)->rect);
if (node->next)
merged = 0;
parent_node = NULL;
node = rects->head;
- while (node != NULL)
+ while (node)
{
rect_t r2, outer;
int area;
num = _add_redraw(&lr, tb->outbuf_w, tb->outbuf_h, x, y, w, h);
num += _add_redraw(&lr, tb->outbuf_w, tb->outbuf_h, x + dx, y + dy, w, h);
- while (lr.head != NULL)
+ while (lr.head)
{
list_node_t *node = rect_list_unlink_next(&lr, NULL);
rect_list_add_split_fuzzy_and_merge(&tb->rects, node,
tb->need_merge = 0;
}
- for (n = tb->rects.head; n != NULL; n = n->next) {
+ for (n = tb->rects.head; n; n = n->next) {
rect_t cur;
cur = ((rect_node_t *)n)->rect;
evas_engines = eina_array_new(4);
- for (i = 0; evas_static_module[i].init != NULL; ++i)
+ for (i = 0; evas_static_module[i].init; ++i)
evas_static_module[i].init();
}
evas_module_load(Evas_Module *em)
{
if (em->loaded) return 1;
- if (em->definition == NULL) return 0;
+ if (!em->definition) return 0;
if (!em->definition->func.open(em)) return 0;
em->loaded = 1;
{
if (!em->loaded)
return;
- if (em->definition == NULL)
+ if (!em->definition)
return ;
// for now lets not unload modules - they may still be in use.
char *path;
int i;
- for (i = 0; evas_static_module[i].shutdown != NULL; ++i)
+ for (i = 0; evas_static_module[i].shutdown; ++i)
evas_static_module[i].shutdown();
EINA_LIST_FREE(eina_evas_modules, en)
Evas_Engine_Info_Direct3D *in;
re = (Render_Engine *)e->engine.data.output;
in = (Evas_Engine_Info_Direct3D *)info;
- if (e->engine.data.output == NULL)
+ if (!e->engine.data.output)
{
e->engine.data.output = _output_setup(e->output.w,
e->output.h,
}
else if (in->info.fullscreen != 0)
{
- if (re != NULL)
+ if (re)
evas_direct3d_set_layered(re->d3d, 0, 0, 0, NULL);
evas_direct3d_set_fullscreen(re->d3d, -1, -1, 1);
}
else if (in->info.fullscreen == 0)
{
evas_direct3d_set_fullscreen(re->d3d, re->width, re->height, 0);
- if (re != NULL && in->info.layered == 0)
+ if (re && in->info.layered == 0)
evas_direct3d_set_layered(re->d3d, 0, 0, 0, NULL);
- else if (re != NULL && in->info.layered != 0 && in->shape != NULL)
+ else if (re && in->info.layered != 0 && in->shape)
evas_direct3d_set_layered(re->d3d, 1, in->shape->width, in->shape->height, in->shape->mask);
}
- if (e->engine.data.output == NULL)
+ if (!e->engine.data.output)
return 0;
- if (e->engine.data.context == NULL)
+ if (!e->engine.data.context)
e->engine.data.context = e->engine.func->context_new(e->engine.data.output);
return 1;
xob->shm_info->readOnly = False;
xob->shm_info->shmaddr = xob->xim->data =
shmat(xob->shm_info->shmid, 0, 0);
- if (xob->shm_info->shmaddr != NULL)
+ if (xob->shm_info->shmaddr)
{
XErrorHandler ph;
xob->shm_info->shmaddr = xob->xim->data =
shmat(xob->shm_info->shmid, 0, 0);
- if (xob->shm_info->shmaddr != NULL)
+ if (xob->shm_info->shmaddr)
{
/*
* FIXME: no error mechanism
{
xcbob->shm_info->shmaddr = xcbob->image->data =
shmat(xcbob->shm_info->shmid, 0, 0);
- if (xcbob->shm_info->shmaddr != NULL)
+ if (xcbob->shm_info->shmaddr)
{
/*
* FIXME: no error mechanism
xob->shm_info->readOnly = False;
xob->shm_info->shmaddr = xob->xim->data =
shmat(xob->shm_info->shmid, 0, 0);
- if (xob->shm_info->shmaddr != NULL)
+ if (xob->shm_info->shmaddr)
{
XErrorHandler ph;
shm_info.shmid = shmget(IPC_PRIVATE, xim->size, IPC_CREAT | 0777);
if (shm_info.shmid >= 0) {
shm_info.shmaddr = xim->data = shmat(shm_info.shmid, 0, 0);
- if ((shm_info.shmaddr != NULL) && (shm_info.shmaddr != (void *) -1)) {
+ if ((shm_info.shmaddr) && (shm_info.shmaddr != (void *) -1)) {
xcb_get_input_focus_reply_t *reply;
/*
* FIXME: no error mechanism
return EINA_FALSE;
}
- if (rgba_image.rgba.put.any == NULL)
+ if (!rgba_image.rgba.put.any)
{
ERR("Evas Tiff loader: no put function");
goto close_file;
info_ptr = png_create_info_struct(png_ptr);
- if (info_ptr == NULL)
+ if (!info_ptr)
{
png_destroy_write_struct(&png_ptr, NULL);
goto close_file;