summaryrefslogtreecommitdiff
path: root/hw/xfree86/dixmods/extmod
diff options
context:
space:
mode:
authorJoel Bosveld <joel.bosveld@gmail.com>2009-09-08 23:06:00 +0800
committerJoel Bosveld <joel.bosveld@gmail.com>2009-09-08 23:55:13 +0800
commit1ba17340a98a34b40f78442963aa4132e6cfae5c (patch)
treed11d814844e4ad037d146133250b73f28cdb3e31 /hw/xfree86/dixmods/extmod
parent5e38708c3466129c3e5af40a915c044bb26e083f (diff)
parent1bdc9ec617d357b076c9e69296018bc212d91c7d (diff)
Merge branch 'upstream' (one day I will rebase rather than merge)HEADmaster
Conflicts: test/Makefile.am
Diffstat (limited to 'hw/xfree86/dixmods/extmod')
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.h20
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c12
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c45
3 files changed, 34 insertions, 43 deletions
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h
index 1de14858c..6210526aa 100644
--- a/hw/xfree86/dixmods/extmod/modinit.h
+++ b/hw/xfree86/dixmods/extmod/modinit.h
@@ -7,20 +7,16 @@
#define INITARGS void
#endif
-#define _SHAPE_SERVER_ /* don't want Xlib structures */
-#include <X11/extensions/shapestr.h>
+#include <X11/extensions/shapeproto.h>
#ifdef MULTIBUFFER
extern void MultibufferExtensionInit(INITARGS);
-#define _MULTIBUF_SERVER_ /* don't want Xlib structures */
-#include <X11/extensions/multibufst.h>
+#include <X11/extensions/multibufproto.h>
#endif
#ifdef XTEST
extern void XTestExtensionInit(INITARGS);
-#define _XTEST_SERVER_
-#include <X11/extensions/XTest.h>
-#include <X11/extensions/xteststr.h>
+#include <X11/extensions/xtestproto.h>
#endif
#if 1
@@ -34,20 +30,18 @@ extern void ScreenSaverExtensionInit (INITARGS);
#ifdef XF86VIDMODE
extern void XFree86VidModeExtensionInit(INITARGS);
-#define _XF86VIDMODE_SERVER_
-#include <X11/extensions/xf86vmstr.h>
+#include <X11/extensions/xf86vmproto.h>
#endif
#ifdef XFreeXDGA
extern void XFree86DGAExtensionInit(INITARGS);
extern void XFree86DGARegister(INITARGS);
-#define _XF86DGA_SERVER_
-#include <X11/extensions/xf86dgastr.h>
+#include <X11/extensions/xf86dgaproto.h>
#endif
#ifdef DPMSExtension
extern void DPMSExtensionInit(INITARGS);
-#include <X11/extensions/dpmsstr.h>
+#include <X11/extensions/dpmsconst.h>
#endif
#ifdef XV
@@ -65,7 +59,7 @@ extern void ResExtensionInit(INITARGS);
#ifdef SHM
extern void ShmExtensionInit(INITARGS);
-#include <X11/extensions/shmstr.h>
+#include <X11/extensions/shmproto.h>
extern void ShmRegisterFuncs(
ScreenPtr pScreen,
ShmFuncsPtr funcs);
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
index 46aa8b882..7579f7d51 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -22,9 +22,7 @@
#include "cursorstr.h"
#include "scrnintstr.h"
#include "servermd.h"
-#define _XF86DGA_SERVER_
-#include <X11/extensions/xf86dga.h>
-#include <X11/extensions/xf86dgastr.h>
+#include <X11/extensions/xf86dgaproto.h>
#include "swaprep.h"
#include "dgaproc.h"
#include "xf86dgaext.h"
@@ -159,7 +157,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client)
}
nameSize = deviceName ? (strlen(deviceName) + 1) : 0;
- rep.length = (nameSize + 3) >> 2;
+ rep.length = bytes_to_int32(nameSize);
WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *)&rep);
if(rep.length)
@@ -225,10 +223,10 @@ ProcXDGAQueryModes(ClientPtr client)
size = num * sz_xXDGAModeInfo;
for(i = 0; i < num; i++)
- size += (strlen(mode[i].name) + 4) & ~3L; /* plus NULL */
+ size += pad_to_int32(strlen(mode[i].name) + 1); /* plus NULL */
rep.number = num;
- rep.length = size >> 2;
+ rep.length = bytes_to_int32(size);
WriteToClient(client, sz_xXDGAQueryModesReply, (char*)&rep);
@@ -389,7 +387,7 @@ ProcXDGASetMode(ClientPtr client)
info.reserved1 = mode.reserved1;
info.reserved2 = mode.reserved2;
- rep.length = (sz_xXDGAModeInfo + info.name_size) >> 2;
+ rep.length = bytes_to_int32(sz_xXDGAModeInfo + info.name_size);
WriteToClient(client, sz_xXDGASetModeReply, (char*)&rep);
WriteToClient(client, sz_xXDGAModeInfo, (char*)(&info));
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;