From 4ecf749f7e43181e5cf2be22bc99c1e931d8402b Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 15 Aug 2021 18:56:42 -0400 Subject: [PATCH] [host] remove all casts around malloc --- host/platform/Linux/capture/XCB/src/xcb.c | 2 +- host/platform/Windows/capture/NVFBC/src/nvfbc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/host/platform/Linux/capture/XCB/src/xcb.c b/host/platform/Linux/capture/XCB/src/xcb.c index 2ccbfae0..046227e6 100644 --- a/host/platform/Linux/capture/XCB/src/xcb.c +++ b/host/platform/Linux/capture/XCB/src/xcb.c @@ -64,7 +64,7 @@ static const char * xcb_getName(void) static bool xcb_create(CaptureGetPointerBuffer getPointerBufferFn, CapturePostPointerBuffer postPointerBufferFn) { DEBUG_ASSERT(!this); - this = (struct xcb *)calloc(1, sizeof(*this)); + this = calloc(1, sizeof(*this)); this->shmID = -1; this->data = (void *)-1; this->frameEvent = lgCreateEvent(true, 20); diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index 2052a737..b0407b44 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -153,7 +153,7 @@ static bool nvfbc_create( if (!NvFBCInit()) return false; - this = (struct iface *)calloc(1, sizeof(*this)); + this = calloc(1, sizeof(*this)); this->seperateCursor = option_get_bool("nvfbc", "decoupleCursor"); this->getPointerBufferFn = getPointerBufferFn; @@ -176,7 +176,7 @@ static bool nvfbc_init(void) GetEnvironmentVariable("NVFBC_PRIV_DATA", buffer, bufferLen); privDataLen = (bufferLen - 1) / 2; - privData = (uint8_t *)malloc(privDataLen); + privData = malloc(privDataLen); char hex[3] = {0}; for (int i = 0; i < privDataLen; ++i) {