diff --git a/common/src/option.c b/common/src/option.c index f89ae96d..2144e98b 100644 --- a/common/src/option.c +++ b/common/src/option.c @@ -125,7 +125,7 @@ bool option_register(struct Option options[]) for(int i = 0; options[i].type != OPTION_TYPE_NONE; ++i) { - state.options[state.oCount + i] = (struct Option *)malloc(sizeof(**state.options)); + state.options[state.oCount + i] = malloc(sizeof(**state.options)); struct Option * o = state.options[state.oCount + i]; memcpy(o, &options[i], sizeof(*o)); diff --git a/common/src/platform/linux/crash.c b/common/src/platform/linux/crash.c index 10c4b07f..9cb27f91 100644 --- a/common/src/platform/linux/crash.c +++ b/common/src/platform/linux/crash.c @@ -89,7 +89,7 @@ static bool load_symbols(void) } long storage = bfd_get_symtab_upper_bound(crash.fd); - crash.syms = (asymbol **)malloc(storage); + crash.syms = malloc(storage); crash.symCount = bfd_canonicalize_symtab(crash.fd, crash.syms); if (crash.symCount < 0) { diff --git a/common/src/platform/linux/event.c b/common/src/platform/linux/event.c index c593e281..da04d8ac 100644 --- a/common/src/platform/linux/event.c +++ b/common/src/platform/linux/event.c @@ -39,7 +39,7 @@ struct LGEvent LGEvent * lgCreateEvent(bool autoReset, unsigned int msSpinTime) { - LGEvent * handle = (LGEvent *)calloc(1, sizeof(*handle)); + LGEvent * handle = calloc(1, sizeof(*handle)); if (!handle) { DEBUG_ERROR("Failed to allocate memory"); diff --git a/common/src/platform/linux/ivshmem.c b/common/src/platform/linux/ivshmem.c index 92aef4f1..46d0634e 100644 --- a/common/src/platform/linux/ivshmem.c +++ b/common/src/platform/linux/ivshmem.c @@ -171,7 +171,7 @@ bool ivshmemOpenDev(struct IVSHMEM * dev, const char * shmDevice) return false; } - struct IVSHMEMInfo * info = (struct IVSHMEMInfo *)malloc(sizeof(*info)); + struct IVSHMEMInfo * info = malloc(sizeof(*info)); info->size = devSize; info->devFd = devFd; info->hasDMA = hasDMA; diff --git a/common/src/platform/linux/thread.c b/common/src/platform/linux/thread.c index 7e5ab24e..5c62e5a1 100644 --- a/common/src/platform/linux/thread.c +++ b/common/src/platform/linux/thread.c @@ -43,7 +43,7 @@ static void * threadWrapper(void * opaque) bool lgCreateThread(const char * name, LGThreadFunction function, void * opaque, LGThread ** handle) { - *handle = (LGThread*)malloc(sizeof(**handle)); + *handle = malloc(sizeof(**handle)); (*handle)->name = name; (*handle)->function = function; (*handle)->opaque = opaque; diff --git a/common/src/platform/windows/ivshmem.c b/common/src/platform/windows/ivshmem.c index 6b1015ce..de4aeb17 100644 --- a/common/src/platform/windows/ivshmem.c +++ b/common/src/platform/windows/ivshmem.c @@ -160,7 +160,7 @@ bool ivshmemInit(struct IVSHMEM * dev) return false; } - infData = (PSP_DEVICE_INTERFACE_DETAIL_DATA)calloc(1, reqSize); + infData = calloc(1, reqSize); infData->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA); if (!SetupDiGetDeviceInterfaceDetail(devInfoSet, &devInterfaceData, infData, reqSize, NULL, NULL)) { @@ -181,7 +181,7 @@ bool ivshmemInit(struct IVSHMEM * dev) free(infData); SetupDiDestroyDeviceInfoList(devInfoSet); - struct IVSHMEMInfo * info = (struct IVSHMEMInfo *)malloc(sizeof(*info)); + struct IVSHMEMInfo * info = malloc(sizeof(*info)); info->handle = handle; dev->opaque = info; diff --git a/common/src/platform/windows/thread.c b/common/src/platform/windows/thread.c index 462b4400..4cc30c7c 100644 --- a/common/src/platform/windows/thread.c +++ b/common/src/platform/windows/thread.c @@ -44,7 +44,7 @@ static DWORD WINAPI threadWrapper(LPVOID lpParameter) bool lgCreateThread(const char * name, LGThreadFunction function, void * opaque, LGThread ** handle) { - *handle = (LGThread *)malloc(sizeof(**handle)); + *handle = malloc(sizeof(**handle)); (*handle)->name = name; (*handle)->function = function; (*handle)->opaque = opaque;