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

Comparing ray/src/common/ealloc.c (file contents):
Revision 2.4 by greg, Wed Apr 23 00:52:33 2003 UTC vs.
Revision 2.8 by schorsch, Fri Nov 14 17:22:06 2003 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11   #include  <stdio.h>
12   #include  <stdlib.h>
13  
14 + #include "rterror.h"
15  
16 < char *
17 < emalloc(n)                      /* return pointer to n uninitialized bytes */
17 < unsigned int  n;
16 > extern char *   /* return pointer to n uninitialized bytes */
17 > emalloc(unsigned int  n)
18   {
19          register char  *cp;
20          
# Line 26 | Line 26 | unsigned int  n;
26  
27          eputs("Out of memory in emalloc\n");
28          quit(1);
29 +        return NULL; /* pro forma return */
30   }
31  
32  
33 < char *
34 < ecalloc(ne, es)                 /* return pointer to initialized memory */
34 < register unsigned int  ne;
35 < unsigned int  es;
33 > extern char *                   /* return pointer to initialized memory */
34 > ecalloc(register unsigned int ne, unsigned int es)
35   {
36          register char  *cp;
37          
# Line 51 | Line 50 | unsigned int  es;
50   }
51  
52  
53 < char *
54 < erealloc(cp, n)                 /* reallocate cp to size n */
56 < register char  *cp;
57 < unsigned int  n;
53 > extern char *                   /* reallocate cp to size n */
54 > erealloc(register char  *cp, unsigned int  n)
55   {
56          if (n == 0) {
57                  if (cp != NULL)
# Line 72 | Line 69 | unsigned int  n;
69  
70          eputs("Out of memory in erealloc\n");
71          quit(1);
72 +        return NULL; /* pro forma return */
73   }
74  
75  
76 < void
77 < efree(cp)                       /* free memory allocated by above */
80 < char  *cp;
76 > extern void                     /* free memory allocated by above */
77 > efree(char  *cp)
78   {
79          free((void *)cp);
80   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines