修改this为pthis,防止在cpp上编译不通过(和关键字冲突)

This commit is contained in:
建峰 2024-09-01 13:15:47 +08:00
parent 52155db7e8
commit 2aca923437

8
main.c
View File

@ -46,14 +46,14 @@ struct _shape
void shape_area(void *self) void shape_area(void *self)
{ {
struct _shape *this = (struct _shape *)self; struct _shape *pthis = (struct _shape *)self;
this->vtb->area(self); pthis->vtb->area(self);
} }
void shape_draw(void *self) void shape_draw(void *self)
{ {
struct _shape *this = (struct _shape *)self; struct _shape *pthis = (struct _shape *)self;
this->vtb->draw(self); pthis->vtb->draw(self);
} }
PRIVATE void _shape_area(void *self) PRIVATE void _shape_area(void *self)