summaryrefslogtreecommitdiff
path: root/src/lib/ecore_psl1ght
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_psl1ght
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_psl1ght')
-rw-r--r--src/lib/ecore_psl1ght/ecore_psl1ght.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/ecore_psl1ght/ecore_psl1ght.c b/src/lib/ecore_psl1ght/ecore_psl1ght.c
index 7f2e9ca592..adc0595432 100644
--- a/src/lib/ecore_psl1ght/ecore_psl1ght.c
+++ b/src/lib/ecore_psl1ght/ecore_psl1ght.c
@@ -383,7 +383,7 @@ _ecore_psl1ght_mouse_move(s32 x_axis, s32 y_axis)
383{ 383{
384 Ecore_Event_Mouse_Move *ev; 384 Ecore_Event_Mouse_Move *ev;
385 385
386 ev = malloc(sizeof(Ecore_Event_Mouse_Move)); 386 ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
387 if (!ev) return; 387 if (!ev) return;
388 388
389 mouse_x += x_axis; 389 mouse_x += x_axis;
@@ -416,7 +416,7 @@ _ecore_psl1ght_mouse_button(int button, int pressed)
416 Ecore_Event_Mouse_Button *ev; 416 Ecore_Event_Mouse_Button *ev;
417 static unsigned int previous_timestamp = 0; 417 static unsigned int previous_timestamp = 0;
418 418
419 ev = malloc(sizeof(Ecore_Event_Mouse_Button)); 419 ev = calloc(1, sizeof(Ecore_Event_Mouse_Button));
420 if (!ev) return; 420 if (!ev) return;
421 421
422 ev->window = 0; 422 ev->window = 0;
@@ -449,7 +449,7 @@ _ecore_psl1ght_mouse_wheel(s8 wheel, s8 tilt)
449{ 449{
450 Ecore_Event_Mouse_Wheel *ev; 450 Ecore_Event_Mouse_Wheel *ev;
451 451
452 ev = malloc(sizeof(Ecore_Event_Mouse_Wheel)); 452 ev = calloc(1, sizeof(Ecore_Event_Mouse_Wheel));
453 if (!ev) return; 453 if (!ev) return;
454 454
455 ev->timestamp = _ecore_psl1ght_get_time (); 455 ev->timestamp = _ecore_psl1ght_get_time ();