Revise method to cast variables for mem functions

This commit is contained in:
Mr-Dave
2024-07-24 19:25:25 -06:00
parent e3bcf5c4b5
commit 5b3bb97d0c
19 changed files with 197 additions and 236 deletions

View File

@@ -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)
{