summaryrefslogtreecommitdiff
path: root/xserver/Xext/xf86bigfont.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-12-05 15:36:12 +0000
commita90ee792d96752ad1b71b9ada922fa6afe478c99 (patch)
tree6143b00f7646951d23dfe2a4fe2992ca40b77069 /xserver/Xext/xf86bigfont.c
parentbc97d4ecc0aa9e1b823565b07282f848700bd11a (diff)
Upgrade to xorg-server 1.9.2.
Tested by ajacoutot@, krw@, shadchin@ and jasper@ on various configurations including multihead with both zaphod and xrandr.
Diffstat (limited to 'xserver/Xext/xf86bigfont.c')
-rw-r--r--xserver/Xext/xf86bigfont.c50
1 files changed, 19 insertions, 31 deletions
diff --git a/xserver/Xext/xf86bigfont.c b/xserver/Xext/xf86bigfont.c
index a4eb3f659..8f0ddd93d 100644
--- a/xserver/Xext/xf86bigfont.c
+++ b/xserver/Xext/xf86bigfont.c
@@ -134,7 +134,7 @@ CheckForShmSyscall(void)
badSysCall = TRUE;
}
signal(SIGSYS, oldHandler);
- return (!badSysCall);
+ return !badSysCall;
}
#define MUST_CHECK_FOR_SHM_SYSCALL
@@ -230,7 +230,7 @@ shmalloc(
if (size < 3500)
return (ShmDescPtr) NULL;
- pDesc = xalloc(sizeof(ShmDescRec));
+ pDesc = malloc(sizeof(ShmDescRec));
if (!pDesc)
return (ShmDescPtr) NULL;
@@ -239,7 +239,7 @@ shmalloc(
if (shmid == -1) {
ErrorF(XF86BIGFONTNAME " extension: shmget() failed, size = %u, %s\n",
size, strerror(errno));
- xfree(pDesc);
+ free(pDesc);
return (ShmDescPtr) NULL;
}
@@ -247,7 +247,7 @@ shmalloc(
ErrorF(XF86BIGFONTNAME " extension: shmat() failed, size = %u, %s\n",
size, strerror(errno));
shmctl(shmid, IPC_RMID, (void *) 0);
- xfree(pDesc);
+ free(pDesc);
return (ShmDescPtr) NULL;
}
@@ -276,7 +276,7 @@ shmdealloc(
if (pDesc->next) pDesc->next->prev = pDesc->prev;
*pDesc->prev = pDesc->next;
- xfree(pDesc);
+ free(pDesc);
}
#endif
@@ -368,7 +368,7 @@ ProcXF86BigfontQueryVersion(
}
WriteToClient(client,
sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
- return client->noClientException;
+ return Success;
}
static void
@@ -404,7 +404,7 @@ ProcXF86BigfontQueryFont(
int nCharInfos;
int shmid;
#ifdef HAS_SHM
- ShmDescPtr pDesc;
+ ShmDescPtr pDesc = NULL;
#else
#define pDesc 0
#endif
@@ -427,18 +427,8 @@ ProcXF86BigfontQueryFont(
return BadLength;
}
#endif
- client->errorValue = stuff->id; /* EITHER font or gc */
- dixLookupResourceByType((pointer *)&pFont, stuff->id, RT_FONT,
- client, DixGetAttrAccess);
- if (!pFont) {
- 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;
- }
+ if (dixLookupFontable(&pFont, stuff->id, client, DixGetAttrAccess) != Success)
+ return BadFont; /* procotol spec says only error is BadFont */
pmax = FONTINKMAX(pFont);
pmin = FONTINKMIN(pFont);
@@ -459,8 +449,6 @@ ProcXF86BigfontQueryFont(
#ifdef HAS_SHM
if (!badSysCall)
pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex);
- else
- pDesc = NULL;
if (pDesc) {
pCI = (xCharInfo *) pDesc->attach_addr;
if (stuff_flags & XF86Bigfont_FLAGS_Shm)
@@ -474,7 +462,7 @@ ProcXF86BigfontQueryFont(
shmid = pDesc->shmid;
} else {
#endif
- pCI = xalloc(nCharInfos * sizeof(xCharInfo));
+ pCI = malloc(nCharInfos * sizeof(xCharInfo));
if (!pCI)
return BadAlloc;
#ifdef HAS_SHM
@@ -536,9 +524,9 @@ ProcXF86BigfontQueryFont(
if (hashModulus > nCharInfos+1)
hashModulus = nCharInfos+1;
- tmp = xalloc((4*nCharInfos+1) * sizeof(CARD16));
+ tmp = malloc((4*nCharInfos+1) * sizeof(CARD16));
if (!tmp) {
- if (!pDesc) xfree(pCI);
+ if (!pDesc) free(pCI);
return BadAlloc;
}
pIndex2UniqIndex = tmp;
@@ -620,12 +608,12 @@ ProcXF86BigfontQueryFont(
? nUniqCharInfos * sizeof(xCharInfo)
+ (nCharInfos+1)/2 * 2 * sizeof(CARD16)
: 0);
- xXF86BigfontQueryFontReply* reply = xalloc(rlength);
+ xXF86BigfontQueryFontReply* reply = malloc(rlength);
char* p;
if (!reply) {
if (nCharInfos > 0) {
- if (shmid == -1) xfree(pIndex2UniqIndex);
- if (!pDesc) xfree(pCI);
+ if (shmid == -1) free(pIndex2UniqIndex);
+ if (!pDesc) free(pCI);
}
return BadAlloc;
}
@@ -703,12 +691,12 @@ ProcXF86BigfontQueryFont(
}
}
WriteToClient(client, rlength, (char *)reply);
- xfree(reply);
+ free(reply);
if (nCharInfos > 0) {
- if (shmid == -1) xfree(pIndex2UniqIndex);
- if (!pDesc) xfree(pCI);
+ if (shmid == -1) free(pIndex2UniqIndex);
+ if (!pDesc) free(pCI);
}
- return (client->noClientException);
+ return Success;
}
}