aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/Quarks.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/X11/Quarks.c')
-rw-r--r--nx-X11/lib/X11/Quarks.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/nx-X11/lib/X11/Quarks.c b/nx-X11/lib/X11/Quarks.c
index 9a7cb04d5..132ec6f67 100644
--- a/nx-X11/lib/X11/Quarks.c
+++ b/nx-X11/lib/X11/Quarks.c
@@ -186,15 +186,14 @@ ExpandQuarkTable(void)
newmask = (oldmask << 1) + 1;
else {
if (!stringTable) {
- stringTable = (XrmString **)Xmalloc(sizeof(XrmString *) *
- CHUNKPER);
+ stringTable = Xmalloc(sizeof(XrmString *) * CHUNKPER);
if (!stringTable)
return False;
stringTable[0] = (XrmString *)NULL;
}
#ifdef PERMQ
if (!permTable)
- permTable = (Bits **)Xmalloc(sizeof(Bits *) * CHUNKPER);
+ permTable = Xmalloc(sizeof(Bits *) * CHUNKPER);
if (!permTable)
return False;
#endif
@@ -206,10 +205,9 @@ ExpandQuarkTable(void)
#endif
newmask = 0x1ff;
}
- entries = (Entry *)Xmalloc(sizeof(Entry) * (newmask + 1));
+ entries = Xcalloc(newmask + 1, sizeof(Entry));
if (!entries)
return False;
- bzero((char *)entries, sizeof(Entry) * (newmask + 1));
quarkTable = entries;
quarkMask = newmask;
quarkRehash = quarkMask - 2;
@@ -232,7 +230,7 @@ ExpandQuarkTable(void)
}
}
if (oldmask)
- Xfree((char *)oldentries);
+ Xfree(oldentries);
return True;
}
@@ -290,13 +288,13 @@ nomatch: if (!rehash)
q = nextQuark;
if (!(q & QUANTUMMASK)) {
if (!(q & CHUNKMASK)) {
- if (!(new = Xrealloc((char *)stringTable,
+ if (!(new = Xrealloc(stringTable,
sizeof(XrmString *) *
((q >> QUANTUMSHIFT) + CHUNKPER))))
goto fail;
stringTable = (XrmString **)new;
#ifdef PERMQ
- if (!(new = Xrealloc((char *)permTable,
+ if (!(new = Xrealloc(permTable,
sizeof(Bits *) *
((q >> QUANTUMSHIFT) + CHUNKPER))))
goto fail;