Revert and re-apply badnull patch

Revert previous patch generated by badnull.cocci script, and apply the new one.
The main difference is that assert and assert-like functions are not touched
anymore.




SVN revision: 51650
This commit is contained in:
Lucas De Marchi 2010-08-26 01:34:13 +00:00
parent 293692f2ba
commit d8002ff386
30 changed files with 243 additions and 243 deletions

View File

@ -49,7 +49,7 @@ START_TEST(ecore_test_ecore_main_loop)
fail_if(ret != 1); fail_if(ret != 1);
timer = ecore_timer_add(0.0, _quit_cb, &did); timer = ecore_timer_add(0.0, _quit_cb, &did);
fail_if(!timer); fail_if(timer == NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();
@ -70,7 +70,7 @@ START_TEST(ecore_test_ecore_main_loop_idler)
fail_if(ret != 1); fail_if(ret != 1);
idler = ecore_idler_add(_quit_cb, &did); idler = ecore_idler_add(_quit_cb, &did);
fail_if(!idler); fail_if(idler == NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();
@ -91,7 +91,7 @@ START_TEST(ecore_test_ecore_main_loop_idle_enterer)
fail_if(ret != 1); fail_if(ret != 1);
idle_enterer = ecore_idle_enterer_add(_quit_cb, &did); idle_enterer = ecore_idle_enterer_add(_quit_cb, &did);
fail_if(!idle_enterer); fail_if(idle_enterer == NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();
@ -114,10 +114,10 @@ START_TEST(ecore_test_ecore_main_loop_idle_exiter)
/* make system exit idle */ /* make system exit idle */
timer = ecore_timer_add(0.0, _dummy_cb, (void *)(long)0); timer = ecore_timer_add(0.0, _dummy_cb, (void *)(long)0);
fail_if(!timer); fail_if(timer == NULL);
idle_exiter = ecore_idle_exiter_add(_quit_cb, &did); idle_exiter = ecore_idle_exiter_add(_quit_cb, &did);
fail_if(!idle_exiter); fail_if(idle_exiter == NULL);
ecore_main_loop_begin(); ecore_main_loop_begin();
@ -139,7 +139,7 @@ START_TEST(ecore_test_ecore_main_loop_timer)
fail_if(ret != 1); fail_if(ret != 1);
timer = ecore_timer_add(2.0, _quit_cb, &did); timer = ecore_timer_add(2.0, _quit_cb, &did);
fail_if(!timer); fail_if(timer == NULL);
start = ecore_time_get(); start = ecore_time_get();
ecore_main_loop_begin(); ecore_main_loop_begin();

View File

@ -389,7 +389,7 @@ _edje_lua_new_class(lua_State *L, const Edje_Lua_Reg ** class)
{ {
int n = 0; int n = 0;
_edje_lua_new_metatable(L, class); _edje_lua_new_metatable(L, class);
while (class && (class[n])) while (class && (class[n] != NULL))
{ {
luaL_register(L, NULL, class[n]->mt); luaL_register(L, NULL, class[n]->mt);
lua_pushstring(L, "hands off, it's none of your business!"); lua_pushstring(L, "hands off, it's none of your business!");
@ -5079,7 +5079,7 @@ _edje_lua_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
void void
_edje_lua_init() _edje_lua_init()
{ {
if (Ledje) return; if (Ledje != NULL) return;
/* /*
* create main Lua state with the custom memory allocation function * create main Lua state with the custom memory allocation function
*/ */
@ -5165,7 +5165,7 @@ _edje_lua_init()
void void
_edje_lua_shutdown() _edje_lua_shutdown()
{ {
if (!Ledje) return; if (Ledje == NULL) return;
lua_close(Ledje); lua_close(Ledje);
Ledje = NULL; Ledje = NULL;
} }

View File

@ -1874,8 +1874,8 @@ eet_data_descriptor_element_add(Eet_Data_Descriptor *edd,
&& &&
(type != EET_T_UNKNOW (type != EET_T_UNKNOW
|| !subtype || !subtype
|| subtype->func.type_get == NULL || !subtype->func.type_get
|| subtype->func.type_set == NULL)) || !subtype->func.type_set))
return; return;
/* VARIANT type will only work if the map only contains EET_G_*, but not UNION, VARIANT and ARRAY. */ /* VARIANT type will only work if the map only contains EET_G_*, but not UNION, VARIANT and ARRAY. */
@ -4123,7 +4123,7 @@ eet_data_get_unknown(Eet_Free_Context *context,
str = (char **)(((char *)data)); str = (char **)(((char *)data));
if (*str) if (*str)
{ {
if ((!ed) || (edd->func.str_direct_alloc == NULL)) if ((!ed) || (!edd->func.str_direct_alloc))
{ {
*str = edd->func.str_alloc(*str); *str = edd->func.str_alloc(*str);
_eet_freelist_str_add(context, *str); _eet_freelist_str_add(context, *str);

View File

@ -1623,10 +1623,10 @@ open_error:
ef->sha1_length = 0; ef->sha1_length = 0;
ef->ed = (mode == EET_FILE_MODE_WRITE) ef->ed = (mode == EET_FILE_MODE_WRITE)
|| (ef->readfp == NULL && mode == EET_FILE_MODE_READ_WRITE) ? || (!ef->readfp && mode == EET_FILE_MODE_READ_WRITE) ?
eet_dictionary_add() : NULL; eet_dictionary_add() : NULL;
if (ef->readfp == NULL && if (!ef->readfp &&
(mode == EET_FILE_MODE_READ_WRITE || mode == EET_FILE_MODE_WRITE)) (mode == EET_FILE_MODE_READ_WRITE || mode == EET_FILE_MODE_WRITE))
goto empty_file; goto empty_file;
@ -1946,7 +1946,7 @@ eet_read_direct(Eet_File *ef,
if (!efn) if (!efn)
goto on_error; goto on_error;
if (efn->offset < 0 && efn->data == NULL) if (efn->offset < 0 && !efn->data)
goto on_error; goto on_error;
/* get size (uncompressed, if compressed at all) */ /* get size (uncompressed, if compressed at all) */

View File

@ -203,13 +203,13 @@ _eet_test_basic_check(Eet_Test_Basic_Type * result, int i)
fail_if(tmp > 0.00005); fail_if(tmp > 0.00005);
fail_if(!!result->empty); fail_if(result->empty != NULL);
if (i == 0) if (i == 0)
{ {
Eet_Test_Basic_Type * tmp; Eet_Test_Basic_Type * tmp;
tmp = result->with; tmp = result->with;
fail_if(!tmp); fail_if(tmp == NULL);
fail_if(tmp->c != EET_TEST_CHAR); fail_if(tmp->c != EET_TEST_CHAR);
fail_if(tmp->s != EET_TEST_SHORT); fail_if(tmp->s != EET_TEST_SHORT);
@ -223,7 +223,7 @@ _eet_test_basic_check(Eet_Test_Basic_Type * result, int i)
fail_if(tmp->ul != EET_TEST_LONG_LONG); fail_if(tmp->ul != EET_TEST_LONG_LONG);
} }
else else
fail_if(!!result->with); fail_if(result->with != NULL);
} /* _eet_test_basic_check */ } /* _eet_test_basic_check */
static void static void
@ -895,7 +895,7 @@ START_TEST(eet_file_simple_write)
fail_if(eet_mode_get(ef) != EET_FILE_MODE_WRITE); fail_if(eet_mode_get(ef) != EET_FILE_MODE_WRITE);
fail_if(!!eet_list(ef, "*", &size)); fail_if(eet_list(ef, "*", &size) != NULL);
fail_if(eet_num_entries(ef) != -1); fail_if(eet_num_entries(ef) != -1);
eet_close(ef); eet_close(ef);
@ -1036,11 +1036,11 @@ START_TEST(eet_file_data_test)
/* Test the resulting data. */ /* Test the resulting data. */
fail_if(_eet_test_ex_check(result, 0) != 0); fail_if(_eet_test_ex_check(result, 0) != 0);
fail_if(_eet_test_ex_check(eina_list_data_get(result->list), 1) != 0); fail_if(_eet_test_ex_check(eina_list_data_get(result->list), 1) != 0);
fail_if(!eina_list_data_get(result->ilist)); fail_if(eina_list_data_get(result->ilist) == NULL);
fail_if(*((int *)eina_list_data_get(result->ilist)) != 42); fail_if(*((int *)eina_list_data_get(result->ilist)) != 42);
fail_if(!eina_list_data_get(result->slist)); fail_if(eina_list_data_get(result->slist) == NULL);
fail_if(strcmp(eina_list_data_get(result->slist), "test") != 0); fail_if(strcmp(eina_list_data_get(result->slist), "test") != 0);
fail_if(!eina_hash_find(result->shash, EET_TEST_KEY1)); fail_if(eina_hash_find(result->shash, EET_TEST_KEY1) == NULL);
fail_if(strcmp(eina_hash_find(result->shash, EET_TEST_KEY1), "test") != 0); fail_if(strcmp(eina_hash_find(result->shash, EET_TEST_KEY1), "test") != 0);
fail_if(strcmp(result->charray[0], "test") != 0); fail_if(strcmp(result->charray[0], "test") != 0);
@ -1074,13 +1074,13 @@ START_TEST(eet_file_data_test)
fail_if(eet_num_entries(ef) != 1); fail_if(eet_num_entries(ef) != 1);
/* Test some more wrong case */ /* Test some more wrong case */
fail_if(!!eet_data_read(ef, edd, "plop")); fail_if(eet_data_read(ef, edd, "plop") != NULL);
fail_if(!!eet_data_read(ef, edd, EET_TEST_FILE_KEY1)); fail_if(eet_data_read(ef, edd, EET_TEST_FILE_KEY1) != NULL);
/* Reinsert and reread data */ /* Reinsert and reread data */
fail_if(!eet_data_write(ef, edd, EET_TEST_FILE_KEY1, &etbt, 0)); fail_if(!eet_data_write(ef, edd, EET_TEST_FILE_KEY1, &etbt, 0));
fail_if(!eet_data_read(ef, edd, EET_TEST_FILE_KEY1)); fail_if(eet_data_read(ef, edd, EET_TEST_FILE_KEY1) == NULL);
fail_if(!eet_read_direct(ef, EET_TEST_FILE_KEY1, &size)); fail_if(eet_read_direct(ef, EET_TEST_FILE_KEY1, &size) == NULL);
eet_close(ef); eet_close(ef);
@ -1163,11 +1163,11 @@ START_TEST(eet_file_data_dump_test)
/* Test the resulting data. */ /* Test the resulting data. */
fail_if(_eet_test_ex_check(result, 0) != 0); fail_if(_eet_test_ex_check(result, 0) != 0);
fail_if(_eet_test_ex_check(eina_list_data_get(result->list), 1) != 0); fail_if(_eet_test_ex_check(eina_list_data_get(result->list), 1) != 0);
fail_if(!eina_list_data_get(result->ilist)); fail_if(eina_list_data_get(result->ilist) == NULL);
fail_if(*((int *)eina_list_data_get(result->ilist)) != 42); fail_if(*((int *)eina_list_data_get(result->ilist)) != 42);
fail_if(!eina_list_data_get(result->slist)); fail_if(eina_list_data_get(result->slist) == NULL);
fail_if(strcmp(eina_list_data_get(result->slist), "test") != 0); fail_if(strcmp(eina_list_data_get(result->slist), "test") != 0);
fail_if(!eina_hash_find(result->shash, EET_TEST_KEY1)); fail_if(eina_hash_find(result->shash, EET_TEST_KEY1) == NULL);
fail_if(strcmp(eina_hash_find(result->shash, EET_TEST_KEY1), "test") != 0); fail_if(strcmp(eina_hash_find(result->shash, EET_TEST_KEY1), "test") != 0);
fail_if(strcmp(result->charray[0], "test") != 0); fail_if(strcmp(result->charray[0], "test") != 0);
@ -1307,7 +1307,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_noalpha.w); fail_if(w != test_noalpha.w);
fail_if(h != test_noalpha.h); fail_if(h != test_noalpha.h);
fail_if(alpha != test_noalpha.alpha); fail_if(alpha != test_noalpha.alpha);
@ -1353,7 +1353,7 @@ START_TEST(eet_image)
fail_if(lossy != 0); fail_if(lossy != 0);
data = malloc(w * h * 4); data = malloc(w * h * 4);
fail_if(!data); fail_if(data == NULL);
result = eet_data_image_read_to_surface(ef, result = eet_data_image_read_to_surface(ef,
EET_TEST_FILE_IMAGE "0", EET_TEST_FILE_IMAGE "0",
4, 4,
@ -1375,7 +1375,7 @@ START_TEST(eet_image)
free(data); free(data);
data = malloc(w * h * 4); data = malloc(w * h * 4);
fail_if(!data); fail_if(data == NULL);
result = eet_data_image_read_to_surface(ef, result = eet_data_image_read_to_surface(ef,
EET_TEST_FILE_IMAGE "0", EET_TEST_FILE_IMAGE "0",
0, 0,
@ -1404,7 +1404,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_noalpha.w); fail_if(w != test_noalpha.w);
fail_if(h != test_noalpha.h); fail_if(h != test_noalpha.h);
fail_if(alpha != test_noalpha.alpha); fail_if(alpha != test_noalpha.alpha);
@ -1422,7 +1422,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_noalpha.w); fail_if(w != test_noalpha.w);
fail_if(h != test_noalpha.h); fail_if(h != test_noalpha.h);
fail_if(alpha != test_noalpha.alpha); fail_if(alpha != test_noalpha.alpha);
@ -1439,7 +1439,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_noalpha.w); fail_if(w != test_noalpha.w);
fail_if(h != test_noalpha.h); fail_if(h != test_noalpha.h);
fail_if(alpha != test_noalpha.alpha); fail_if(alpha != test_noalpha.alpha);
@ -1454,7 +1454,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_noalpha.w); fail_if(w != test_noalpha.w);
fail_if(h != test_noalpha.h); fail_if(h != test_noalpha.h);
fail_if(alpha != test_noalpha.alpha); fail_if(alpha != test_noalpha.alpha);
@ -1469,7 +1469,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_noalpha.w); fail_if(w != test_noalpha.w);
fail_if(h != test_noalpha.h); fail_if(h != test_noalpha.h);
fail_if(alpha != test_noalpha.alpha); fail_if(alpha != test_noalpha.alpha);
@ -1499,7 +1499,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_alpha.w); fail_if(w != test_alpha.w);
fail_if(h != test_alpha.h); fail_if(h != test_alpha.h);
fail_if(alpha != test_alpha.alpha); fail_if(alpha != test_alpha.alpha);
@ -1530,7 +1530,7 @@ START_TEST(eet_image)
&compress, &compress,
&quality, &quality,
&lossy); &lossy);
fail_if(!data); fail_if(data == NULL);
fail_if(w != test_alpha.w); fail_if(w != test_alpha.w);
fail_if(h != test_alpha.h); fail_if(h != test_alpha.h);
fail_if(alpha != test_alpha.alpha); fail_if(alpha != test_alpha.alpha);
@ -1654,7 +1654,7 @@ START_TEST(eet_identity_simple)
fail_if(memcmp(test, buffer, strlen(buffer) + 1) != 0); fail_if(memcmp(test, buffer, strlen(buffer) + 1) != 0);
tmp = eet_identity_x509(ef, &size); tmp = eet_identity_x509(ef, &size);
fail_if(!tmp); fail_if(tmp == NULL);
eet_identity_certificate_print(tmp, size, noread); eet_identity_certificate_print(tmp, size, noread);
@ -1850,7 +1850,7 @@ open_close_worker(void * path)
while (!open_worker_stop) while (!open_worker_stop)
{ {
Eet_File * ef = eet_open((char const *)path, EET_FILE_MODE_READ); Eet_File * ef = eet_open((char const *)path, EET_FILE_MODE_READ);
if (!ef) if (ef == NULL)
pthread_exit("eet_open() failed"); pthread_exit("eet_open() failed");
else else
{ {
@ -1871,7 +1871,7 @@ open_close_worker(void * path)
while (!open_worker_stop) while (!open_worker_stop)
{ {
Eet_File * ef = eet_open((char const *)path, EET_FILE_MODE_READ); Eet_File * ef = eet_open((char const *)path, EET_FILE_MODE_READ);
if (!ef) if (ef == NULL)
_endthreadex(-1); _endthreadex(-1);
else else
{ {
@ -1964,11 +1964,11 @@ _eet_connection_read(const void * eet_data, size_t size, void * user_data)
fail_if(!node); fail_if(!node);
fail_if(_eet_test_ex_check(result, 0) != 0); fail_if(_eet_test_ex_check(result, 0) != 0);
fail_if(_eet_test_ex_check(eina_list_data_get(result->list), 1) != 0); fail_if(_eet_test_ex_check(eina_list_data_get(result->list), 1) != 0);
fail_if(!eina_list_data_get(result->ilist)); fail_if(eina_list_data_get(result->ilist) == NULL);
fail_if(*((int *)eina_list_data_get(result->ilist)) != 42); fail_if(*((int *)eina_list_data_get(result->ilist)) != 42);
fail_if(!eina_list_data_get(result->slist)); fail_if(eina_list_data_get(result->slist) == NULL);
fail_if(strcmp(eina_list_data_get(result->slist), "test") != 0); fail_if(strcmp(eina_list_data_get(result->slist), "test") != 0);
fail_if(!eina_hash_find(result->shash, EET_TEST_KEY1)); fail_if(eina_hash_find(result->shash, EET_TEST_KEY1) == NULL);
fail_if(strcmp(eina_hash_find(result->shash, EET_TEST_KEY1), "test") != 0); fail_if(strcmp(eina_hash_find(result->shash, EET_TEST_KEY1), "test") != 0);
fail_if(strcmp(result->charray[0], "test") != 0); fail_if(strcmp(result->charray[0], "test") != 0);
@ -2329,7 +2329,7 @@ _eet_union_type_get(const void * data, Eina_Bool * unknow)
if (unknow) if (unknow)
*unknow = EINA_FALSE; *unknow = EINA_FALSE;
for (i = 0; eet_mapping[i].name; ++i) for (i = 0; eet_mapping[i].name != NULL; ++i)
if (*u == eet_mapping[i].u) if (*u == eet_mapping[i].u)
return eet_mapping[i].name; return eet_mapping[i].name;
@ -2348,7 +2348,7 @@ _eet_union_type_set(const char * type, void * data, Eina_Bool unknow)
if (unknow) if (unknow)
return EINA_FALSE; return EINA_FALSE;
for (i = 0; eet_mapping[i].name; ++i) for (i = 0; eet_mapping[i].name != NULL; ++i)
if (strcmp(eet_mapping[i].name, type) == 0) if (strcmp(eet_mapping[i].name, type) == 0)
{ {
*u = eet_mapping[i].u; *u = eet_mapping[i].u;
@ -2367,7 +2367,7 @@ _eet_variant_type_get(const void * data, Eina_Bool * unknow)
if (unknow) if (unknow)
*unknow = type->unknow; *unknow = type->unknow;
for (i = 0; eet_mapping[i].name; ++i) for (i = 0; eet_mapping[i].name != NULL; ++i)
if (strcmp(type->type, eet_mapping[i].name) == 0) if (strcmp(type->type, eet_mapping[i].name) == 0)
return eet_mapping[i].name; return eet_mapping[i].name;

View File

@ -81,7 +81,7 @@ eina_trash_pop(Eina_Trash **trash)
tmp = *trash; tmp = *trash;
if (*trash != NULL) if (*trash)
*trash = (*trash)->next; *trash = (*trash)->next;
return tmp; return tmp;

View File

@ -531,7 +531,7 @@ _eina_matrixsparse_row_idx_siblings_find(const Eina_Matrixsparse *m,
if (r->row > row) if (r->row > row)
break; break;
assert(!!r); assert(r != NULL);
*p_prev = r->prev; *p_prev = r->prev;
*p_next = r; *p_next = r;
} }
@ -541,7 +541,7 @@ _eina_matrixsparse_row_idx_siblings_find(const Eina_Matrixsparse *m,
if (r->row < row) if (r->row < row)
break; break;
assert(!!r); assert(r != NULL);
*p_prev = r; *p_prev = r;
*p_next = r->next; *p_next = r->next;
} }
@ -564,7 +564,7 @@ _eina_matrixsparse_row_cell_idx_siblings_find(const Eina_Matrixsparse_Row *r,
if (c->col > col) if (c->col > col)
break; break;
assert(!!c); assert(c != NULL);
*p_prev = c->prev; *p_prev = c->prev;
*p_next = c; *p_next = c;
} }
@ -574,7 +574,7 @@ _eina_matrixsparse_row_cell_idx_siblings_find(const Eina_Matrixsparse_Row *r,
if (c->col < col) if (c->col < col)
break; break;
assert(!!c); assert(c != NULL);
*p_prev = c; *p_prev = c;
*p_next = c->next; *p_next = c->next;
} }
@ -613,8 +613,8 @@ _eina_matrixsparse_row_idx_add(Eina_Matrixsparse *m, unsigned long row)
{ {
Eina_Matrixsparse_Row *prev = NULL, *next = NULL; Eina_Matrixsparse_Row *prev = NULL, *next = NULL;
_eina_matrixsparse_row_idx_siblings_find(m, row, &prev, &next); _eina_matrixsparse_row_idx_siblings_find(m, row, &prev, &next);
assert(!!prev); assert(prev != NULL);
assert(!!next); assert(next != NULL);
r->prev = prev; r->prev = prev;
r->next = next; r->next = next;
prev->next = r; prev->next = r;
@ -666,8 +666,8 @@ _eina_matrixsparse_row_cell_idx_add(Eina_Matrixsparse_Row *r,
{ {
Eina_Matrixsparse_Cell *prev = NULL, *next = NULL; Eina_Matrixsparse_Cell *prev = NULL, *next = NULL;
_eina_matrixsparse_row_cell_idx_siblings_find(r, col, &prev, &next); _eina_matrixsparse_row_cell_idx_siblings_find(r, col, &prev, &next);
assert(!!prev); assert(prev != NULL);
assert(!!next); assert(next != NULL);
c->prev = prev; c->prev = prev;
c->next = next; c->next = next;
prev->next = c; prev->next = c;

View File

@ -85,8 +85,8 @@ START_TEST(eina_binshare_small)
t0 = eina_binshare_add_length(buf, i); t0 = eina_binshare_add_length(buf, i);
t1 = eina_binshare_add_length(buf, i); t1 = eina_binshare_add_length(buf, i);
fail_if(!t0); fail_if(t0 == NULL);
fail_if(!t1); fail_if(t1 == NULL);
fail_if(t0 != t1); fail_if(t0 != t1);
fail_if(memcmp(t0, buf, i) != 0); fail_if(memcmp(t0, buf, i) != 0);
@ -110,8 +110,8 @@ START_TEST(eina_binshare_test_share)
t0 = eina_binshare_add_length(TEST0, TEST0_SIZE); t0 = eina_binshare_add_length(TEST0, TEST0_SIZE);
t1 = eina_binshare_add_length(TEST0, TEST0_SIZE); t1 = eina_binshare_add_length(TEST0, TEST0_SIZE);
fail_if(!t0); fail_if(t0 == NULL);
fail_if(!t1); fail_if(t1 == NULL);
fail_if(memcmp(t0, TEST0, TEST0_SIZE) != 0); fail_if(memcmp(t0, TEST0, TEST0_SIZE) != 0);
fail_if(memcmp(t1, TEST0, TEST0_SIZE) != 0); fail_if(memcmp(t1, TEST0, TEST0_SIZE) != 0);
fail_if(t0 != t1); fail_if(t0 != t1);
@ -168,7 +168,7 @@ START_TEST(eina_binshare_collision)
if (rand() > RAND_MAX / 2) if (rand() > RAND_MAX / 2)
{ {
const char *r = eina_binshare_add_length(buffer, strlen(buffer)); const char *r = eina_binshare_add_length(buffer, strlen(buffer));
fail_if(!r); fail_if(r == NULL);
} }
} }
@ -180,9 +180,9 @@ START_TEST(eina_binshare_collision)
eina_array_push(ea, eina_array_push(ea,
(void *)eina_binshare_add_length(buffer, strlen(buffer))); (void *)eina_binshare_add_length(buffer, strlen(buffer)));
r = eina_binshare_add_length(buffer, strlen(buffer)); r = eina_binshare_add_length(buffer, strlen(buffer));
fail_if(!r); fail_if(r == NULL);
r = eina_binshare_add_length(buffer, strlen(buffer)); r = eina_binshare_add_length(buffer, strlen(buffer));
fail_if(!r); fail_if(r == NULL);
} }
for (i = 0; i < 200; ++i) for (i = 0; i < 200; ++i)

View File

@ -111,7 +111,7 @@ START_TEST(eina_hash_extended)
fail_if(eina_init() != 2); fail_if(eina_init() != 2);
hash = eina_hash_string_djb2_new(NULL); hash = eina_hash_string_djb2_new(NULL);
fail_if(!hash); fail_if(hash == NULL);
fail_if(eina_hash_direct_add(hash, "42", "42") != EINA_TRUE); fail_if(eina_hash_direct_add(hash, "42", "42") != EINA_TRUE);
@ -123,7 +123,7 @@ START_TEST(eina_hash_extended)
fail_if(eina_hash_direct_add(hash, tmp, tmp) != EINA_TRUE); fail_if(eina_hash_direct_add(hash, tmp, tmp) != EINA_TRUE);
} }
fail_if(!eina_hash_find(hash, "42")); fail_if(eina_hash_find(hash, "42") == NULL);
eina_hash_free(hash); eina_hash_free(hash);
@ -140,7 +140,7 @@ START_TEST(eina_hash_double_item)
fail_if(eina_init() != 2); fail_if(eina_init() != 2);
hash = eina_hash_string_superfast_new(NULL); hash = eina_hash_string_superfast_new(NULL);
fail_if(!hash); fail_if(hash == NULL);
fail_if(eina_hash_add(hash, "7", &i[0]) != EINA_TRUE); 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_hash_add(hash, "7", &i[1]) != EINA_TRUE);
@ -167,7 +167,7 @@ START_TEST(eina_hash_all_int)
fail_if(eina_init() != 2); fail_if(eina_init() != 2);
hash = eina_hash_int32_new(NULL); hash = eina_hash_int32_new(NULL);
fail_if(!hash); fail_if(hash == NULL);
for (it = 0; it < 4; ++it) for (it = 0; it < 4; ++it)
fail_if(eina_hash_add(hash, &i[it], &i[it]) != EINA_TRUE); fail_if(eina_hash_add(hash, &i[it], &i[it]) != EINA_TRUE);
@ -182,7 +182,7 @@ START_TEST(eina_hash_all_int)
eina_hash_free(hash); eina_hash_free(hash);
hash = eina_hash_int64_new(NULL); hash = eina_hash_int64_new(NULL);
fail_if(!hash); fail_if(hash == NULL);
for (it = 0; it < 4; ++it) for (it = 0; it < 4; ++it)
fail_if(eina_hash_add(hash, &j[it], &j[it]) != EINA_TRUE); fail_if(eina_hash_add(hash, &j[it], &j[it]) != EINA_TRUE);

View File

@ -220,39 +220,39 @@ START_TEST(eina_test_merge)
l1 = eina_list_append(l1, &data[1]); l1 = eina_list_append(l1, &data[1]);
l1 = eina_list_append(l1, &data[2]); l1 = eina_list_append(l1, &data[2]);
l1 = eina_list_append(l1, &data[3]); l1 = eina_list_append(l1, &data[3]);
fail_if(!l1); fail_if(l1 == NULL);
l2 = eina_list_append(NULL, &data[4]); l2 = eina_list_append(NULL, &data[4]);
l2 = eina_list_append(l2, &data[5]); l2 = eina_list_append(l2, &data[5]);
fail_if(!l2); fail_if(l2 == NULL);
l1 = eina_list_merge(l1, l2); l1 = eina_list_merge(l1, l2);
fail_if(!l1); fail_if(l1 == NULL);
fail_if(eina_list_count(l1) != 6); fail_if(eina_list_count(l1) != 6);
for (i = 0, l2 = l1; ((l2) && (i < 6)); ++i, l2 = l2->next) for (i = 0, l2 = l1; ((l2 != NULL) && (i < 6)); ++i, l2 = l2->next)
fail_if(l2->data != &data[i]); fail_if(l2->data != &data[i]);
fail_if(i != 6); fail_if(i != 6);
fail_if(!!l2); fail_if(l2 != NULL);
eina_list_free(l1); eina_list_free(l1);
l1 = eina_list_append(NULL, &data[0]); l1 = eina_list_append(NULL, &data[0]);
l1 = eina_list_append(l1, &data[1]); l1 = eina_list_append(l1, &data[1]);
fail_if(!l1); fail_if(l1 == NULL);
l2 = eina_list_append(NULL, &data[2]); l2 = eina_list_append(NULL, &data[2]);
l2 = eina_list_append(l2, &data[3]); l2 = eina_list_append(l2, &data[3]);
l2 = eina_list_append(l2, &data[4]); l2 = eina_list_append(l2, &data[4]);
l2 = eina_list_append(l2, &data[5]); l2 = eina_list_append(l2, &data[5]);
fail_if(!l2); fail_if(l2 == NULL);
l1 = eina_list_merge(l1, l2); l1 = eina_list_merge(l1, l2);
fail_if(!l1); fail_if(l1 == NULL);
fail_if(eina_list_count(l1) != 6); fail_if(eina_list_count(l1) != 6);
for (i = 0, l2 = l1; ((l2) && (i < 6)); ++i, l2 = l2->next) for (i = 0, l2 = l1; ((l2 != NULL) && (i < 6)); ++i, l2 = l2->next)
fail_if(l2->data != &data[i]); fail_if(l2->data != &data[i]);
fail_if(i != 6); fail_if(i != 6);
fail_if(!!l2); fail_if(l2 != NULL);
l3 = eina_list_append(NULL, &data[6]); l3 = eina_list_append(NULL, &data[6]);
l3 = eina_list_append(l3, &data[7]); l3 = eina_list_append(l3, &data[7]);
@ -272,15 +272,15 @@ START_TEST(eina_test_merge)
l5 = eina_list_sort(l5, -1, eina_int_cmp); l5 = eina_list_sort(l5, -1, eina_int_cmp);
l1 = eina_list_sorted_merge(l1, l3, eina_int_cmp); l1 = eina_list_sorted_merge(l1, l3, eina_int_cmp);
fail_if(!l1); fail_if(l1 == NULL);
fail_if(eina_list_count(l1) != 9); fail_if(eina_list_count(l1) != 9);
l1 = eina_list_sorted_merge(l1, l4, eina_int_cmp); l1 = eina_list_sorted_merge(l1, l4, eina_int_cmp);
fail_if(!l1); fail_if(l1 == NULL);
fail_if(eina_list_count(l1) != 12); fail_if(eina_list_count(l1) != 12);
l1 = eina_list_sorted_merge(l1, l5, eina_int_cmp); l1 = eina_list_sorted_merge(l1, l5, eina_int_cmp);
fail_if(!l1); fail_if(l1 == NULL);
fail_if(eina_list_count(l1) != 15); fail_if(eina_list_count(l1) != 15);
fail_if(!eina_list_sorted_check(l1)); fail_if(!eina_list_sorted_check(l1));
@ -305,14 +305,14 @@ START_TEST(eina_test_sorted_insert)
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
l1 = eina_list_sorted_insert(l1, eina_int_cmp, data + i); l1 = eina_list_sorted_insert(l1, eina_int_cmp, data + i);
fail_if(!l1); fail_if(l1 == NULL);
fail_if(!eina_list_sorted_check(l1)); fail_if(!eina_list_sorted_check(l1));
l2 = NULL; l2 = NULL;
EINA_LIST_FOREACH(l1, itr, d) EINA_LIST_FOREACH(l1, itr, d)
l2 = eina_list_sorted_insert(l2, eina_int_cmp, d); l2 = eina_list_sorted_insert(l2, eina_int_cmp, d);
fail_if(!l2); fail_if(l2 == NULL);
fail_if(!eina_list_sorted_check(l2)); fail_if(!eina_list_sorted_check(l2));
eina_list_free(l2); eina_list_free(l2);
@ -320,7 +320,7 @@ START_TEST(eina_test_sorted_insert)
EINA_LIST_REVERSE_FOREACH(l1, itr, d) EINA_LIST_REVERSE_FOREACH(l1, itr, d)
l2 = eina_list_sorted_insert(l2, eina_int_cmp, d); l2 = eina_list_sorted_insert(l2, eina_int_cmp, d);
fail_if(!l2); fail_if(l2 == NULL);
fail_if(!eina_list_sorted_check(l2)); fail_if(!eina_list_sorted_check(l2));
eina_list_free(l2); eina_list_free(l2);
eina_list_free(l1); eina_list_free(l1);
@ -330,7 +330,7 @@ START_TEST(eina_test_sorted_insert)
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
l1 = eina_list_sorted_insert(l1, eina_int_cmp, data2 + i); l1 = eina_list_sorted_insert(l1, eina_int_cmp, data2 + i);
fail_if(!l1); fail_if(l1 == NULL);
fail_if(!eina_list_sorted_check(l1)); fail_if(!eina_list_sorted_check(l1));
eina_list_free(l1); eina_list_free(l1);

View File

@ -286,7 +286,7 @@ START_TEST(eina_test_resize)
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS, matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data); eina_matrixsparse_free_cell_cb, data);
fail_if(!matrix); fail_if(matrix == NULL);
/* cell insertion */ /* cell insertion */
data[0][5] = 5; data[0][5] = 5;
@ -408,7 +408,7 @@ START_TEST(eina_test_iterators)
matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS, matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS,
eina_matrixsparse_free_cell_cb, data); eina_matrixsparse_free_cell_cb, data);
fail_if(!matrix); fail_if(matrix == NULL);
r = eina_matrixsparse_data_idx_set(matrix, 3, 5, &data[3][5]); r = eina_matrixsparse_data_idx_set(matrix, 3, 5, &data[3][5]);
fail_if(r == EINA_FALSE); fail_if(r == EINA_FALSE);
@ -448,23 +448,23 @@ START_TEST(eina_test_iterators)
fail_if(r == EINA_FALSE); fail_if(r == EINA_FALSE);
it = eina_matrixsparse_iterator_new(matrix); it = eina_matrixsparse_iterator_new(matrix);
fail_if(!it); fail_if(it == NULL);
EINA_ITERATOR_FOREACH(it, cell) EINA_ITERATOR_FOREACH(it, cell)
{ {
fail_if(!cell); fail_if(cell == NULL);
r = eina_matrixsparse_cell_position_get(cell, &row, &col); r = eina_matrixsparse_cell_position_get(cell, &row, &col);
fail_if(r == EINA_FALSE); fail_if(r == EINA_FALSE);
test1 = eina_matrixsparse_cell_data_get(cell); test1 = eina_matrixsparse_cell_data_get(cell);
fail_if(!test1 || *test1 != data[row][col]); fail_if(test1 == NULL || *test1 != data[row][col]);
} }
eina_iterator_free(it); eina_iterator_free(it);
it = eina_matrixsparse_iterator_complete_new(matrix); it = eina_matrixsparse_iterator_complete_new(matrix);
fail_if(!it); fail_if(it == NULL);
EINA_ITERATOR_FOREACH(it, cell) EINA_ITERATOR_FOREACH(it, cell)
{ {
fail_if(!cell); fail_if(cell == NULL);
r = eina_matrixsparse_cell_position_get(cell, &row, &col); r = eina_matrixsparse_cell_position_get(cell, &row, &col);
fail_if(r == EINA_FALSE); fail_if(r == EINA_FALSE);

View File

@ -68,9 +68,9 @@ _eina_mempool_test(Eina_Mempool *mp, Eina_Bool with_realloc, Eina_Bool with_gc)
eina_mempool_free(mp, tbl[i]); eina_mempool_free(mp, tbl[i]);
if (with_realloc) if (with_realloc)
fail_if(!eina_mempool_realloc(mp, tbl[500], 25)); fail_if(eina_mempool_realloc(mp, tbl[500], 25) == NULL);
else else
fail_if(!!eina_mempool_realloc(mp, tbl[500], 25)); fail_if(eina_mempool_realloc(mp, tbl[500], 25) != NULL);
if (with_gc) if (with_gc)
{ {

View File

@ -30,7 +30,7 @@
static inline Eina_Bool static inline Eina_Bool
_eina_rbtree_is_red(Eina_Rbtree *tree) _eina_rbtree_is_red(Eina_Rbtree *tree)
{ {
return !!tree && tree->color == EINA_RBTREE_RED; return tree != NULL && tree->color == EINA_RBTREE_RED;
} }
static int static int
@ -261,7 +261,7 @@ START_TEST(eina_rbtree_simple_remove)
_eina_rbtree_black_height(root, _eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
fail_if(!root); fail_if(root == NULL);
i = 69; i = 69;
lookup = eina_rbtree_inline_lookup(root, lookup = eina_rbtree_inline_lookup(root,
@ -271,7 +271,7 @@ START_TEST(eina_rbtree_simple_remove)
eina_rbtree_int_key), eina_rbtree_int_key),
NULL); NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); _eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
fail_if(!lookup); fail_if(lookup == NULL);
root = root =
eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB( eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB(
@ -325,7 +325,7 @@ START_TEST(eina_rbtree_simple_remove2)
_eina_rbtree_black_height(root, _eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
fail_if(!root); fail_if(root == NULL);
i = 69; i = 69;
lookup = eina_rbtree_inline_lookup(root, lookup = eina_rbtree_inline_lookup(root,
@ -335,7 +335,7 @@ START_TEST(eina_rbtree_simple_remove2)
eina_rbtree_int_key), eina_rbtree_int_key),
NULL); NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); _eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
fail_if(!lookup); fail_if(lookup == NULL);
root = root =
eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB( eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB(
@ -419,7 +419,7 @@ START_TEST(eina_rbtree_simple_remove3)
_eina_rbtree_black_height(root, _eina_rbtree_black_height(root,
EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
fail_if(!root); fail_if(root == NULL);
i = 1113497590; i = 1113497590;
lookup = eina_rbtree_inline_lookup(root, lookup = eina_rbtree_inline_lookup(root,
@ -429,7 +429,7 @@ START_TEST(eina_rbtree_simple_remove3)
eina_rbtree_int_key), eina_rbtree_int_key),
NULL); NULL);
_eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); _eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp));
fail_if(!lookup); fail_if(lookup == NULL);
root = root =
eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB( eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB(

View File

@ -91,25 +91,25 @@ START_TEST(str_split)
eina_init(); eina_init();
result = eina_str_split_full("nomatch", "", -1, &elements); result = eina_str_split_full("nomatch", "", -1, &elements);
fail_if(!!result); fail_if(result != NULL);
fail_if(elements != 0); fail_if(elements != 0);
result = eina_str_split_full("nomatch", "x", -1, &elements); result = eina_str_split_full("nomatch", "x", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 1); fail_if(elements != 1);
fail_if(strcmp(result[0], "nomatch") != 0); fail_if(strcmp(result[0], "nomatch") != 0);
free(result[0]); free(result[0]);
free(result); free(result);
result = eina_str_split_full("nomatch", "xyz", -1, &elements); result = eina_str_split_full("nomatch", "xyz", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 1); fail_if(elements != 1);
fail_if(strcmp(result[0], "nomatch") != 0); fail_if(strcmp(result[0], "nomatch") != 0);
free(result[0]); free(result[0]);
free(result); free(result);
result = eina_str_split_full("match:match:match", ":", -1, &elements); result = eina_str_split_full("match:match:match", ":", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 3); fail_if(elements != 3);
while (elements >= 1) while (elements >= 1)
{ {
@ -120,7 +120,7 @@ START_TEST(str_split)
free(result); free(result);
result = eina_str_split_full("a:b:c", ":", -1, &elements); result = eina_str_split_full("a:b:c", ":", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 3); fail_if(elements != 3);
fail_if(strcmp(result[0], "a") != 0); fail_if(strcmp(result[0], "a") != 0);
fail_if(strcmp(result[1], "b") != 0); fail_if(strcmp(result[1], "b") != 0);
@ -129,7 +129,7 @@ START_TEST(str_split)
free(result); free(result);
result = eina_str_split_full("a:b:", ":", -1, &elements); result = eina_str_split_full("a:b:", ":", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 3); fail_if(elements != 3);
fail_if(strcmp(result[0], "a") != 0); fail_if(strcmp(result[0], "a") != 0);
fail_if(strcmp(result[1], "b") != 0); fail_if(strcmp(result[1], "b") != 0);
@ -138,7 +138,7 @@ START_TEST(str_split)
free(result); free(result);
result = eina_str_split_full(":b:c", ":", -1, &elements); result = eina_str_split_full(":b:c", ":", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 3); fail_if(elements != 3);
fail_if(strcmp(result[0], "") != 0); fail_if(strcmp(result[0], "") != 0);
fail_if(strcmp(result[1], "b") != 0); fail_if(strcmp(result[1], "b") != 0);
@ -147,7 +147,7 @@ START_TEST(str_split)
free(result); free(result);
result = eina_str_split_full(":", ":", -1, &elements); result = eina_str_split_full(":", ":", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 2); fail_if(elements != 2);
fail_if(strcmp(result[0], "") != 0); fail_if(strcmp(result[0], "") != 0);
fail_if(strcmp(result[1], "") != 0); fail_if(strcmp(result[1], "") != 0);
@ -155,14 +155,14 @@ START_TEST(str_split)
free(result); free(result);
result = eina_str_split_full("a", "!!!!!!!!!", -1, &elements); result = eina_str_split_full("a", "!!!!!!!!!", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 1); fail_if(elements != 1);
fail_if(strcmp(result[0], "a") != 0); fail_if(strcmp(result[0], "a") != 0);
free(result[0]); free(result[0]);
free(result); free(result);
result = eina_str_split_full("aaba", "ab", -1, &elements); result = eina_str_split_full("aaba", "ab", -1, &elements);
fail_if(!result); fail_if(result == NULL);
fail_if(elements != 2); fail_if(elements != 2);
fail_if(strcmp(result[0], "a") != 0); fail_if(strcmp(result[0], "a") != 0);
fail_if(strcmp(result[1], "a") != 0); fail_if(strcmp(result[1], "a") != 0);

View File

@ -350,7 +350,7 @@ START_TEST(strbuf_append_realloc)
fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size)); fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size));
str = eina_strbuf_string_get(buf); str = eina_strbuf_string_get(buf);
fail_if(!str); fail_if(str == NULL);
for (i = 0; i < runs; i++, str += target_pattern_size) for (i = 0; i < runs; i++, str += target_pattern_size)
fail_if(memcmp(str, target_pattern, target_pattern_size)); fail_if(memcmp(str, target_pattern, target_pattern_size));
@ -385,7 +385,7 @@ START_TEST(strbuf_prepend_realloc)
fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size)); fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size));
str = eina_strbuf_string_get(buf); str = eina_strbuf_string_get(buf);
fail_if(!str); fail_if(str == NULL);
for (i = 0; i < runs; i++, str += target_pattern_size) for (i = 0; i < runs; i++, str += target_pattern_size)
fail_if(memcmp(str, target_pattern, target_pattern_size)); fail_if(memcmp(str, target_pattern, target_pattern_size));

View File

@ -82,8 +82,8 @@ START_TEST(eina_stringshare_small)
t0 = eina_stringshare_add(buf); t0 = eina_stringshare_add(buf);
t1 = eina_stringshare_add(buf); t1 = eina_stringshare_add(buf);
fail_if(!t0); fail_if(t0 == NULL);
fail_if(!t1); fail_if(t1 == NULL);
fail_if(t0 != t1); fail_if(t0 != t1);
fail_if(strcmp(t0, buf) != 0); fail_if(strcmp(t0, buf) != 0);
fail_if((int)strlen(buf) != eina_stringshare_strlen(t0)); fail_if((int)strlen(buf) != eina_stringshare_strlen(t0));
@ -108,8 +108,8 @@ START_TEST(eina_stringshare_test_share)
t0 = eina_stringshare_add(TEST0); t0 = eina_stringshare_add(TEST0);
t1 = eina_stringshare_add(TEST0); t1 = eina_stringshare_add(TEST0);
fail_if(!t0); fail_if(t0 == NULL);
fail_if(!t1); fail_if(t1 == NULL);
fail_if(strcmp(t0, TEST0) != 0); fail_if(strcmp(t0, TEST0) != 0);
fail_if(strcmp(t1, TEST0) != 0); fail_if(strcmp(t1, TEST0) != 0);
fail_if(t0 != t1); fail_if(t0 != t1);
@ -162,7 +162,7 @@ START_TEST(eina_stringshare_collision)
if (rand() > RAND_MAX / 2) if (rand() > RAND_MAX / 2)
{ {
const char *r = eina_stringshare_add(buffer); const char *r = eina_stringshare_add(buffer);
fail_if(!r); fail_if(r == NULL);
} }
} }
@ -173,9 +173,9 @@ START_TEST(eina_stringshare_collision)
eina_convert_itoa(60000 - i, buffer); eina_convert_itoa(60000 - i, buffer);
eina_array_push(ea, (void *)eina_stringshare_add(buffer)); eina_array_push(ea, (void *)eina_stringshare_add(buffer));
r = eina_stringshare_add(buffer); r = eina_stringshare_add(buffer);
fail_if(!r); fail_if(r == NULL);
r = eina_stringshare_add(buffer); r = eina_stringshare_add(buffer);
fail_if(!r); fail_if(r == NULL);
} }
for (i = 0; i < 200; ++i) for (i = 0; i < 200; ++i)

View File

@ -133,7 +133,7 @@ START_TEST(eina_unicode_strncpy_test)
/* Hopefully won't segfault */ /* Hopefully won't segfault */
rv = eina_unicode_strncpy(NULL, STR1, 0); rv = eina_unicode_strncpy(NULL, STR1, 0);
fail_if(!!rv); fail_if(rv != NULL);
eina_shutdown(); eina_shutdown();
} }

