aboutsummaryrefslogtreecommitdiff
path: root/src/widget.c
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-05-30 16:41:20 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-05-30 16:41:20 +0200
commitbe230dfdb78f70d6632c5c263b3d3c7bbb477a1a (patch)
treed6216f83978ad6a4409e203ea97361d3a6227522 /src/widget.c
parentd3d706fa2ff8eb69791d829745e8f7cb4fe18f5e (diff)
downloadcherry-be230dfdb78f70d6632c5c263b3d3c7bbb477a1a.tar.gz
cherry-be230dfdb78f70d6632c5c263b3d3c7bbb477a1a.zip
Return a non-pointer object cherry_widget_new()
Diffstat (limited to 'src/widget.c')
-rw-r--r--src/widget.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/widget.c b/src/widget.c
index c3007e1..b3b0307 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -10,18 +10,18 @@ cherry_widget_draw(CherryWidget *widget)
widget->drawn = 1;
}
-CherryWidget *
+CherryWidget
cherry_widget_new(void)
{
- CherryWidget *widget = malloc(sizeof(*widget));
- widget->x = 0;
- widget->y = 0;
- widget->widgets = clist_create();
- widget->width = 0;
- widget->height = 0;
- widget->visible = 0;
- widget->drawn = 0;
- widget->draw = cherry_widget_draw;
+ CherryWidget widget;
+ widget.x = 0;
+ widget.y = 0;
+ widget.widgets = clist_create();
+ widget.width = 0;
+ widget.height = 0;
+ widget.visible = 0;
+ widget.drawn = 0;
+ widget.draw = cherry_widget_draw;
return widget;
}