From fc559ef64840fe54c0136f064cbfb2d3c055b692 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 5 Sep 2022 09:07:29 +0200 Subject: Added cstr_append_fmt(). --- examples/box2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/box2.c') diff --git a/examples/box2.c b/examples/box2.c index 75f9970f..28b4acff 100644 --- a/examples/box2.c +++ b/examples/box2.c @@ -35,7 +35,7 @@ Point origin(void) { cbox_Point boxed_origin(void) { // Allocate this point on the heap, and return a pointer to it - return cbox_Point_make((Point){ .x=0.0, .y=0.0 }); + return cbox_Point_from((Point){ .x=0.0, .y=0.0 }); } @@ -53,16 +53,16 @@ int main(void) { c_auto (cbox_BoxPoint, box_in_a_box) { // Heap allocated rectangle - boxed_rectangle = cbox_Rectangle_make((Rectangle){ + boxed_rectangle = cbox_Rectangle_from((Rectangle){ .top_left = origin(), .bottom_right = (Point){ .x=3.0, .y=-4.0 } }); // The output of functions can be boxed - boxed_point = cbox_Point_make(origin()); + boxed_point = cbox_Point_from(origin()); // Double indirection - box_in_a_box = cbox_BoxPoint_make(boxed_origin()); + box_in_a_box = cbox_BoxPoint_from(boxed_origin()); printf("Point occupies %" PRIuMAX " bytes on the stack\n", sizeof(point)); -- cgit v1.2.3