View File

@ -71,8 +71,8 @@ START_TEST(eina_ustringshare_test_share)
t0 = eina_ustringshare_add(TEST0); t0 = eina_ustringshare_add(TEST0);
t1 = eina_ustringshare_add(TEST0); t1 = eina_ustringshare_add(TEST0);
fail_if(!t0); fail_if(t0 == NULL);
fail_if(!t1); fail_if(t1 == NULL);
fail_if(eina_unicode_strcmp(t0, TEST0) != 0); fail_if(eina_unicode_strcmp(t0, TEST0) != 0);
fail_if(eina_unicode_strcmp(t1, TEST0) != 0); fail_if(eina_unicode_strcmp(t1, TEST0) != 0);
fail_if(t0 != t1); fail_if(t0 != t1);

View File

@ -218,7 +218,7 @@
amx_GetAddr((amx), (param), &amx_cstr_); \ amx_GetAddr((amx), (param), &amx_cstr_); \
amx_StrLen(amx_cstr_, &amx_length_); \ amx_StrLen(amx_cstr_, &amx_length_); \
if (amx_length_ > 0 && \ if (amx_length_ > 0 && \
((result) = (char*)alloca(amx_length_ + 1)) != NULL) \ ((result) = (char *)alloca(amx_length_ + 1))) \
amx_GetString((result), amx_cstr_); \ amx_GetString((result), amx_cstr_); \
else (result) = NULL; \ else (result) = NULL; \
} }

