Use [x]zalloc instead of [x]malloc + memset
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
committed by
Bryce Harrington
parent
b18f788e2e
commit
5e653caa4a
+1
-2
@@ -687,8 +687,7 @@ text_entry_create(struct editor *editor, const char *text)
|
||||
{
|
||||
struct text_entry *entry;
|
||||
|
||||
entry = xmalloc(sizeof *entry);
|
||||
memset(entry, 0, sizeof *entry);
|
||||
entry = xzalloc(sizeof *entry);
|
||||
|
||||
entry->widget = widget_add_widget(editor->widget, entry);
|
||||
entry->window = editor->window;
|
||||
|
||||
@@ -498,8 +498,7 @@ triangle_create(struct window *window, struct egl_state *egl)
|
||||
{
|
||||
struct triangle *tri;
|
||||
|
||||
tri = xmalloc(sizeof *tri);
|
||||
memset(tri, 0, sizeof *tri);
|
||||
tri = xzalloc(sizeof *tri);
|
||||
|
||||
tri->egl = egl;
|
||||
tri->widget = window_add_subsurface(window, tri,
|
||||
@@ -720,8 +719,7 @@ demoapp_create(struct display *display)
|
||||
{
|
||||
struct demoapp *app;
|
||||
|
||||
app = xmalloc(sizeof *app);
|
||||
memset(app, 0, sizeof *app);
|
||||
app = xzalloc(sizeof *app);
|
||||
|
||||
app->egl = egl_state_create(display_get_display(display));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user