aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/xkb/xkb.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2017-03-02 15:38:08 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2017-03-03 22:44:44 +0100
commit06bb154df0a4d6e35885bce6a63057bd8f8636e8 (patch)
tree7eb1bb1a0e4633e77edf9d3d8e3829849303f1cd /nx-X11/programs/Xserver/xkb/xkb.c
parent6e8aee499ede4f8849653cdd248a6c0db5fb8b76 (diff)
downloadnx-libs-06bb154df0a4d6e35885bce6a63057bd8f8636e8.tar.gz
nx-libs-06bb154df0a4d6e35885bce6a63057bd8f8636e8.tar.bz2
nx-libs-06bb154df0a4d6e35885bce6a63057bd8f8636e8.zip
replace (DE)ALLOCATE_LOCAL by malloc/free
This is basically a backport of the following commits + replacing xalloc/xfree by malloc/free. Fixes ArcticaProject/nx-libs#358. commit 2761c103311a1160bc483fd0367d654733df8598 Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:03:26 2007 +0000 OS: Remove usage of alloca Replace with heap allocations. commit 5e363500c86042c394595e1a6633581eb8fcd1bb Author: Daniel Stone <daniel@fooishbar.org> Date: Mon Nov 5 14:38:28 2007 +0000 OS: Remove ALLOCATE_LOCAL from os.h Remove ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK from os.h, and remove the include of Xalloca.h as well.
Diffstat (limited to 'nx-X11/programs/Xserver/xkb/xkb.c')
-rw-r--r--nx-X11/programs/Xserver/xkb/xkb.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c
index b41548b83..6798f2dda 100644
--- a/nx-X11/programs/Xserver/xkb/xkb.c
+++ b/nx-X11/programs/Xserver/xkb/xkb.c
@@ -1301,7 +1301,7 @@ unsigned i,len;
char *desc,*start;
len= (rep->length*4)-(SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply));
- start= desc= (char *)ALLOCATE_LOCAL(len);
+ start= desc= (char *)malloc(len);
if (!start)
return BadAlloc;
memset(start, 0, len);
@@ -1342,7 +1342,7 @@ char *desc,*start;
}
WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), rep);
WriteToClient(client, len, start);
- DEALLOCATE_LOCAL((char *)start);
+ free((char *)start);
return client->noClientException;
}
@@ -2486,7 +2486,7 @@ int size;
size= rep->length*4;
if (size>0) {
- data = (char *)ALLOCATE_LOCAL(size);
+ data = (char *)malloc(size);
if (data) {
register unsigned i,bit;
xkbModsWireDesc * grp;
@@ -2534,7 +2534,7 @@ int size;
WriteToClient(client, SIZEOF(xkbGetCompatMapReply), rep);
if (data) {
WriteToClient(client, size, data);
- DEALLOCATE_LOCAL((char *)data);
+ free((char *)data);
}
return client->noClientException;
}
@@ -2781,7 +2781,7 @@ register unsigned bit;
length = rep->length*4;
if (length>0) {
CARD8 *to;
- to= map= (CARD8 *)ALLOCATE_LOCAL(length);
+ to= map= (CARD8 *)malloc(length);
if (map) {
xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *)to;
for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
@@ -2819,7 +2819,7 @@ register unsigned bit;
WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), rep);
if (map) {
WriteToClient(client, length, map);
- DEALLOCATE_LOCAL((char *)map);
+ free((char *)map);
}
return client->noClientException;
}
@@ -3308,7 +3308,7 @@ char * desc;
swapl(&rep->indicators);
}
- start = desc = (char *)ALLOCATE_LOCAL(length);
+ start = desc = (char *)malloc(length);
if ( !start )
return BadAlloc;
if (which&XkbKeycodesNameMask) {
@@ -3429,7 +3429,7 @@ char * desc;
}
WriteToClient(client, SIZEOF(xkbGetNamesReply), rep);
WriteToClient(client, length, start);
- DEALLOCATE_LOCAL((char *)start);
+ free((char *)start);
return client->noClientException;
}
@@ -4315,7 +4315,7 @@ XkbSendGeometry( ClientPtr client,
if (geom!=NULL) {
len= rep->length*4;
- start= desc= (char *)ALLOCATE_LOCAL(len);
+ start= desc= (char *)malloc(len);
if (!start)
return BadAlloc;
desc= XkbWriteCountedString(desc,geom->label_font,client->swapped);
@@ -4358,7 +4358,7 @@ XkbSendGeometry( ClientPtr client,
if (len>0)
WriteToClient(client, len, start);
if (start!=NULL)
- DEALLOCATE_LOCAL((char *)start);
+ free((char *)start);
if (freeGeom)
XkbFreeGeometry(geom,XkbGeomAllMask,True);
return client->noClientException;
@@ -5753,12 +5753,12 @@ char * str;
}
WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), &rep);
- str= (char*) ALLOCATE_LOCAL(nameLen);
+ str= (char*) malloc(nameLen);
if (!str)
return BadAlloc;
XkbWriteCountedString(str,dev->name,client->swapped);
WriteToClient(client,nameLen,str);
- DEALLOCATE_LOCAL(str);
+ free(str);
length-= nameLen;
if (rep.nBtnsRtrn>0) {