#else /* no safety checks */
#define EINA_SAFETY_ON_NULL_RETURN(exp) \
- do { (void)((exp) == NULL); } while (0)
+ do { (void)(!(exp)); } while (0)
#define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val) \
- do { if (0 && (exp) == NULL) { (void)val; } } while (0)
+ do { if (0 && !(exp)) { (void)val; } } while (0)
#define EINA_SAFETY_ON_NULL_GOTO(exp, label) \
do { if (0 && (exp) == NULL) { goto label; } } while (0)
return NULL;
for (current = strchr(path, PATH_DELIM);
- current != NULL;
+ current;
path = current + 1, current = strchr(path, PATH_DELIM))
{
length = current - path;
if (!(it->index < it->hash->population))
return EINA_FALSE;
- if (it->current == NULL)
+ if (!it->current)
{
ok = EINA_FALSE;
bucket = 0;
{
while (bucket < it->hash->size)
{
- if (it->hash->buckets[bucket] != NULL)
+ if (it->hash->buckets[bucket])
{
it->current =
eina_rbtree_iterator_prefix(it->hash->buckets[bucket]);
static Eina_Bool
eina_inlist_iterator_next(Eina_Iterator_Inlist *it, void **data) {
- if (it->current == NULL)
+ if (!it->current)
return EINA_FALSE;
if (data)
else if (idx > it->index)
/* Looking after current. */
for (i = it->index, over = it->current;
- i < idx && over != NULL;
+ i < idx && over;
++i, over = over->next)
;
else
if (idx > middle)
/* Looking backward from current. */
for (i = it->index, over = it->current;
- i > idx && over != NULL;
+ i > idx && over;
--i, over = over->prev)
;
else
/* Looking from the start. */
for (i = 0, over = it->head;
- i < idx && over != NULL;
+ i < idx && over;
++i, over = over->next)
;
}
- if (over == NULL)
+ if (!over)
return EINA_FALSE;
it->current = over;
EINA_SAFETY_ON_NULL_RETURN_VAL(list, NULL);
EINA_SAFETY_ON_NULL_RETURN_VAL(item, list);
EINA_SAFETY_ON_TRUE_RETURN_VAL
- ((item != list) && (item->prev == NULL) && (item->next == NULL), list);
+ ((item != list) && (!item->prev) && (!item->next), list);
if (item->next)
item->next->prev = item->prev;
{
EINA_MAGIC_CHECK_LIST_ITERATOR(it, EINA_FALSE);
- if (it->current == NULL)
+ if (!it->current)
return EINA_FALSE;
*data = eina_list_data_get(it->current);
{
EINA_MAGIC_CHECK_LIST_ITERATOR(it, EINA_FALSE);
- if (it->current == NULL)
+ if (!it->current)
return EINA_FALSE;
*data = eina_list_data_get(it->current);
/* Go backward from the end. */
for (i = eina_list_count(it->head) - 1,
over = eina_list_last(it->head);
- i > idx && over != NULL;
+ i > idx && over;
--i, over = eina_list_prev(over))
;
else
/* Go forward from current. */
for (i = it->index, over = it->current;
- i < idx && over != NULL;
+ i < idx && over;
++i, over = eina_list_next(over))
;
}
if (idx > middle)
/* Go backward from current. */
for (i = it->index, over = it->current;
- i > idx && over != NULL;
+ i > idx && over;
--i, over = eina_list_prev(over))
;
else
/* Go forward from start. */
for (i = 0, over = it->head;
- i < idx && over != NULL;
+ i < idx && over;
++i, over = eina_list_next(over))
;
}
- if (over == NULL)
+ if (!over)
return EINA_FALSE;
it->current = over;
va_list args;
#ifdef EINA_SAFETY_CHECKS
- if (EINA_UNLIKELY(file == NULL))
+ if (EINA_UNLIKELY(!file))
{
fputs("ERR: eina_log_print() file == NULL\n", stderr);
return;
}
- if (EINA_UNLIKELY(fnc == NULL))
+ if (EINA_UNLIKELY(!fnc))
{
fputs("ERR: eina_log_print() fnc == NULL\n", stderr);
return;
}
- if (EINA_UNLIKELY(fmt == NULL))
+ if (EINA_UNLIKELY(!fmt))
{
fputs("ERR: eina_log_print() fmt == NULL\n", stderr);
return;
const char *fnc, int line, const char *fmt, va_list args)
{
#ifdef EINA_SAFETY_CHECKS
- if (EINA_UNLIKELY(file == NULL))
+ if (EINA_UNLIKELY(!file))
{
fputs("ERR: eina_log_print() file == NULL\n", stderr);
return;
}
- if (EINA_UNLIKELY(fnc == NULL))
+ if (EINA_UNLIKELY(!fnc))
{
fputs("ERR: eina_log_print() fnc == NULL\n", stderr);
return;
}
- if (EINA_UNLIKELY(fmt == NULL))
+ if (EINA_UNLIKELY(!fmt))
{
fputs("ERR: eina_log_print() fmt == NULL\n", stderr);
return;
assert(dir != 0);
if (dir > 0)
{
- for (; r != NULL; r = r->next)
+ for (; r; r = r->next)
if (r->row == row)
{
((Eina_Matrixsparse *)m)->last_used = r;
}
else if (dir < 0)
- for (; r != NULL; r = r->prev)
+ for (; r; r = r->prev)
if (r->row == row)
{
((Eina_Matrixsparse *)m)->last_used = r;
assert(dir != 0);
if (dir > 0)
{
- for (; r != NULL; c = c->next)
+ for (; r; c = c->next)
if (c->col == col)
{
((Eina_Matrixsparse_Row *)r)->last_used = c;
}
else if (dir < 0)
- for (; r != NULL; c = c->prev)
+ for (; r; c = c->prev)
if (c->col == col)
{
((Eina_Matrixsparse_Row *)r)->last_used = c;
assert(dir != 0);
if (dir > 0)
{
- for (; r != NULL; r = r->next)
+ for (; r; r = r->next)
if (r->row > row)
break;
- assert(r != NULL);
+ assert(!!r);
*p_prev = r->prev;
*p_next = r;
}
else if (dir < 0)
{
- for (; r != NULL; r = r->prev)
+ for (; r; r = r->prev)
if (r->row < row)
break;
- assert(r != NULL);
+ assert(!!r);
*p_prev = r;
*p_next = r->next;
}
assert(dir != 0);
if (dir > 0)
{
- for (; c != NULL; c = c->next)
+ for (; c; c = c->next)
if (c->col > col)
break;
- assert(c != NULL);
+ assert(!!c);
*p_prev = c->prev;
*p_next = c;
}
else if (dir < 0)
{
- for (; c != NULL; c = c->prev)
+ for (; c; c = c->prev)
if (c->col < col)
break;
- assert(c != NULL);
+ assert(!!c);
*p_prev = c;
*p_next = c->next;
}
{
Eina_Matrixsparse_Row *prev = NULL, *next = NULL;
_eina_matrixsparse_row_idx_siblings_find(m, row, &prev, &next);
- assert(prev != NULL);
- assert(next != NULL);
+ assert(!!prev);
+ assert(!!next);
r->prev = prev;
r->next = next;
prev->next = r;
{
Eina_Matrixsparse_Cell *prev = NULL, *next = NULL;
_eina_matrixsparse_row_cell_idx_siblings_find(r, col, &prev, &next);
- assert(prev != NULL);
- assert(next != NULL);
+ assert(!!prev);
+ assert(!!next);
c->prev = prev;
c->next = next;
prev->next = c;
if (it->idx.row >= it->m->size.rows)
return 0;
- if (it->dummy.col.data != NULL)
+ if (it->dummy.col.data)
ERR("Last iterator call changed dummy cell!");
if ((it->ref.col) &&
{
EINA_MAGIC_CHECK_MATRIXSPARSE_ITERATOR(it);
- if (it->dummy.col.data != NULL)
+ if (it->dummy.col.data)
ERR("Last iterator call changed dummy cell!");
EINA_MAGIC_SET(it, EINA_MAGIC_NONE);
free_func = m->free.func;
user_data = m->free.user_data;
- for (r = m->rows; r != NULL; )
+ for (r = m->rows; r; )
{
Eina_Matrixsparse_Row *r_aux = r;
Eina_Matrixsparse_Cell *c;
last = eina_array_data_get(it->stack, eina_array_count_get(it->stack) - 1);
tree = last->tree;
- if (last->tree == NULL || last->up == EINA_TRUE)
+ if (!last->tree || last->up == EINA_TRUE)
{
last = eina_array_pop(it->stack);
while (last->dir == EINA_RBTREE_LEFT
- || last->tree == NULL)
+ || !last->tree)
{
if (tree)
if ((it->mask & EINA_RBTREE_ITERATOR_POSTFIX_MASK) ==
static inline Eina_Bool
_eina_rbtree_is_red(Eina_Rbtree *node)
{
- return node != NULL && node->color == EINA_RBTREE_RED;
+ return !!node && node->color == EINA_RBTREE_RED;
}
static inline Eina_Rbtree *
/* Search down the tree */
for (;; )
{
- if (q == NULL)
+ if (!q)
/* Insert new node at the bottom */
p->son[dir] = q = node;
else if (_eina_rbtree_is_red(q->son[0])
dir = cmp(q, node, (void *)data);
/* Update helpers */
- if ( g != NULL )
+ if ( g )
t = g;
g = p, p = q;
q->son[EINA_RBTREE_RIGHT] = root;
/* Search and push a red down */
- while (q->son[dir] != NULL)
+ while (q->son[dir])
{
Eina_Rbtree_Direction last = dir;
Eina_Rbtree *g;
{
Eina_Rbtree *s = p->son[!last];
- if (s != NULL)
+ if (s)
{
if (!_eina_rbtree_is_red(s->son[EINA_RBTREE_LEFT])
&& !_eina_rbtree_is_red(s->son[EINA_RBTREE_RIGHT]))
}
/* Replace and remove if found */
- if (f != NULL)
+ if (f)
{
/* 'q' should take the place of 'node' parent */
f->son[f->son[1] == node] = q;
/* Switch the link from the parent to q's son */
- p->son[p->son[1] == q] = q->son[q->son[0] == NULL];
+ p->son[p->son[1] == q] = q->son[!q->son[0]];
/* Put q at the place of node */
q->son[0] = node->son[0];
}
root = head.son[1];
- if (root != NULL)
+ if (root)
root->color = EINA_RBTREE_BLACK;
return root;
prev = node;
node = node->next;
- for (; node != NULL; prev = node, node = node->next)
+ for (; node; prev = node, node = node->next)
if (_eina_share_common_node_eq(node, str, slen))
{
/* promote node, make hot items be at the beginning */
prev = head->head;
cur = head->head->next;
- for (; cur != NULL; prev = cur, cur = cur->next)
+ for (; cur; prev = cur, cur = cur->next)
if (cur == node)
{
prev->next = cur->next;
merged = 0;
parent_node = NULL;
node = rects->head;
- while (node != NULL)
+ while (node)
{
rect_t r2, outer;
int area;
Eina_Rectangle *rect = (Eina_Rectangle *)data;
list_node_t *n;
- for (n = it->curr; n != NULL; n = n->next)
+ for (n = it->curr; n; n = n->next)
{
rect_t cur;
list->last = end;
- if (list->first == NULL)
+ if (!list->first)
{
list->first = end;
list->index = 0;
list->first = start;
/* If no last node, then the first node is the last node */
- if (list->last == NULL)
+ if (!list->last)
list->last = list->first;
list->nodes++;
if (list->current == list->first)
return _ecore_list_prepend_0(list, new_node);
- if (list->current == NULL)
+ if (!list->current)
{
int ret_value;
return FALSE;
_ecore_list_first_goto(list);
- while ((value = _ecore_list_next(list)) != NULL)
+ while ((value = _ecore_list_next(list)))
function(value, user_data);
return TRUE;
return NULL;
_ecore_list_first_goto(list);
- while ((value = _ecore_list_current(list)) != NULL)
+ while ((value = _ecore_list_current(list)))
{
if (!function(value, user_data))
return value;
eina_init();
- for (i = 0; etc[i].bench_case != NULL; ++i)
+ for (i = 0; etc[i].bench_case; ++i)
{
test = eina_benchmark_new(etc[i].bench_case, argv[1]);
if (!test)
{
const Eina_Test_Case *itr = etc;
fputs("Available Test Cases:\n", stderr);
- for (; itr->test_case != NULL; itr++)
+ for (; itr->test_case; itr++)
fprintf(stderr, "\t%s\n", itr->test_case);
}
s = suite_create("Eina");
- for (i = 0; etc[i].test_case != NULL; ++i)
+ for (i = 0; etc[i].test_case; ++i)
{
if (!_use_test(argc, argv, etc[i].test_case))
continue;
t0 = eina_binshare_add_length(buf, i);
t1 = eina_binshare_add_length(buf, i);
- fail_if(t0 == NULL);
- fail_if(t1 == NULL);
+ fail_if(!t0);
+ fail_if(!t1);
fail_if(t0 != t1);
fail_if(memcmp(t0, buf, i) != 0);
t0 = eina_binshare_add_length(TEST0, TEST0_SIZE);
t1 = eina_binshare_add_length(TEST0, TEST0_SIZE);
- fail_if(t0 == NULL);
- fail_if(t1 == NULL);
+ fail_if(!t0);
+ fail_if(!t1);
fail_if(memcmp(t0, TEST0, TEST0_SIZE) != 0);
fail_if(memcmp(t1, TEST0, TEST0_SIZE) != 0);
fail_if(t0 != t1);
if (rand() > RAND_MAX / 2)
{
const char *r = eina_binshare_add_length(buffer, strlen(buffer));
- fail_if(r == NULL);
+ fail_if(!r);
}
}
eina_array_push(ea,
(void *)eina_binshare_add_length(buffer, strlen(buffer)));
r = eina_binshare_add_length(buffer, strlen(buffer));
- fail_if(r == NULL);
+ fail_if(!r);
r = eina_binshare_add_length(buffer, strlen(buffer));
- fail_if(r == NULL);
+ fail_if(!r);
}
for (i = 0; i < 200; ++i)
fail_if(eina_init() != 2);
hash = eina_hash_string_djb2_new(NULL);
- fail_if(hash == NULL);
+ fail_if(!hash);
fail_if(eina_hash_direct_add(hash, "42", "42") != EINA_TRUE);
fail_if(eina_hash_direct_add(hash, tmp, tmp) != EINA_TRUE);
}
- fail_if(eina_hash_find(hash, "42") == NULL);
+ fail_if(!eina_hash_find(hash, "42"));
eina_hash_free(hash);
fail_if(eina_init() != 2);
hash = eina_hash_string_superfast_new(NULL);
- fail_if(hash == NULL);
+ fail_if(!hash);
fail_if(eina_hash_add(hash, "7", &i[0]) != EINA_TRUE);
fail_if(eina_hash_add(hash, "7", &i[1]) != EINA_TRUE);
fail_if(eina_init() != 2);
hash = eina_hash_int32_new(NULL);
- fail_if(hash == NULL);
+ fail_if(!hash);
for (it = 0; it < 4; ++it)
fail_if(eina_hash_add(hash, &i[it], &i[it]) != EINA_TRUE);
eina_hash_free(hash);
hash = eina_hash_int64_new(NULL);
- fail_if(hash == NULL);
+ fail_if(!hash);
for (it = 0; it < 4; ++it)
fail_if(eina_hash_add(hash, &j[it], &j[it]) != EINA_TRUE);
l1 = eina_list_append(l1, &data[1]);
l1 = eina_list_append(l1, &data[2]);
l1 = eina_list_append(l1, &data[3]);
- fail_if(l1 == NULL);
+ fail_if(!l1);
l2 = eina_list_append(NULL, &data[4]);
l2 = eina_list_append(l2, &data[5]);
- fail_if(l2 == NULL);
+ fail_if(!l2);
l1 = eina_list_merge(l1, l2);
- fail_if(l1 == NULL);
+ fail_if(!l1);
fail_if(eina_list_count(l1) != 6);
- for (i = 0, l2 = l1; ((l2 != NULL) && (i < 6)); ++i, l2 = l2->next)
+ for (i = 0, l2 = l1; ((l2) && (i < 6)); ++i, l2 = l2->next)
fail_if(l2->data != &data[i]);
fail_if(i != 6);
- fail_if(l2 != NULL);
+ fail_if(!!l2);
eina_list_free(l1);
l1 = eina_list_append(NULL, &data[0]);
l1 = eina_list_append(l1, &data[1]);
- fail_if(l1 == NULL);
+ fail_if(!l1);
l2 = eina_list_append(NULL, &data[2]);
l2 = eina_list_append(l2, &data[3]);
l2 = eina_list_append(l2, &data[4]);
l2 = eina_list_append(l2, &data[5]);
- fail_if(l2 == NULL);
+ fail_if(!l2);
l1 = eina_list_merge(l1, l2);
- fail_if(l1 == NULL);
+ fail_if(!l1);
fail_if(eina_list_count(l1) != 6);
- for (i = 0, l2 = l1; ((l2 != NULL) && (i < 6)); ++i, l2 = l2->next)
+ for (i = 0, l2 = l1; ((l2) && (i < 6)); ++i, l2 = l2->next)
fail_if(l2->data != &data[i]);
fail_if(i != 6);
- fail_if(l2 != NULL);
+ fail_if(!!l2);
l3 = eina_list_append(NULL, &data[6]);
l3 = eina_list_append(l3, &data[7]);
l5 = eina_list_sort(l5, -1, eina_int_cmp);
l1 = eina_list_sorted_merge(l1, l3, eina_int_cmp);
- fail_if(l1 == NULL);
+ fail_if(!l1);
fail_if(eina_list_count(l1) != 9);
l1 = eina_list_sorted_merge(l1, l4, eina_int_cmp);
- fail_if(l1 == NULL);
+ fail_if(!l1);
fail_if(eina_list_count(l1) != 12);
l1 = eina_list_sorted_merge(l1, l5, eina_int_cmp);
- fail_if(l1 == NULL);
+ fail_if(!l1);
fail_if(eina_list_count(l1) != 15);
fail_if(!eina_list_sorted_check(l1));
for (i = 0; i < count; i++)
l1 = eina_list_sorted_insert(l1, eina_int_cmp, data + i);
- fail_if(l1 == NULL);
+ fail_if(!l1);
fail_if(!eina_list_sorted_check(l1));
l2 = NULL;
EINA_LIST_FOREACH(l1, itr, d)
l2 = eina_list_sorted_insert(l2, eina_int_cmp, d);
- fail_if(l2 == NULL);
+ fail_if(!l2);
fail_if(!eina_list_sorted_check(l2));
eina_list_free(l2);
EINA_LIST_REVERSE_FOREACH(l1, itr, d)
l2 = eina_list_sorted_insert(l2, eina_int_cmp, d);
- fail_if(l2 == NULL);
+ fail_if(!l2);
fail_if(!eina_list_sorted_check(l2));
eina_list_free(l2);
eina_list_free(l1);
for (i = 0; i < count; i++)
l1 = eina_list_sorted_insert(l1, eina_int_cmp, data2 + i);
- fail_if(l1 == NULL);
+ fail_if(!l1);
fail_if(!eina_list_sorted_check(l1));
eina_list_free(l1);
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data);
- fail_if(matrix == NULL);
+ fail_if(!matrix);
/* cell insertion */
data[0][5] = 5;
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data);
- fail_if(matrix == NULL);
+ fail_if(!matrix);
r = eina_matrixsparse_data_idx_set(matrix, 3, 5, &data[3][5]);
fail_if(r == EINA_FALSE);
fail_if(r == EINA_FALSE);
it = eina_matrixsparse_iterator_new(matrix);
- fail_if(it == NULL);
+ fail_if(!it);
EINA_ITERATOR_FOREACH(it, cell)
{
- fail_if(cell == NULL);
+ fail_if(!cell);
r = eina_matrixsparse_cell_position_get(cell, &row, &col);
fail_if(r == EINA_FALSE);
test1 = eina_matrixsparse_cell_data_get(cell);
- fail_if(test1 == NULL || *test1 != data[row][col]);
+ fail_if(!test1 || *test1 != data[row][col]);
}
eina_iterator_free(it);
it = eina_matrixsparse_iterator_complete_new(matrix);
- fail_if(it == NULL);
+ fail_if(!it);
EINA_ITERATOR_FOREACH(it, cell)
{
- fail_if(cell == NULL);
+ fail_if(!cell);
r = eina_matrixsparse_cell_position_get(cell, &row, &col);
fail_if(r == EINA_FALSE);
eina_mempool_free(mp, tbl[i]);
if (with_realloc)
- fail_if(eina_mempool_realloc(mp, tbl[500], 25) == NULL);
+ fail_if(!eina_mempool_realloc(mp, tbl[500], 25));
else
- fail_if(eina_mempool_realloc(mp, tbl[500], 25) != NULL);
+ fail_if(!!eina_mempool_realloc(mp, tbl[500], 25));
if (with_gc)
{
static inline Eina_Bool
_eina_rbtree_is_red(Eina_Rbtree *tree)
{
- return tree != NULL && tree->color == EINA_RBTREE_RED;
+ return !!tree && tree->color == EINA_RBTREE_RED;
}
static int
_eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
- fail_if(root == NULL);
+ fail_if(!root);
i = 69;
lookup = eina_rbtree_inline_lookup(root,
eina_rbtree_int_key),
NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
- fail_if(lookup == NULL);
+ fail_if(!lookup);
root =
eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB(
_eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
- fail_if(root == NULL);
+ fail_if(!root);
i = 69;
lookup = eina_rbtree_inline_lookup(root,
eina_rbtree_int_key),
NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
- fail_if(lookup == NULL);
+ fail_if(!lookup);
root =
eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB(
_eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
- fail_if(root == NULL);
+ fail_if(!root);
i = 1113497590;
lookup = eina_rbtree_inline_lookup(root,
eina_rbtree_int_key),
NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
- fail_if(lookup == NULL);
+ fail_if(!lookup);
root =
eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB(
eina_init();
result = eina_str_split_full("nomatch", "", -1, &elements);
- fail_if(result != NULL);
+ fail_if(!!result);
fail_if(elements != 0);
result = eina_str_split_full("nomatch", "x", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 1);
fail_if(strcmp(result[0], "nomatch") != 0);
free(result[0]);
free(result);
result = eina_str_split_full("nomatch", "xyz", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 1);
fail_if(strcmp(result[0], "nomatch") != 0);
free(result[0]);
free(result);
result = eina_str_split_full("match:match:match", ":", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 3);
while (elements >= 1)
{
free(result);
result = eina_str_split_full("a:b:c", ":", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 3);
fail_if(strcmp(result[0], "a") != 0);
fail_if(strcmp(result[1], "b") != 0);
free(result);
result = eina_str_split_full("a:b:", ":", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 3);
fail_if(strcmp(result[0], "a") != 0);
fail_if(strcmp(result[1], "b") != 0);
free(result);
result = eina_str_split_full(":b:c", ":", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 3);
fail_if(strcmp(result[0], "") != 0);
fail_if(strcmp(result[1], "b") != 0);
free(result);
result = eina_str_split_full(":", ":", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 2);
fail_if(strcmp(result[0], "") != 0);
fail_if(strcmp(result[1], "") != 0);
free(result);
result = eina_str_split_full("a", "!!!!!!!!!", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 1);
fail_if(strcmp(result[0], "a") != 0);
free(result[0]);
free(result);
result = eina_str_split_full("aaba", "ab", -1, &elements);
- fail_if(result == NULL);
+ fail_if(!result);
fail_if(elements != 2);
fail_if(strcmp(result[0], "a") != 0);
fail_if(strcmp(result[1], "a") != 0);
fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size));
str = eina_strbuf_string_get(buf);
- fail_if(str == NULL);
+ fail_if(!str);
for (i = 0; i < runs; i++, str += target_pattern_size)
fail_if(memcmp(str, target_pattern, target_pattern_size));
fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size));
str = eina_strbuf_string_get(buf);
- fail_if(str == NULL);
+ fail_if(!str);
for (i = 0; i < runs; i++, str += target_pattern_size)
fail_if(memcmp(str, target_pattern, target_pattern_size));
t0 = eina_stringshare_add(buf);
t1 = eina_stringshare_add(buf);
- fail_if(t0 == NULL);
- fail_if(t1 == NULL);
+ fail_if(!t0);
+ fail_if(!t1);
fail_if(t0 != t1);
fail_if(strcmp(t0, buf) != 0);
fail_if((int)strlen(buf) != eina_stringshare_strlen(t0));
t0 = eina_stringshare_add(TEST0);
t1 = eina_stringshare_add(TEST0);
- fail_if(t0 == NULL);
- fail_if(t1 == NULL);
+ fail_if(!t0);
+ fail_if(!t1);
fail_if(strcmp(t0, TEST0) != 0);
fail_if(strcmp(t1, TEST0) != 0);
fail_if(t0 != t1);
if (rand() > RAND_MAX / 2)
{
const char *r = eina_stringshare_add(buffer);
- fail_if(r == NULL);
+ fail_if(!r);
}
}
eina_convert_itoa(60000 - i, buffer);
eina_array_push(ea, (void *)eina_stringshare_add(buffer));
r = eina_stringshare_add(buffer);
- fail_if(r == NULL);
+ fail_if(!r);
r = eina_stringshare_add(buffer);
- fail_if(r == NULL);
+ fail_if(!r);
}
for (i = 0; i < 200; ++i)
/* Hopefully won't segfault */
rv = eina_unicode_strncpy(NULL, STR1, 0);
- fail_if(rv != NULL);
+ fail_if(!!rv);
eina_shutdown();
}
t0 = eina_ustringshare_add(TEST0);
t1 = eina_ustringshare_add(TEST0);
- fail_if(t0 == NULL);
- fail_if(t1 == NULL);
+ fail_if(!t0);
+ fail_if(!t1);
fail_if(eina_unicode_strcmp(t0, TEST0) != 0);
fail_if(eina_unicode_strcmp(t1, TEST0) != 0);
fail_if(t0 != t1);
Evas_List *prev1;
Evas_List *prev2;
- if (size1 == 0 || head1 == NULL) /* List1 is empty, head1 is already at the end of the list. So only need to update head2 */
+ if (size1 == 0 || !head1) /* List1 is empty, head1 is already at the end of the list. So only need to update head2 */
{
for (; pass_number < size_sum; ++pass_number)
head2 = evas_list_next (head2);
break;
}
else
- if (size2 == 0 || head2 == NULL) /* List2 is empty, just leave */
+ if (size2 == 0 || !head2) /* List2 is empty, just leave */
break;
else
if (func (head1->data, head2->data) < 0)