Bah, macros are hard.
This commit is contained in:
parent
c38feeb149
commit
3e0353c785
|
@ -108,7 +108,7 @@ static unsigned char XF86MiscReqCode = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
# define DEBUG_P(x) ErrorF(x"\n");
|
# define DEBUG_P(x) ErrorF x;
|
||||||
#else
|
#else
|
||||||
# define DEBUG_P(x) do {} while (0)
|
# define DEBUG_P(x) do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
@ -120,8 +120,6 @@ XFree86MiscExtensionInit(void)
|
||||||
{
|
{
|
||||||
ExtensionEntry* extEntry;
|
ExtensionEntry* extEntry;
|
||||||
|
|
||||||
DEBUG_P("XFree86MiscExtensionInit");
|
|
||||||
|
|
||||||
if (!xf86GetModInDevEnabled())
|
if (!xf86GetModInDevEnabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -154,8 +152,6 @@ ProcXF86MiscQueryVersion(client)
|
||||||
xXF86MiscQueryVersionReply rep;
|
xXF86MiscQueryVersionReply rep;
|
||||||
register int n;
|
register int n;
|
||||||
|
|
||||||
DEBUG_P("XF86MiscQueryVersion");
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86MiscQueryVersionReq);
|
REQUEST_SIZE_MATCH(xXF86MiscQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
|
@ -252,8 +248,6 @@ ProcXF86MiscGetMouseSettings(client)
|
||||||
register int n;
|
register int n;
|
||||||
int devnamelen;
|
int devnamelen;
|
||||||
|
|
||||||
DEBUG_P("XF86MiscGetMouseSettings");
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
|
REQUEST_SIZE_MATCH(xXF86MiscGetMouseSettingsReq);
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
@ -303,8 +297,6 @@ ProcXF86MiscGetKbdSettings(client)
|
||||||
pointer kbd;
|
pointer kbd;
|
||||||
register int n;
|
register int n;
|
||||||
|
|
||||||
DEBUG_P("XF86MiscGetKbdSettings");
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
|
REQUEST_SIZE_MATCH(xXF86MiscGetKbdSettingsReq);
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.length = 0;
|
rep.length = 0;
|
||||||
|
@ -338,19 +330,17 @@ ProcXF86MiscSetMouseSettings(client)
|
||||||
|
|
||||||
REQUEST(xXF86MiscSetMouseSettingsReq);
|
REQUEST(xXF86MiscSetMouseSettingsReq);
|
||||||
|
|
||||||
DEBUG_P("XF86MiscSetMouseSettings");
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86MiscSetMouseSettingsReq);
|
REQUEST_AT_LEAST_SIZE(xXF86MiscSetMouseSettingsReq);
|
||||||
|
|
||||||
ClientVersion(client, &major, &minor);
|
ClientVersion(client, &major, &minor);
|
||||||
|
|
||||||
if (xf86GetVerbosity() > 1) {
|
if (xf86GetVerbosity() > 1) {
|
||||||
DEBUG_P("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n",
|
DEBUG_P(("SetMouseSettings - type: %d brate: %d srate: %d chdmid: %d\n",
|
||||||
(int)stuff->mousetype, (int)stuff->baudrate,
|
(int)stuff->mousetype, (int)stuff->baudrate,
|
||||||
(int)stuff->samplerate, stuff->chordmiddle);
|
(int)stuff->samplerate, stuff->chordmiddle));
|
||||||
DEBUG_P(" em3but: %d em3tim: %d res: %d flags: %ld\n",
|
DEBUG_P((" em3but: %d em3tim: %d res: %d flags: %ld\n",
|
||||||
stuff->emulate3buttons, (int)stuff->emulate3timeout,
|
stuff->emulate3buttons, (int)stuff->emulate3timeout,
|
||||||
(int)stuff->resolution, (unsigned long)stuff->flags);
|
(int)stuff->resolution, (unsigned long)stuff->flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0)
|
if ((mouse = MiscExtCreateStruct(MISC_POINTER)) == (pointer) 0)
|
||||||
|
@ -376,7 +366,7 @@ ProcXF86MiscSetMouseSettings(client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
strncpy(devname,(char*)(&stuff[1]),stuff->devnamelen);
|
strncpy(devname,(char*)(&stuff[1]),stuff->devnamelen);
|
||||||
if (xf86GetVerbosity() > 1)
|
if (xf86GetVerbosity() > 1)
|
||||||
DEBUG_P("SetMouseSettings - device: %s\n",devname);
|
DEBUG_P(("SetMouseSettings - device: %s\n",devname));
|
||||||
MiscExtSetMouseDevice(mouse, devname);
|
MiscExtSetMouseDevice(mouse, devname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -395,12 +385,12 @@ ProcXF86MiscSetMouseSettings(client)
|
||||||
case MISC_RET_BADCOMBO: return MISCERR(XF86MiscBadMouseCombo);
|
case MISC_RET_BADCOMBO: return MISCERR(XF86MiscBadMouseCombo);
|
||||||
case MISC_RET_NOMODULE: return MISCERR(XF86MiscNoModule);
|
case MISC_RET_NOMODULE: return MISCERR(XF86MiscNoModule);
|
||||||
default:
|
default:
|
||||||
DEBUG_P("Unexpected return from MiscExtApply(POINTER) = %d\n", ret);
|
DEBUG_P(("Unexpected return from MiscExtApply(POINTER) = %d\n", ret));
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xf86GetVerbosity() > 1)
|
if (xf86GetVerbosity() > 1)
|
||||||
DEBUG_P("SetMouseSettings - Succeeded\n");
|
DEBUG_P(("SetMouseSettings - Succeeded\n"));
|
||||||
return (client->noClientException);
|
return (client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -412,14 +402,12 @@ ProcXF86MiscSetKbdSettings(client)
|
||||||
pointer kbd;
|
pointer kbd;
|
||||||
REQUEST(xXF86MiscSetKbdSettingsReq);
|
REQUEST(xXF86MiscSetKbdSettingsReq);
|
||||||
|
|
||||||
DEBUG_P("XF86MiscSetKbdSettings");
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
|
REQUEST_SIZE_MATCH(xXF86MiscSetKbdSettingsReq);
|
||||||
|
|
||||||
if (xf86GetVerbosity() > 1)
|
if (xf86GetVerbosity() > 1)
|
||||||
DEBUG_P("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n",
|
DEBUG_P(("SetKbdSettings - type: %d rate: %d delay: %d snumlk: %d\n",
|
||||||
(int)stuff->kbdtype, (int)stuff->rate,
|
(int)stuff->kbdtype, (int)stuff->rate,
|
||||||
(int)stuff->delay, stuff->servnumlock);
|
(int)stuff->delay, stuff->servnumlock));
|
||||||
|
|
||||||
if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
|
if ((kbd = MiscExtCreateStruct(MISC_KEYBOARD)) == (pointer) 0)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
@ -434,12 +422,12 @@ ProcXF86MiscSetKbdSettings(client)
|
||||||
case MISC_RET_BADVAL: return BadValue;
|
case MISC_RET_BADVAL: return BadValue;
|
||||||
case MISC_RET_BADKBDTYPE: return MISCERR(XF86MiscBadKbdType);
|
case MISC_RET_BADKBDTYPE: return MISCERR(XF86MiscBadKbdType);
|
||||||
default:
|
default:
|
||||||
DEBUG_P("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret);
|
DEBUG_P(("Unexpected return from MiscExtApply(KEYBOARD) = %d\n", ret));
|
||||||
return BadImplementation;
|
return BadImplementation;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xf86GetVerbosity() > 1)
|
if (xf86GetVerbosity() > 1)
|
||||||
DEBUG_P("SetKbdSettings - Succeeded\n");
|
DEBUG_P(("SetKbdSettings - Succeeded\n"));
|
||||||
return (client->noClientException);
|
return (client->noClientException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,14 +439,12 @@ ProcXF86MiscSetGrabKeysState(client)
|
||||||
xXF86MiscSetGrabKeysStateReply rep;
|
xXF86MiscSetGrabKeysStateReply rep;
|
||||||
REQUEST(xXF86MiscSetGrabKeysStateReq);
|
REQUEST(xXF86MiscSetGrabKeysStateReq);
|
||||||
|
|
||||||
DEBUG_P("XF86MiscSetGrabKeysState");
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
|
REQUEST_SIZE_MATCH(xXF86MiscSetGrabKeysStateReq);
|
||||||
|
|
||||||
if ((status = MiscExtSetGrabKeysState(client, stuff->enable)) == 0) {
|
if ((status = MiscExtSetGrabKeysState(client, stuff->enable)) == 0) {
|
||||||
if (xf86GetVerbosity() > 1)
|
if (xf86GetVerbosity() > 1)
|
||||||
DEBUG_P("SetGrabKeysState - %s\n",
|
DEBUG_P(("SetGrabKeysState - %s\n",
|
||||||
stuff->enable ? "enabled" : "disabled");
|
stuff->enable ? "enabled" : "disabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
|
@ -482,8 +468,6 @@ ProcXF86MiscSetClientVersion(ClientPtr client)
|
||||||
|
|
||||||
MiscPrivPtr pPriv;
|
MiscPrivPtr pPriv;
|
||||||
|
|
||||||
DEBUG_P("XF86MiscSetClientVersion");
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
|
REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq);
|
||||||
|
|
||||||
if ((pPriv = M_GETPRIV(client)) == NULL) {
|
if ((pPriv = M_GETPRIV(client)) == NULL) {
|
||||||
|
@ -493,7 +477,7 @@ ProcXF86MiscSetClientVersion(ClientPtr client)
|
||||||
M_SETPRIV(client, pPriv);
|
M_SETPRIV(client, pPriv);
|
||||||
}
|
}
|
||||||
if (xf86GetVerbosity() > 1)
|
if (xf86GetVerbosity() > 1)
|
||||||
DEBUG_P("SetClientVersion: %i %i\n",stuff->major,stuff->minor);
|
DEBUG_P(("SetClientVersion: %i %i\n",stuff->major,stuff->minor));
|
||||||
pPriv->major = stuff->major;
|
pPriv->major = stuff->major;
|
||||||
pPriv->minor = stuff->minor;
|
pPriv->minor = stuff->minor;
|
||||||
|
|
||||||
|
@ -511,8 +495,6 @@ ProcXF86MiscGetFilePaths(client)
|
||||||
register int n;
|
register int n;
|
||||||
int configlen, modulelen, loglen;
|
int configlen, modulelen, loglen;
|
||||||
|
|
||||||
DEBUG_P("XF86MiscGetFilePaths");
|
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
|
REQUEST_SIZE_MATCH(xXF86MiscGetFilePathsReq);
|
||||||
rep.type = X_Reply;
|
rep.type = X_Reply;
|
||||||
rep.sequenceNumber = client->sequence;
|
rep.sequenceNumber = client->sequence;
|
||||||
|
@ -559,8 +541,6 @@ ProcXF86MiscPassMessage(client)
|
||||||
|
|
||||||
REQUEST(xXF86MiscPassMessageReq);
|
REQUEST(xXF86MiscPassMessageReq);
|
||||||
|
|
||||||
DEBUG_P("XF86MiscPassMessage");
|
|
||||||
|
|
||||||
REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq);
|
REQUEST_AT_LEAST_SIZE(xXF86MiscPassMessageReq);
|
||||||
size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2;
|
size = (sizeof(xXF86MiscPassMessageReq) + 3) >> 2;
|
||||||
size+= (stuff->typelen + 3) >> 2;
|
size+= (stuff->typelen + 3) >> 2;
|
||||||
|
|
Loading…
Reference in New Issue