mirror of
https://github.com/Motion-Project/motion.git
synced 2026-06-12 07:44:34 -04:00
Revise method to cast variables for mem functions
This commit is contained in:
50
src/util.cpp
50
src/util.cpp
@@ -119,26 +119,6 @@ void myunquote(std::string &parm)
|
||||
|
||||
}
|
||||
|
||||
void mymemset(void *dst, int src, int sz)
|
||||
{
|
||||
memset(dst, src, (ulong)sz);
|
||||
}
|
||||
|
||||
void mymemset(void *dst, int src, ulong sz)
|
||||
{
|
||||
memset(dst, src, sz);
|
||||
}
|
||||
|
||||
void mymemcpy(void *dst, void *src, int sz)
|
||||
{
|
||||
memcpy(dst, src, (ulong)sz);
|
||||
}
|
||||
|
||||
void mymemcpy(void *dst, void *src, ulong sz)
|
||||
{
|
||||
memcpy(dst, src, sz);
|
||||
}
|
||||
|
||||
/* Free memory and set the pointer to NULL*/
|
||||
void myfree(void *ptr_addr) {
|
||||
void **ptr = (void **)ptr_addr;
|
||||
@@ -149,36 +129,6 @@ void myfree(void *ptr_addr) {
|
||||
}
|
||||
}
|
||||
|
||||
/** mymalloc */
|
||||
void *mymalloc(int nbytes)
|
||||
{
|
||||
void *dummy = calloc((size_t)nbytes, 1);
|
||||
|
||||
if (!dummy) {
|
||||
MOTPLS_LOG(EMG, TYPE_ALL, SHOW_ERRNO
|
||||
, _("Could not allocate %d bytes of memory!")
|
||||
, nbytes);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return dummy;
|
||||
}
|
||||
|
||||
/** mymalloc */
|
||||
void *mymalloc(uint nbytes)
|
||||
{
|
||||
void *dummy = calloc((size_t)nbytes, 1);
|
||||
|
||||
if (!dummy) {
|
||||
MOTPLS_LOG(EMG, TYPE_ALL, SHOW_ERRNO
|
||||
, _("Could not allocate %llu bytes of memory!")
|
||||
, (unsigned long long)nbytes);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return dummy;
|
||||
}
|
||||
|
||||
/** mymalloc */
|
||||
void *mymalloc(size_t nbytes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user