From 498f21cb4342aeabc2f53a27bf7a26d1bcf8c79d Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Fri, 20 May 2022 12:11:12 +0200 Subject: Yet a fix in shape.c --- examples/shape.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/shape.c b/examples/shape.c index 5617d4c9..f67198c9 100644 --- a/examples/shape.c +++ b/examples/shape.c @@ -5,8 +5,8 @@ #include #define c_self(s, T) \ - T* self = c_container_of(s, T, base); \ - assert(s->api == &T##_api) + T* self = (T *)s; \ + assert(self->base.api == &T##_api) #define c_vtable(Api, T) \ c_static_assert(offsetof(T, base) == 0); \ @@ -94,7 +94,7 @@ static void Polygon_drop(Shape* shape) c_self(shape, Polygon); puts("drop poly"); PVec_drop(&self->points); - Shape_drop(self); + Shape_drop(shape); } static void Polygon_draw(const Shape* shape) -- cgit v1.2.3