diff options
| author | Tyge Løvset <[email protected]> | 2022-05-20 12:11:12 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-05-20 12:11:12 +0200 |
| commit | 498f21cb4342aeabc2f53a27bf7a26d1bcf8c79d (patch) | |
| tree | 516fdcf150ad5cc42370b073e43c0111a8028e08 /examples/shape.c | |
| parent | d555ce38d5f56c835cc3cc0c5f3ffffa58aab621 (diff) | |
| download | STC-modified-498f21cb4342aeabc2f53a27bf7a26d1bcf8c79d.tar.gz STC-modified-498f21cb4342aeabc2f53a27bf7a26d1bcf8c79d.zip | |
Yet a fix in shape.c
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)
|
