summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorDuna Oh <duna.oh@samsung.com>2016-04-20 08:33:20 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-20 08:33:20 -0400
commitfbe4e4b6adcd1fadb22aa838836254673e2bbb86 (patch)
tree56390f69044fd6e44dc1513a7b51fa900036b49f /src/lib/ecore_x
parent115b69fd479a08db2e8b401f28aa6867179e5de3 (diff)
Ecore: Use calloc() to initialize Ecore_Event_Mouse_XXXX
Summary: To ensure initialize all fields of Ecore_Event_Mouse_XXX, use calloc() instead of malloc(). Test Plan: N/A Reviewers: gwanglim, cedric, raster, devilhorns, ManMower, zmike Subscribers: jpeg, input.hacker, JHyun Differential Revision: https://phab.enlightenment.org/D3906
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_events.c6
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_events.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_events.c b/src/lib/ecore_x/xcb/ecore_xcb_events.c
index 3d4a495fcb..c2c944e404 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_events.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_events.c
@@ -609,7 +609,7 @@ _ecore_xcb_event_handle_button_press(xcb_generic_event_t *event)
609 { 609 {
610 Ecore_Event_Mouse_Wheel *e; 610 Ecore_Event_Mouse_Wheel *e;
611 611
612 if (!(e = malloc(sizeof(Ecore_Event_Mouse_Wheel)))) return; 612 if (!(e = calloc(1, sizeof(Ecore_Event_Mouse_Wheel)))) return;
613 613
614 e->timestamp = ev->time; 614 e->timestamp = ev->time;
615 e->modifiers = _ecore_xcb_events_modifiers_get(ev->state); 615 e->modifiers = _ecore_xcb_events_modifiers_get(ev->state);
@@ -2524,7 +2524,7 @@ _ecore_xcb_event_mouse_move(uint16_t timestamp,
2524{ 2524{
2525 Ecore_Event_Mouse_Move *e; 2525 Ecore_Event_Mouse_Move *e;
2526 2526
2527 if (!(e = malloc(sizeof(Ecore_Event_Mouse_Move)))) return; 2527 if (!(e = calloc(1, sizeof(Ecore_Event_Mouse_Move)))) return;
2528 2528
2529 e->window = win; 2529 e->window = win;
2530 e->root_window = root_win; 2530 e->root_window = root_win;
@@ -2597,7 +2597,7 @@ _ecore_xcb_event_mouse_button(int event,
2597 Ecore_Event_Mouse_Button *e; 2597 Ecore_Event_Mouse_Button *e;
2598 Ecore_X_Mouse_Down_Info *info = NULL; 2598 Ecore_X_Mouse_Down_Info *info = NULL;
2599 2599
2600 if (!(e = malloc(sizeof(Ecore_Event_Mouse_Button)))) return NULL; 2600 if (!(e = calloc(1, sizeof(Ecore_Event_Mouse_Button)))) return NULL;
2601 2601
2602 e->window = win; 2602 e->window = win;
2603 e->root_window = root_win; 2603 e->root_window = root_win;
diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c b/src/lib/ecore_x/xlib/ecore_x_events.c
index cf5ec17b57..21e3489c4c 100644
--- a/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -245,7 +245,7 @@ _ecore_mouse_move(unsigned int timestamp,
245 Ecore_Event_Mouse_Move *e; 245 Ecore_Event_Mouse_Move *e;
246 Ecore_Event *event; 246 Ecore_Event *event;
247 247
248 e = malloc(sizeof(Ecore_Event_Mouse_Move)); 248 e = calloc(1, sizeof(Ecore_Event_Mouse_Move));
249 if (!e) 249 if (!e)
250 return; 250 return;
251 251
@@ -306,7 +306,7 @@ _ecore_x_axis_update(Ecore_Window window,
306 Ecore_Event_Axis_Update *e; 306 Ecore_Event_Axis_Update *e;
307 int i; 307 int i;
308 308
309 e = malloc(sizeof(Ecore_Event_Axis_Update)); 309 e = calloc(1, sizeof(Ecore_Event_Axis_Update));
310 if (!e) 310 if (!e)
311 { 311 {
312 if (axis) free(axis); 312 if (axis) free(axis);
@@ -449,7 +449,7 @@ _ecore_mouse_button(int event,
449{ 449{
450 Ecore_Event_Mouse_Button *e; 450 Ecore_Event_Mouse_Button *e;
451 451
452 e = malloc(sizeof(Ecore_Event_Mouse_Button)); 452 e = calloc(1, sizeof(Ecore_Event_Mouse_Button));
453 if (!e) 453 if (!e)
454 return NULL; 454 return NULL;
455 455
@@ -617,7 +617,7 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
617 { 617 {
618 Ecore_Event_Mouse_Wheel *e; 618 Ecore_Event_Mouse_Wheel *e;
619 619
620 e = malloc(sizeof(Ecore_Event_Mouse_Wheel)); 620 e = calloc(1, sizeof(Ecore_Event_Mouse_Wheel));
621 if (!e) 621 if (!e)
622 return; 622 return;
623 623