diff options
author | Bryce Harrington <bryce@osg.samsung.com> | 2014-11-20 22:21:57 -0800 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2014-11-28 16:13:13 +0200 |
commit | de16d8930644ac0d24c2cd63ad70671e28d892e0 (patch) | |
tree | 83162f11ef6adefc3ec49daa089c3286098b3e50 /src/rpi-renderer.c | |
parent | bff3472e2eb2099e8d9e6e54af73030f25372fb7 (diff) |
Use zalloc instead of calloc(1, ...)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Diffstat (limited to 'src/rpi-renderer.c')
-rw-r--r-- | src/rpi-renderer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c index 4d0f522f..2feab635 100644 --- a/src/rpi-renderer.c +++ b/src/rpi-renderer.c @@ -492,8 +492,8 @@ rpir_surface_create(struct rpi_renderer *renderer) { struct rpir_surface *surface; - surface = calloc(1, sizeof *surface); - if (!surface) + surface = zalloc(sizeof *surface); + if (surface == NULL) return NULL; wl_list_init(&surface->views); @@ -576,8 +576,8 @@ rpir_view_create(struct rpir_surface *surface) { struct rpir_view *view; - view = calloc(1, sizeof *view); - if (!view) + view = zalloc(sizeof *view); + if (view == NULL) return NULL; view->surface = surface; @@ -1549,7 +1549,7 @@ rpi_renderer_attach(struct weston_surface *base, struct weston_buffer *buffer) surface->buffer_type = BUFFER_TYPE_EGL; if(surface->egl_back == NULL) - surface->egl_back = calloc(1, sizeof *surface->egl_back); + surface->egl_back = zalloc(sizeof *surface->egl_back); weston_buffer_reference(&surface->egl_back->buffer_ref, buffer); surface->egl_back->resource_handle = @@ -1725,7 +1725,7 @@ rpi_renderer_create(struct weston_compositor *compositor, weston_log("Initializing the DispmanX compositing renderer\n"); - renderer = calloc(1, sizeof *renderer); + renderer = zalloc(sizeof *renderer); if (renderer == NULL) return -1; @@ -1797,8 +1797,8 @@ rpi_renderer_output_create(struct weston_output *base, assert(base->renderer_state == NULL); - output = calloc(1, sizeof *output); - if (!output) + output = zalloc(sizeof *output); + if (output == NULL) return -1; output->display = display; |