mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-20 22:38:09 +00:00
[common] remove all casts around malloc
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user