Commit 9f6d3c30 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Cleanup: Removed no longer needed REFOBJECT_DEFINE_TYPE_FREE(NULL)s

parent 2dd90458
...@@ -19,9 +19,7 @@ ...@@ -19,9 +19,7 @@
#define TO_BASE(x) REFOBJECT_TO_TYPE((x), refobject_base_t *) #define TO_BASE(x) REFOBJECT_TO_TYPE((x), refobject_base_t *)
REFOBJECT_DEFINE_TYPE(refobject_base_t, REFOBJECT_DEFINE_TYPE(refobject_base_t);
REFOBJECT_DEFINE_TYPE_FREE(NULL)
);
static inline int check_type(const refobject_type_t *type) static inline int check_type(const refobject_type_t *type)
{ {
......
...@@ -62,9 +62,7 @@ static void test_valid(void) ...@@ -62,9 +62,7 @@ static void test_valid(void)
refobject_base_t __base; refobject_base_t __base;
} ctest_test_type_t; } ctest_test_type_t;
REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_t, REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_t);
REFOBJECT_DEFINE_TYPE_FREE(NULL)
);
ctest_test("NULL is not valid", !REFOBJECT_IS_VALID(REFOBJECT_NULL, refobject_base_t)); ctest_test("NULL is not valid", !REFOBJECT_IS_VALID(REFOBJECT_NULL, refobject_base_t));
...@@ -85,31 +83,23 @@ static void test_sizes(void) ...@@ -85,31 +83,23 @@ static void test_sizes(void)
refobject_base_t __base; refobject_base_t __base;
char padding[1024]; char padding[1024];
} ctest_test_type_a_t; } ctest_test_type_a_t;
REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_a_t, REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_a_t);
REFOBJECT_DEFINE_TYPE_FREE(NULL)
);
typedef struct { typedef struct {
refobject_base_t __base; refobject_base_t __base;
char padding[131072]; char padding[131072];
} ctest_test_type_b_t; } ctest_test_type_b_t;
REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_b_t, REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_b_t);
REFOBJECT_DEFINE_TYPE_FREE(NULL)
);
typedef struct { typedef struct {
char padding[sizeof(refobject_base_t) - 1]; char padding[sizeof(refobject_base_t) - 1];
} ctest_test_type_c_t; } ctest_test_type_c_t;
REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_c_t, REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_c_t);
REFOBJECT_DEFINE_TYPE_FREE(NULL)
);
typedef struct { typedef struct {
char padding[0]; char padding[0];
} ctest_test_type_d_t; } ctest_test_type_d_t;
REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_d_t, REFOBJECT_DEFINE_PRIVATE_TYPE(ctest_test_type_d_t);
REFOBJECT_DEFINE_TYPE_FREE(NULL)
);
a = REFOBJECT_FROM_TYPE(refobject_new__new(ctest_test_type_a_t, NULL, NULL, REFOBJECT_NULL)); a = REFOBJECT_FROM_TYPE(refobject_new__new(ctest_test_type_a_t, NULL, NULL, REFOBJECT_NULL));
ctest_test("refobject created with size=sizeof(refobject_base_t) + 1024", !REFOBJECT_IS_NULL(a)); ctest_test("refobject created with size=sizeof(refobject_base_t) + 1024", !REFOBJECT_IS_NULL(a));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment