File: missing-prototypes.patch

package info (click to toggle)
dot-forward 1%3A0.71-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 784 kB
  • sloc: ansic: 4,981; makefile: 321; sh: 153
file content (146 lines) | stat: -rw-r--r-- 2,868 bytes parent folder | download
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
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/dot-forward.c
+++ b/dot-forward.c
@@ -16,6 +16,9 @@
 #include "control.h"
 #include "qmail.h"
 #include "auto_qmail.h"
+#include "case.h"
+#include "fd.h"
+#include "sig.h"
 
 #define FATAL "dot-forward: fatal: "
 #define INFO "dot-forward: info: "
@@ -302,8 +305,8 @@ unsigned long qp;
 char *qqx;
 char strnum[FMT_ULONG];
 
-int mywrite(fd,buf,len)
-int fd; char *buf; int len;
+ssize_t mywrite(fd,buf,len)
+int fd; char *buf; size_t len;
 {
   qmail_put(&qq,buf,len);
   return len;
--- a/seek_set.c
+++ b/seek_set.c
@@ -1,4 +1,5 @@
 #include <sys/types.h>
+#include <unistd.h>
 #include "seek.h"
 
 #define SET 0 /* sigh */
--- a/fd_copy.c
+++ b/fd_copy.c
@@ -1,4 +1,5 @@
 #include <fcntl.h>
+#include <unistd.h>
 #include "fd.h"
 
 int fd_copy(to,from)
--- a/fd_move.c
+++ b/fd_move.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
 #include "fd.h"
 
 int fd_move(to,from)
--- 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/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;