View File

@ -179,14 +179,14 @@ sc_opensrc(char *filename)
void void
sc_closesrc(void *handle) sc_closesrc(void *handle)
{ {
assert(!!handle); assert(handle != NULL);
fclose((FILE *) handle); fclose((FILE *) handle);
} }
void void
sc_resetsrc(void *handle, void *position) sc_resetsrc(void *handle, void *position)
{ {
assert(!!handle); assert(handle != NULL);
fsetpos((FILE *) handle, (fpos_t *) position); fsetpos((FILE *) handle, (fpos_t *) position);
} }
@ -427,7 +427,7 @@ sc_compile(int argc, char *argv[])
/* write the binary file (the file is already open) */ /* write the binary file (the file is already open) */
if (errnum == 0 && jmpcode == 0) if (errnum == 0 && jmpcode == 0)
{ {
assert(!!binf); assert(binf != NULL);
sc_resetasm(outf); /* flush and loop back, for reading */ sc_resetasm(outf); /* flush and loop back, for reading */
assemble(binf, outf); /* assembler file is now input */ assemble(binf, outf); /* assembler file is now input */
} /* if */ } /* if */
@ -442,7 +442,7 @@ sc_compile(int argc, char *argv[])
free(litq); free(litq);
phopt_cleanup(); phopt_cleanup();
stgbuffer_cleanup(); stgbuffer_cleanup();
assert(jmpcode != 0 || !loctab.next); /* on normal flow, assert(jmpcode != 0 || loctab.next == NULL); /* on normal flow,
* local symbols * local symbols
* should already have been deleted */ * should already have been deleted */
delete_symbols(&loctab, 0, TRUE, TRUE); /* delete local variables delete_symbols(&loctab, 0, TRUE, TRUE); /* delete local variables
@ -1784,7 +1784,7 @@ operatorname(char *name)
char *str; char *str;
cell val; cell val;
assert(!!name); assert(name != NULL);
/* check the operator */ /* check the operator */
opertok = lex(&val, &str); opertok = lex(&val, &str);
@ -1937,7 +1937,7 @@ operatoradjust(int opertok, symbol * sym, char *opername, int resulttag)
static int static int
check_operatortag(int opertok, int resulttag, char *opername) check_operatortag(int opertok, int resulttag, char *opername)
{ {
assert(!!opername && opername[0] != '\0'); assert(opername != NULL && opername[0] != '\0');
switch (opertok) switch (opertok)
{ {
case '!': case '!':
@ -2043,7 +2043,7 @@ funcdisplayname(char *dest, char *funcname)
unary = parse_funcname(funcname, &tags[0], &tags[1], opname); unary = parse_funcname(funcname, &tags[0], &tags[1], opname);
tagsym[1] = find_constval_byval(&tagname_tab, tags[1]); tagsym[1] = find_constval_byval(&tagname_tab, tags[1]);
assert(!!tagsym[1]); assert(tagsym[1] != NULL);
if (unary) if (unary)
{ {
sprintf(dest, "operator%s(%s:)", opname, tagsym[1]->name); sprintf(dest, "operator%s(%s:)", opname, tagsym[1]->name);
@ -2343,7 +2343,7 @@ newfunc(char *firstname, int firsttag, int fpublic, int fstatic, int stock)
* and labels */ * and labels */
delete_symbols(&loctab, 0, TRUE, TRUE); /* clear local variables delete_symbols(&loctab, 0, TRUE, TRUE); /* clear local variables
* queue */ * queue */
assert(!loctab.next); assert(loctab.next == NULL);
curfunc = NULL; curfunc = NULL;
if (sc_status == statSKIP) if (sc_status == statSKIP)
{ {
@ -2587,7 +2587,7 @@ declargs(symbol * sym)
needtoken(')'); needtoken(')');
} /* if */ } /* if */
/* resolve any "sizeof" arguments (now that all arguments are known) */ /* resolve any "sizeof" arguments (now that all arguments are known) */
assert(!!sym->dim.arglist); assert(sym->dim.arglist != NULL);
arglist = sym->dim.arglist; arglist = sym->dim.arglist;
for (idx = 0; idx < argcnt && arglist[idx].ident != 0; idx++) for (idx = 0; idx < argcnt && arglist[idx].ident != 0; idx++)
{ {
@ -2845,7 +2845,7 @@ reduce_referrers(symbol * root)
{ {
if (ref->parent) if (ref->parent)
continue; /* hierarchical data type */ continue; /* hierarchical data type */
assert(!!ref->refer); assert(ref->refer != NULL);
for (i = 0; i < ref->numrefers && ref->refer[i] != sym; for (i = 0; i < ref->numrefers && ref->refer[i] != sym;
i++) i++)
/* nothing */ ; /* nothing */ ;
@ -2948,7 +2948,7 @@ calc_array_datasize(symbol * sym, cell * offset)
{ {
cell length; cell length;
assert(!!sym); assert(sym != NULL);
assert(sym->ident == iARRAY || sym->ident == iREFARRAY); assert(sym->ident == iARRAY || sym->ident == iREFARRAY);
length = sym->dim.array.length; length = sym->dim.array.length;
if (sym->dim.array.level > 0) if (sym->dim.array.level > 0)
@ -3606,7 +3606,7 @@ dofor(void)
* "continue" must ignore these fields. * "continue" must ignore these fields.
*/ */
ptr = readwhile(); ptr = readwhile();
assert(!!ptr); assert(ptr != NULL);
ptr[wqBRK] = (int)declared; ptr[wqBRK] = (int)declared;
ptr[wqCONT] = (int)declared; ptr[wqCONT] = (int)declared;
jumplabel(skiplab); /* skip expression 3 1st time */ jumplabel(skiplab); /* skip expression 3 1st time */
@ -3951,7 +3951,7 @@ doreturn(void)
needtoken(tTERM); needtoken(tTERM);
rettype |= uRETVALUE; /* function returns a value */ rettype |= uRETVALUE; /* function returns a value */
/* check tagname with function tagname */ /* check tagname with function tagname */
assert(!!curfunc); assert(curfunc != NULL);
if (!matchtag(curfunc->tag, tag, TRUE)) if (!matchtag(curfunc->tag, tag, TRUE))
error(213); /* tagname mismatch */ error(213); /* tagname mismatch */
} }
@ -3963,7 +3963,7 @@ doreturn(void)
{ {
char symname[2 * sNAMEMAX + 16]; /* allow space for user char symname[2 * sNAMEMAX + 16]; /* allow space for user
* defined operators */ * defined operators */
assert(!!curfunc); assert(curfunc != NULL);
funcdisplayname(symname, curfunc->name); funcdisplayname(symname, curfunc->name);
error(209, symname); /* function should return a value */ error(209, symname); /* function should return a value */
} /* if */ } /* if */

View File

@ -741,7 +741,7 @@ preproc_expr(cell * val, int *tag)
*/ */
assert(strlen(pline) < sLINEMAX); assert(strlen(pline) < sLINEMAX);
term = strchr(pline, '\0'); term = strchr(pline, '\0');
assert(!!term); assert(term != NULL);
chrcat(pline, PREPROC_TERM); /* the "DEL" code (see SC.H) */ chrcat(pline, PREPROC_TERM); /* the "DEL" code (see SC.H) */
result = constexpr(val, tag); /* get value (or 0 on error) */ result = constexpr(val, tag); /* get value (or 0 on error) */
*term = '\0'; /* erase the token (if still present) */ *term = '\0'; /* erase the token (if still present) */
@ -756,7 +756,7 @@ preproc_expr(cell * val, int *tag)
static char * static char *
getstring(char *dest, int max, char *line) getstring(char *dest, int max, char *line)
{ {
assert(!!dest && !!line); assert(dest != NULL && line != NULL);
*dest = '\0'; *dest = '\0';
while (*line <= ' ' && *line != '\0') while (*line <= ' ' && *line != '\0')
line++; /* skip whitespace */ line++; /* skip whitespace */
@ -1133,7 +1133,7 @@ command(void)
if (skiplevel == 0) if (skiplevel == 0)
{ {
check_empty(lptr); check_empty(lptr);
assert(!!inpf); assert(inpf != NULL);
if (inpf != inpf_org) if (inpf != inpf_org)
sc_closesrc(inpf); sc_closesrc(inpf);
inpf = NULL; inpf = NULL;
@ -2074,7 +2074,7 @@ lexclr(int clreol)
if (clreol) if (clreol)
{ {
lptr = strchr(pline, '\0'); lptr = strchr(pline, '\0');
assert(!!lptr); assert(lptr != NULL);
} /* if */ } /* if */
} }
@ -2370,12 +2370,12 @@ free_symbol(symbol * sym)
/* free all sub-symbol allocated memory blocks, depending on the /* free all sub-symbol allocated memory blocks, depending on the
* kind of the symbol * kind of the symbol
*/ */
assert(!!sym); assert(sym != NULL);
if (sym->ident == iFUNCTN) if (sym->ident == iFUNCTN)
{ {
/* run through the argument list; "default array" arguments /* run through the argument list; "default array" arguments
* must be freed explicitly; the tag list must also be freed */ * must be freed explicitly; the tag list must also be freed */
assert(!!sym->dim.arglist); assert(sym->dim.arglist != NULL);
for (arg = sym->dim.arglist; arg->ident != 0; arg++) for (arg = sym->dim.arglist; arg->ident != 0; arg++)
{ {
if (arg->ident == iREFARRAY && arg->hasdefault) if (arg->ident == iREFARRAY && arg->hasdefault)
@ -2384,12 +2384,12 @@ free_symbol(symbol * sym)
&& ((arg->hasdefault & uSIZEOF) != 0 && ((arg->hasdefault & uSIZEOF) != 0
|| (arg->hasdefault & uTAGOF) != 0)) || (arg->hasdefault & uTAGOF) != 0))
free(arg->defvalue.size.symname); free(arg->defvalue.size.symname);
assert(!!arg->tags); assert(arg->tags != NULL);
free(arg->tags); free(arg->tags);
} /* for */ } /* for */
free(sym->dim.arglist); free(sym->dim.arglist);
} /* if */ } /* if */
assert(!!sym->refer); assert(sym->refer != NULL);
free(sym->refer); free(sym->refer);
free(sym); free(sym);
} }
@ -2405,7 +2405,7 @@ delete_symbol(symbol * root, symbol * sym)
while (root->next != sym) while (root->next != sym)
{ {
root = root->next; root = root->next;
assert(!!root); assert(root != NULL);
} /* while */ } /* while */
/* unlink it, then free it */ /* unlink it, then free it */
@ -2518,9 +2518,9 @@ refer_symbol(symbol * entry, symbol * bywhom)
{ {
int count; int count;
assert(!!bywhom); /* it makes no sense to add a "void" referrer */ assert(bywhom != NULL); /* it makes no sense to add a "void" referrer */
assert(!!entry); assert(entry != NULL);
assert(!!entry->refer); assert(entry->refer != NULL);
/* see if it is already there */ /* see if it is already there */
for (count = 0; count < entry->numrefers && entry->refer[count] != bywhom; for (count = 0; count < entry->numrefers && entry->refer[count] != bywhom;
@ -2556,7 +2556,7 @@ refer_symbol(symbol * entry, symbol * bywhom)
} /* if */ } /* if */
/* add the referrer */ /* add the referrer */
assert(!entry->refer[count]); assert(entry->refer[count] == NULL);
entry->refer[count] = bywhom; entry->refer[count] = bywhom;
return TRUE; return TRUE;
} }
@ -2612,7 +2612,7 @@ findconst(char *name)
sym = find_symbol(&glbtab, name, fcurrent); sym = find_symbol(&glbtab, name, fcurrent);
if (!sym || sym->ident != iCONSTEXPR) if (!sym || sym->ident != iCONSTEXPR)
return NULL; return NULL;
assert(!sym->parent); /* constants have no hierarchy */ assert(sym->parent == NULL); /* constants have no hierarchy */
return sym; return sym;
} }
@ -2639,9 +2639,9 @@ addsym(char *name, cell addr, int ident, int vclass, int tag, int usage)
/* global variables/constants/functions may only be defined once */ /* global variables/constants/functions may only be defined once */
assert(!(ident == iFUNCTN || ident == iCONSTEXPR) || vclass != sGLOBAL assert(!(ident == iFUNCTN || ident == iCONSTEXPR) || vclass != sGLOBAL
|| !findglb(name)); || findglb(name) == NULL);
/* labels may only be defined once */ /* labels may only be defined once */
assert(ident != iLABEL || !findloc(name)); assert(ident != iLABEL || findloc(name) == NULL);
/* create an empty referrer list */ /* create an empty referrer list */
if (!(refer = (symbol **)malloc(sizeof(symbol *)))) if (!(refer = (symbol **)malloc(sizeof(symbol *))))
@ -2680,7 +2680,7 @@ addvariable(char *name, cell addr, int ident, int vclass, int tag,
int level; int level;
/* global variables may only be defined once */ /* global variables may only be defined once */
assert(vclass != sGLOBAL || !(sym = findglb(name)) assert(vclass != sGLOBAL || (sym = findglb(name)) == NULL
|| (sym->usage & uDEFINE) == 0); || (sym->usage & uDEFINE) == 0);
if (ident == iARRAY || ident == iREFARRAY) if (ident == iARRAY || ident == iREFARRAY)

View File

@ -179,7 +179,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
} }
else else
{ {
assert(!!oper); assert(oper != NULL);
assert(numparam == 1); assert(numparam == 1);
/* try a select group of unary operators */ /* try a select group of unary operators */
assert((sizeof unoperstr / sizeof unoperstr[0]) == assert((sizeof unoperstr / sizeof unoperstr[0]) ==
@ -248,7 +248,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
if (oper == user_inc || oper == user_dec) if (oper == user_inc || oper == user_dec)
{ {
assert(!savepri); assert(!savepri);
assert(!!lval); assert(lval != NULL);
if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR) if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR)
push1(); /* save current address in PRI */ push1(); /* save current address in PRI */
rvalue(lval); /* get the symbol's value in PRI */ rvalue(lval); /* get the symbol's value in PRI */
@ -269,7 +269,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
* result must be stored; this address must be preserved accross the * result must be stored; this address must be preserved accross the
* call * call
*/ */
assert(!!lval); /* this was checked earlier */ assert(lval != NULL); /* this was checked earlier */
assert(lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR); /* checked earlier */ assert(lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR); /* checked earlier */
push2(); push2();
} /* if */ } /* if */
@ -308,14 +308,14 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam,
if (sym->x.lib) if (sym->x.lib)
sym->x.lib->value += 1; /* increment "usage count" of the library */ sym->x.lib->value += 1; /* increment "usage count" of the library */
sideeffect = TRUE; /* assume functions carry out a side-effect */ sideeffect = TRUE; /* assume functions carry out a side-effect */
assert(!!resulttag); assert(resulttag != NULL);
*resulttag = sym->tag; /* save tag of the called function */ *resulttag = sym->tag; /* save tag of the called function */
if (savepri || savealt) if (savepri || savealt)
pop2(); /* restore the saved PRI/ALT that into ALT */ pop2(); /* restore the saved PRI/ALT that into ALT */
if (oper == user_inc || oper == user_dec) if (oper == user_inc || oper == user_dec)
{ {
assert(!!lval); assert(lval != NULL);
if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR) if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR)
pop2(); /* restore address (in ALT) */ pop2(); /* restore address (in ALT) */
store(lval); /* store PRI in the symbol */ store(lval); /* store PRI in the symbol */
@ -787,7 +787,7 @@ array_totalsize(symbol * sym)
{ {
cell length; cell length;
assert(!!sym); assert(sym != NULL);
assert(sym->ident == iARRAY || sym->ident == iREFARRAY); assert(sym->ident == iARRAY || sym->ident == iREFARRAY);
length = sym->dim.array.length; length = sym->dim.array.length;
if (sym->dim.array.level > 0) if (sym->dim.array.level > 0)
@ -805,13 +805,13 @@ array_totalsize(symbol * sym)
static cell static cell
array_levelsize(symbol * sym, int level) array_levelsize(symbol * sym, int level)
{ {
assert(!!sym); assert(sym != NULL);
assert(sym->ident == iARRAY || sym->ident == iREFARRAY); assert(sym->ident == iARRAY || sym->ident == iREFARRAY);
assert(level <= sym->dim.array.level); assert(level <= sym->dim.array.level);
while (level-- > 0) while (level-- > 0)
{ {
sym = finddepend(sym); sym = finddepend(sym);
assert(!!sym); assert(sym != NULL);
} /* if */ } /* if */
return sym->dim.array.length; return sym->dim.array.length;
} }
@ -908,7 +908,7 @@ hier14(value * lval1)
/* array assignment is permitted too (with restrictions) */ /* array assignment is permitted too (with restrictions) */
if (oper) if (oper)
return error(23); /* array assignment must be simple assigment */ return error(23); /* array assignment must be simple assigment */
assert(!!lval1->sym); assert(lval1->sym != NULL);
if (array_totalsize(lval1->sym) == 0) if (array_totalsize(lval1->sym) == 0)
return error(46, lval1->sym->name); /* unknown array size */ return error(46, lval1->sym->name); /* unknown array size */
lvalue = TRUE; lvalue = TRUE;
@ -918,7 +918,7 @@ hier14(value * lval1)
if (!lvalue) if (!lvalue)
return error(22); /* must be lvalue */ return error(22); /* must be lvalue */
/* may not change "constant" parameters */ /* may not change "constant" parameters */
assert(!!lval1->sym); assert(lval1->sym != NULL);
if ((lval1->sym->usage & uCONST) != 0) if ((lval1->sym->usage & uCONST) != 0)
return error(22); /* assignment to const argument */ return error(22); /* assignment to const argument */
lval3 = *lval1; /* save symbol to enable storage of expresion result */ lval3 = *lval1; /* save symbol to enable storage of expresion result */
@ -969,7 +969,7 @@ hier14(value * lval1)
if (lval2.ident == iVARIABLE && lval3.ident == lval2.ident if (lval2.ident == iVARIABLE && lval3.ident == lval2.ident
&& lval3.sym == lval2.sym) && lval3.sym == lval2.sym)
{ {
assert(!!lval3.sym); assert(lval3.sym != NULL);
error(226, lval3.sym->name); /* self-assignment */ error(226, lval3.sym->name); /* self-assignment */
} /* if */ } /* if */
} /* if */ } /* if */
@ -1015,7 +1015,7 @@ hier14(value * lval1)
symbol *sym2 = lval2.sym; symbol *sym2 = lval2.sym;
int i; int i;
assert(!!sym1 && !!sym2); assert(sym1 != NULL && sym2 != NULL);
/* ^^^ sym2 must be valid, because only variables can be /* ^^^ sym2 must be valid, because only variables can be
* multi-dimensional (there are no multi-dimensional arrays), * multi-dimensional (there are no multi-dimensional arrays),
* sym1 must be valid because it must be an lvalue * sym1 must be valid because it must be an lvalue
@ -1025,7 +1025,7 @@ hier14(value * lval1)
{ {
sym1 = finddepend(sym1); sym1 = finddepend(sym1);
sym2 = finddepend(sym2); sym2 = finddepend(sym2);
assert(!!sym1 && !!sym2); assert(sym1 != NULL && sym2 != NULL);
/* ^^^ both arrays have the same dimensions (this was checked /* ^^^ both arrays have the same dimensions (this was checked
* earlier) so the dependend should always be found * earlier) so the dependend should always be found
*/ */
@ -1210,7 +1210,7 @@ hier2(value * lval)
case tINC: /* ++lval */ case tINC: /* ++lval */
if (!hier2(lval)) if (!hier2(lval))
return error(22); /* must be lvalue */ return error(22); /* must be lvalue */
assert(!!lval->sym); assert(lval->sym != NULL);
if ((lval->sym->usage & uCONST) != 0) if ((lval->sym->usage & uCONST) != 0)
return error(22); /* assignment to const argument */ return error(22); /* assignment to const argument */
if (!check_userop(user_inc, lval->tag, 0, 1, lval, &lval->tag)) if (!check_userop(user_inc, lval->tag, 0, 1, lval, &lval->tag))
@ -1221,7 +1221,7 @@ hier2(value * lval)
case tDEC: /* --lval */ case tDEC: /* --lval */
if (!hier2(lval)) if (!hier2(lval))
return error(22); /* must be lvalue */ return error(22); /* must be lvalue */
assert(!!lval->sym); assert(lval->sym != NULL);
if ((lval->sym->usage & uCONST) != 0) if ((lval->sym->usage & uCONST) != 0)
return error(22); /* assignment to const argument */ return error(22); /* assignment to const argument */
if (!check_userop(user_dec, lval->tag, 0, 1, lval, &lval->tag)) if (!check_userop(user_dec, lval->tag, 0, 1, lval, &lval->tag))
@ -1300,7 +1300,7 @@ hier2(value * lval)
if (sym && sym->ident != iFUNCTN && sym->ident != iREFFUNC if (sym && sym->ident != iFUNCTN && sym->ident != iREFFUNC
&& (sym->usage & uDEFINE) == 0) && (sym->usage & uDEFINE) == 0)
sym = NULL; /* symbol is not a function, it is in the table, but not "defined" */ sym = NULL; /* symbol is not a function, it is in the table, but not "defined" */
val = (sym); val = !!sym;
if (!val && find_subst(st, strlen(st))) if (!val && find_subst(st, strlen(st)))
val = 1; val = 1;
clear_value(lval); clear_value(lval);
@ -1405,7 +1405,7 @@ hier2(value * lval)
case tINC: /* lval++ */ case tINC: /* lval++ */
if (!lvalue) if (!lvalue)
return error(22); /* must be lvalue */ return error(22); /* must be lvalue */
assert(!!lval->sym); assert(lval->sym != NULL);
if ((lval->sym->usage & uCONST) != 0) if ((lval->sym->usage & uCONST) != 0)
return error(22); /* assignment to const argument */ return error(22); /* assignment to const argument */
/* on incrementing array cells, the address in PRI must be saved for /* on incrementing array cells, the address in PRI must be saved for
@ -1429,7 +1429,7 @@ hier2(value * lval)
case tDEC: /* lval-- */ case tDEC: /* lval-- */
if (!lvalue) if (!lvalue)
return error(22); /* must be lvalue */ return error(22); /* must be lvalue */
assert(!!lval->sym); assert(lval->sym != NULL);
if ((lval->sym->usage & uCONST) != 0) if ((lval->sym->usage & uCONST) != 0)
return error(22); /* assignment to const argument */ return error(22); /* assignment to const argument */
saveresult = (lval->ident == iARRAYCELL saveresult = (lval->ident == iARRAYCELL
@ -1604,7 +1604,7 @@ hier1(value * lval1)
charalign(); /* align character index into array */ charalign(); /* align character index into array */
} /* if */ } /* if */
/* the indexed item may be another array (multi-dimensional arrays) */ /* the indexed item may be another array (multi-dimensional arrays) */
assert(lval1->sym == sym && !!sym); /* should still be set */ assert(lval1->sym == sym && sym != NULL); /* should still be set */
if (sym->dim.array.level > 0) if (sym->dim.array.level > 0)
{ {
assert(close == ']'); /* checked earlier */ assert(close == ']'); /* checked earlier */
@ -1617,7 +1617,7 @@ hier1(value * lval1)
/* adjust the "value" structure and find the referenced array */ /* adjust the "value" structure and find the referenced array */
lval1->ident = iREFARRAY; lval1->ident = iREFARRAY;
lval1->sym = finddepend(sym); lval1->sym = finddepend(sym);
assert(!!lval1->sym); assert(lval1->sym != NULL);
assert(lval1->sym->dim.array.level == assert(lval1->sym->dim.array.level ==
sym->dim.array.level - 1); sym->dim.array.level - 1);
/* try to parse subsequent array indices */ /* try to parse subsequent array indices */
@ -1778,7 +1778,7 @@ primary(value * lval)
{ {
return error(17, st); /* undefined symbol */ return error(17, st); /* undefined symbol */
} /* endif */ } /* endif */
assert(!!sym); assert(sym != NULL);
assert(sym->ident == iFUNCTN || sym->ident != iREFFUNC); assert(sym->ident == iFUNCTN || sym->ident != iREFFUNC);
lval->sym = sym; lval->sym = sym;
lval->ident = sym->ident; lval->ident = sym->ident;
@ -1814,10 +1814,10 @@ setdefarray(cell * string, cell size, cell array_sz, cell * dataaddr,
* the default array data is "dumped" into the data segment only once (on the * the default array data is "dumped" into the data segment only once (on the
* first use). * first use).
*/ */
assert(!!string); assert(string != NULL);
assert(size > 0); assert(size > 0);
/* check whether to dump the default array */ /* check whether to dump the default array */
assert(!!dataaddr); assert(dataaddr != NULL);
if (sc_status == statWRITE && *dataaddr < 0) if (sc_status == statWRITE && *dataaddr < 0)
{ {
int i; int i;
@ -1907,9 +1907,9 @@ callfunction(symbol * sym)
cell lexval; cell lexval;
char *lexstr; char *lexstr;
assert(!!sym); assert(sym != NULL);
arg = sym->dim.arglist; arg = sym->dim.arglist;
assert(!!arg); assert(arg != NULL);
stgmark(sSTARTREORDER); stgmark(sSTARTREORDER);
for (argpos = 0; argpos < sMAXARGS; argpos++) for (argpos = 0; argpos < sMAXARGS; argpos++)
arglist[argpos] = ARG_UNHANDLED; arglist[argpos] = ARG_UNHANDLED;
@ -1974,7 +1974,7 @@ callfunction(symbol * sym)
/* always pass by reference */ /* always pass by reference */
if (lval.ident == iVARIABLE || lval.ident == iREFERENCE) if (lval.ident == iVARIABLE || lval.ident == iREFERENCE)
{ {
assert(!!lval.sym); assert(lval.sym != NULL);
if ((lval.sym->usage & uCONST) != 0 if ((lval.sym->usage & uCONST) != 0
&& (arg[argidx].usage & uCONST) == 0) && (arg[argidx].usage & uCONST) == 0)
{ {
@ -2045,7 +2045,7 @@ callfunction(symbol * sym)
{ {
if (lvalue) if (lvalue)
{ {
assert(!!lval.sym); assert(lval.sym != NULL);
address(lval.sym); address(lval.sym);
} }
else else
@ -2121,7 +2121,7 @@ callfunction(symbol * sym)
symbol *sym = lval.sym; symbol *sym = lval.sym;
short level = 0; short level = 0;
assert(!!sym); assert(sym != NULL);
if (sym->dim.array.level + 1 != arg[argidx].numdim) if (sym->dim.array.level + 1 != arg[argidx].numdim)
error(48); /* array dimensions must match */ error(48); /* array dimensions must match */
/* the lengths for all dimensions must match, unless the dimension /* the lengths for all dimensions must match, unless the dimension
@ -2137,12 +2137,12 @@ callfunction(symbol * sym)
append_constval(&arrayszlst, arg[argidx].name, append_constval(&arrayszlst, arg[argidx].name,
sym->dim.array.length, level); sym->dim.array.length, level);
sym = finddepend(sym); sym = finddepend(sym);
assert(!!sym); assert(sym != NULL);
level++; level++;
} /* if */ } /* if */
/* the last dimension is checked too, again, unless it is zero */ /* the last dimension is checked too, again, unless it is zero */
assert(level < sDIMEN_MAX); assert(level < sDIMEN_MAX);
assert(!!sym); assert(sym != NULL);
if (arg[argidx].dim[level] != 0 if (arg[argidx].dim[level] != 0
&& sym->dim.array.length != && sym->dim.array.length !=
arg[argidx].dim[level]) arg[argidx].dim[level])

View File

@ -336,7 +336,7 @@ rvalue(value * lval)
else if (lval->ident == iREFERENCE) else if (lval->ident == iREFERENCE)
{ {
/* indirect fetch, but address not yet in PRI */ /* indirect fetch, but address not yet in PRI */
assert(!!sym); assert(sym != NULL);
assert(sym->vclass == sLOCAL); /* global references don't exist in Small */ assert(sym->vclass == sLOCAL); /* global references don't exist in Small */
if (sym->vclass == sLOCAL) if (sym->vclass == sLOCAL)
stgwrite("\tlref.s.pri "); stgwrite("\tlref.s.pri ");
@ -349,7 +349,7 @@ rvalue(value * lval)
else else
{ {
/* direct or stack relative fetch */ /* direct or stack relative fetch */
assert(!!sym); assert(sym != NULL);
if (sym->vclass == sLOCAL) if (sym->vclass == sLOCAL)
stgwrite("\tload.s.pri "); stgwrite("\tload.s.pri ");
else else
@ -367,7 +367,7 @@ rvalue(value * lval)
void void
address(symbol * sym) address(symbol * sym)
{ {
assert(!!sym); assert(sym != NULL);
/* the symbol can be a local array, a global array, or an array /* the symbol can be a local array, a global array, or an array
* that is passed by reference. * that is passed by reference.
*/ */
@ -416,7 +416,7 @@ store(value * lval)
} }
else if (lval->ident == iREFERENCE) else if (lval->ident == iREFERENCE)
{ {
assert(!!sym); assert(sym != NULL);
if (sym->vclass == sLOCAL) if (sym->vclass == sLOCAL)
stgwrite("\tsref.s.pri "); stgwrite("\tsref.s.pri ");
else else
@ -426,7 +426,7 @@ store(value * lval)
} }
else else
{ {
assert(!!sym); assert(sym != NULL);
markusage(sym, uWRITTEN); markusage(sym, uWRITTEN);
if (sym->vclass == sLOCAL) if (sym->vclass == sLOCAL)
stgwrite("\tstor.s.pri "); stgwrite("\tstor.s.pri ");
@ -455,7 +455,7 @@ memcopy(cell size)
void void
copyarray(symbol * sym, cell size) copyarray(symbol * sym, cell size)
{ {
assert(!!sym); assert(sym != NULL);
/* the symbol can be a local array, a global array, or an array /* the symbol can be a local array, a global array, or an array
* that is passed by reference. * that is passed by reference.
*/ */
@ -485,7 +485,7 @@ fillarray(symbol * sym, cell size, cell val)
{ {
const1(val); /* load val in PRI */ const1(val); /* load val in PRI */
assert(!!sym); assert(sym != NULL);
/* the symbol can be a local array, a global array, or an array /* the symbol can be a local array, a global array, or an array
* that is passed by reference. * that is passed by reference.
*/ */
@ -658,7 +658,7 @@ ffcase(cell val, char *labelname, int newtable)
void void
ffcall(symbol * sym, int numargs) ffcall(symbol * sym, int numargs)
{ {
assert(!!sym); assert(sym != NULL);
assert(sym->ident == iFUNCTN); assert(sym->ident == iFUNCTN);
if ((sym->usage & uNATIVE) != 0) if ((sym->usage & uNATIVE) != 0)
{ {
@ -1177,7 +1177,7 @@ inc(value * lval)
} }
else if (lval->ident == iREFERENCE) else if (lval->ident == iREFERENCE)
{ {
assert(!!sym); assert(sym != NULL);
stgwrite("\tpush.pri\n"); stgwrite("\tpush.pri\n");
/* load dereferenced value */ /* load dereferenced value */
assert(sym->vclass == sLOCAL); /* global references don't exist in Small */ assert(sym->vclass == sLOCAL); /* global references don't exist in Small */
@ -1200,7 +1200,7 @@ inc(value * lval)
else else
{ {
/* local or global variable */ /* local or global variable */
assert(!!sym); assert(sym != NULL);
if (sym->vclass == sLOCAL) if (sym->vclass == sLOCAL)
stgwrite("\tinc.s "); stgwrite("\tinc.s ");
else else
@ -1243,7 +1243,7 @@ dec(value * lval)
} }
else if (lval->ident == iREFERENCE) else if (lval->ident == iREFERENCE)
{ {
assert(!!sym); assert(sym != NULL);
stgwrite("\tpush.pri\n"); stgwrite("\tpush.pri\n");
/* load dereferenced value */ /* load dereferenced value */
assert(sym->vclass == sLOCAL); /* global references don't exist in Small */ assert(sym->vclass == sLOCAL); /* global references don't exist in Small */
@ -1266,7 +1266,7 @@ dec(value * lval)
else else
{ {
/* local or global variable */ /* local or global variable */
assert(!!sym); assert(sym != NULL);
if (sym->vclass == sLOCAL) if (sym->vclass == sLOCAL)
stgwrite("\tdec.s "); stgwrite("\tdec.s ");
else else

View File

@ -156,7 +156,7 @@ static void
write_encoded(FILE * fbin, ucell * c, int num) write_encoded(FILE * fbin, ucell * c, int num)
{ {
assert(sizeof(cell) <= 4); /* code must be adjusted for larger cells */ assert(sizeof(cell) <= 4); /* code must be adjusted for larger cells */
assert(!!fbin); assert(fbin != NULL);
while (num-- > 0) while (num-- > 0)
{ {
if (sc_compress) if (sc_compress)
@ -298,7 +298,7 @@ do_call(FILE * fbin, char *params, cell opcode)
* already have been set (in order for static globals to be found). * already have been set (in order for static globals to be found).
*/ */
sym = findglb(name); sym = findglb(name);
assert(!!sym); assert(sym != NULL);
assert(sym->ident == iFUNCTN || sym->ident == iREFFUNC); assert(sym->ident == iFUNCTN || sym->ident == iREFFUNC);
assert(sym->vclass == sGLOBAL); assert(sym->vclass == sGLOBAL);
@ -322,7 +322,7 @@ do_jump(FILE * fbin, char *params, cell opcode)
if (fbin) if (fbin)
{ {
assert(!!lbltab); assert(lbltab != NULL);
p = lbltab[i]; p = lbltab[i];
write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, (ucell *) & opcode, 1);
write_encoded(fbin, &p, 1); write_encoded(fbin, &p, 1);
@ -414,7 +414,7 @@ do_switch(FILE * fbin, char *params, cell opcode)
if (fbin) if (fbin)
{ {
assert(!!lbltab); assert(lbltab != NULL);
p = lbltab[i]; p = lbltab[i];
write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, (ucell *) & opcode, 1);
write_encoded(fbin, &p, 1); write_encoded(fbin, &p, 1);
@ -438,7 +438,7 @@ do_case(FILE * fbin, char *params, cell opcode __UNUSED__)
if (fbin) if (fbin)
{ {
assert(!!lbltab); assert(lbltab != NULL);
p = lbltab[i]; p = lbltab[i];
write_encoded(fbin, &v, 1); write_encoded(fbin, &v, 1);
write_encoded(fbin, &p, 1); write_encoded(fbin, &p, 1);
@ -625,7 +625,7 @@ findopcode(char *instr, int maxlen)
while (low < high) while (low < high)
{ {
mid = (low + high) / 2; mid = (low + high) / 2;
assert(!!opcodelist[mid].name); assert(opcodelist[mid].name != NULL);
cmp = strcasecmp(str, opcodelist[mid].name); cmp = strcasecmp(str, opcodelist[mid].name);
if (cmp > 0) if (cmp > 0)
low = mid + 1; low = mid + 1;
@ -664,10 +664,10 @@ assemble(FILE * fout, FILE * fin)
/* verify that the opcode list is sorted (skip entry 1; it is reserved /* verify that the opcode list is sorted (skip entry 1; it is reserved
* for a non-existant opcode) * for a non-existant opcode)
*/ */
assert(!!opcodelist[1].name); assert(opcodelist[1].name != NULL);
for (i = 2; i < (sizeof opcodelist / sizeof opcodelist[0]); i++) for (i = 2; i < (sizeof opcodelist / sizeof opcodelist[0]); i++)
{ {
assert(!!opcodelist[i].name); assert(opcodelist[i].name != NULL);
assert(strcasecmp(opcodelist[i].name, opcodelist[i - 1].name) > 0); assert(strcasecmp(opcodelist[i].name, opcodelist[i - 1].name) > 0);
} /* for */ } /* for */
#endif #endif
@ -867,7 +867,7 @@ assemble(FILE * fout, FILE * fin)
char alias[sNAMEMAX + 1]; char alias[sNAMEMAX + 1];
sym = nativelist[i]; sym = nativelist[i];
assert(!!sym); assert(sym != NULL);
if (!lookup_alias(alias, sym->name)) if (!lookup_alias(alias, sym->name))
{ {
assert(strlen(sym->name) <= sNAMEMAX); assert(strlen(sym->name) <= sNAMEMAX);
@ -1044,7 +1044,7 @@ assemble(FILE * fout, FILE * fin)
/* nothing */ ; /* nothing */ ;
assert(params > instr); assert(params > instr);
i = findopcode(instr, (int)(params - instr)); i = findopcode(instr, (int)(params - instr));
assert(!!opcodelist[i].name); assert(opcodelist[i].name != NULL);
if (opcodelist[i].segment == pass) if (opcodelist[i].segment == pass)
opcodelist[i].func(fout, skipwhitespace(params), opcodelist[i].func(fout, skipwhitespace(params),
opcodelist[i].opcode); opcodelist[i].opcode);

View File

@ -533,7 +533,7 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1],
* that the same symbol may occur multiple times in the pattern) plus * that the same symbol may occur multiple times in the pattern) plus
* line endings and startings ('\t' to start a line and '\n\0' to end one) * line endings and startings ('\t' to start a line and '\n\0' to end one)
*/ */
assert(!!repl_length); assert(repl_length != NULL);
*repl_length = 0; *repl_length = 0;
lptr = pattern; lptr = pattern;
while (*lptr) while (*lptr)
@ -627,7 +627,7 @@ stgopt(char *start, char *end)
char symbols[_maxoptvars][_aliasmax + 1]; char symbols[_maxoptvars][_aliasmax + 1];
int seq, match_length, repl_length; int seq, match_length, repl_length;
assert(!!sequences); assert(sequences != NULL);
while (start < end) while (start < end)
{ {
if ((sc_debug & sNOOPTIMIZE) != 0 || sc_status != statWRITE) if ((sc_debug & sNOOPTIMIZE) != 0 || sc_status != statWRITE)
@ -677,7 +677,7 @@ stgopt(char *start, char *end)
seq++; seq++;
} /* if */ } /* if */
} /* while */ } /* while */
assert(!sequences[seq].find); assert(sequences[seq].find == NULL);
filewrite(start); filewrite(start);
} /* if */ } /* if */
assert(start < end); assert(start < end);

View File

@ -39,9 +39,9 @@ insert_stringpair(stringpair * root, char *first, char *second, int matchlength)
{ {
stringpair *cur, *pred; stringpair *cur, *pred;
assert(!!root); assert(root != NULL);
assert(!!first); assert(first != NULL);
assert(!!second); assert(second != NULL);
/* create a new node, and check whether all is okay */ /* create a new node, and check whether all is okay */
if (!(cur = (stringpair *)malloc(sizeof(stringpair)))) if (!(cur = (stringpair *)malloc(sizeof(stringpair))))
return NULL; return NULL;
@ -71,13 +71,13 @@ delete_stringpairtable(stringpair * root)
{ {
stringpair *cur, *next; stringpair *cur, *next;
assert(!!root); assert(root != NULL);
cur = root->next; cur = root->next;
while (cur) while (cur)
{ {
next = cur->next; next = cur->next;
assert(!!cur->first); assert(cur->first != NULL);
assert(!!cur->second); assert(cur->second != NULL);
free(cur->first); free(cur->first);
free(cur->second); free(cur->second);
free(cur); free(cur);
@ -92,7 +92,7 @@ find_stringpair(stringpair * cur, char *first, int matchlength)
int result = 0; int result = 0;
assert(matchlength > 0); /* the function cannot handle zero-length comparison */ assert(matchlength > 0); /* the function cannot handle zero-length comparison */
assert(!!first); assert(first != NULL);
while (cur && result <= 0) while (cur && result <= 0)
{ {
result = (int)*cur->first - (int)*first; result = (int)*cur->first - (int)*first;
@ -112,15 +112,15 @@ delete_stringpair(stringpair * root, stringpair * item)
{ {
stringpair *cur; stringpair *cur;
assert(!!root); assert(root != NULL);
cur = root; cur = root;
while (cur->next) while (cur->next)
{ {
if (cur->next == item) if (cur->next == item)
{ {
cur->next = item->next; /* unlink from list */ cur->next = item->next; /* unlink from list */
assert(!!item->first); assert(item->first != NULL);
assert(!!item->second); assert(item->second != NULL);
free(item->first); free(item->first);
free(item->second); free(item->second);
free(item); free(item);
@ -139,9 +139,9 @@ insert_alias(char *name, char *alias)
{ {
stringpair *cur; stringpair *cur;
assert(!!name); assert(name != NULL);
assert(strlen(name) <= sNAMEMAX); assert(strlen(name) <= sNAMEMAX);
assert(!!alias); assert(alias != NULL);
assert(strlen(alias) <= sEXPMAX); assert(strlen(alias) <= sEXPMAX);
if (!(cur = insert_stringpair(&alias_tab, name, alias, strlen(name)))) if (!(cur = insert_stringpair(&alias_tab, name, alias, strlen(name))))
error(103); /* insufficient memory (fatal error) */ error(103); /* insufficient memory (fatal error) */
@ -175,7 +175,7 @@ insert_path(char *path)
{ {
stringlist *cur; stringlist *cur;
assert(!!path); assert(path != NULL);
if (!(cur = (stringlist *)malloc(sizeof(stringlist)))) if (!(cur = (stringlist *)malloc(sizeof(stringlist))))
error(103); /* insufficient memory (fatal error) */ error(103); /* insufficient memory (fatal error) */
if (!(cur->line = strdup(path))) if (!(cur->line = strdup(path)))
@ -194,7 +194,7 @@ get_path(int index)
cur = cur->next; cur = cur->next;
if (cur) if (cur)
{ {
assert(!!cur->line); assert(cur->line != NULL);
return cur->line; return cur->line;
} /* if */ } /* if */
return NULL; return NULL;
@ -208,7 +208,7 @@ delete_pathtable(void)
while (cur) while (cur)
{ {
next = cur->next; next = cur->next;
assert(!!cur->line); assert(cur->line != NULL);
free(cur->line); free(cur->line);
free(cur); free(cur);
cur = next; cur = next;
@ -240,8 +240,8 @@ insert_subst(char *pattern, char *substitution, int prefixlen)
{ {
stringpair *cur; stringpair *cur;
assert(!!pattern); assert(pattern != NULL);
assert(!!substitution); assert(substitution != NULL);
if (!(cur = insert_stringpair(&substpair, pattern, substitution, prefixlen))) if (!(cur = insert_stringpair(&substpair, pattern, substitution, prefixlen)))
error(103); /* insufficient memory (fatal error) */ error(103); /* insufficient memory (fatal error) */
adjustindex(*pattern); adjustindex(*pattern);
@ -253,7 +253,7 @@ find_subst(char *name, int length)
{ {
stringpair *item; stringpair *item;
assert(!!name); assert(name != NULL);
assert(length > 0); assert(length > 0);
assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z') assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z')
|| *name == '_'); || *name == '_');
@ -268,7 +268,7 @@ delete_subst(char *name, int length)
{ {
stringpair *item; stringpair *item;
assert(!!name); assert(name != NULL);
assert(length > 0); assert(length > 0);
assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z') assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z')
|| *name == '_'); || *name == '_');

View File

@ -144,7 +144,7 @@ _evas_cache_engine_image_dealloc(Evas_Cache_Engine_Image *cache, Engine_Image_En
EAPI int EAPI int
evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache) evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache)
{ {
assert(!!cache); assert(cache != NULL);
return cache->usage; return cache->usage;
} }
@ -152,7 +152,7 @@ evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache)
EAPI int EAPI int
evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache) evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache)
{ {
assert(!!cache); assert(cache != NULL);
return cache->limit; return cache->limit;
} }
@ -160,7 +160,7 @@ evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache)
EAPI void EAPI void
evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit) evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit)
{ {
assert(!!cache); assert(cache != NULL);
cache->limit = limit; cache->limit = limit;
} }
@ -247,7 +247,7 @@ _evas_cache_engine_image_free_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ co
EAPI void EAPI void
evas_cache_engine_image_flush(Evas_Cache_Engine_Image *cache) evas_cache_engine_image_flush(Evas_Cache_Engine_Image *cache)
{ {
assert(!!cache); assert(cache != NULL);
while ((cache->lru) && (cache->limit < cache->usage)) while ((cache->lru) && (cache->limit < cache->usage))
{ {
@ -264,7 +264,7 @@ evas_cache_engine_image_shutdown(Evas_Cache_Engine_Image *cache)
Engine_Image_Entry *eim; Engine_Image_Entry *eim;
Eina_List *delete_list = NULL; Eina_List *delete_list = NULL;
assert(!!cache); assert(cache != NULL);
if (cache->func.debug) cache->func.debug("shutdown-engine", NULL); if (cache->func.debug) cache->func.debug("shutdown-engine", NULL);
@ -303,7 +303,7 @@ evas_cache_engine_image_request(Evas_Cache_Engine_Image *cache,
Image_Entry *im; Image_Entry *im;
const char *ekey; const char *ekey;
assert(!!cache); assert(cache != NULL);
*error = EVAS_LOAD_ERROR_NONE; *error = EVAS_LOAD_ERROR_NONE;

View File

@ -525,7 +525,7 @@ _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target)
EAPI int EAPI int
evas_cache_image_usage_get(Evas_Cache_Image *cache) evas_cache_image_usage_get(Evas_Cache_Image *cache)
{ {
assert(!!cache); assert(cache != NULL);
return cache->usage; return cache->usage;
} }
@ -533,7 +533,7 @@ evas_cache_image_usage_get(Evas_Cache_Image *cache)
EAPI int EAPI int
evas_cache_image_get(Evas_Cache_Image *cache) evas_cache_image_get(Evas_Cache_Image *cache)
{ {
assert(!!cache); assert(cache != NULL);
return cache->limit; return cache->limit;
} }
@ -541,7 +541,7 @@ evas_cache_image_get(Evas_Cache_Image *cache)
EAPI void EAPI void
evas_cache_image_set(Evas_Cache_Image *cache, int limit) evas_cache_image_set(Evas_Cache_Image *cache, int limit)
{ {
assert(!!cache); assert(cache != NULL);
#ifdef EVAS_FRAME_QUEUING #ifdef EVAS_FRAME_QUEUING
LKL(cache->lock); LKL(cache->lock);
#endif #endif
@ -698,7 +698,7 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char *
size_t key_length; size_t key_length;
struct stat st; struct stat st;
assert(!!cache); assert(cache != NULL);
if ((!file) || ((!file) && (!key))) if ((!file) || ((!file) && (!key)))
{ {

View File

@ -131,7 +131,7 @@ evas_common_font_source_memory_load(const char *name, const void *data, int data
int error; int error;
RGBA_Font_Source *fs; RGBA_Font_Source *fs;
assert(!!name); assert(name != NULL);
fs = calloc(1, sizeof(RGBA_Font_Source) + data_size); fs = calloc(1, sizeof(RGBA_Font_Source) + data_size);
if (!fs) return NULL; if (!fs) return NULL;
@ -164,7 +164,7 @@ evas_common_font_source_load(const char *name)
{ {
RGBA_Font_Source *fs; RGBA_Font_Source *fs;
assert(!!name); assert(name != NULL);
fs = calloc(1, sizeof(RGBA_Font_Source)); fs = calloc(1, sizeof(RGBA_Font_Source));
if (!fs) return NULL; if (!fs) return NULL;

View File

@ -176,7 +176,7 @@ evas_object_clip_recalc(Evas_Object *obj)
int nx, ny, nw, nh, nvis, nr, ng, nb, na; int nx, ny, nw, nh, nvis, nr, ng, nb, na;
if (!obj->cur.cache.clip.dirty && if (!obj->cur.cache.clip.dirty &&
!(obj->cur.clipper == NULL || obj->cur.clipper->cur.cache.clip.dirty)) !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty))
return; return;
if (obj->layer->evas->events_frozen > 0) return; if (obj->layer->evas->events_frozen > 0) return;
evas_object_coords_recalc(obj); evas_object_coords_recalc(obj);