diff options
| author | Tyge Løvset <[email protected]> | 2022-04-27 19:07:18 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-04-27 19:07:18 +0200 |
| commit | edfcc712b48e2a582bcad1bc5a4102f18154e549 (patch) | |
| tree | 70ed252f3bfd4e5841a25d802da630b73e58b800 /examples/box2.c | |
| parent | df73eddd7933df7c96269f11e37fc1a96916f747 (diff) | |
| download | STC-modified-edfcc712b48e2a582bcad1bc5a4102f18154e549.tar.gz STC-modified-edfcc712b48e2a582bcad1bc5a4102f18154e549.zip | |
Final fixes to carc and cbox; Reverted constructor name to make; (similarity to make_shared/make_unique in c++).
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 6d118e2c..2d1b82fc 100644 --- a/examples/box2.c +++ b/examples/box2.c @@ -38,7 +38,7 @@ Point origin(void) { cbox_Point boxed_origin(void) {
// Allocate this point on the heap, and return a pointer to it
- return cbox_Point_from((Point){ .x=0.0, .y=0.0 });
+ return cbox_Point_make((Point){ .x=0.0, .y=0.0 });
}
@@ -56,16 +56,16 @@ int main(void) { c_auto (cbox_Point, boxed_point)
c_auto (cbox_BoxPoint, box_in_a_box)
{
- boxed_rectangle = cbox_Rectangle_from((Rectangle){
+ boxed_rectangle = cbox_Rectangle_make((Rectangle){
.top_left = origin(),
.bottom_right = (Point){ .x=3.0, .y=-4.0 }
});
// The output of functions can be boxed
- boxed_point = cbox_Point_from(origin());
+ boxed_point = cbox_Point_make(origin());
// Double indirection
- box_in_a_box = cbox_BoxPoint_from(boxed_origin());
+ box_in_a_box = cbox_BoxPoint_make(boxed_origin());
printf("Point occupies %" PRIuMAX " bytes on the stack\n",
sizeof(point));
|
