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
|
$NetBSD: patch-ac,v 1.2 2011/10/02 23:12:06 dholland Exp $
- use <stdlib.h> instead of a custom malloc declaration
- avoid symbol conflict with gettext
- make copyright/rcsid strings external to avoid unused warnings
- use standard C
--- fpr/fpr.c.orig 1994-05-27 12:31:21.000000000 +0000
+++ fpr/fpr.c
@@ -35,15 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)fpr.c 8.1 (Berkeley) 6/6/93";
+char sccsid[] = "@(#)fpr.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
+#include <stdlib.h>
#include <stdio.h>
#define BLANK ' '
@@ -80,13 +81,15 @@ COLUMN *line;
int maxpos;
int maxcol;
-extern char *malloc();
-extern char *calloc();
-extern char *realloc();
-
+void init(void);
+void my_gettext(void);
+void savech(int col);
+void flush(void);
+void nospace(void);
-main()
+int
+main(void)
{
register int ch;
register char ateof;
@@ -124,7 +127,7 @@ main()
while ( ! ateof)
{
- gettext();
+ my_gettext();
ch = getchar();
if (ch == EOF)
{
@@ -176,7 +179,8 @@ main()
-init()
+void
+init(void)
{
register COLUMN *cp;
register COLUMN *cend;
@@ -209,8 +213,8 @@ init()
}
-
-gettext()
+void
+my_gettext(void)
{
register int i;
register char ateol;
@@ -283,8 +287,8 @@ gettext()
-savech(col)
-int col;
+void
+savech(int col)
{
register char ch;
register int oldmax;
@@ -340,7 +344,8 @@ int col;
-flush()
+void
+flush(void)
{
register int i;
register int anchor;
@@ -403,7 +408,8 @@ flush()
-nospace()
+void
+nospace(void)
{
fputs("Storage limit exceeded.\n", stderr);
exit(1);
|