summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-04-28 14:31:37 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-05-06 17:47:11 -0700
commit776bcc9e459630c60a4a7f3fdf992589518acb5c (patch)
tree62ebb10e1c26158b16988e5835662a0195040000 /os
parent20703d1690257deb8c1c6f6dcc779ba615ef488f (diff)
Get rid of fsalloc/fsrealloc/fsfree wrapper macros
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xfs/-/merge_requests/7>
Diffstat (limited to 'os')
-rw-r--r--os/config.c14
-rw-r--r--os/connection.c6
-rw-r--r--os/io.c50
-rw-r--r--os/osglue.c14
4 files changed, 42 insertions, 42 deletions
diff --git a/os/config.c b/os/config.c
index cd1e228..a301440 100644
--- a/os/config.c
+++ b/os/config.c
@@ -296,7 +296,7 @@ SetConfigValues(void)
num, font_catalogue);
}
InitErrors();
- fsfree((char *) font_catalogue);
+ FSfree((char *) font_catalogue);
font_catalogue = NULL;
}
@@ -311,7 +311,7 @@ ReadConfigFile(const char *filename)
int i;
char *data;
- data = (char *) fsalloc(CONFIG_MAX_FILESIZE);
+ data = (char *) FSalloc(CONFIG_MAX_FILESIZE);
if (!data) {
ErrorF(CONFIG_ERR_MEMORY, filename);
return FSBadAlloc;
@@ -338,12 +338,12 @@ ReadConfigFile(const char *filename)
}
}
if (fp == NULL) {
- fsfree(data);
+ FSfree(data);
return FSBadName;
}
ret = fread(data, sizeof(char), CONFIG_MAX_FILESIZE, fp);
if (ret <= 0) {
- fsfree(data);
+ FSfree(data);
(void) fclose(fp);
ErrorF(CONFIG_ERR_READ, filename);
return FSBadName;
@@ -357,7 +357,7 @@ ReadConfigFile(const char *filename)
strip_comments(data);
ret = parse_config(data);
- fsfree(data);
+ FSfree(data);
return ret;
}
@@ -527,8 +527,8 @@ config_set_catalogue(
if (!strcmp(parm->parm_name, "catalogue")) {
/* stash it for later */
- fsfree((char *) font_catalogue); /* dump any previous one */
- b = font_catalogue = (char *) fsalloc(strlen(val) + 1);
+ FSfree((char *) font_catalogue); /* dump any previous one */
+ b = font_catalogue = (char *) FSalloc(strlen(val) + 1);
if (!font_catalogue)
FatalError("insufficient memory for font catalogue\n");
while (*val) { /* remove all the gunk */
diff --git a/os/connection.c b/os/connection.c
index f0680b6..5bdc738 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -325,9 +325,9 @@ MakeNewConnections(void)
_FontTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1);
- oc = (OsCommPtr) fsalloc(sizeof(OsCommRec));
+ oc = (OsCommPtr) FSalloc(sizeof(OsCommRec));
if (!oc) {
- fsfree(oc);
+ FSfree(oc);
error_conn_max(new_trans_conn);
_FontTransClose(new_trans_conn);
continue;
@@ -431,7 +431,7 @@ close_fd(OsCommPtr oc)
if (!XFD_ANYSET(&ClientsWriteBlocked))
AnyClientsWriteBlocked = FALSE;
FD_CLR(fd, &OutputPending);
- fsfree(oc);
+ FSfree(oc);
}
void
diff --git a/os/io.c b/os/io.c
index 87cc5f2..b94fd60 100644
--- a/os/io.c
+++ b/os/io.c
@@ -133,8 +133,8 @@ ReadRequest(ClientPtr client)
ConnectionInputPtr aci = AvailableInput->input;
if (aci->size > BUFWATERMARK) {
- fsfree(aci->buffer);
- fsfree(aci);
+ FSfree(aci->buffer);
+ FSfree(aci);
} else {
aci->next = FreeInputs;
FreeInputs = aci;
@@ -177,7 +177,7 @@ ReadRequest(ClientPtr client)
if (needed > oci->size) {
char *ibuf;
- ibuf = (char *) fsrealloc(oci->buffer, needed);
+ ibuf = (char *) FSrealloc(oci->buffer, needed);
if (!ibuf) {
yield_control_death();
return -1;
@@ -216,7 +216,7 @@ ReadRequest(ClientPtr client)
(oci->bufcnt < BUFSIZE) && (needed < BUFSIZE)) {
char *ibuf;
- ibuf = (char *) fsrealloc(oci->buffer, BUFSIZE);
+ ibuf = (char *) FSrealloc(oci->buffer, BUFSIZE);
if (ibuf) {
oci->size = BUFSIZE;
oci->buffer = ibuf;
@@ -273,8 +273,8 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
register ConnectionInputPtr aci = AvailableInput->input;
if (aci->size > BUFWATERMARK) {
- fsfree(aci->buffer);
- fsfree(aci);
+ FSfree(aci->buffer);
+ FSfree(aci);
} else {
aci->next = FreeInputs;
FreeInputs = aci;
@@ -297,7 +297,7 @@ InsertFakeRequest(ClientPtr client, char *data, int count)
if ((gotnow + count) > oci->size) {
char *ibuf;
- ibuf = (char *) fsrealloc(oci->buffer, gotnow + count);
+ ibuf = (char *) FSrealloc(oci->buffer, gotnow + count);
if (!ibuf)
return FALSE;
oci->size = gotnow + count;
@@ -436,7 +436,7 @@ FlushClient(
if (notWritten > oco->size) {
unsigned char *obuf;
- obuf = (unsigned char *) fsrealloc(oco->buf,
+ obuf = (unsigned char *) FSrealloc(oco->buf,
notWritten + OutputBufferSize);
if (!obuf) {
if (oc->trans_conn)
@@ -483,8 +483,8 @@ FlushClient(
AnyClientsWriteBlocked = FALSE;
}
if (oco->size > BUFWATERMARK) {
- fsfree(oco->buf);
- fsfree(oco);
+ FSfree(oco->buf);
+ FSfree(oco);
} else {
oco->next = FreeOutputs;
FreeOutputs = oco;
@@ -583,7 +583,7 @@ WriteToClient(ClientPtr client, int count, char *buf)
}
write_to_client_internal(client, count, buf, padlength[count & 3]);
if (flag)
- fsfree(buf);
+ FSfree(buf);
}
static ConnectionInputPtr
@@ -591,12 +591,12 @@ AllocateInputBuffer(void)
{
register ConnectionInputPtr oci;
- oci = (ConnectionInputPtr) fsalloc(sizeof(ConnectionInput));
+ oci = (ConnectionInputPtr) FSalloc(sizeof(ConnectionInput));
if (!oci)
return (ConnectionInputPtr) NULL;
- oci->buffer = (char *) fsalloc(BUFSIZE);
+ oci->buffer = (char *) FSalloc(BUFSIZE);
if (!oci->buffer) {
- fsfree(oci);
+ FSfree(oci);
return (ConnectionInputPtr) NULL;
}
oci->next = NULL;
@@ -612,12 +612,12 @@ AllocateOutputBuffer(void)
{
register ConnectionOutputPtr oco;
- oco = (ConnectionOutputPtr) fsalloc(sizeof(ConnectionOutput));
+ oco = (ConnectionOutputPtr) FSalloc(sizeof(ConnectionOutput));
if (!oco)
return (ConnectionOutputPtr) NULL;
- oco->buf = (unsigned char *) fsalloc(BUFSIZE);
+ oco->buf = (unsigned char *) FSalloc(BUFSIZE);
if (!oco->buf) {
- fsfree(oco);
+ FSfree(oco);
return (ConnectionOutputPtr) NULL;
}
oco->size = BUFSIZE;
@@ -636,8 +636,8 @@ FreeOsBuffers(OsCommPtr oc)
AvailableInput = (OsCommPtr) NULL;
if ((oci = oc->input) != (ConnectionInputPtr) 0) {
if (FreeInputs) {
- fsfree(oci->buffer);
- fsfree(oci);
+ FSfree(oci->buffer);
+ FSfree(oci);
} else {
FreeInputs = oci;
oci->next = (ConnectionInputPtr) NULL;
@@ -648,8 +648,8 @@ FreeOsBuffers(OsCommPtr oc)
}
if ((oco = oc->output) != (ConnectionOutputPtr) 0) {
if (FreeOutputs) {
- fsfree(oco->buf);
- fsfree(oco);
+ FSfree(oco->buf);
+ FSfree(oco);
} else {
FreeOutputs = oco;
oco->next = (ConnectionOutputPtr) NULL;
@@ -666,12 +666,12 @@ ResetOsBuffers(void)
while ((oci = FreeInputs) != (ConnectionInputPtr) 0) {
FreeInputs = oci->next;
- fsfree(oci->buffer);
- fsfree(oci);
+ FSfree(oci->buffer);
+ FSfree(oci);
}
while ((oco = FreeOutputs) != (ConnectionOutputPtr) 0) {
FreeOutputs = oco->next;
- fsfree(oco->buf);
- fsfree(oco);
+ FSfree(oco->buf);
+ FSfree(oco);
}
}
diff --git a/os/osglue.c b/os/osglue.c
index 1a45137..812b3c5 100644
--- a/os/osglue.c
+++ b/os/osglue.c
@@ -160,7 +160,7 @@ ListCatalogues(const char *pattern, int patlen, int maxnames,
if (maxnames) {
if (pattern_match(pattern, patlen, catalogue_name)) {
size = strlen(catalogue_name);
- catlist = (char *) fsalloc(size + 1);
+ catlist = (char *) FSalloc(size + 1);
if (!catlist)
goto bail;
*catlist = size;
@@ -223,7 +223,7 @@ SetAlternateServers(char *list)
a->namelen = 0;
while (*t) {
if (*t == ',') {
- a->name = (char *) fsalloc(a->namelen);
+ a->name = (char *) FSalloc(a->namelen);
if (!a->name) {
goto unwind;
}
@@ -238,7 +238,7 @@ SetAlternateServers(char *list)
t++;
}
}
- a->name = (char *) fsalloc(a->namelen);
+ a->name = (char *) FSalloc(a->namelen);
if (!a->name) {
goto unwind;
}
@@ -246,18 +246,18 @@ SetAlternateServers(char *list)
a->subset = FALSE; /* XXX */
for (i = 0; i < num_alts; i++) {
- fsfree((char *) alt_servers[i].name);
+ FSfree((char *) alt_servers[i].name);
}
- fsfree((char *) alt_servers);
+ FSfree((char *) alt_servers);
num_alts = num;
alt_servers = alts;
return FSSuccess;
unwind:
for (i = 0; i < num; i++) {
- fsfree(alts[i].name);
+ FSfree(alts[i].name);
}
- fsfree(alts);
+ FSfree(alts);
return FSBadAlloc;
}