From d8002ff386853ff907daddb61c8d6874801c3e97 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 26 Aug 2010 01:34:13 +0000 Subject: [PATCH] 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 --- legacy/ecore/src/tests/ecore_test_ecore.c | 12 ++-- legacy/edje/src/lib/edje_lua.c | 6 +- legacy/eet/src/lib/eet_data.c | 6 +- legacy/eet/src/lib/eet_lib.c | 6 +- legacy/eet/src/tests/eet_suite.c | 66 +++++++++---------- legacy/eina/src/include/eina_inline_trash.x | 2 +- legacy/eina/src/lib/eina_matrixsparse.c | 16 ++--- legacy/eina/src/tests/eina_test_binshare.c | 14 ++-- legacy/eina/src/tests/eina_test_hash.c | 10 +-- legacy/eina/src/tests/eina_test_list.c | 34 +++++----- .../eina/src/tests/eina_test_matrixsparse.c | 14 ++-- legacy/eina/src/tests/eina_test_mempool.c | 4 +- legacy/eina/src/tests/eina_test_rbtree.c | 14 ++-- legacy/eina/src/tests/eina_test_str.c | 20 +++--- legacy/eina/src/tests/eina_test_strbuf.c | 4 +- legacy/eina/src/tests/eina_test_stringshare.c | 14 ++-- legacy/eina/src/tests/eina_test_ustr.c | 2 +- .../eina/src/tests/eina_test_ustringshare.c | 4 +- legacy/embryo/src/bin/embryo_cc_amx.h | 2 +- legacy/embryo/src/bin/embryo_cc_sc1.c | 28 ++++---- legacy/embryo/src/bin/embryo_cc_sc2.c | 34 +++++----- legacy/embryo/src/bin/embryo_cc_sc3.c | 60 ++++++++--------- legacy/embryo/src/bin/embryo_cc_sc4.c | 24 +++---- legacy/embryo/src/bin/embryo_cc_sc6.c | 20 +++--- legacy/embryo/src/bin/embryo_cc_sc7.c | 6 +- legacy/embryo/src/bin/embryo_cc_sclist.c | 38 +++++------ .../src/lib/cache/evas_cache_engine_image.c | 12 ++-- legacy/evas/src/lib/cache/evas_cache_image.c | 8 +-- .../src/lib/engines/common/evas_font_load.c | 4 +- legacy/evas/src/lib/include/evas_inline.x | 2 +- 30 files changed, 243 insertions(+), 243 deletions(-) diff --git a/legacy/ecore/src/tests/ecore_test_ecore.c b/legacy/ecore/src/tests/ecore_test_ecore.c index 1409db388d..8fa9e9c866 100644 --- a/legacy/ecore/src/tests/ecore_test_ecore.c +++ b/legacy/ecore/src/tests/ecore_test_ecore.c @@ -49,7 +49,7 @@ START_TEST(ecore_test_ecore_main_loop) fail_if(ret != 1); timer = ecore_timer_add(0.0, _quit_cb, &did); - fail_if(!timer); + fail_if(timer == NULL); ecore_main_loop_begin(); @@ -70,7 +70,7 @@ START_TEST(ecore_test_ecore_main_loop_idler) fail_if(ret != 1); idler = ecore_idler_add(_quit_cb, &did); - fail_if(!idler); + fail_if(idler == NULL); ecore_main_loop_begin(); @@ -91,7 +91,7 @@ START_TEST(ecore_test_ecore_main_loop_idle_enterer) fail_if(ret != 1); idle_enterer = ecore_idle_enterer_add(_quit_cb, &did); - fail_if(!idle_enterer); + fail_if(idle_enterer == NULL); ecore_main_loop_begin(); @@ -114,10 +114,10 @@ START_TEST(ecore_test_ecore_main_loop_idle_exiter) /* make system exit idle */ 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); - fail_if(!idle_exiter); + fail_if(idle_exiter == NULL); ecore_main_loop_begin(); @@ -139,7 +139,7 @@ START_TEST(ecore_test_ecore_main_loop_timer) fail_if(ret != 1); timer = ecore_timer_add(2.0, _quit_cb, &did); - fail_if(!timer); + fail_if(timer == NULL); start = ecore_time_get(); ecore_main_loop_begin(); diff --git a/legacy/edje/src/lib/edje_lua.c b/legacy/edje/src/lib/edje_lua.c index 892bca7a45..b9afd1d4ca 100644 --- a/legacy/edje/src/lib/edje_lua.c +++ b/legacy/edje/src/lib/edje_lua.c @@ -389,7 +389,7 @@ _edje_lua_new_class(lua_State *L, const Edje_Lua_Reg ** class) { int n = 0; _edje_lua_new_metatable(L, class); - while (class && (class[n])) + while (class && (class[n] != NULL)) { luaL_register(L, NULL, class[n]->mt); 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 _edje_lua_init() { - if (Ledje) return; + if (Ledje != NULL) return; /* * create main Lua state with the custom memory allocation function */ @@ -5165,7 +5165,7 @@ _edje_lua_init() void _edje_lua_shutdown() { - if (!Ledje) return; + if (Ledje == NULL) return; lua_close(Ledje); Ledje = NULL; } diff --git a/legacy/eet/src/lib/eet_data.c b/legacy/eet/src/lib/eet_data.c index 2ae5246494..0a305a8102 100644 --- a/legacy/eet/src/lib/eet_data.c +++ b/legacy/eet/src/lib/eet_data.c @@ -1874,8 +1874,8 @@ eet_data_descriptor_element_add(Eet_Data_Descriptor *edd, && (type != EET_T_UNKNOW || !subtype - || subtype->func.type_get == NULL - || subtype->func.type_set == NULL)) + || !subtype->func.type_get + || !subtype->func.type_set)) return; /* 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)); if (*str) { - if ((!ed) || (edd->func.str_direct_alloc == NULL)) + if ((!ed) || (!edd->func.str_direct_alloc)) { *str = edd->func.str_alloc(*str); _eet_freelist_str_add(context, *str); diff --git a/legacy/eet/src/lib/eet_lib.c b/legacy/eet/src/lib/eet_lib.c index 3fc2ac2bff..b5a2ab86ea 100644 --- a/legacy/eet/src/lib/eet_lib.c +++ b/legacy/eet/src/lib/eet_lib.c @@ -1623,10 +1623,10 @@ open_error: ef->sha1_length = 0; 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; - if (ef->readfp == NULL && + if (!ef->readfp && (mode == EET_FILE_MODE_READ_WRITE || mode == EET_FILE_MODE_WRITE)) goto empty_file; @@ -1946,7 +1946,7 @@ eet_read_direct(Eet_File *ef, if (!efn) goto on_error; - if (efn->offset < 0 && efn->data == NULL) + if (efn->offset < 0 && !efn->data) goto on_error; /* get size (uncompressed, if compressed at all) */ diff --git a/legacy/eet/src/tests/eet_suite.c b/legacy/eet/src/tests/eet_suite.c index b93820e2d6..af96a91547 100644 --- a/legacy/eet/src/tests/eet_suite.c +++ b/legacy/eet/src/tests/eet_suite.c @@ -203,13 +203,13 @@ _eet_test_basic_check(Eet_Test_Basic_Type * result, int i) fail_if(tmp > 0.00005); - fail_if(!!result->empty); + fail_if(result->empty != NULL); if (i == 0) { Eet_Test_Basic_Type * tmp; tmp = result->with; - fail_if(!tmp); + fail_if(tmp == NULL); fail_if(tmp->c != EET_TEST_CHAR); 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); } else - fail_if(!!result->with); + fail_if(result->with != NULL); } /* _eet_test_basic_check */ 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_list(ef, "*", &size)); + fail_if(eet_list(ef, "*", &size) != NULL); fail_if(eet_num_entries(ef) != -1); eet_close(ef); @@ -1036,11 +1036,11 @@ START_TEST(eet_file_data_test) /* Test the resulting data. */ 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(!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(!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(!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(result->charray[0], "test") != 0); @@ -1074,13 +1074,13 @@ START_TEST(eet_file_data_test) fail_if(eet_num_entries(ef) != 1); /* Test some more wrong case */ - fail_if(!!eet_data_read(ef, edd, "plop")); - fail_if(!!eet_data_read(ef, edd, EET_TEST_FILE_KEY1)); + fail_if(eet_data_read(ef, edd, "plop") != NULL); + fail_if(eet_data_read(ef, edd, EET_TEST_FILE_KEY1) != NULL); /* Reinsert and reread data */ 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_read_direct(ef, EET_TEST_FILE_KEY1, &size)); + fail_if(eet_data_read(ef, edd, EET_TEST_FILE_KEY1) == NULL); + fail_if(eet_read_direct(ef, EET_TEST_FILE_KEY1, &size) == NULL); eet_close(ef); @@ -1163,11 +1163,11 @@ START_TEST(eet_file_data_dump_test) /* Test the resulting data. */ 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(!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(!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(!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(result->charray[0], "test") != 0); @@ -1307,7 +1307,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_noalpha.w); fail_if(h != test_noalpha.h); fail_if(alpha != test_noalpha.alpha); @@ -1353,7 +1353,7 @@ START_TEST(eet_image) fail_if(lossy != 0); data = malloc(w * h * 4); - fail_if(!data); + fail_if(data == NULL); result = eet_data_image_read_to_surface(ef, EET_TEST_FILE_IMAGE "0", 4, @@ -1375,7 +1375,7 @@ START_TEST(eet_image) free(data); data = malloc(w * h * 4); - fail_if(!data); + fail_if(data == NULL); result = eet_data_image_read_to_surface(ef, EET_TEST_FILE_IMAGE "0", 0, @@ -1404,7 +1404,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_noalpha.w); fail_if(h != test_noalpha.h); fail_if(alpha != test_noalpha.alpha); @@ -1422,7 +1422,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_noalpha.w); fail_if(h != test_noalpha.h); fail_if(alpha != test_noalpha.alpha); @@ -1439,7 +1439,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_noalpha.w); fail_if(h != test_noalpha.h); fail_if(alpha != test_noalpha.alpha); @@ -1454,7 +1454,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_noalpha.w); fail_if(h != test_noalpha.h); fail_if(alpha != test_noalpha.alpha); @@ -1469,7 +1469,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_noalpha.w); fail_if(h != test_noalpha.h); fail_if(alpha != test_noalpha.alpha); @@ -1499,7 +1499,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_alpha.w); fail_if(h != test_alpha.h); fail_if(alpha != test_alpha.alpha); @@ -1530,7 +1530,7 @@ START_TEST(eet_image) &compress, &quality, &lossy); - fail_if(!data); + fail_if(data == NULL); fail_if(w != test_alpha.w); fail_if(h != test_alpha.h); fail_if(alpha != test_alpha.alpha); @@ -1654,7 +1654,7 @@ START_TEST(eet_identity_simple) fail_if(memcmp(test, buffer, strlen(buffer) + 1) != 0); tmp = eet_identity_x509(ef, &size); - fail_if(!tmp); + fail_if(tmp == NULL); eet_identity_certificate_print(tmp, size, noread); @@ -1850,7 +1850,7 @@ open_close_worker(void * path) while (!open_worker_stop) { Eet_File * ef = eet_open((char const *)path, EET_FILE_MODE_READ); - if (!ef) + if (ef == NULL) pthread_exit("eet_open() failed"); else { @@ -1871,7 +1871,7 @@ open_close_worker(void * path) while (!open_worker_stop) { Eet_File * ef = eet_open((char const *)path, EET_FILE_MODE_READ); - if (!ef) + if (ef == NULL) _endthreadex(-1); else { @@ -1964,11 +1964,11 @@ _eet_connection_read(const void * eet_data, size_t size, void * user_data) fail_if(!node); 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(!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(!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(!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(result->charray[0], "test") != 0); @@ -2329,7 +2329,7 @@ _eet_union_type_get(const void * data, Eina_Bool * unknow) if (unknow) *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) return eet_mapping[i].name; @@ -2348,7 +2348,7 @@ _eet_union_type_set(const char * type, void * data, Eina_Bool unknow) if (unknow) 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) { *u = eet_mapping[i].u; @@ -2367,7 +2367,7 @@ _eet_variant_type_get(const void * data, Eina_Bool * unknow) if (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) return eet_mapping[i].name; diff --git a/legacy/eina/src/include/eina_inline_trash.x b/legacy/eina/src/include/eina_inline_trash.x index f3d4ff9011..4a50611174 100644 --- a/legacy/eina/src/include/eina_inline_trash.x +++ b/legacy/eina/src/include/eina_inline_trash.x @@ -81,7 +81,7 @@ eina_trash_pop(Eina_Trash **trash) tmp = *trash; - if (*trash != NULL) + if (*trash) *trash = (*trash)->next; return tmp; diff --git a/legacy/eina/src/lib/eina_matrixsparse.c b/legacy/eina/src/lib/eina_matrixsparse.c index ac26a6c092..ce5e062077 100644 --- a/legacy/eina/src/lib/eina_matrixsparse.c +++ b/legacy/eina/src/lib/eina_matrixsparse.c @@ -531,7 +531,7 @@ _eina_matrixsparse_row_idx_siblings_find(const Eina_Matrixsparse *m, if (r->row > row) break; - assert(!!r); + assert(r != NULL); *p_prev = r->prev; *p_next = r; } @@ -541,7 +541,7 @@ _eina_matrixsparse_row_idx_siblings_find(const Eina_Matrixsparse *m, if (r->row < row) break; - assert(!!r); + assert(r != NULL); *p_prev = r; *p_next = r->next; } @@ -564,7 +564,7 @@ _eina_matrixsparse_row_cell_idx_siblings_find(const Eina_Matrixsparse_Row *r, if (c->col > col) break; - assert(!!c); + assert(c != NULL); *p_prev = c->prev; *p_next = c; } @@ -574,7 +574,7 @@ _eina_matrixsparse_row_cell_idx_siblings_find(const Eina_Matrixsparse_Row *r, if (c->col < col) break; - assert(!!c); + assert(c != NULL); *p_prev = c; *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_idx_siblings_find(m, row, &prev, &next); - assert(!!prev); - assert(!!next); + assert(prev != NULL); + assert(next != NULL); r->prev = prev; r->next = next; 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_row_cell_idx_siblings_find(r, col, &prev, &next); - assert(!!prev); - assert(!!next); + assert(prev != NULL); + assert(next != NULL); c->prev = prev; c->next = next; prev->next = c; diff --git a/legacy/eina/src/tests/eina_test_binshare.c b/legacy/eina/src/tests/eina_test_binshare.c index 8dab062e79..b6c4c79396 100644 --- a/legacy/eina/src/tests/eina_test_binshare.c +++ b/legacy/eina/src/tests/eina_test_binshare.c @@ -85,8 +85,8 @@ START_TEST(eina_binshare_small) t0 = eina_binshare_add_length(buf, i); t1 = eina_binshare_add_length(buf, i); - fail_if(!t0); - fail_if(!t1); + fail_if(t0 == NULL); + fail_if(t1 == NULL); fail_if(t0 != t1); 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); t1 = eina_binshare_add_length(TEST0, TEST0_SIZE); - fail_if(!t0); - fail_if(!t1); + fail_if(t0 == NULL); + fail_if(t1 == NULL); fail_if(memcmp(t0, TEST0, TEST0_SIZE) != 0); fail_if(memcmp(t1, TEST0, TEST0_SIZE) != 0); fail_if(t0 != t1); @@ -168,7 +168,7 @@ START_TEST(eina_binshare_collision) if (rand() > RAND_MAX / 2) { 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, (void *)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)); - fail_if(!r); + fail_if(r == NULL); } for (i = 0; i < 200; ++i) diff --git a/legacy/eina/src/tests/eina_test_hash.c b/legacy/eina/src/tests/eina_test_hash.c index ac6ee76c6c..aeeb655e7b 100644 --- a/legacy/eina/src/tests/eina_test_hash.c +++ b/legacy/eina/src/tests/eina_test_hash.c @@ -111,7 +111,7 @@ START_TEST(eina_hash_extended) fail_if(eina_init() != 2); 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); @@ -123,7 +123,7 @@ START_TEST(eina_hash_extended) 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); @@ -140,7 +140,7 @@ START_TEST(eina_hash_double_item) fail_if(eina_init() != 2); 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[1]) != EINA_TRUE); @@ -167,7 +167,7 @@ START_TEST(eina_hash_all_int) fail_if(eina_init() != 2); hash = eina_hash_int32_new(NULL); - fail_if(!hash); + fail_if(hash == NULL); for (it = 0; it < 4; ++it) 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); hash = eina_hash_int64_new(NULL); - fail_if(!hash); + fail_if(hash == NULL); for (it = 0; it < 4; ++it) fail_if(eina_hash_add(hash, &j[it], &j[it]) != EINA_TRUE); diff --git a/legacy/eina/src/tests/eina_test_list.c b/legacy/eina/src/tests/eina_test_list.c index eef1965490..6e088473d1 100644 --- a/legacy/eina/src/tests/eina_test_list.c +++ b/legacy/eina/src/tests/eina_test_list.c @@ -220,39 +220,39 @@ START_TEST(eina_test_merge) l1 = eina_list_append(l1, &data[1]); l1 = eina_list_append(l1, &data[2]); 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(l2, &data[5]); - fail_if(!l2); + fail_if(l2 == NULL); l1 = eina_list_merge(l1, l2); - fail_if(!l1); + fail_if(l1 == NULL); 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(i != 6); - fail_if(!!l2); + fail_if(l2 != NULL); eina_list_free(l1); l1 = eina_list_append(NULL, &data[0]); 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(l2, &data[3]); l2 = eina_list_append(l2, &data[4]); l2 = eina_list_append(l2, &data[5]); - fail_if(!l2); + fail_if(l2 == NULL); l1 = eina_list_merge(l1, l2); - fail_if(!l1); + fail_if(l1 == NULL); 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(i != 6); - fail_if(!!l2); + fail_if(l2 != NULL); l3 = eina_list_append(NULL, &data[6]); 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); l1 = eina_list_sorted_merge(l1, l3, eina_int_cmp); - fail_if(!l1); + fail_if(l1 == NULL); fail_if(eina_list_count(l1) != 9); l1 = eina_list_sorted_merge(l1, l4, eina_int_cmp); - fail_if(!l1); + fail_if(l1 == NULL); fail_if(eina_list_count(l1) != 12); 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_sorted_check(l1)); @@ -305,14 +305,14 @@ START_TEST(eina_test_sorted_insert) for (i = 0; i < count; 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)); l2 = NULL; EINA_LIST_FOREACH(l1, itr, 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)); eina_list_free(l2); @@ -320,7 +320,7 @@ START_TEST(eina_test_sorted_insert) EINA_LIST_REVERSE_FOREACH(l1, itr, 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)); eina_list_free(l2); eina_list_free(l1); @@ -330,7 +330,7 @@ START_TEST(eina_test_sorted_insert) for (i = 0; i < count; 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)); eina_list_free(l1); diff --git a/legacy/eina/src/tests/eina_test_matrixsparse.c b/legacy/eina/src/tests/eina_test_matrixsparse.c index 3f529a8e96..e07b1eead7 100644 --- a/legacy/eina/src/tests/eina_test_matrixsparse.c +++ b/legacy/eina/src/tests/eina_test_matrixsparse.c @@ -286,7 +286,7 @@ START_TEST(eina_test_resize) matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS, eina_matrixsparse_free_cell_cb, data); - fail_if(!matrix); + fail_if(matrix == NULL); /* cell insertion */ data[0][5] = 5; @@ -408,7 +408,7 @@ START_TEST(eina_test_iterators) matrix = eina_matrixsparse_new(MAX_ROWS, MAX_COLS, 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]); fail_if(r == EINA_FALSE); @@ -448,23 +448,23 @@ START_TEST(eina_test_iterators) fail_if(r == EINA_FALSE); it = eina_matrixsparse_iterator_new(matrix); - fail_if(!it); + fail_if(it == NULL); EINA_ITERATOR_FOREACH(it, cell) { - fail_if(!cell); + fail_if(cell == NULL); r = eina_matrixsparse_cell_position_get(cell, &row, &col); fail_if(r == EINA_FALSE); 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); it = eina_matrixsparse_iterator_complete_new(matrix); - fail_if(!it); + fail_if(it == NULL); EINA_ITERATOR_FOREACH(it, cell) { - fail_if(!cell); + fail_if(cell == NULL); r = eina_matrixsparse_cell_position_get(cell, &row, &col); fail_if(r == EINA_FALSE); diff --git a/legacy/eina/src/tests/eina_test_mempool.c b/legacy/eina/src/tests/eina_test_mempool.c index a17d06d6bb..f911fff7c3 100644 --- a/legacy/eina/src/tests/eina_test_mempool.c +++ b/legacy/eina/src/tests/eina_test_mempool.c @@ -68,9 +68,9 @@ _eina_mempool_test(Eina_Mempool *mp, Eina_Bool with_realloc, Eina_Bool with_gc) eina_mempool_free(mp, tbl[i]); if (with_realloc) - fail_if(!eina_mempool_realloc(mp, tbl[500], 25)); + fail_if(eina_mempool_realloc(mp, tbl[500], 25) == NULL); else - fail_if(!!eina_mempool_realloc(mp, tbl[500], 25)); + fail_if(eina_mempool_realloc(mp, tbl[500], 25) != NULL); if (with_gc) { diff --git a/legacy/eina/src/tests/eina_test_rbtree.c b/legacy/eina/src/tests/eina_test_rbtree.c index cb8b85d993..fabe2bfd2a 100644 --- a/legacy/eina/src/tests/eina_test_rbtree.c +++ b/legacy/eina/src/tests/eina_test_rbtree.c @@ -30,7 +30,7 @@ static inline Eina_Bool _eina_rbtree_is_red(Eina_Rbtree *tree) { - return !!tree && tree->color == EINA_RBTREE_RED; + return tree != NULL && tree->color == EINA_RBTREE_RED; } static int @@ -261,7 +261,7 @@ START_TEST(eina_rbtree_simple_remove) _eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); - fail_if(!root); + fail_if(root == NULL); i = 69; lookup = eina_rbtree_inline_lookup(root, @@ -271,7 +271,7 @@ START_TEST(eina_rbtree_simple_remove) eina_rbtree_int_key), NULL); _eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); - fail_if(!lookup); + fail_if(lookup == NULL); root = 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_CMP_NODE_CB(eina_rbtree_int_cmp)); - fail_if(!root); + fail_if(root == NULL); i = 69; lookup = eina_rbtree_inline_lookup(root, @@ -335,7 +335,7 @@ START_TEST(eina_rbtree_simple_remove2) eina_rbtree_int_key), NULL); _eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); - fail_if(!lookup); + fail_if(lookup == NULL); root = 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_CMP_NODE_CB(eina_rbtree_int_cmp)); - fail_if(!root); + fail_if(root == NULL); i = 1113497590; lookup = eina_rbtree_inline_lookup(root, @@ -429,7 +429,7 @@ START_TEST(eina_rbtree_simple_remove3) eina_rbtree_int_key), NULL); _eina_rbtree_black_height(root, EINA_RBTREE_CMP_NODE_CB(eina_rbtree_int_cmp)); - fail_if(!lookup); + fail_if(lookup == NULL); root = eina_rbtree_inline_remove(root, lookup, EINA_RBTREE_CMP_NODE_CB( diff --git a/legacy/eina/src/tests/eina_test_str.c b/legacy/eina/src/tests/eina_test_str.c index fc34fd92ad..f0ea291731 100644 --- a/legacy/eina/src/tests/eina_test_str.c +++ b/legacy/eina/src/tests/eina_test_str.c @@ -91,25 +91,25 @@ START_TEST(str_split) eina_init(); result = eina_str_split_full("nomatch", "", -1, &elements); - fail_if(!!result); + fail_if(result != NULL); fail_if(elements != 0); result = eina_str_split_full("nomatch", "x", -1, &elements); - fail_if(!result); + fail_if(result == NULL); 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); + fail_if(result == NULL); 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); + fail_if(result == NULL); fail_if(elements != 3); while (elements >= 1) { @@ -120,7 +120,7 @@ START_TEST(str_split) free(result); result = eina_str_split_full("a:b:c", ":", -1, &elements); - fail_if(!result); + fail_if(result == NULL); fail_if(elements != 3); fail_if(strcmp(result[0], "a") != 0); fail_if(strcmp(result[1], "b") != 0); @@ -129,7 +129,7 @@ START_TEST(str_split) free(result); result = eina_str_split_full("a:b:", ":", -1, &elements); - fail_if(!result); + fail_if(result == NULL); fail_if(elements != 3); fail_if(strcmp(result[0], "a") != 0); fail_if(strcmp(result[1], "b") != 0); @@ -138,7 +138,7 @@ START_TEST(str_split) free(result); result = eina_str_split_full(":b:c", ":", -1, &elements); - fail_if(!result); + fail_if(result == NULL); fail_if(elements != 3); fail_if(strcmp(result[0], "") != 0); fail_if(strcmp(result[1], "b") != 0); @@ -147,7 +147,7 @@ START_TEST(str_split) free(result); result = eina_str_split_full(":", ":", -1, &elements); - fail_if(!result); + fail_if(result == NULL); fail_if(elements != 2); fail_if(strcmp(result[0], "") != 0); fail_if(strcmp(result[1], "") != 0); @@ -155,14 +155,14 @@ START_TEST(str_split) free(result); result = eina_str_split_full("a", "!!!!!!!!!", -1, &elements); - fail_if(!result); + fail_if(result == NULL); 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); + fail_if(result == NULL); fail_if(elements != 2); fail_if(strcmp(result[0], "a") != 0); fail_if(strcmp(result[1], "a") != 0); diff --git a/legacy/eina/src/tests/eina_test_strbuf.c b/legacy/eina/src/tests/eina_test_strbuf.c index dc66dc5fee..87dfc56bf8 100644 --- a/legacy/eina/src/tests/eina_test_strbuf.c +++ b/legacy/eina/src/tests/eina_test_strbuf.c @@ -350,7 +350,7 @@ START_TEST(strbuf_append_realloc) fail_if(eina_strbuf_length_get(buf) != (runs * target_pattern_size)); str = eina_strbuf_string_get(buf); - fail_if(!str); + fail_if(str == NULL); for (i = 0; i < runs; i++, str += 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)); str = eina_strbuf_string_get(buf); - fail_if(!str); + fail_if(str == NULL); for (i = 0; i < runs; i++, str += target_pattern_size) fail_if(memcmp(str, target_pattern, target_pattern_size)); diff --git a/legacy/eina/src/tests/eina_test_stringshare.c b/legacy/eina/src/tests/eina_test_stringshare.c index e578b16bf6..0d34aec31c 100644 --- a/legacy/eina/src/tests/eina_test_stringshare.c +++ b/legacy/eina/src/tests/eina_test_stringshare.c @@ -82,8 +82,8 @@ START_TEST(eina_stringshare_small) t0 = eina_stringshare_add(buf); t1 = eina_stringshare_add(buf); - fail_if(!t0); - fail_if(!t1); + fail_if(t0 == NULL); + fail_if(t1 == NULL); fail_if(t0 != t1); fail_if(strcmp(t0, buf) != 0); fail_if((int)strlen(buf) != eina_stringshare_strlen(t0)); @@ -108,8 +108,8 @@ START_TEST(eina_stringshare_test_share) t0 = eina_stringshare_add(TEST0); t1 = eina_stringshare_add(TEST0); - fail_if(!t0); - fail_if(!t1); + fail_if(t0 == NULL); + fail_if(t1 == NULL); fail_if(strcmp(t0, TEST0) != 0); fail_if(strcmp(t1, TEST0) != 0); fail_if(t0 != t1); @@ -162,7 +162,7 @@ START_TEST(eina_stringshare_collision) if (rand() > RAND_MAX / 2) { 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_array_push(ea, (void *)eina_stringshare_add(buffer)); r = eina_stringshare_add(buffer); - fail_if(!r); + fail_if(r == NULL); r = eina_stringshare_add(buffer); - fail_if(!r); + fail_if(r == NULL); } for (i = 0; i < 200; ++i) diff --git a/legacy/eina/src/tests/eina_test_ustr.c b/legacy/eina/src/tests/eina_test_ustr.c index 992fd257a8..c4ccd95d51 100644 --- a/legacy/eina/src/tests/eina_test_ustr.c +++ b/legacy/eina/src/tests/eina_test_ustr.c @@ -133,7 +133,7 @@ START_TEST(eina_unicode_strncpy_test) /* Hopefully won't segfault */ rv = eina_unicode_strncpy(NULL, STR1, 0); - fail_if(!!rv); + fail_if(rv != NULL); eina_shutdown(); } diff --git a/legacy/eina/src/tests/eina_test_ustringshare.c b/legacy/eina/src/tests/eina_test_ustringshare.c index 7cd37cebde..1d1f7b88eb 100644 --- a/legacy/eina/src/tests/eina_test_ustringshare.c +++ b/legacy/eina/src/tests/eina_test_ustringshare.c @@ -71,8 +71,8 @@ START_TEST(eina_ustringshare_test_share) t0 = eina_ustringshare_add(TEST0); t1 = eina_ustringshare_add(TEST0); - fail_if(!t0); - fail_if(!t1); + fail_if(t0 == NULL); + fail_if(t1 == NULL); fail_if(eina_unicode_strcmp(t0, TEST0) != 0); fail_if(eina_unicode_strcmp(t1, TEST0) != 0); fail_if(t0 != t1); diff --git a/legacy/embryo/src/bin/embryo_cc_amx.h b/legacy/embryo/src/bin/embryo_cc_amx.h index b7753919e7..0118e2d2af 100644 --- a/legacy/embryo/src/bin/embryo_cc_amx.h +++ b/legacy/embryo/src/bin/embryo_cc_amx.h @@ -218,7 +218,7 @@ amx_GetAddr((amx), (param), &amx_cstr_); \ amx_StrLen(amx_cstr_, &amx_length_); \ if (amx_length_ > 0 && \ - ((result) = (char*)alloca(amx_length_ + 1)) != NULL) \ + ((result) = (char *)alloca(amx_length_ + 1))) \ amx_GetString((result), amx_cstr_); \ else (result) = NULL; \ } diff --git a/legacy/embryo/src/bin/embryo_cc_sc1.c b/legacy/embryo/src/bin/embryo_cc_sc1.c index 7e0b6a2941..2beeb38c2e 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc1.c +++ b/legacy/embryo/src/bin/embryo_cc_sc1.c @@ -179,14 +179,14 @@ sc_opensrc(char *filename) void sc_closesrc(void *handle) { - assert(!!handle); + assert(handle != NULL); fclose((FILE *) handle); } void sc_resetsrc(void *handle, void *position) { - assert(!!handle); + assert(handle != NULL); 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) */ if (errnum == 0 && jmpcode == 0) { - assert(!!binf); + assert(binf != NULL); sc_resetasm(outf); /* flush and loop back, for reading */ assemble(binf, outf); /* assembler file is now input */ } /* if */ @@ -442,7 +442,7 @@ sc_compile(int argc, char *argv[]) free(litq); phopt_cleanup(); stgbuffer_cleanup(); - assert(jmpcode != 0 || !loctab.next); /* on normal flow, + assert(jmpcode != 0 || loctab.next == NULL); /* on normal flow, * local symbols * should already have been deleted */ delete_symbols(&loctab, 0, TRUE, TRUE); /* delete local variables @@ -1784,7 +1784,7 @@ operatorname(char *name) char *str; cell val; - assert(!!name); + assert(name != NULL); /* check the operator */ opertok = lex(&val, &str); @@ -1937,7 +1937,7 @@ operatoradjust(int opertok, symbol * sym, char *opername, int resulttag) static int check_operatortag(int opertok, int resulttag, char *opername) { - assert(!!opername && opername[0] != '\0'); + assert(opername != NULL && opername[0] != '\0'); switch (opertok) { case '!': @@ -2043,7 +2043,7 @@ funcdisplayname(char *dest, char *funcname) unary = parse_funcname(funcname, &tags[0], &tags[1], opname); tagsym[1] = find_constval_byval(&tagname_tab, tags[1]); - assert(!!tagsym[1]); + assert(tagsym[1] != NULL); if (unary) { 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 */ delete_symbols(&loctab, 0, TRUE, TRUE); /* clear local variables * queue */ - assert(!loctab.next); + assert(loctab.next == NULL); curfunc = NULL; if (sc_status == statSKIP) { @@ -2587,7 +2587,7 @@ declargs(symbol * sym) needtoken(')'); } /* if */ /* resolve any "sizeof" arguments (now that all arguments are known) */ - assert(!!sym->dim.arglist); + assert(sym->dim.arglist != NULL); arglist = sym->dim.arglist; for (idx = 0; idx < argcnt && arglist[idx].ident != 0; idx++) { @@ -2845,7 +2845,7 @@ reduce_referrers(symbol * root) { if (ref->parent) continue; /* hierarchical data type */ - assert(!!ref->refer); + assert(ref->refer != NULL); for (i = 0; i < ref->numrefers && ref->refer[i] != sym; i++) /* nothing */ ; @@ -2948,7 +2948,7 @@ calc_array_datasize(symbol * sym, cell * offset) { cell length; - assert(!!sym); + assert(sym != NULL); assert(sym->ident == iARRAY || sym->ident == iREFARRAY); length = sym->dim.array.length; if (sym->dim.array.level > 0) @@ -3606,7 +3606,7 @@ dofor(void) * "continue" must ignore these fields. */ ptr = readwhile(); - assert(!!ptr); + assert(ptr != NULL); ptr[wqBRK] = (int)declared; ptr[wqCONT] = (int)declared; jumplabel(skiplab); /* skip expression 3 1st time */ @@ -3951,7 +3951,7 @@ doreturn(void) needtoken(tTERM); rettype |= uRETVALUE; /* function returns a value */ /* check tagname with function tagname */ - assert(!!curfunc); + assert(curfunc != NULL); if (!matchtag(curfunc->tag, tag, TRUE)) error(213); /* tagname mismatch */ } @@ -3963,7 +3963,7 @@ doreturn(void) { char symname[2 * sNAMEMAX + 16]; /* allow space for user * defined operators */ - assert(!!curfunc); + assert(curfunc != NULL); funcdisplayname(symname, curfunc->name); error(209, symname); /* function should return a value */ } /* if */ diff --git a/legacy/embryo/src/bin/embryo_cc_sc2.c b/legacy/embryo/src/bin/embryo_cc_sc2.c index 3548e43125..67845f8e94 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc2.c +++ b/legacy/embryo/src/bin/embryo_cc_sc2.c @@ -741,7 +741,7 @@ preproc_expr(cell * val, int *tag) */ assert(strlen(pline) < sLINEMAX); term = strchr(pline, '\0'); - assert(!!term); + assert(term != NULL); chrcat(pline, PREPROC_TERM); /* the "DEL" code (see SC.H) */ result = constexpr(val, tag); /* get value (or 0 on error) */ *term = '\0'; /* erase the token (if still present) */ @@ -756,7 +756,7 @@ preproc_expr(cell * val, int *tag) static char * getstring(char *dest, int max, char *line) { - assert(!!dest && !!line); + assert(dest != NULL && line != NULL); *dest = '\0'; while (*line <= ' ' && *line != '\0') line++; /* skip whitespace */ @@ -1133,7 +1133,7 @@ command(void) if (skiplevel == 0) { check_empty(lptr); - assert(!!inpf); + assert(inpf != NULL); if (inpf != inpf_org) sc_closesrc(inpf); inpf = NULL; @@ -2074,7 +2074,7 @@ lexclr(int clreol) if (clreol) { lptr = strchr(pline, '\0'); - assert(!!lptr); + assert(lptr != NULL); } /* if */ } @@ -2370,12 +2370,12 @@ free_symbol(symbol * sym) /* free all sub-symbol allocated memory blocks, depending on the * kind of the symbol */ - assert(!!sym); + assert(sym != NULL); if (sym->ident == iFUNCTN) { /* run through the argument list; "default array" arguments * 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++) { if (arg->ident == iREFARRAY && arg->hasdefault) @@ -2384,12 +2384,12 @@ free_symbol(symbol * sym) && ((arg->hasdefault & uSIZEOF) != 0 || (arg->hasdefault & uTAGOF) != 0)) free(arg->defvalue.size.symname); - assert(!!arg->tags); + assert(arg->tags != NULL); free(arg->tags); } /* for */ free(sym->dim.arglist); } /* if */ - assert(!!sym->refer); + assert(sym->refer != NULL); free(sym->refer); free(sym); } @@ -2405,7 +2405,7 @@ delete_symbol(symbol * root, symbol * sym) while (root->next != sym) { root = root->next; - assert(!!root); + assert(root != NULL); } /* while */ /* unlink it, then free it */ @@ -2518,9 +2518,9 @@ refer_symbol(symbol * entry, symbol * bywhom) { int count; - assert(!!bywhom); /* it makes no sense to add a "void" referrer */ - assert(!!entry); - assert(!!entry->refer); + assert(bywhom != NULL); /* it makes no sense to add a "void" referrer */ + assert(entry != NULL); + assert(entry->refer != NULL); /* see if it is already there */ for (count = 0; count < entry->numrefers && entry->refer[count] != bywhom; @@ -2556,7 +2556,7 @@ refer_symbol(symbol * entry, symbol * bywhom) } /* if */ /* add the referrer */ - assert(!entry->refer[count]); + assert(entry->refer[count] == NULL); entry->refer[count] = bywhom; return TRUE; } @@ -2612,7 +2612,7 @@ findconst(char *name) sym = find_symbol(&glbtab, name, fcurrent); if (!sym || sym->ident != iCONSTEXPR) return NULL; - assert(!sym->parent); /* constants have no hierarchy */ + assert(sym->parent == NULL); /* constants have no hierarchy */ 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 */ assert(!(ident == iFUNCTN || ident == iCONSTEXPR) || vclass != sGLOBAL - || !findglb(name)); + || findglb(name) == NULL); /* labels may only be defined once */ - assert(ident != iLABEL || !findloc(name)); + assert(ident != iLABEL || findloc(name) == NULL); /* create an empty referrer list */ if (!(refer = (symbol **)malloc(sizeof(symbol *)))) @@ -2680,7 +2680,7 @@ addvariable(char *name, cell addr, int ident, int vclass, int tag, int level; /* global variables may only be defined once */ - assert(vclass != sGLOBAL || !(sym = findglb(name)) + assert(vclass != sGLOBAL || (sym = findglb(name)) == NULL || (sym->usage & uDEFINE) == 0); if (ident == iARRAY || ident == iREFARRAY) diff --git a/legacy/embryo/src/bin/embryo_cc_sc3.c b/legacy/embryo/src/bin/embryo_cc_sc3.c index 2760fc1cc8..ad30e0cdec 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc3.c +++ b/legacy/embryo/src/bin/embryo_cc_sc3.c @@ -179,7 +179,7 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, } else { - assert(!!oper); + assert(oper != NULL); assert(numparam == 1); /* try a select group of unary operators */ 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) { assert(!savepri); - assert(!!lval); + assert(lval != NULL); if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR) push1(); /* save current address 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 * call */ - assert(!!lval); /* this was checked earlier */ + assert(lval != NULL); /* this was checked earlier */ assert(lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR); /* checked earlier */ push2(); } /* if */ @@ -308,14 +308,14 @@ check_userop(void (*oper) (void), int tag1, int tag2, int numparam, if (sym->x.lib) sym->x.lib->value += 1; /* increment "usage count" of the library */ sideeffect = TRUE; /* assume functions carry out a side-effect */ - assert(!!resulttag); + assert(resulttag != NULL); *resulttag = sym->tag; /* save tag of the called function */ if (savepri || savealt) pop2(); /* restore the saved PRI/ALT that into ALT */ if (oper == user_inc || oper == user_dec) { - assert(!!lval); + assert(lval != NULL); if (lval->ident == iARRAYCELL || lval->ident == iARRAYCHAR) pop2(); /* restore address (in ALT) */ store(lval); /* store PRI in the symbol */ @@ -787,7 +787,7 @@ array_totalsize(symbol * sym) { cell length; - assert(!!sym); + assert(sym != NULL); assert(sym->ident == iARRAY || sym->ident == iREFARRAY); length = sym->dim.array.length; if (sym->dim.array.level > 0) @@ -805,13 +805,13 @@ array_totalsize(symbol * sym) static cell array_levelsize(symbol * sym, int level) { - assert(!!sym); + assert(sym != NULL); assert(sym->ident == iARRAY || sym->ident == iREFARRAY); assert(level <= sym->dim.array.level); while (level-- > 0) { sym = finddepend(sym); - assert(!!sym); + assert(sym != NULL); } /* if */ return sym->dim.array.length; } @@ -908,7 +908,7 @@ hier14(value * lval1) /* array assignment is permitted too (with restrictions) */ if (oper) return error(23); /* array assignment must be simple assigment */ - assert(!!lval1->sym); + assert(lval1->sym != NULL); if (array_totalsize(lval1->sym) == 0) return error(46, lval1->sym->name); /* unknown array size */ lvalue = TRUE; @@ -918,7 +918,7 @@ hier14(value * lval1) if (!lvalue) return error(22); /* must be lvalue */ /* may not change "constant" parameters */ - assert(!!lval1->sym); + assert(lval1->sym != NULL); if ((lval1->sym->usage & uCONST) != 0) return error(22); /* assignment to const argument */ 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 && lval3.sym == lval2.sym) { - assert(!!lval3.sym); + assert(lval3.sym != NULL); error(226, lval3.sym->name); /* self-assignment */ } /* if */ } /* if */ @@ -1015,7 +1015,7 @@ hier14(value * lval1) symbol *sym2 = lval2.sym; int i; - assert(!!sym1 && !!sym2); + assert(sym1 != NULL && sym2 != NULL); /* ^^^ sym2 must be valid, because only variables can be * multi-dimensional (there are no multi-dimensional arrays), * sym1 must be valid because it must be an lvalue @@ -1025,7 +1025,7 @@ hier14(value * lval1) { sym1 = finddepend(sym1); sym2 = finddepend(sym2); - assert(!!sym1 && !!sym2); + assert(sym1 != NULL && sym2 != NULL); /* ^^^ both arrays have the same dimensions (this was checked * earlier) so the dependend should always be found */ @@ -1210,7 +1210,7 @@ hier2(value * lval) case tINC: /* ++lval */ if (!hier2(lval)) return error(22); /* must be lvalue */ - assert(!!lval->sym); + assert(lval->sym != NULL); if ((lval->sym->usage & uCONST) != 0) return error(22); /* assignment to const argument */ if (!check_userop(user_inc, lval->tag, 0, 1, lval, &lval->tag)) @@ -1221,7 +1221,7 @@ hier2(value * lval) case tDEC: /* --lval */ if (!hier2(lval)) return error(22); /* must be lvalue */ - assert(!!lval->sym); + assert(lval->sym != NULL); if ((lval->sym->usage & uCONST) != 0) return error(22); /* assignment to const argument */ 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 && (sym->usage & uDEFINE) == 0) 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))) val = 1; clear_value(lval); @@ -1405,7 +1405,7 @@ hier2(value * lval) case tINC: /* lval++ */ if (!lvalue) return error(22); /* must be lvalue */ - assert(!!lval->sym); + assert(lval->sym != NULL); if ((lval->sym->usage & uCONST) != 0) return error(22); /* assignment to const argument */ /* on incrementing array cells, the address in PRI must be saved for @@ -1429,7 +1429,7 @@ hier2(value * lval) case tDEC: /* lval-- */ if (!lvalue) return error(22); /* must be lvalue */ - assert(!!lval->sym); + assert(lval->sym != NULL); if ((lval->sym->usage & uCONST) != 0) return error(22); /* assignment to const argument */ saveresult = (lval->ident == iARRAYCELL @@ -1604,7 +1604,7 @@ hier1(value * lval1) charalign(); /* align character index into array */ } /* if */ /* 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) { assert(close == ']'); /* checked earlier */ @@ -1617,7 +1617,7 @@ hier1(value * lval1) /* adjust the "value" structure and find the referenced array */ lval1->ident = iREFARRAY; lval1->sym = finddepend(sym); - assert(!!lval1->sym); + assert(lval1->sym != NULL); assert(lval1->sym->dim.array.level == sym->dim.array.level - 1); /* try to parse subsequent array indices */ @@ -1778,7 +1778,7 @@ primary(value * lval) { return error(17, st); /* undefined symbol */ } /* endif */ - assert(!!sym); + assert(sym != NULL); assert(sym->ident == iFUNCTN || sym->ident != iREFFUNC); lval->sym = sym; 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 * first use). */ - assert(!!string); + assert(string != NULL); assert(size > 0); /* check whether to dump the default array */ - assert(!!dataaddr); + assert(dataaddr != NULL); if (sc_status == statWRITE && *dataaddr < 0) { int i; @@ -1907,9 +1907,9 @@ callfunction(symbol * sym) cell lexval; char *lexstr; - assert(!!sym); + assert(sym != NULL); arg = sym->dim.arglist; - assert(!!arg); + assert(arg != NULL); stgmark(sSTARTREORDER); for (argpos = 0; argpos < sMAXARGS; argpos++) arglist[argpos] = ARG_UNHANDLED; @@ -1974,7 +1974,7 @@ callfunction(symbol * sym) /* always pass by reference */ if (lval.ident == iVARIABLE || lval.ident == iREFERENCE) { - assert(!!lval.sym); + assert(lval.sym != NULL); if ((lval.sym->usage & uCONST) != 0 && (arg[argidx].usage & uCONST) == 0) { @@ -2045,7 +2045,7 @@ callfunction(symbol * sym) { if (lvalue) { - assert(!!lval.sym); + assert(lval.sym != NULL); address(lval.sym); } else @@ -2121,7 +2121,7 @@ callfunction(symbol * sym) symbol *sym = lval.sym; short level = 0; - assert(!!sym); + assert(sym != NULL); if (sym->dim.array.level + 1 != arg[argidx].numdim) error(48); /* array dimensions must match */ /* the lengths for all dimensions must match, unless the dimension @@ -2137,12 +2137,12 @@ callfunction(symbol * sym) append_constval(&arrayszlst, arg[argidx].name, sym->dim.array.length, level); sym = finddepend(sym); - assert(!!sym); + assert(sym != NULL); level++; } /* if */ /* the last dimension is checked too, again, unless it is zero */ assert(level < sDIMEN_MAX); - assert(!!sym); + assert(sym != NULL); if (arg[argidx].dim[level] != 0 && sym->dim.array.length != arg[argidx].dim[level]) diff --git a/legacy/embryo/src/bin/embryo_cc_sc4.c b/legacy/embryo/src/bin/embryo_cc_sc4.c index 85c97955cc..57cbca1fe2 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc4.c +++ b/legacy/embryo/src/bin/embryo_cc_sc4.c @@ -336,7 +336,7 @@ rvalue(value * lval) else if (lval->ident == iREFERENCE) { /* indirect fetch, but address not yet in PRI */ - assert(!!sym); + assert(sym != NULL); assert(sym->vclass == sLOCAL); /* global references don't exist in Small */ if (sym->vclass == sLOCAL) stgwrite("\tlref.s.pri "); @@ -349,7 +349,7 @@ rvalue(value * lval) else { /* direct or stack relative fetch */ - assert(!!sym); + assert(sym != NULL); if (sym->vclass == sLOCAL) stgwrite("\tload.s.pri "); else @@ -367,7 +367,7 @@ rvalue(value * lval) void address(symbol * sym) { - assert(!!sym); + assert(sym != NULL); /* the symbol can be a local array, a global array, or an array * that is passed by reference. */ @@ -416,7 +416,7 @@ store(value * lval) } else if (lval->ident == iREFERENCE) { - assert(!!sym); + assert(sym != NULL); if (sym->vclass == sLOCAL) stgwrite("\tsref.s.pri "); else @@ -426,7 +426,7 @@ store(value * lval) } else { - assert(!!sym); + assert(sym != NULL); markusage(sym, uWRITTEN); if (sym->vclass == sLOCAL) stgwrite("\tstor.s.pri "); @@ -455,7 +455,7 @@ memcopy(cell size) void copyarray(symbol * sym, cell size) { - assert(!!sym); + assert(sym != NULL); /* the symbol can be a local array, a global array, or an array * that is passed by reference. */ @@ -485,7 +485,7 @@ fillarray(symbol * sym, cell size, cell val) { const1(val); /* load val in PRI */ - assert(!!sym); + assert(sym != NULL); /* the symbol can be a local array, a global array, or an array * that is passed by reference. */ @@ -658,7 +658,7 @@ ffcase(cell val, char *labelname, int newtable) void ffcall(symbol * sym, int numargs) { - assert(!!sym); + assert(sym != NULL); assert(sym->ident == iFUNCTN); if ((sym->usage & uNATIVE) != 0) { @@ -1177,7 +1177,7 @@ inc(value * lval) } else if (lval->ident == iREFERENCE) { - assert(!!sym); + assert(sym != NULL); stgwrite("\tpush.pri\n"); /* load dereferenced value */ assert(sym->vclass == sLOCAL); /* global references don't exist in Small */ @@ -1200,7 +1200,7 @@ inc(value * lval) else { /* local or global variable */ - assert(!!sym); + assert(sym != NULL); if (sym->vclass == sLOCAL) stgwrite("\tinc.s "); else @@ -1243,7 +1243,7 @@ dec(value * lval) } else if (lval->ident == iREFERENCE) { - assert(!!sym); + assert(sym != NULL); stgwrite("\tpush.pri\n"); /* load dereferenced value */ assert(sym->vclass == sLOCAL); /* global references don't exist in Small */ @@ -1266,7 +1266,7 @@ dec(value * lval) else { /* local or global variable */ - assert(!!sym); + assert(sym != NULL); if (sym->vclass == sLOCAL) stgwrite("\tdec.s "); else diff --git a/legacy/embryo/src/bin/embryo_cc_sc6.c b/legacy/embryo/src/bin/embryo_cc_sc6.c index 2fe23d9f81..61e182874f 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc6.c +++ b/legacy/embryo/src/bin/embryo_cc_sc6.c @@ -156,7 +156,7 @@ static void write_encoded(FILE * fbin, ucell * c, int num) { assert(sizeof(cell) <= 4); /* code must be adjusted for larger cells */ - assert(!!fbin); + assert(fbin != NULL); while (num-- > 0) { 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). */ sym = findglb(name); - assert(!!sym); + assert(sym != NULL); assert(sym->ident == iFUNCTN || sym->ident == iREFFUNC); assert(sym->vclass == sGLOBAL); @@ -322,7 +322,7 @@ do_jump(FILE * fbin, char *params, cell opcode) if (fbin) { - assert(!!lbltab); + assert(lbltab != NULL); p = lbltab[i]; write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, &p, 1); @@ -414,7 +414,7 @@ do_switch(FILE * fbin, char *params, cell opcode) if (fbin) { - assert(!!lbltab); + assert(lbltab != NULL); p = lbltab[i]; write_encoded(fbin, (ucell *) & opcode, 1); write_encoded(fbin, &p, 1); @@ -438,7 +438,7 @@ do_case(FILE * fbin, char *params, cell opcode __UNUSED__) if (fbin) { - assert(!!lbltab); + assert(lbltab != NULL); p = lbltab[i]; write_encoded(fbin, &v, 1); write_encoded(fbin, &p, 1); @@ -625,7 +625,7 @@ findopcode(char *instr, int maxlen) while (low < high) { mid = (low + high) / 2; - assert(!!opcodelist[mid].name); + assert(opcodelist[mid].name != NULL); cmp = strcasecmp(str, opcodelist[mid].name); if (cmp > 0) 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 * for a non-existant opcode) */ - assert(!!opcodelist[1].name); + assert(opcodelist[1].name != NULL); 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); } /* for */ #endif @@ -867,7 +867,7 @@ assemble(FILE * fout, FILE * fin) char alias[sNAMEMAX + 1]; sym = nativelist[i]; - assert(!!sym); + assert(sym != NULL); if (!lookup_alias(alias, sym->name)) { assert(strlen(sym->name) <= sNAMEMAX); @@ -1044,7 +1044,7 @@ assemble(FILE * fout, FILE * fin) /* nothing */ ; assert(params > instr); i = findopcode(instr, (int)(params - instr)); - assert(!!opcodelist[i].name); + assert(opcodelist[i].name != NULL); if (opcodelist[i].segment == pass) opcodelist[i].func(fout, skipwhitespace(params), opcodelist[i].opcode); diff --git a/legacy/embryo/src/bin/embryo_cc_sc7.c b/legacy/embryo/src/bin/embryo_cc_sc7.c index bdc2b8e19e..c8a977e696 100644 --- a/legacy/embryo/src/bin/embryo_cc_sc7.c +++ b/legacy/embryo/src/bin/embryo_cc_sc7.c @@ -533,7 +533,7 @@ replacesequence(char *pattern, char symbols[_maxoptvars][_aliasmax + 1], * 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) */ - assert(!!repl_length); + assert(repl_length != NULL); *repl_length = 0; lptr = pattern; while (*lptr) @@ -627,7 +627,7 @@ stgopt(char *start, char *end) char symbols[_maxoptvars][_aliasmax + 1]; int seq, match_length, repl_length; - assert(!!sequences); + assert(sequences != NULL); while (start < end) { if ((sc_debug & sNOOPTIMIZE) != 0 || sc_status != statWRITE) @@ -677,7 +677,7 @@ stgopt(char *start, char *end) seq++; } /* if */ } /* while */ - assert(!sequences[seq].find); + assert(sequences[seq].find == NULL); filewrite(start); } /* if */ assert(start < end); diff --git a/legacy/embryo/src/bin/embryo_cc_sclist.c b/legacy/embryo/src/bin/embryo_cc_sclist.c index dcba3572d3..aaf5a1282b 100644 --- a/legacy/embryo/src/bin/embryo_cc_sclist.c +++ b/legacy/embryo/src/bin/embryo_cc_sclist.c @@ -39,9 +39,9 @@ insert_stringpair(stringpair * root, char *first, char *second, int matchlength) { stringpair *cur, *pred; - assert(!!root); - assert(!!first); - assert(!!second); + assert(root != NULL); + assert(first != NULL); + assert(second != NULL); /* create a new node, and check whether all is okay */ if (!(cur = (stringpair *)malloc(sizeof(stringpair)))) return NULL; @@ -71,13 +71,13 @@ delete_stringpairtable(stringpair * root) { stringpair *cur, *next; - assert(!!root); + assert(root != NULL); cur = root->next; while (cur) { next = cur->next; - assert(!!cur->first); - assert(!!cur->second); + assert(cur->first != NULL); + assert(cur->second != NULL); free(cur->first); free(cur->second); free(cur); @@ -92,7 +92,7 @@ find_stringpair(stringpair * cur, char *first, int matchlength) int result = 0; assert(matchlength > 0); /* the function cannot handle zero-length comparison */ - assert(!!first); + assert(first != NULL); while (cur && result <= 0) { result = (int)*cur->first - (int)*first; @@ -112,15 +112,15 @@ delete_stringpair(stringpair * root, stringpair * item) { stringpair *cur; - assert(!!root); + assert(root != NULL); cur = root; while (cur->next) { if (cur->next == item) { cur->next = item->next; /* unlink from list */ - assert(!!item->first); - assert(!!item->second); + assert(item->first != NULL); + assert(item->second != NULL); free(item->first); free(item->second); free(item); @@ -139,9 +139,9 @@ insert_alias(char *name, char *alias) { stringpair *cur; - assert(!!name); + assert(name != NULL); assert(strlen(name) <= sNAMEMAX); - assert(!!alias); + assert(alias != NULL); assert(strlen(alias) <= sEXPMAX); if (!(cur = insert_stringpair(&alias_tab, name, alias, strlen(name)))) error(103); /* insufficient memory (fatal error) */ @@ -175,7 +175,7 @@ insert_path(char *path) { stringlist *cur; - assert(!!path); + assert(path != NULL); if (!(cur = (stringlist *)malloc(sizeof(stringlist)))) error(103); /* insufficient memory (fatal error) */ if (!(cur->line = strdup(path))) @@ -194,7 +194,7 @@ get_path(int index) cur = cur->next; if (cur) { - assert(!!cur->line); + assert(cur->line != NULL); return cur->line; } /* if */ return NULL; @@ -208,7 +208,7 @@ delete_pathtable(void) while (cur) { next = cur->next; - assert(!!cur->line); + assert(cur->line != NULL); free(cur->line); free(cur); cur = next; @@ -240,8 +240,8 @@ insert_subst(char *pattern, char *substitution, int prefixlen) { stringpair *cur; - assert(!!pattern); - assert(!!substitution); + assert(pattern != NULL); + assert(substitution != NULL); if (!(cur = insert_stringpair(&substpair, pattern, substitution, prefixlen))) error(103); /* insufficient memory (fatal error) */ adjustindex(*pattern); @@ -253,7 +253,7 @@ find_subst(char *name, int length) { stringpair *item; - assert(!!name); + assert(name != NULL); assert(length > 0); assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z') || *name == '_'); @@ -268,7 +268,7 @@ delete_subst(char *name, int length) { stringpair *item; - assert(!!name); + assert(name != NULL); assert(length > 0); assert((*name >= 'A' && *name <= 'Z') || (*name >= 'a' && *name <= 'z') || *name == '_'); diff --git a/legacy/evas/src/lib/cache/evas_cache_engine_image.c b/legacy/evas/src/lib/cache/evas_cache_engine_image.c index 95f1894be8..63b7512919 100644 --- a/legacy/evas/src/lib/cache/evas_cache_engine_image.c +++ b/legacy/evas/src/lib/cache/evas_cache_engine_image.c @@ -144,7 +144,7 @@ _evas_cache_engine_image_dealloc(Evas_Cache_Engine_Image *cache, Engine_Image_En EAPI int evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache) { - assert(!!cache); + assert(cache != NULL); return cache->usage; } @@ -152,7 +152,7 @@ evas_cache_engine_image_usage_get(Evas_Cache_Engine_Image *cache) EAPI int evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache) { - assert(!!cache); + assert(cache != NULL); return cache->limit; } @@ -160,7 +160,7 @@ evas_cache_engine_image_get(Evas_Cache_Engine_Image *cache) EAPI void evas_cache_engine_image_set(Evas_Cache_Engine_Image *cache, int limit) { - assert(!!cache); + assert(cache != NULL); cache->limit = limit; } @@ -247,7 +247,7 @@ _evas_cache_engine_image_free_cb(__UNUSED__ const Eina_Hash *hash, __UNUSED__ co EAPI void evas_cache_engine_image_flush(Evas_Cache_Engine_Image *cache) { - assert(!!cache); + assert(cache != NULL); 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; Eina_List *delete_list = NULL; - assert(!!cache); + assert(cache != 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; const char *ekey; - assert(!!cache); + assert(cache != NULL); *error = EVAS_LOAD_ERROR_NONE; diff --git a/legacy/evas/src/lib/cache/evas_cache_image.c b/legacy/evas/src/lib/cache/evas_cache_image.c index 117815d19e..bba2691b6c 100644 --- a/legacy/evas/src/lib/cache/evas_cache_image.c +++ b/legacy/evas/src/lib/cache/evas_cache_image.c @@ -525,7 +525,7 @@ _evas_cache_image_entry_preload_remove(Image_Entry *ie, const void *target) EAPI int evas_cache_image_usage_get(Evas_Cache_Image *cache) { - assert(!!cache); + assert(cache != NULL); return cache->usage; } @@ -533,7 +533,7 @@ evas_cache_image_usage_get(Evas_Cache_Image *cache) EAPI int evas_cache_image_get(Evas_Cache_Image *cache) { - assert(!!cache); + assert(cache != NULL); return cache->limit; } @@ -541,7 +541,7 @@ evas_cache_image_get(Evas_Cache_Image *cache) EAPI void evas_cache_image_set(Evas_Cache_Image *cache, int limit) { - assert(!!cache); + assert(cache != NULL); #ifdef EVAS_FRAME_QUEUING LKL(cache->lock); #endif @@ -698,7 +698,7 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, const char * size_t key_length; struct stat st; - assert(!!cache); + assert(cache != NULL); if ((!file) || ((!file) && (!key))) { diff --git a/legacy/evas/src/lib/engines/common/evas_font_load.c b/legacy/evas/src/lib/engines/common/evas_font_load.c index 8ea3188f38..4acbc9f52e 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_load.c +++ b/legacy/evas/src/lib/engines/common/evas_font_load.c @@ -131,7 +131,7 @@ evas_common_font_source_memory_load(const char *name, const void *data, int data int error; RGBA_Font_Source *fs; - assert(!!name); + assert(name != NULL); fs = calloc(1, sizeof(RGBA_Font_Source) + data_size); if (!fs) return NULL; @@ -164,7 +164,7 @@ evas_common_font_source_load(const char *name) { RGBA_Font_Source *fs; - assert(!!name); + assert(name != NULL); fs = calloc(1, sizeof(RGBA_Font_Source)); if (!fs) return NULL; diff --git a/legacy/evas/src/lib/include/evas_inline.x b/legacy/evas/src/lib/include/evas_inline.x index c08ee9af95..19aa7f6540 100644 --- a/legacy/evas/src/lib/include/evas_inline.x +++ b/legacy/evas/src/lib/include/evas_inline.x @@ -176,7 +176,7 @@ evas_object_clip_recalc(Evas_Object *obj) int nx, ny, nw, nh, nvis, nr, ng, nb, na; 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; if (obj->layer->evas->events_frozen > 0) return; evas_object_coords_recalc(obj);