Also cleans up variable scope. ../src/wcmValidateDevice.c: In function 'wcmCheckSource': ../src/wcmValidateDevice.c:37:2: warning: passing argument 3 of 'xf86CheckStrOption' discards 'const' qualifier from pointer target type [enabled by default] In file included from /usr/include/xorg/xf86str.h:43:0, from /usr/include/xorg/xf86.h:44, from ../src/xf86Wacom.h:33, from ../src/wcmValidateDevice.c:23: /usr/include/xorg/xf86Opt.h:87:24: note: expected 'char *' but argument is of type 'const char *' ../src/wcmValidateDevice.c:52:4: warning: passing argument 3 of 'xf86CheckStrOption' discards 'const' qualifier from pointer target type [enabled by default] In file included from /usr/include/xorg/xf86str.h:43:0, from /usr/include/xorg/xf86.h:44, from ../src/xf86Wacom.h:33, from ../src/wcmValidateDevice.c:23: /usr/include/xorg/xf86Opt.h:87:24: note: expected 'char *' but argument is of type 'const char *'
Signed-off-by: Jason Gerecke <killert...@gmail.com> --- src/wcmValidateDevice.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c index fac813e..b4f15af 100644 --- a/src/wcmValidateDevice.c +++ b/src/wcmValidateDevice.c @@ -33,15 +33,11 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t min_maj) { int match = 0; - char* device; - char* fsource = xf86CheckStrOption(pInfo->options, "_source", ""); InputInfoPtr pDevices = xf86FirstLocalDevice(); - WacomCommonPtr pCommon = NULL; - char* psource; for (; pDevices != NULL; pDevices = pDevices->next) { - device = xf86CheckStrOption(pDevices->options, "Device", NULL); + char* device = xf86CheckStrOption(pDevices->options, "Device", NULL); /* device can be NULL on some distros */ if (!device || !strstr(pDevices->drv->driverName, "wacom")) @@ -49,14 +45,17 @@ static Bool wcmCheckSource(InputInfoPtr pInfo, dev_t min_maj) if (pInfo != pDevices) { - psource = xf86CheckStrOption(pDevices->options, "_source", ""); - pCommon = ((WacomDevicePtr)pDevices->private)->common; + WacomCommonPtr pCommon = ((WacomDevicePtr)pDevices->private)->common; + char* fsource = xf86CheckStrOption(pInfo->options, "_source", NULL); + char* psource = xf86CheckStrOption(pDevices->options, "_source", NULL); + if (pCommon->min_maj && pCommon->min_maj == min_maj) { /* only add the new tool if the matching major/minor * was from the same source */ - if (strcmp(fsource, psource)) + if ((!fsource && !psource) || + (fsource && psource && strcmp(fsource, psource))) { match = 1; break; -- 1.7.10.2 ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel