diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-01-15 16:11:16 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-01-23 17:33:10 +1000 |
commit | 93de7b0b73d4c5f6f68e3a2ffe8f76b5212ee016 (patch) | |
tree | cdc651e3e3f9b99ca6ebbc9a8d05f484f9fc6a46 | |
parent | autogen.sh: Implement GNOME Build API (diff) | |
download | xf86-input-evdev-93de7b0b73d4c5f6f68e3a2ffe8f76b5212ee016.tar.gz xf86-input-evdev-93de7b0b73d4c5f6f68e3a2ffe8f76b5212ee016.tar.bz2 xf86-input-evdev-93de7b0b73d4c5f6f68e3a2ffe8f76b5212ee016.zip |
Move allocation of EvdevRec into a helper function
Makes it easier to initialise everything to the right values.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c index 5667dc1..baa7ac1 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2461,13 +2461,20 @@ EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) xf86DeleteInput(pInfo, flags); } +static EvdevPtr +EvdevAlloc(void) +{ + EvdevPtr pEvdev = calloc(sizeof(EvdevRec), 1); + return pEvdev; +} + static int EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) { EvdevPtr pEvdev; int rc = BadAlloc; - if (!(pEvdev = calloc(sizeof(EvdevRec), 1))) + if (!(pEvdev = EvdevAlloc())) goto error; pInfo->private = pEvdev; |