summaryrefslogtreecommitdiff
path: root/lib/libXi/src/XGetVers.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libXi/src/XGetVers.c')
-rw-r--r--lib/libXi/src/XGetVers.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/libXi/src/XGetVers.c b/lib/libXi/src/XGetVers.c
index 0751b98f8..f7e22e6a0 100644
--- a/lib/libXi/src/XGetVers.c
+++ b/lib/libXi/src/XGetVers.c
@@ -68,12 +68,16 @@ XGetExtensionVersion(register Display * dpy, _Xconst char *name)
XExtDisplayInfo *info = XInput_find_display(dpy);
LockDisplay(dpy);
- ext = _XiGetExtensionVersion(dpy, name, info);
- if (ext != (XExtensionVersion *) NoSuchExtension) {
- UnlockDisplay(dpy);
- SyncHandle();
- }
- return (ext);
+
+ if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
+ return NULL;
+
+ ext = _XiGetExtensionVersionRequest(dpy, name, info->codes->major_opcode);
+
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ return ext;
}
_X_HIDDEN XExtensionVersion*
@@ -91,7 +95,7 @@ _XiGetExtensionVersionRequest(Display *dpy, _Xconst char *name, int xi_opcode)
_XSend(dpy, name, (long)req->nbytes);
if (!_XReply(dpy, (xReply *) & rep, 0, xTrue)) {
- return (XExtensionVersion *) NULL;
+ return NULL;
}
ext = (XExtensionVersion *) Xmalloc(sizeof(XExtensionVersion));
@@ -105,13 +109,3 @@ _XiGetExtensionVersionRequest(Display *dpy, _Xconst char *name, int xi_opcode)
return ext;
}
-
-_X_HIDDEN XExtensionVersion *
-_XiGetExtensionVersion(register Display * dpy, _Xconst char *name,
- XExtDisplayInfo *info)
-{
- if (_XiCheckExtInit(dpy, Dont_Check, info) == -1)
- return ((XExtensionVersion *) NoSuchExtension);
-
- return _XiGetExtensionVersionRequest(dpy, name, info->codes->major_opcode);
-}