ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/malloc.c
(Generate patch)

Comparing ray/src/common/malloc.c (file contents):
Revision 2.15 by greg, Tue May 13 17:58:32 2003 UTC vs.
Revision 2.16 by schorsch, Mon Jun 30 14:59:11 2003 UTC

# Line 22 | Line 22 | static const char      RCSid[] = "$Id$";
22   #include "copyright.h"
23  
24   #include  <errno.h>
25 + #include  <string.h>
26  
26 #ifndef  BSD
27 #define  bcopy(s,d,n)           (void)memcpy(d,s,n)
28 #define  bzero(d,n)             (void)memset(d,0,n)
29 #endif
27  
28   #ifdef MSTATS
29   #include  <stdio.h>
# Line 182 | Line 179 | unsigned       *np;
179                  cptab.ptr = big->ptr;
180                  cptab.siz = big->siz;
181                  big->siz = 0;                   /* clear and copy */
182 <                bcopy((char *)tab, (char *)(mtab(&cptab)+1),
182 >                memcpy((char *)(mtab(&cptab)+1), (char *)tab,
183                                  tablen*sizeof(struct mblk));
184 <                bzero((char *)(mtab(&cptab)+tablen+1),
184 >                memset((char *)(mtab(&cptab)+tablen+1), '\0',
185                          (mtablen(&cptab)-tablen-1)*sizeof(struct mblk));
186          }                       /* next round */
187   }
# Line 384 | Line 381 | unsigned       n;
381          if ((p = malloc(n)) == NULL)
382                  return(n<=on ? op : NULL);
383          if (on) {
384 <                bcopy(op, p, n>on ? on : n);
384 >                memcpy(p, op, n>on ? on : n);
385                  free(op);
386          }
387          return(p);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines