summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-20 10:39:35 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-08-20 10:39:35 -0700
commit14a44d0e3e6c3d9e757e2fdd143587efe532f1e9 (patch)
tree601ef03e2e52c5f5255100100140814ba416aaa0
parentafc015217221acd8667a96111b147f3a742a2c4e (diff)
downloadxorg-lib-libXtst-14a44d0e3e6c3d9e757e2fdd143587efe532f1e9.tar.gz
Remove obsolete casts from Xmalloc() and Xcalloc() calls
Not needed in C89 and later Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/XRecord.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/XRecord.c b/src/XRecord.c
index 9a655cb..6c9b54e 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -166,7 +166,7 @@ static XPointer alloc_mem_cache(void)
struct mem_cache_str *cache;
/* note that an error will go unnoticed */
- cache = (struct mem_cache_str *) Xmalloc(sizeof(struct mem_cache_str));
+ cache = Xmalloc(sizeof(struct mem_cache_str));
if (cache) {
cache->display_closed = False;
cache->inter_data = NULL;
@@ -317,7 +317,7 @@ XRecordCreateContext(Display *dpy, int datum_flags,
XRecordRange *
XRecordAllocRange(void)
{
- return (XRecordRange*)Xcalloc(1, sizeof(XRecordRange));
+ return Xcalloc(1, sizeof(XRecordRange));
}
Status
@@ -427,7 +427,7 @@ XRecordGetContext(Display *dpy, XRecordContext context,
}
count = rep.nClients;
- ret = (XRecordState*)Xmalloc(sizeof(XRecordState));
+ ret = Xmalloc(sizeof(XRecordState));
if (!ret) {
_XEatDataWords (dpy, rep.length);
UnlockDisplay(dpy);
@@ -558,10 +558,10 @@ static struct reply_buffer *alloc_reply_buffer(
/*
* nothing available; malloc a new struct
*/
- rbp = (struct reply_buffer *)Xmalloc(sizeof(struct reply_buffer));
+ rbp = Xmalloc(sizeof(struct reply_buffer));
if (!rbp)
return NULL;
- rbp->buf = (unsigned char *)Xmalloc(nbytes);
+ rbp->buf = Xmalloc(nbytes);
if (!rbp->buf) {
Xfree(rbp);
return NULL;
@@ -585,7 +585,7 @@ static XRecordInterceptData *alloc_inter_data(XExtDisplayInfo *info)
return &iq->data;
}
/* allocate a new one */
- iq = (struct intercept_queue *)Xmalloc(sizeof(struct intercept_queue));
+ iq = Xmalloc(sizeof(struct intercept_queue));
if (!iq)
return NULL;
iq->cache = cache;
@@ -1015,8 +1015,7 @@ XRecordEnableContextAsync(Display *dpy, XRecordContext context,
record_async_state *async_state;
XRecordCheckExtension (dpy, info, 0);
- async = (_XAsyncHandler *)Xmalloc(sizeof(_XAsyncHandler) +
- sizeof(record_async_state));
+ async = Xmalloc(sizeof(_XAsyncHandler) + sizeof(record_async_state));
if (!async)
return 0;
async_state = (record_async_state *)(async + 1);