[PATCH libXi 3/7] Do not return NoSuchExtension casted to pointer as an error.

Michal Srb msrb at suse.com
Sat Nov 1 11:00:53 PDT 2014


Several functions were returning NoSuchExtension casted to a pointer in case of
an error. Often in parallel with returning NULL in case of another error. It is
undocumented and certainly wrong.

Signed-off-by: Michal Srb <msrb at suse.com>
---
 src/XGMotion.c | 2 +-
 src/XGetDCtl.c | 2 +-
 src/XGetFCtl.c | 2 +-
 src/XGetKMap.c | 2 +-
 src/XGetMMap.c | 2 +-
 src/XGetProp.c | 2 +-
 src/XOpenDev.c | 2 +-
 src/XQueryDv.c | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/XGMotion.c b/src/XGMotion.c
index a4c75b6..7785843 100644
--- a/src/XGMotion.c
+++ b/src/XGMotion.c
@@ -81,7 +81,7 @@ XGetDeviceMotionEvents(
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
-	return ((XDeviceTimeCoord *) NoSuchExtension);
+        return NULL;
 
     GetReq(GetDeviceMotionEvents, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XGetDCtl.c b/src/XGetDCtl.c
index b576aa5..c5d3b53 100644
--- a/src/XGetDCtl.c
+++ b/src/XGetDCtl.c
@@ -79,7 +79,7 @@ XGetDeviceControl(
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Add_XChangeDeviceControl, info) == -1)
-	return ((XDeviceControl *) NoSuchExtension);
+        return NULL;
 
     GetReq(GetDeviceControl, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XGetFCtl.c b/src/XGetFCtl.c
index 2d71fab..7fd6d0e 100644
--- a/src/XGetFCtl.c
+++ b/src/XGetFCtl.c
@@ -79,7 +79,7 @@ XGetFeedbackControl(
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
-	return ((XFeedbackState *) NoSuchExtension);
+        return NULL;
 
     GetReq(GetFeedbackControl, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XGetKMap.c b/src/XGetKMap.c
index 00dde06..0540ce4 100644
--- a/src/XGetKMap.c
+++ b/src/XGetKMap.c
@@ -78,7 +78,7 @@ XGetDeviceKeyMapping(register Display * dpy, XDevice * dev,
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
-	return ((KeySym *) NoSuchExtension);
+        return NULL;
 
     GetReq(GetDeviceKeyMapping, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XGetMMap.c b/src/XGetMMap.c
index ce10c2d..246698c 100644
--- a/src/XGetMMap.c
+++ b/src/XGetMMap.c
@@ -73,7 +73,7 @@ XGetDeviceModifierMapping(
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
-	return ((XModifierKeymap *) NoSuchExtension);
+        return NULL;
 
     GetReq(GetDeviceModifierMapping, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XGetProp.c b/src/XGetProp.c
index 8c69ef2..a3fa558 100644
--- a/src/XGetProp.c
+++ b/src/XGetProp.c
@@ -75,7 +75,7 @@ XGetDeviceDontPropagateList(
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
-	return ((XEventClass *) NoSuchExtension);
+        return NULL;
 
     GetReq(GetDeviceDontPropagateList, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XOpenDev.c b/src/XOpenDev.c
index e784f8b..029dec2 100644
--- a/src/XOpenDev.c
+++ b/src/XOpenDev.c
@@ -73,7 +73,7 @@ XOpenDevice(
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
-	return ((XDevice *) NoSuchExtension);
+        return NULL;
 
     GetReq(OpenDevice, req);
     req->reqType = info->codes->major_opcode;
diff --git a/src/XQueryDv.c b/src/XQueryDv.c
index 3836777..de1c0e5 100644
--- a/src/XQueryDv.c
+++ b/src/XQueryDv.c
@@ -78,7 +78,7 @@ XQueryDeviceState(
 
     LockDisplay(dpy);
     if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
-	return ((XDeviceState *) NoSuchExtension);
+        return NULL;
 
     GetReq(QueryDeviceState, req);
     req->reqType = info->codes->major_opcode;
-- 
1.8.4.5



More information about the xorg-devel mailing list