eo2: cleaned up EO2_CLASS_DESCRIPTION_OPS and OP_DESC_SIZE (renamed).
authorTom Hacohen <tom@stosb.com>
Mon, 29 Jul 2013 16:50:56 +0000 (17:50 +0100)
committerTom Hacohen <tom@stosb.com>
Thu, 10 Apr 2014 03:20:16 +0000 (04:20 +0100)
src/lib/eo/Eo.h
src/lib/eo/eo2_base_class.c

index e9ba310..f917c8e 100644 (file)
@@ -607,10 +607,10 @@ EAPI Eina_Bool eo_shutdown(void);
 #define EO2_VERSION 2
 
 // computes size of Eo2_Op_Description[]
-#define OP_DESC_SIZE(desc) (sizeof(desc)/sizeof(Eo2_Op_Description) -1 )
+#define EO2_OP_DESC_SIZE(desc) (sizeof(desc)/sizeof(*desc) - 1)
 
 // An helper macro to help populating #Eo_Class_Description.
-#define EO2_CLASS_DESCRIPTION_OPS(op_descs, count) { NULL, NULL, op_descs, count }
+#define EO2_CLASS_DESCRIPTION_OPS(op_descs) { NULL, NULL, op_descs, EO2_OP_DESC_SIZE(op_descs) }
 
 // sort Eo2_Op_Description[] by eapi_func then attribute OP ids
 EAPI void
index beacc5c..2189752 100644 (file)
@@ -814,7 +814,7 @@ static const Eo_Class_Description class_desc = {
      EO2_VERSION,
      "Eo Base",
      EO_CLASS_TYPE_REGULAR_NO_INSTANT,
-     EO2_CLASS_DESCRIPTION_OPS(op_descs, OP_DESC_SIZE(op_descs)),
+     EO2_CLASS_DESCRIPTION_OPS(op_descs),
      event_desc,
      sizeof(Private_Data),
      _class_constructor,