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
|
$NetBSD: patch-src_input_c,v 1.1 2012/05/10 20:53:30 dholland Exp $
- don't use implicit int
- silence gcc braces warning
- silence initialization warning seen with gcc 4.1
- fix signed/unsigned pointer conversions
--- src/input.c~ 2012-05-10 19:25:36.000000000 +0000
+++ src/input.c
@@ -59,7 +59,7 @@ extern struct passwd *getpwnam();
*/
#if !WINDOW_MSWIN /* for MS Windows, mlyesno is defined in mswsys.c */
-PASCAL NEAR mlyesno(prompt)
+int PASCAL NEAR mlyesno(prompt)
char *prompt;
@@ -106,7 +106,7 @@ char *prompt;
* return. Handle erase, kill, and abort keys.
*/
-PASCAL NEAR mlreply(prompt, buf, nbuf)
+int PASCAL NEAR mlreply(prompt, buf, nbuf)
char *prompt;
char *buf;
@@ -119,7 +119,7 @@ int nbuf;
/* ectoc: expanded character to character
collapse the CTRL and SPEC flags back into an ascii code */
-PASCAL NEAR ectoc(c)
+int PASCAL NEAR ectoc(c)
int c;
@@ -136,7 +136,7 @@ int c;
/* ctoec: character to extended character
pull out the CTRL and SPEC prefixes (if possible) */
-PASCAL NEAR ctoec(c)
+int PASCAL NEAR ctoec(c)
int c;
@@ -259,13 +259,14 @@ int maxlen; /* maximum length of input
cpos = 0;
/* if it exists, prompt the user for a buffer name */
- if (prompt)
+ if (prompt) {
if (type == CMP_COMMAND)
mlwrite("%s", prompt);
else if (defval)
mlwrite("%s[%s]: ", prompt, defval);
else
mlwrite("%s: ", prompt);
+ }
/* build a name string from the keyboard */
while (TRUE) {
@@ -737,6 +738,9 @@ int *cpos; /* ptr to position of next ch
char longestmatch[NSTRING]; /* temp buffer for longest match */
int longestlen; /* length of longest match (always > *cpos) */
+ /* required by gcc 4.1 */
+ longestlen = 0;
+
/* everything (or nothing) matches an empty string */
if (*cpos == 0)
return;
@@ -986,13 +990,14 @@ int PASCAL NEAR getcmd()
to specify the proper terminator. If the terminator is not
a return('\r'), return will echo as "<NL>"
*/
-int PASCAL NEAR getstring(buf, nbuf, eolchar)
+int PASCAL NEAR getstring(buf_c, nbuf, eolchar)
-unsigned char *buf;
+char *buf_c;
int nbuf;
int eolchar;
{
+ unsigned char *buf;
register int cpos; /* current character position in string */
register int c; /* current input character */
register int ec; /* extended current input character */
@@ -1000,6 +1005,8 @@ int eolchar;
char *kp; /* pointer into key_name */
char key_name[10]; /* name of a quoted key */
+ buf = (unsigned char *)buf_c;
+
cpos = 0;
quotef = FALSE;
@@ -1136,7 +1143,7 @@ int eolchar;
}
}
-PASCAL NEAR outstring(s) /* output a string of input characters */
+VOID PASCAL NEAR outstring(s) /* output a string of input characters */
char *s; /* string to output */
@@ -1146,7 +1153,7 @@ char *s; /* string to output */
mlout(*s++);
}
-PASCAL NEAR ostring(s) /* output a string of output characters */
+VOID PASCAL NEAR ostring(s) /* output a string of output characters */
char *s; /* string to output */
|