diff options
author | Rami Ylimäki <rami.ylimaki@vincit.fi> | 2011-03-08 11:23:47 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-03-09 15:28:10 +1000 |
commit | 41111ce1efc6181b8da042c5b01f01cdf92315be (patch) | |
tree | a80c572160cbf63974bae47bc911ac12473c5522 | |
parent | Release leaked device identifier on input device disconnect. (diff) | |
download | xf86-input-evdev-41111ce1efc6181b8da042c5b01f01cdf92315be.tar.gz xf86-input-evdev-41111ce1efc6181b8da042c5b01f01cdf92315be.tar.bz2 xf86-input-evdev-41111ce1efc6181b8da042c5b01f01cdf92315be.zip |
Remove constness of device filename to avoid warning when freed.
A warning from free() can be avoided by casting the constness away
from its argument pointer or by not declaring the pointer as const in
the first place.
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev.c | 4 | ||||
-rw-r--r-- | src/evdev.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c index b62caa2..ab46277 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1788,7 +1788,7 @@ static int EvdevOpenDevice(InputInfoPtr pInfo) { EvdevPtr pEvdev = pInfo->private; - char *device = (char*)pEvdev->device; + char *device = pEvdev->device; if (!device) { @@ -1835,7 +1835,7 @@ EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) /* Release strings allocated in EvdevAddKeyClass. */ XkbFreeRMLVOSet(&pEvdev->rmlvo, FALSE); /* Release string allocated in EvdevOpenDevice. */ - free((void *)pEvdev->device); /* (const char *) */ + free(pEvdev->device); pEvdev->device = NULL; } xf86DeleteInput(pInfo, flags); diff --git a/src/evdev.h b/src/evdev.h index 5df7d3e..c16ccb2 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -104,7 +104,7 @@ typedef struct { } EventQueueRec, *EventQueuePtr; typedef struct { - const char *device; + char *device; int grabDevice; /* grab the event device? */ int num_vals; /* number of valuators */ |