summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/shape.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-08 16:16:49 +0100
committerTyge Løvset <[email protected]>2023-02-08 17:18:24 +0100
commitc4441f5fc665194fbd7a894a67a64a08c3beac42 (patch)
tree82f231b6e8fcb75625166f98aa785baaa265a3d6 /misc/examples/shape.c
parent673dd5319a488d4b702b94dd9aeda4e497ae4fbc (diff)
downloadSTC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.tar.gz
STC-modified-c4441f5fc665194fbd7a894a67a64a08c3beac42.zip
Changed to use lowercase flow-control macros in examples (uppercase will still be supported). Improved many examples to use c_make() to init containers.
Diffstat (limited to 'misc/examples/shape.c')
-rw-r--r--misc/examples/shape.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/shape.c b/misc/examples/shape.c
index f71704d9..d290fb4d 100644
--- a/misc/examples/shape.c
+++ b/misc/examples/shape.c
@@ -111,7 +111,7 @@ static void Polygon_draw(const Shape* shape)
{
const Polygon* self = c_dyn_cast(Polygon, shape);
printf("Polygon :");
- c_FOREACH (i, PointVec, self->points)
+ c_foreach (i, PointVec, self->points)
printf(" (%g,%g)", i.ref->x, i.ref->y);
puts("");
}
@@ -138,23 +138,23 @@ void testShape(const Shape* shape)
int main(void)
{
- c_AUTO (Shapes, shapes)
+ c_auto (Shapes, shapes)
{
Triangle* tri1 = c_new(Triangle, Triangle_from((Point){5, 7}, (Point){12, 7}, (Point){12, 20}));
Polygon* pol1 = c_new(Polygon, Polygon_init());
Polygon* pol2 = c_new(Polygon, Polygon_init());
- c_FORLIST (i, Point, {{50, 72}, {123, 73}, {127, 201}, {828, 333}})
+ c_forlist (i, Point, {{50, 72}, {123, 73}, {127, 201}, {828, 333}})
Polygon_addPoint(pol1, *i.ref);
- c_FORLIST (i, Point, {{5, 7}, {12, 7}, {12, 20}, {82, 33}, {17, 56}})
+ c_forlist (i, Point, {{5, 7}, {12, 7}, {12, 20}, {82, 33}, {17, 56}})
Polygon_addPoint(pol2, *i.ref);
Shapes_push(&shapes, &tri1->shape);
Shapes_push(&shapes, &pol1->shape);
Shapes_push(&shapes, &pol2->shape);
- c_FOREACH (i, Shapes, shapes)
+ c_foreach (i, Shapes, shapes)
testShape(*i.ref);
}
}