diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-03-07 23:46:05 -0800 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:27 +0200 |
commit | e15023b2ad2a5ca8742cbb93fe10cb38ab079831 (patch) | |
tree | ac6b9de01f8f71b15392cc5216e53220da288e75 /nx-X11/lib/X11/Xrm.c | |
parent | 47d0ea1ba5bdd53d5df2cd06ffb637c889cf5e03 (diff) | |
download | nx-libs-e15023b2ad2a5ca8742cbb93fe10cb38ab079831.tar.gz nx-libs-e15023b2ad2a5ca8742cbb93fe10cb38ab079831.tar.bz2 nx-libs-e15023b2ad2a5ca8742cbb93fe10cb38ab079831.zip |
Remove more unnecessary casts from Xmalloc/calloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/Xrm.c')
-rw-r--r-- | nx-X11/lib/X11/Xrm.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/nx-X11/lib/X11/Xrm.c b/nx-X11/lib/X11/Xrm.c index 2a3f4889b..e498e4e5a 100644 --- a/nx-X11/lib/X11/Xrm.c +++ b/nx-X11/lib/X11/Xrm.c @@ -494,7 +494,7 @@ static XrmDatabase NewDatabase(void) { register XrmDatabase db; - db = (XrmDatabase) Xmalloc(sizeof(XrmHashBucketRec)); + db = Xmalloc(sizeof(XrmHashBucketRec)); if (db) { _XCreateMutex(&db->linfo); db->table = (NTable)NULL; @@ -827,7 +827,7 @@ static void PutEntry( NTable *nprev, *firstpprev; #define NEWTABLE(q,i) \ - table = (NTable)Xmalloc(sizeof(LTableRec)); \ + table = Xmalloc(sizeof(LTableRec)); \ if (!table) \ return; \ table->name = q; \ @@ -840,7 +840,7 @@ static void PutEntry( nprev = NodeBuckets(table); \ } else { \ table->leaf = 1; \ - if (!(nprev = (NTable *)Xmalloc(sizeof(VEntry *)))) {\ + if (!(nprev = Xmalloc(sizeof(VEntry *)))) {\ Xfree(table); \ return; \ } \ @@ -954,9 +954,8 @@ static void PutEntry( prev = nprev; } /* now allocate the value entry */ - entry = (VEntry)Xmalloc(((type == XrmQString) ? - sizeof(VEntryRec) : sizeof(DEntryRec)) + - value->size); + entry = Xmalloc(((type == XrmQString) ? + sizeof(VEntryRec) : sizeof(DEntryRec)) + value->size); if (!entry) return; entry->name = q = *quarks; @@ -986,13 +985,12 @@ static void PutEntry( if (resourceQuarks) { unsigned char *prevQuarks = resourceQuarks; - resourceQuarks = (unsigned char *)Xrealloc((char *)resourceQuarks, - size); + resourceQuarks = Xrealloc(resourceQuarks, size); if (!resourceQuarks) { Xfree(prevQuarks); } } else - resourceQuarks = (unsigned char *)Xmalloc(size); + resourceQuarks = Xmalloc(size); if (resourceQuarks) { bzero((char *)&resourceQuarks[oldsize], size - oldsize); maxResourceQuark = (size << 3) - 1; @@ -1137,11 +1135,11 @@ static void GetDatabase( str_len = strlen (str); if (DEF_BUFF_SIZE > str_len) lhs = lhs_s; - else if ((lhs = (char*) Xmalloc (str_len)) == NULL) + else if ((lhs = Xmalloc (str_len)) == NULL) return; alloc_chars = DEF_BUFF_SIZE < str_len ? str_len : DEF_BUFF_SIZE; - if ((rhs = (char*) Xmalloc (alloc_chars)) == NULL) { + if ((rhs = Xmalloc (alloc_chars)) == NULL) { if (lhs != lhs_s) Xfree (lhs); return; } |