diff options
Diffstat (limited to 'examples/shape.c')
| -rw-r--r-- | examples/shape.c | 6 |
1 files 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 <stc/ccommon.h>
#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)
|
