Several changes for ANSI C
authorceriel <none@none>
Fri, 4 Dec 1992 09:36:54 +0000 (09:36 +0000)
committerceriel <none@none>
Fri, 4 Dec 1992 09:36:54 +0000 (09:36 +0000)
modules/src/alloc/Malloc.c
modules/src/alloc/No_Mem.c
modules/src/alloc/Realloc.c
modules/src/alloc/Salloc.c
modules/src/alloc/alloc.h
modules/src/alloc/botch.c
modules/src/alloc/clear.c
modules/src/alloc/st_alloc.c
modules/src/alloc/std_alloc.c

index 29951d0..156f117 100644 (file)
        char *Malloc(n)         : allocate n bytes
 */
 
+#if __STDC__
+#include <stdlib.h>
+#else
+extern char *malloc();
+#endif
 #include       "alloc.h"
 
 char *
index 3a0155b..c880881 100644 (file)
@@ -4,6 +4,7 @@
  * See the copyright notice in the ACK home directory, in the file "Copyright".
  */
 #include       <system.h>
+#include       "alloc.h"
 
 No_Mem()
 {
index 76e24d9..e40af1b 100644 (file)
        char *Realloc(ptr, n)   : reallocate buffer to n bytes
 */
 
+#if __STDC__
+#include <stdlib.h>
+#else
+extern char *malloc();
+extern char *realloc();
+#endif
+
 #include       "alloc.h"
 
 char *
index 4d16045..ba7f074 100644 (file)
                                        str
 */
 
+#if __STDC__
+#include <stdlib.h>
+#else
+extern char *malloc();
+#endif
+
 #include       "alloc.h"
 
 char *
index 966aaf8..82783a2 100644 (file)
                char *Srealloc(str, n)  same as Realloc.
 */
 
-extern char *Salloc(), *Malloc(), *Srealloc(), *Realloc();
 #if __STDC__
-extern void *malloc(), *realloc();
+char *Malloc(unsigned int);
+char *Salloc(char *, unsigned int);
+char *Srealloc(char *, unsigned int);
+char *Realloc(char *, unsigned int);
+char *st_alloc(char **, unsigned int, int);
+char *std_alloc(char **, unsigned int, int, int *);
+int No_Mem(void);
+void clear(char *, unsigned int);
+void botch(char *, unsigned int);
 #else
-extern char *malloc(), *realloc();
+extern char    *Salloc(), *Malloc(), *Srealloc(), *Realloc();
+extern char    *st_alloc(), *std_alloc();
 #endif
 
 /*     S T R U C T U R E - S T O R A G E  D E F I N I T I O N S        */
@@ -30,7 +38,6 @@ typedef struct _ALLOC_ {
        struct _ALLOC_ *_A_next;
 } *_PALLOC_;
 
-extern char    *st_alloc();
 
 #define        _A_st_free(ptr, phead, size)    (((_PALLOC_)ptr)->_A_next = \
                                                (_PALLOC_)(*phead), \
index 410da93..cc58808 100644 (file)
@@ -7,6 +7,11 @@
                to check if freed memory is used inappopriately.
 */
 
+#include "alloc.h"
+
+#if __STDC__
+void
+#endif
 botch(ptr, n)
        register char *ptr;
        register unsigned int n;
index 996af53..36ebcad 100644 (file)
@@ -6,7 +6,13 @@
 /*     clear - clear a block of memory, and try to do it fast.
 */
 
+#include "alloc.h"
+
 /* instead of Calloc: */
+
+#if __STDC__
+void
+#endif
 clear(ptr, n)
        register char *ptr;
        register unsigned int n;
index ad469df..404d95c 100644 (file)
@@ -8,6 +8,12 @@
                The counterpart, st_free, is a macro, defined in alloc.h
 */
 
+#if __STDC__
+#include <stdlib.h>
+#else
+extern char *malloc();
+#endif
+
 #include       "alloc.h"
 
 char *
index ada36f2..5335cf0 100644 (file)
@@ -9,6 +9,12 @@
        This is a counting version of st_alloc.
 */
 
+#if __STDC__
+#include <stdlib.h>
+#else
+extern char *malloc();
+#endif
+
 #include       "alloc.h"
 
 char *