clsptr -> cls.
This commit is contained in:
parent
794d352d33
commit
1b72ec95bf
4 changed files with 10 additions and 10 deletions
|
@ -72,7 +72,7 @@ equal(void *ptr1, void *ptr2)
|
|||
CFWArray *array1, *array2;
|
||||
size_t i;
|
||||
|
||||
if (obj2->clsptr != cfw_array)
|
||||
if (obj2->cls != cfw_array)
|
||||
return false;
|
||||
|
||||
array1 = ptr1;
|
||||
|
|
|
@ -36,7 +36,7 @@ cfw_new(CFWClass *class, ...)
|
|||
if ((obj = malloc(class->size)) == NULL)
|
||||
return NULL;
|
||||
|
||||
obj->clsptr = class;
|
||||
obj->cls = class;
|
||||
obj->ref_cnt = 1;
|
||||
|
||||
if (class->ctor != NULL) {
|
||||
|
@ -78,8 +78,8 @@ cfw_free(void *ptr)
|
|||
{
|
||||
CFWObject *obj = ptr;
|
||||
|
||||
if (obj->clsptr->dtor != NULL)
|
||||
obj->clsptr->dtor(obj);
|
||||
if (obj->cls->dtor != NULL)
|
||||
obj->cls->dtor(obj);
|
||||
|
||||
free(obj);
|
||||
}
|
||||
|
@ -89,8 +89,8 @@ cfw_equal(void *ptr1, void *ptr2)
|
|||
{
|
||||
CFWObject *obj1 = ptr1, *obj2 = ptr2;
|
||||
|
||||
if (obj1->clsptr->equal != NULL) {
|
||||
return obj1->clsptr->equal(obj1, obj2);
|
||||
if (obj1->cls->equal != NULL) {
|
||||
return obj1->cls->equal(obj1, obj2);
|
||||
} else
|
||||
return (obj1 == obj2);
|
||||
}
|
||||
|
@ -100,8 +100,8 @@ cfw_copy(void *ptr)
|
|||
{
|
||||
CFWObject *obj = ptr;
|
||||
|
||||
if (obj->clsptr->copy != NULL)
|
||||
return obj->clsptr->copy(obj);
|
||||
if (obj->cls->copy != NULL)
|
||||
return obj->cls->copy(obj);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "cfwclass.h"
|
||||
|
||||
typedef struct CFWObject {
|
||||
CFWClass *clsptr;
|
||||
CFWClass *cls;
|
||||
int ref_cnt;
|
||||
} CFWObject;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ equal(void *ptr1, void *ptr2)
|
|||
CFWObject *obj2 = ptr2;
|
||||
CFWString *str1, *str2;
|
||||
|
||||
if (obj2->clsptr != cfw_string)
|
||||
if (obj2->cls != cfw_string)
|
||||
return false;
|
||||
|
||||
str1 = ptr1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue