mirror of
https://gitee.com/apaki/cmake_demo.git
synced 2025-05-17 20:01:36 +08:00
感觉得学习一下优秀的代码框架了。我尝试了很多,但现在想不到好的办法了。
This commit is contained in:
parent
42d305eabe
commit
b88995b0bd
@ -11,11 +11,8 @@ double rect_area(void *self, void *parent)
|
|||||||
|
|
||||||
void rect_draw(void *self, void *parent)
|
void rect_draw(void *self, void *parent)
|
||||||
{
|
{
|
||||||
// struct _rect *pthis = (struct _rect *)parent;
|
struct _rect *pthis = (struct _rect *)parent;
|
||||||
// pthis->shape->vtb.draw(self, NULL);
|
pthis->shape->vtb.draw(self, NULL);
|
||||||
|
|
||||||
struct _rect *pthis = container_of(parent, struct _rect, self);
|
|
||||||
pthis->shape->vtb.draw(pthis, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double _rect_area(void *self, void *parent)
|
double _rect_area(void *self, void *parent)
|
||||||
|
Loading…
Reference in New Issue
Block a user