e-object-check - this has been turned off since 2007 - back on

this is crazy. all the E_OBJECT_CHECK macros have been off since 2007.
this is just nuts. either remove them, or have them on by default, but
not off. so this turns them back on and fixes code to actually compile
again with them on, as this broke over the years. a lot of code
expects/assumes thatthese willcheck types and null ptrs, but they
don't because they are off by default.
devs/discomfitor/eo
Carsten Haitzler 9 years ago
parent 9395553039
commit 0313a54da4
  1. 2
      src/bin/e.h
  2. 2
      src/bin/e_desktop_editor.c
  3. 20
      src/bin/e_gadcon.c
  4. 14
      src/bin/e_object.h
  5. 4
      src/bin/e_shelf.c
  6. 16
      src/modules/winlist/e_winlist.c

@ -17,8 +17,8 @@
# define USE_IPC
# if 0
# define OBJECT_PARANOIA_CHECK
# define OBJECT_CHECK
# endif
# define OBJECT_CHECK
# ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64

@ -279,7 +279,7 @@ _e_desktop_edit_free(E_Desktop_Edit *editor)
{
if (!editor) return;
E_OBJECT_CHECK(editor);
E_OBJECT_TYPE_CHECK(editor, E_EAP_EDIT_TYPE);
E_OBJECT_TYPE_CHECK(editor, E_DESKTOP_EDIT_TYPE);
E_FREE(editor->tmp_image_path);
E_FREE(editor);

@ -560,8 +560,8 @@ e_gadcon_populate(E_Gadcon *gc)
Eina_List *l;
E_Config_Gadcon_Client *cf_gcc;
E_OBJECT_CHECK(gc);
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
E_OBJECT_CHECK_RETURN(gc, EINA_FALSE);
E_OBJECT_TYPE_CHECK_RETURN(gc, E_GADCON_TYPE, EINA_FALSE);
e_gadcon_layout_freeze(gc->o_container);
EINA_LIST_FOREACH(gc->cf->clients, l, cf_gcc)
{
@ -652,7 +652,9 @@ e_gadcon_orient(E_Gadcon *gc, E_Gadcon_Orient orient)
E_OBJECT_CHECK(gc);
E_OBJECT_IF_NOT_TYPE(gc, E_GADCON_DUMMY_TYPE)
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
{
E_OBJECT_TYPE_CHECK(gc, E_GADCON_TYPE);
}
if (gc->orient == orient) return;
gc->orient = orient;
if (gc->dummy) return;
@ -1497,8 +1499,8 @@ e_gadcon_client_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *
{
int gx = 0, gy = 0;
E_OBJECT_CHECK(gcc);
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
E_OBJECT_CHECK_RETURN(gcc, 0);
E_OBJECT_TYPE_CHECK_RETURN(gcc, E_GADCON_CLIENT_TYPE, 0);
if (!e_gadcon_canvas_zone_geometry_get(gcc->gadcon, &gx, &gy, NULL, NULL))
return 0;
if (gcc->o_base) evas_object_geometry_get(gcc->o_base, x, y, w, h);
@ -1510,8 +1512,8 @@ e_gadcon_client_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *
EAPI int
e_gadcon_client_viewport_geometry_get(E_Gadcon_Client *gcc, int *x, int *y, int *w, int *h)
{
E_OBJECT_CHECK(gcc);
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
E_OBJECT_CHECK_RETURN(gcc, 0);
E_OBJECT_TYPE_CHECK_RETURN(gcc, E_GADCON_CLIENT_TYPE, 0);
if (gcc->o_box) evas_object_geometry_get(gcc->o_base, x, y, w, h);
else if (gcc->o_base)
@ -1712,8 +1714,8 @@ e_gadcon_client_util_menu_items_append(E_Gadcon_Client *gcc, E_Menu *menu_gadget
E_Menu_Item *mi;
char buf[256];
E_OBJECT_CHECK(gcc);
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
E_OBJECT_CHECK_RETURN(gcc, NULL);
E_OBJECT_TYPE_CHECK_RETURN(gcc, E_GADCON_CLIENT_TYPE, NULL);
if (e_config->menu_gadcon_client_toplevel)
menu_main = menu_gadget;

@ -28,20 +28,20 @@
# define E_OBJECT_CHECK_RETURN(x, ret) do {if (e_object_error(E_OBJECT(x))) return ret;} while (0)
# define E_OBJECT_TYPE_CHECK(x, tp) do {if ((E_OBJECT(x)->type) != (tp)) { fprintf(stderr, "Object type check failed in %s\n", __FUNCTION__); return;} } while (0)
# define E_OBJECT_TYPE_CHECK_RETURN(x, tp, ret) do {if ((E_OBJECT(x)->type) != tp) { fprintf(stderr, "Object type check failed in %s\n", __FUNCTION__); return ret;} } while (0)
# define E_OBJECT_IF_NOT_TYPE(x, tp) if (E_OBJECT(x)->type != (tp))
# define E_OBJECT_IF_NOT_TYPE(x, tp) if (E_OBJECT(x)->type != (tp))
#else
# ifdef OBJECT_CHECK
# define E_OBJECT_CHECK(x) do {if ((!E_OBJECT(x)) || (E_OBJECT(x)->magic != E_OBJECT_MAGIC)) return;} while (0)
# define E_OBJECT_CHECK_RETURN(x, ret) do {if ((!E_OBJECT(x)) || (E_OBJECT(x)->magic != E_OBJECT_MAGIC)) return ret;} while (0)
# define E_OBJECT_TYPE_CHECK(x, tp) do {if ((E_OBJECT(x)->type) != (tp)) { fprintf(stderr, "Object type check failed in %s\n", __FUNCTION__); return;} } while (0)
# define E_OBJECT_TYPE_CHECK_RETURN(x, tp, ret) do {if ((E_OBJECT(x)->type) != (tp)) { fprintf(stderr, "Object type check failed in %s\n", __FUNCTION__); return ret;} } while (0)
# define E_OBJECT_IF_NOT_TYPE(x, type) if (E_OBJECT(x)->type != (type))
# define E_OBJECT_CHECK(x) do {if ((!E_OBJECT(x)) || (E_OBJECT(x)->magic != (int)E_OBJECT_MAGIC)) return;} while (0)
# define E_OBJECT_CHECK_RETURN(x, ret) do {if ((!E_OBJECT(x)) || (E_OBJECT(x)->magic != (int)E_OBJECT_MAGIC)) return ret;} while (0)
# define E_OBJECT_TYPE_CHECK(x, tp) do {if ((E_OBJECT(x)->type) != (int)(tp)) { fprintf(stderr, "Object type check failed in %s\n", __FUNCTION__); return;} } while (0)
# define E_OBJECT_TYPE_CHECK_RETURN(x, tp, ret) do {if ((E_OBJECT(x)->type) != (int)(tp)) { fprintf(stderr, "Object type check failed in %s\n", __FUNCTION__); return ret;} } while (0)
# define E_OBJECT_IF_NOT_TYPE(x, tp) if (E_OBJECT(x)->type != (int)(tp))
# else
# define E_OBJECT_CHECK(x)
# define E_OBJECT_CHECK_RETURN(x, ret)
# define E_OBJECT_TYPE_CHECK(x, type)
# define E_OBJECT_TYPE_CHECK_RETURN(x, type, ret)
# define E_OBJECT_IF_NOT_TYPE(x, type)
# define E_OBJECT_IF_NOT_TYPE(x, type)
# endif
#endif

@ -549,7 +549,9 @@ e_shelf_orient(E_Shelf *es, E_Gadcon_Orient orient)
E_OBJECT_CHECK(es);
E_OBJECT_IF_NOT_TYPE(es, E_SHELF_DUMMY_TYPE)
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
{
E_OBJECT_TYPE_CHECK(es, E_SHELF_TYPE);
}
if (!es->dummy)
{

@ -399,8 +399,8 @@ e_winlist_left(E_Zone *zone)
_ec_next = NULL;
E_OBJECT_CHECK_RETURN(zone, 0);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
ec_orig = e_client_focused_get();
if (!ec_orig) return;
@ -481,8 +481,8 @@ e_winlist_down(E_Zone *zone)
_ec_next = NULL;
E_OBJECT_CHECK_RETURN(zone, 0);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
ec_orig = e_client_focused_get();
if (!ec_orig) return;
@ -563,8 +563,8 @@ e_winlist_up(E_Zone *zone)
_ec_next = NULL;
E_OBJECT_CHECK_RETURN(zone, 0);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
ec_orig = e_client_focused_get();
if (!ec_orig) return;
@ -645,8 +645,8 @@ e_winlist_right(E_Zone *zone)
_ec_next = NULL;
E_OBJECT_CHECK_RETURN(zone, 0);
E_OBJECT_TYPE_CHECK_RETURN(zone, E_ZONE_TYPE, 0);
E_OBJECT_CHECK(zone);
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
ec_orig = e_client_focused_get();
if (!ec_orig) return;

Loading…
Cancel
Save