[PATCH weston 3/3] ivi-shell: use zalloc instead of calloc

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Fri Jul 1 09:34:53 UTC 2016


Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
---
 ivi-shell/input-panel-ivi.c |    2 +-
 ivi-shell/ivi-layout.c      |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ivi-shell/input-panel-ivi.c b/ivi-shell/input-panel-ivi.c
index 581b56b..be9799f 100644
--- a/ivi-shell/input-panel-ivi.c
+++ b/ivi-shell/input-panel-ivi.c
@@ -236,7 +236,7 @@ create_input_panel_surface(struct ivi_shell *shell,
 {
 	struct input_panel_surface *input_panel_surface;
 
-	input_panel_surface = calloc(1, sizeof *input_panel_surface);
+	input_panel_surface = zalloc(sizeof *input_panel_surface);
 	if (!input_panel_surface)
 		return NULL;
 
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 4e56ace..9bd631b 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -162,7 +162,7 @@ ivi_view_create(struct ivi_layout_layer *ivilayer,
 {
 	struct ivi_layout_view *ivi_view;
 
-	ivi_view = calloc(1, sizeof *ivi_view);
+	ivi_view = zalloc(sizeof *ivi_view);
 	if (ivi_view == NULL) {
 		weston_log("fails to allocate memory\n");
 		return NULL;
@@ -259,7 +259,7 @@ create_screen(struct weston_compositor *ec)
 	struct weston_output *output = NULL;
 
 	wl_list_for_each(output, &ec->output_list, link) {
-		iviscrn = calloc(1, sizeof *iviscrn);
+		iviscrn = zalloc(sizeof *iviscrn);
 		if (iviscrn == NULL) {
 			weston_log("fails to allocate memory\n");
 			continue;
@@ -1318,7 +1318,7 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer,
 		return ivilayer;
 	}
 
-	ivilayer = calloc(1, sizeof *ivilayer);
+	ivilayer = zalloc(sizeof *ivilayer);
 	if (ivilayer == NULL) {
 		weston_log("fails to allocate memory\n");
 		return NULL;
@@ -1967,7 +1967,7 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
 		}
 	}
 
-	ivisurf = calloc(1, sizeof *ivisurf);
+	ivisurf = zalloc(sizeof *ivisurf);
 	if (ivisurf == NULL) {
 		weston_log("fails to allocate memory\n");
 		return NULL;
-- 
1.7.9.5



More information about the wayland-devel mailing list