Setting members to 0/NULL after a zalloc or calloc is redundant
calloc (and zalloc) set the allocated memory to 0, so there's really no need to do it manually. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> [Pekka: dropped the src/evdev.c hunk.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
de44761a1a
commit
bff3472e2e
@@ -533,10 +533,6 @@ fbdev_output_create(struct fbdev_compositor *compositor,
|
|||||||
output->base.start_repaint_loop = fbdev_output_start_repaint_loop;
|
output->base.start_repaint_loop = fbdev_output_start_repaint_loop;
|
||||||
output->base.repaint = fbdev_output_repaint;
|
output->base.repaint = fbdev_output_repaint;
|
||||||
output->base.destroy = fbdev_output_destroy;
|
output->base.destroy = fbdev_output_destroy;
|
||||||
output->base.assign_planes = NULL;
|
|
||||||
output->base.set_backlight = NULL;
|
|
||||||
output->base.set_dpms = NULL;
|
|
||||||
output->base.switch_mode = NULL;
|
|
||||||
|
|
||||||
/* only one static mode in list */
|
/* only one static mode in list */
|
||||||
output->mode.flags =
|
output->mode.flags =
|
||||||
|
|||||||
@@ -440,10 +440,6 @@ weston_view_create(struct weston_surface *surface)
|
|||||||
wl_list_init(&view->link);
|
wl_list_init(&view->link);
|
||||||
wl_list_init(&view->layer_link.link);
|
wl_list_init(&view->layer_link.link);
|
||||||
|
|
||||||
view->plane = NULL;
|
|
||||||
view->layer_link.layer = NULL;
|
|
||||||
view->parent_view = NULL;
|
|
||||||
|
|
||||||
pixman_region32_init(&view->clip);
|
pixman_region32_init(&view->clip);
|
||||||
pixman_region32_init(&view->transform.masked_boundingbox);
|
pixman_region32_init(&view->transform.masked_boundingbox);
|
||||||
pixman_region32_init(&view->transform.masked_opaque);
|
pixman_region32_init(&view->transform.masked_opaque);
|
||||||
@@ -459,8 +455,6 @@ weston_view_create(struct weston_surface *surface)
|
|||||||
pixman_region32_init(&view->transform.boundingbox);
|
pixman_region32_init(&view->transform.boundingbox);
|
||||||
view->transform.dirty = 1;
|
view->transform.dirty = 1;
|
||||||
|
|
||||||
view->output = NULL;
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,8 +611,6 @@ weston_surface_create(struct weston_compositor *compositor)
|
|||||||
|
|
||||||
wl_signal_init(&surface->destroy_signal);
|
wl_signal_init(&surface->destroy_signal);
|
||||||
|
|
||||||
surface->resource = NULL;
|
|
||||||
|
|
||||||
surface->compositor = compositor;
|
surface->compositor = compositor;
|
||||||
surface->ref_count = 1;
|
surface->ref_count = 1;
|
||||||
|
|
||||||
@@ -629,10 +621,6 @@ weston_surface_create(struct weston_compositor *compositor)
|
|||||||
|
|
||||||
weston_surface_state_init(&surface->pending);
|
weston_surface_state_init(&surface->pending);
|
||||||
|
|
||||||
surface->output = NULL;
|
|
||||||
|
|
||||||
surface->viewport_resource = NULL;
|
|
||||||
|
|
||||||
pixman_region32_init(&surface->damage);
|
pixman_region32_init(&surface->damage);
|
||||||
pixman_region32_init(&surface->opaque);
|
pixman_region32_init(&surface->opaque);
|
||||||
region_init_infinite(&surface->input);
|
region_init_infinite(&surface->input);
|
||||||
|
|||||||
@@ -1841,8 +1841,6 @@ gl_renderer_output_create(struct weston_output *output,
|
|||||||
for (i = 0; i < BUFFER_DAMAGE_COUNT; i++)
|
for (i = 0; i < BUFFER_DAMAGE_COUNT; i++)
|
||||||
pixman_region32_init(&go->buffer_damage[i]);
|
pixman_region32_init(&go->buffer_damage[i]);
|
||||||
|
|
||||||
go->buffer_damage_index = 0;
|
|
||||||
|
|
||||||
output->renderer_state = go;
|
output->renderer_state = go;
|
||||||
|
|
||||||
log_egl_config_info(gr->egl_display, egl_config);
|
log_egl_config_info(gr->egl_display, egl_config);
|
||||||
|
|||||||
@@ -497,7 +497,6 @@ rpir_surface_create(struct rpi_renderer *renderer)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wl_list_init(&surface->views);
|
wl_list_init(&surface->views);
|
||||||
surface->visible_views = 0;
|
|
||||||
surface->single_buffer = renderer->single_buffer;
|
surface->single_buffer = renderer->single_buffer;
|
||||||
surface->enable_opaque_regions = renderer->enable_opaque_regions;
|
surface->enable_opaque_regions = renderer->enable_opaque_regions;
|
||||||
rpi_resource_init(&surface->resources[0]);
|
rpi_resource_init(&surface->resources[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user