summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2014-04-27 16:04:51 -0700
committerJohn Denker <jsd@av8n.com>2014-04-27 16:33:23 -0700
commit8e0679d9227c964d8df84bcb71054a4f14f72343 (patch)
treeee70210eb701bc604a1b6c577797c989f94fd0be
parent97f3e615e5d634ca0b762193c0e87017d41584fd (diff)
get rid of some warnings
-rw-r--r--alloc.c6
-rw-r--r--auto-int.c12
-rw-r--r--auto-int8.c12
-rw-r--r--auto-str.c14
-rw-r--r--exit.h6
-rw-r--r--qmail-pw2u.c1
-rw-r--r--qmail-qmtpd.c1
7 files changed, 31 insertions, 21 deletions
diff --git a/alloc.c b/alloc.c
index c661453..f890d84 100644
--- a/alloc.c
+++ b/alloc.c
@@ -1,6 +1,10 @@
#include "alloc.h"
#include "error.h"
-extern char *malloc();
+#ifndef __GNUC__
+ extern char *malloc();
+#else
+# include <stdlib.h>
+#endif
extern void free();
#define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
diff --git a/auto-int.c b/auto-int.c
index c138869..b3c307e 100644
--- a/auto-int.c
+++ b/auto-int.c
@@ -7,7 +7,7 @@
char buf1[256];
substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));
-void puts(s)
+void myputs(s)
char *s;
{
if (substdio_puts(&ss1,s) == -1) _exit(111);
@@ -30,11 +30,11 @@ char **argv;
scan_ulong(value,&num);
strnum[fmt_ulong(strnum,num)] = 0;
- puts("int ");
- puts(name);
- puts(" = ");
- puts(strnum);
- puts(";\n");
+ myputs("int ");
+ myputs(name);
+ myputs(" = ");
+ myputs(strnum);
+ myputs(";\n");
if (substdio_flush(&ss1) == -1) _exit(111);
_exit(0);
}
diff --git a/auto-int8.c b/auto-int8.c
index 091978f..77e7930 100644
--- a/auto-int8.c
+++ b/auto-int8.c
@@ -7,7 +7,7 @@
char buf1[256];
substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));
-void puts(s)
+void myputs(s)
char *s;
{
if (substdio_puts(&ss1,s) == -1) _exit(111);
@@ -30,11 +30,11 @@ char **argv;
scan_8long(value,&num);
strnum[fmt_ulong(strnum,num)] = 0;
- puts("int ");
- puts(name);
- puts(" = ");
- puts(strnum);
- puts(";\n");
+ myputs("int ");
+ myputs(name);
+ myputs(" = ");
+ myputs(strnum);
+ myputs(";\n");
if (substdio_flush(&ss1) == -1) _exit(111);
_exit(0);
}
diff --git a/auto-str.c b/auto-str.c
index acc3d60..b52d8b3 100644
--- a/auto-str.c
+++ b/auto-str.c
@@ -5,7 +5,7 @@
char buf1[256];
substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));
-void puts(s)
+void myputs(s)
char *s;
{
if (substdio_puts(&ss1,s) == -1) _exit(111);
@@ -25,20 +25,20 @@ char **argv;
value = argv[2];
if (!value) _exit(100);
- puts("char ");
- puts(name);
- puts("[] = \"\\\n");
+ myputs("char ");
+ myputs(name);
+ myputs("[] = \"\\\n");
while (ch = *value++) {
- puts("\\");
+ myputs("\\");
octal[3] = 0;
octal[2] = '0' + (ch & 7); ch >>= 3;
octal[1] = '0' + (ch & 7); ch >>= 3;
octal[0] = '0' + (ch & 7);
- puts(octal);
+ myputs(octal);
}
- puts("\\\n\";\n");
+ myputs("\\\n\";\n");
if (substdio_flush(&ss1) == -1) _exit(111);
_exit(0);
}
diff --git a/exit.h b/exit.h
index 39011c8..147392d 100644
--- a/exit.h
+++ b/exit.h
@@ -1,6 +1,10 @@
#ifndef EXIT_H
#define EXIT_H
-extern void _exit();
+#ifndef __GNUC__
+ extern void _exit();
+#else
+ extern void _exit(int);
+#endif /* __GNUC__ */
#endif
diff --git a/qmail-pw2u.c b/qmail-pw2u.c
index 4146067..f068ab1 100644
--- a/qmail-pw2u.c
+++ b/qmail-pw2u.c
@@ -16,6 +16,7 @@
#include "auto_break.h"
#include "auto_qmail.h"
#include "auto_usera.h"
+#include "exit.h"
void die_chdir()
{
diff --git a/qmail-qmtpd.c b/qmail-qmtpd.c
index df911a6..5848eec 100644
--- a/qmail-qmtpd.c
+++ b/qmail-qmtpd.c
@@ -11,6 +11,7 @@
#include "readwrite.h"
#include "control.h"
#include "received.h"
+#include "exit.h"
void badproto() { _exit(100); }
void resources() { _exit(111); }