summaryrefslogtreecommitdiff
path: root/Xi/setbmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/setbmap.c')
-rw-r--r--Xi/setbmap.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/Xi/setbmap.c b/Xi/setbmap.c
index 1f5970dee..40f0f9a99 100644
--- a/Xi/setbmap.c
+++ b/Xi/setbmap.c
@@ -59,13 +59,10 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#include <X11/X.h> /* for inputstr.h */
-#include <X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
#include "exevents.h"
-#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
@@ -104,11 +101,8 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xSetDeviceButtonMappingReq);
if (stuff->length != (sizeof(xSetDeviceButtonMappingReq) +
- stuff->map_length + 3) >> 2) {
- SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
- BadLength);
- return Success;
- }
+ stuff->map_length + 3) >> 2)
+ return BadLength;
rep.repType = X_Reply;
rep.RepType = X_SetDeviceButtonMapping;
@@ -117,18 +111,14 @@ ProcXSetDeviceButtonMapping(ClientPtr client)
rep.status = MappingSuccess;
dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0,
- BadDevice);
- return Success;
- }
+ if (dev == NULL)
+ return BadDevice;
ret = SetButtonMapping(client, dev, stuff->map_length, (BYTE *) & stuff[1]);
- if (ret == BadValue || ret == BadMatch) {
- SendErrorToClient(client, IReqCode, X_SetDeviceButtonMapping, 0, ret);
- return Success;
- } else {
+ if (ret == BadValue || ret == BadMatch)
+ return ret;
+ else {
rep.status = ret;
WriteReplyToClient(client, sizeof(xSetDeviceButtonMappingReply), &rep);
}