From ed932acb5860bf8b9296169676499562a55d139e Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Mon, 6 Sep 2004 20:20:36 +0000 Subject: 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 --- pd/src/m_memory.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'pd/src/m_memory.c') 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; -- cgit v1.2.1