diff options
| author | Tyge Løvset <[email protected]> | 2022-09-05 09:07:29 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-09-05 09:07:29 +0200 |
| commit | fc559ef64840fe54c0136f064cbfb2d3c055b692 (patch) | |
| tree | 3935236a6ff3f7cfc8db4e0b5cb96e3203197bbc /examples/box2.c | |
| parent | 491a8cba3ee55a1200fc2de8ef3807dd8436f829 (diff) | |
| download | STC-modified-fc559ef64840fe54c0136f064cbfb2d3c055b692.tar.gz STC-modified-fc559ef64840fe54c0136f064cbfb2d3c055b692.zip | |
Added cstr_append_fmt().
Diffstat (limited to 'examples/box2.c')
| -rw-r--r-- | examples/box2.c | 8 |
1 files changed, 4 insertions, 4 deletions
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)); |
