mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 21:43:40 +00:00
[common] remove all casts around malloc
This commit is contained in:
parent
81c38e825c
commit
2de9e3e9be
@ -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));
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user