1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
|
Author: Andreas Beckmann <anbe@debian.org>
Description: fix building with -Werror=implicit-function-declaration
--- 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 xputs(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");
+ xputs("char ");
+ xputs(name);
+ xputs("[] = \"\\\n");
while (ch = *value++) {
- puts("\\");
+ xputs("\\");
octal[3] = 0;
octal[2] = '0' + (ch & 7); ch >>= 3;
octal[1] = '0' + (ch & 7); ch >>= 3;
octal[0] = '0' + (ch & 7);
- puts(octal);
+ xputs(octal);
}
- puts("\\\n\";\n");
+ xputs("\\\n\";\n");
if (substdio_flush(&ss1) == -1) _exit(111);
_exit(0);
}
--- a/readwrite.h
+++ b/readwrite.h
@@ -1,7 +1,11 @@
#ifndef READWRITE_H
#define READWRITE_H
+#if 1
+#include <unistd.h>
+#else
extern int read();
extern int write();
+#endif
#endif
--- a/alloc.c
+++ b/alloc.c
@@ -1,7 +1,11 @@
#include "alloc.h"
#include "error.h"
+#if 1
+#include <stdlib.h>
+#else
extern char *malloc();
extern void free();
+#endif
#define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
#define SPACE 4096 /* must be multiple of ALIGNMENT */
--- a/cdb.h
+++ b/cdb.h
@@ -1,6 +1,7 @@
#ifndef CDB_H
#define CDB_H
+#include <unistd.h>
#include "uint32.h"
extern uint32 cdb_hash();
--- a/seek.h
+++ b/seek.h
@@ -1,6 +1,8 @@
#ifndef SEEK_H
#define SEEK_H
+#include <unistd.h>
+
typedef unsigned long seek_pos;
extern seek_pos seek_cur();
--- a/fd.h
+++ b/fd.h
@@ -1,6 +1,8 @@
#ifndef FD_H
#define FD_H
+#include <unistd.h>
+
extern int fd_copy();
extern int fd_move();
--- a/cdbmss.h
+++ b/cdbmss.h
@@ -13,4 +13,8 @@ struct cdbmss {
int fd;
} ;
+int cdbmss_start(struct cdbmss *c, int fd);
+int cdbmss_add(struct cdbmss *c, unsigned char *key, unsigned int keylen, unsigned char *data, unsigned int datalen);
+int cdbmss_finish(struct cdbmss *c);
+
#endif
--- a/newaliases.c
+++ b/newaliases.c
@@ -1,3 +1,5 @@
+#include <sys/stat.h>
+#include <stdio.h>
#include "substdio.h"
#include "strerr.h"
#include "stralloc.h"
@@ -9,6 +11,7 @@
#include "auto_qmail.h"
#include "case.h"
#include "cdbmss.h"
+#include "byte.h"
#define FATAL "newaliases: fatal: "
--- a/fastforward.c
+++ b/fastforward.c
@@ -18,6 +18,11 @@
#include "seek.h"
#include "wait.h"
#include "fork.h"
+#include "str.h"
+#include "byte.h"
+#include "slurpclose.h"
+#include "cdb.h"
+#include "open.h"
#define FATAL "fastforward: fatal: "
@@ -53,7 +58,7 @@ struct qmail qq;
char qp[FMT_ULONG];
char qqbuf[1];
-int qqwrite(fd,buf,len) int fd; char *buf; int len;
+ssize_t qqwrite(fd,buf,len) int fd; const void *buf; size_t len;
{
qmail_put(&qq,buf,len);
return len;
@@ -62,7 +67,7 @@ int qqwrite(fd,buf,len) int fd; char *bu
substdio ssqq = SUBSTDIO_FDBUF(qqwrite,-1,qqbuf,sizeof qqbuf);
char messbuf[4096];
-substdio ssmess = SUBSTDIO_FDBUF(read,0,messbuf,sizeof messbuf);
+substdio ssmess = SUBSTDIO_FDBUF((substdio_op)read,0,messbuf,sizeof messbuf);
int flagdeliver = 1;
int flagpassthrough = 0;
--- a/printmaillist.c
+++ b/printmaillist.c
@@ -1,8 +1,10 @@
+#include <unistd.h>
#include "substdio.h"
#include "subfd.h"
#include "strerr.h"
#include "stralloc.h"
#include "getln.h"
+#include "str.h"
#define FATAL "printmaillist: fatal: "
--- a/setforward.c
+++ b/setforward.c
@@ -1,3 +1,4 @@
+#include <stdio.h>
#include "substdio.h"
#include "subfd.h"
#include "strerr.h"
--- a/setmaillist.c
+++ b/setmaillist.c
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <sys/stat.h>
#include "substdio.h"
#include "subfd.h"
#include "strerr.h"
@@ -5,6 +7,7 @@
#include "getln.h"
#include "open.h"
#include "readwrite.h"
+#include "byte.h"
#define FATAL "setmaillist: fatal: "
--- a/newinclude.c
+++ b/newinclude.c
@@ -1,3 +1,5 @@
+#include <stdio.h>
+#include <sys/stat.h>
#include "substdio.h"
#include "strerr.h"
#include "stralloc.h"
@@ -8,6 +10,7 @@
#include "control.h"
#include "auto_qmail.h"
#include "env.h"
+#include "byte.h"
#define FATAL "newinclude: fatal: "
--- a/substdio.c
+++ b/substdio.c
@@ -2,7 +2,7 @@
void substdio_fdbuf(s,op,fd,buf,len)
register substdio *s;
-register int (*op)();
+register ssize_t (*op)(int, const void*, size_t);
register int fd;
register char *buf;
register int len;
--- a/substdio.h
+++ b/substdio.h
@@ -1,12 +1,16 @@
#ifndef SUBSTDIO_H
#define SUBSTDIO_H
+#include <sys/types.h>
+
+typedef ssize_t (*substdio_op)(int, const void *, size_t);
+
typedef struct substdio {
char *x;
int p;
int n;
int fd;
- int (*op)();
+ substdio_op op;
} substdio;
#define SUBSTDIO_FDBUF(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
--- a/subfdins.c
+++ b/subfdins.c
@@ -2,12 +2,12 @@
#include "substdio.h"
#include "subfd.h"
-int subfd_readsmall(fd,buf,len) int fd; char *buf; int len;
+ssize_t subfd_readsmall(fd,buf,len) int fd; void *buf; size_t len;
{
if (substdio_flush(subfdoutsmall) == -1) return -1;
return read(fd,buf,len);
}
char subfd_inbufsmall[256];
-static substdio it = SUBSTDIO_FDBUF(subfd_readsmall,0,subfd_inbufsmall,256);
+static substdio it = SUBSTDIO_FDBUF((substdio_op)subfd_readsmall,0,subfd_inbufsmall,256);
substdio *subfdinsmall = ⁢
--- a/subfd.h
+++ b/subfd.h
@@ -10,6 +10,6 @@ extern substdio *subfdoutsmall;
extern substdio *subfderr;
extern int subfd_read();
-extern int subfd_readsmall();
+extern ssize_t subfd_readsmall();
#endif
|