summaryrefslogtreecommitdiff
path: root/xserver/Xext/xf86bigfont.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:02:39 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:02:39 +0000
commit269d40cbcc43b41f621ca6d91c182952f60ec48e (patch)
tree872f2fddd3f2207e57a28595e73886713ce4a77a /xserver/Xext/xf86bigfont.c
parent917a2249b787451cad3f9697872aeccfd0da3324 (diff)
Update to xserver 1.8. Tested by many. Ok oga@, todd@.
Diffstat (limited to 'xserver/Xext/xf86bigfont.c')
-rw-r--r--xserver/Xext/xf86bigfont.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/xserver/Xext/xf86bigfont.c b/xserver/Xext/xf86bigfont.c
index dabbdd6e0..a4eb3f659 100644
--- a/xserver/Xext/xf86bigfont.c
+++ b/xserver/Xext/xf86bigfont.c
@@ -71,9 +71,10 @@
#include "gcstruct.h"
#include "dixfontstr.h"
#include "extnsionst.h"
+#include "protocol-versions.h"
-#define _XF86BIGFONT_SERVER_
-#include <X11/extensions/xf86bigfstr.h>
+#include <X11/extensions/xf86bigfproto.h>
+#include "xf86bigfontsrv.h"
static void XF86BigfontResetProc(
ExtensionEntry * /* extEntry */
@@ -125,7 +126,7 @@ CheckForShmSyscall(void)
if (shmid != -1)
{
/* Successful allocation - clean up */
- shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
+ shmctl(shmid, IPC_RMID, NULL);
}
else
{
@@ -143,7 +144,7 @@ CheckForShmSyscall(void)
#endif
void
-XFree86BigfontExtensionInit()
+XFree86BigfontExtensionInit(void)
{
if (AddExtension(XF86BIGFONTNAME,
XF86BigfontNumberEvents,
@@ -229,7 +230,7 @@ shmalloc(
if (size < 3500)
return (ShmDescPtr) NULL;
- pDesc = (ShmDescRec *) xalloc(sizeof(ShmDescRec));
+ pDesc = xalloc(sizeof(ShmDescRec));
if (!pDesc)
return (ShmDescPtr) NULL;
@@ -302,7 +303,7 @@ XF86BigfontFreeFontShm(
/* Called upon fatal signal. */
void
-XF86BigfontCleanup()
+XF86BigfontCleanup(void)
{
#ifdef HAS_SHM
while (ShmList)
@@ -339,8 +340,8 @@ ProcXF86BigfontQueryVersion(
reply.type = X_Reply;
reply.length = 0;
reply.sequenceNumber = client->sequence;
- reply.majorVersion = XF86BIGFONT_MAJOR_VERSION;
- reply.minorVersion = XF86BIGFONT_MINOR_VERSION;
+ reply.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION;
+ reply.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION;
reply.uid = geteuid();
reply.gid = getegid();
#ifdef HAS_SHM
@@ -427,15 +428,15 @@ ProcXF86BigfontQueryFont(
}
#endif
client->errorValue = stuff->id; /* EITHER font or gc */
- pFont = (FontPtr)SecurityLookupIDByType(client, stuff->id, RT_FONT,
- DixGetAttrAccess);
+ dixLookupResourceByType((pointer *)&pFont, stuff->id, RT_FONT,
+ client, DixGetAttrAccess);
if (!pFont) {
- GC *pGC = (GC *) SecurityLookupIDByType(client, stuff->id, RT_GC,
- DixGetAttrAccess);
- if (!pGC) {
- client->errorValue = stuff->id;
+ GC *pGC;
+ dixLookupResourceByType((pointer *)&pGC, stuff->id, RT_GC,
+ client, DixGetAttrAccess);
+ if (!pGC)
return BadFont; /* procotol spec says only error is BadFont */
- }
+
pFont = pGC->font;
}
@@ -473,8 +474,7 @@ ProcXF86BigfontQueryFont(
shmid = pDesc->shmid;
} else {
#endif
- pCI = (xCharInfo *)
- xalloc(nCharInfos * sizeof(xCharInfo));
+ pCI = xalloc(nCharInfos * sizeof(xCharInfo));
if (!pCI)
return BadAlloc;
#ifdef HAS_SHM
@@ -536,8 +536,7 @@ ProcXF86BigfontQueryFont(
if (hashModulus > nCharInfos+1)
hashModulus = nCharInfos+1;
- tmp = (CARD16*)
- xalloc((4*nCharInfos+1) * sizeof(CARD16));
+ tmp = xalloc((4*nCharInfos+1) * sizeof(CARD16));
if (!tmp) {
if (!pDesc) xfree(pCI);
return BadAlloc;
@@ -621,8 +620,7 @@ ProcXF86BigfontQueryFont(
? nUniqCharInfos * sizeof(xCharInfo)
+ (nCharInfos+1)/2 * 2 * sizeof(CARD16)
: 0);
- xXF86BigfontQueryFontReply* reply =
- (xXF86BigfontQueryFontReply *) xalloc(rlength);
+ xXF86BigfontQueryFontReply* reply = xalloc(rlength);
char* p;
if (!reply) {
if (nCharInfos > 0) {
@@ -632,7 +630,7 @@ ProcXF86BigfontQueryFont(
return BadAlloc;
}
reply->type = X_Reply;
- reply->length = (rlength - sizeof(xGenericReply)) >> 2;
+ reply->length = bytes_to_int32(rlength - sizeof(xGenericReply));
reply->sequenceNumber = client->sequence;
reply->minBounds = pFont->info.ink_minbounds;
reply->maxBounds = pFont->info.ink_maxbounds;