diff options
author | Joel Bosveld <joel.bosveld@gmail.com> | 2009-09-08 23:06:00 +0800 |
---|---|---|
committer | Joel Bosveld <joel.bosveld@gmail.com> | 2009-09-08 23:55:13 +0800 |
commit | 1ba17340a98a34b40f78442963aa4132e6cfae5c (patch) | |
tree | d11d814844e4ad037d146133250b73f28cdb3e31 /hw/xfree86/dixmods/extmod/xf86vmode.c | |
parent | 5e38708c3466129c3e5af40a915c044bb26e083f (diff) | |
parent | 1bdc9ec617d357b076c9e69296018bc212d91c7d (diff) |
Conflicts:
test/Makefile.am
Diffstat (limited to 'hw/xfree86/dixmods/extmod/xf86vmode.c')
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86vmode.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index bd6c59462..4a288d79f 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -41,8 +41,7 @@ from Kaleb S. KEITHLEY #include "extnsionst.h" #include "scrnintstr.h" #include "servermd.h" -#define _XF86VIDMODE_SERVER_ -#include <X11/extensions/xf86vmstr.h> +#include <X11/extensions/xf86vmproto.h> #include "swaprep.h" #include "xf86.h" #include "vidmodeproc.h" @@ -414,11 +413,11 @@ ProcXF86VidModeGetModeLine(ClientPtr client) REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq); rep.type = X_Reply; if (ver < 2) { - rep.length = (SIZEOF(xXF86OldVidModeGetModeLineReply) - - SIZEOF(xGenericReply)) >> 2; + rep.length = bytes_to_int32(SIZEOF(xXF86OldVidModeGetModeLineReply) - + SIZEOF(xGenericReply)); } else { - rep.length = (SIZEOF(xXF86VidModeGetModeLineReply) - - SIZEOF(xGenericReply)) >> 2; + rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetModeLineReply) - + SIZEOF(xGenericReply)); } rep.sequenceNumber = client->sequence; @@ -670,10 +669,10 @@ ProcXF86VidModeAddModeLine(ClientPtr client) if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq); - len = client->req_len - (sizeof(xXF86OldVidModeAddModeLineReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeAddModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq); - len = client->req_len - (sizeof(xXF86VidModeAddModeLineReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeAddModeLineReq)); } if (len != stuff->privsize) return BadLength; @@ -809,10 +808,10 @@ ProcXF86VidModeDeleteModeLine(ClientPtr client) if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq); - len = client->req_len - (sizeof(xXF86OldVidModeDeleteModeLineReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeDeleteModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq); - len = client->req_len - (sizeof(xXF86VidModeDeleteModeLineReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeDeleteModeLineReq)); } if (len != stuff->privsize) { if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) { @@ -923,10 +922,10 @@ ProcXF86VidModeModModeLine(ClientPtr client) if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq); - len = client->req_len - (sizeof(xXF86OldVidModeModModeLineReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeModModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq); - len = client->req_len - (sizeof(xXF86VidModeModModeLineReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeModModeLineReq)); } if (len != stuff->privsize) return BadLength; @@ -1052,10 +1051,10 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq); len = client->req_len - - (sizeof(xXF86OldVidModeValidateModeLineReq) >> 2); + bytes_to_int32(sizeof(xXF86OldVidModeValidateModeLineReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq); - len = client->req_len - (sizeof(xXF86VidModeValidateModeLineReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeValidateModeLineReq)); } if (len != stuff->privsize) return BadLength; @@ -1107,8 +1106,8 @@ status_reply: xfree(modetmp); rep.type = X_Reply; - rep.length = (SIZEOF(xXF86VidModeValidateModeLineReply) - - SIZEOF(xGenericReply)) >> 2; + rep.length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply) + - SIZEOF(xGenericReply)); rep.sequenceNumber = client->sequence; rep.status = status; if (client->swapped) { @@ -1185,10 +1184,10 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) if (ver < 2) { REQUEST_AT_LEAST_SIZE(xXF86OldVidModeSwitchToModeReq); - len = client->req_len - (sizeof(xXF86OldVidModeSwitchToModeReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeSwitchToModeReq)); } else { REQUEST_AT_LEAST_SIZE(xXF86VidModeSwitchToModeReq); - len = client->req_len - (sizeof(xXF86VidModeSwitchToModeReq) >> 2); + len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeSwitchToModeReq)); } if (len != stuff->privsize) return BadLength; @@ -1289,10 +1288,10 @@ ProcXF86VidModeGetMonitor(ClientPtr client) VIDMODE_MON_MODEL, 0)).ptr); else rep.modelLength = 0; - rep.length = (SIZEOF(xXF86VidModeGetMonitorReply) - SIZEOF(xGenericReply) + + rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetMonitorReply) - SIZEOF(xGenericReply) + (nHsync + nVrefresh) * sizeof(CARD32) + - ((rep.vendorLength + 3) & ~3) + - ((rep.modelLength + 3) & ~3)) >> 2; + pad_to_int32(rep.vendorLength) + + pad_to_int32(rep.modelLength)); rep.sequenceNumber = client->sequence; rep.nhsync = nHsync; rep.nvsync = nVrefresh; @@ -1413,8 +1412,8 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg); rep.type = X_Reply; - rep.length = (SIZEOF(xXF86VidModeGetDotClocksReply) - - SIZEOF(xGenericReply) + numClocks) >> 2; + rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetDotClocksReply) + - SIZEOF(xGenericReply) + numClocks); rep.sequenceNumber = client->sequence; rep.clocks = numClocks; rep.maxclocks = MAXCLOCKS; |