aboutsummaryrefslogtreecommitdiff
path: root/pd/src/m_memory.c
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2004-09-06 20:20:36 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2004-09-06 20:20:36 +0000
commited932acb5860bf8b9296169676499562a55d139e (patch)
treedc6a40dba908deb07c175cd40ee19c197318f72d /pd/src/m_memory.c
parentdad636821f6e7d3ead02c157f308c0ceeba9af3d (diff)
checking in version 0.38test5.
Oops, I realize I forgot some more nice files, will add them and re-commit. svn path=/trunk/; revision=2010
Diffstat (limited to 'pd/src/m_memory.c')
-rw-r--r--pd/src/m_memory.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/pd/src/m_memory.c b/pd/src/m_memory.c
index bb5d79c6..f598e4f8 100644
--- a/pd/src/m_memory.c
+++ b/pd/src/m_memory.c
@@ -23,17 +23,17 @@ void *getbytes(size_t nbytes)
if (nbytes < 1) nbytes = 1;
ret = (void *)calloc(nbytes, 1);
#ifdef LOUD
- fprintf(stderr, "new %x %d\n", (int)ret, nbytes);
+ fprintf(stderr, "new %lx %d\n", (int)ret, nbytes);
#endif /* LOUD */
#ifdef DEBUGMEM
totalmem += nbytes;
#endif
if (!ret)
- post("pd: getbytes() failed -- out of memory");
+ post("pd: getbytes() failed -- out of memory");
return (ret);
}
-void *getzbytes(size_t nbytes) /* obsolete name */
+void *getzbytes(size_t nbytes) /* obsolete name */
{
return (getbytes(nbytes));
}
@@ -43,7 +43,7 @@ void *copybytes(void *src, size_t nbytes)
void *ret;
ret = getbytes(nbytes);
if (nbytes)
- memcpy(ret, src, nbytes);
+ memcpy(ret, src, nbytes);
return (ret);
}
@@ -54,24 +54,24 @@ void *resizebytes(void *old, size_t oldsize, size_t newsize)
if (oldsize < 1) oldsize = 1;
ret = (void *)realloc((char *)old, newsize);
if (newsize > oldsize && ret)
- memset(((char *)ret) + oldsize, 0, newsize - oldsize);
+ memset(((char *)ret) + oldsize, 0, newsize - oldsize);
#ifdef LOUD
- fprintf(stderr, "resize %x %d --> %x %d\n", (int)old, oldsize, (int)ret, newsize);
+ fprintf(stderr, "resize %lx %d --> %lx %d\n", (int)old, oldsize, (int)ret, newsize);
#endif /* LOUD */
#ifdef DEBUGMEM
totalmem += (newsize - oldsize);
#endif
if (!ret)
- post("pd: resizebytes() failed -- out of memory");
+ post("pd: resizebytes() failed -- out of memory");
return (ret);
}
void freebytes(void *fatso, size_t nbytes)
{
if (nbytes == 0)
- nbytes = 1;
+ nbytes = 1;
#ifdef LOUD
- fprintf(stderr, "free %x %d\n", (int)fatso, nbytes);
+ fprintf(stderr, "free %lx %d\n", (int)fatso, nbytes);
#endif /* LOUD */
#ifdef DEBUGMEM
totalmem -= nbytes;