summaryrefslogtreecommitdiff
path: root/editors/uemacs/patches/patch-src_line_c
blob: 32d0879963199da9739177f779a58e4005b89eb1 (plain)
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
$NetBSD: patch-src_line_c,v 1.1 2012/05/10 20:53:30 dholland Exp $

- don't use implicit int
- declare void functions void
- silence bogus initialization seen with gcc 4.1

--- src/line.c~	2012-05-10 19:25:36.000000000 +0000
+++ src/line.c
@@ -60,7 +60,7 @@ register int used;
  * might be in. Release the memory. The buffers are updated too; the magic
  * conditions described in the above comments don't hold here.
  */
-PASCAL NEAR lfree(lp)
+VOID PASCAL NEAR lfree(lp)
 register LINE	*lp;
 {
 	register BUFFER *bp;
@@ -129,7 +129,7 @@ register LINE	*lp;
  * displayed in more than 1 window we change EDIT t HARD. Set MODE if the
  * mode line needs to be updated (the "*" has to be set).
  */
-PASCAL NEAR lchange(flag)
+VOID PASCAL NEAR lchange(flag)
 register int	flag;
 {
 	register EWINDOW *wp;
@@ -158,7 +158,7 @@ register int	flag;
 	}
 }
 
-PASCAL NEAR insspace(f, n)	/* insert spaces forward into text */
+int PASCAL NEAR insspace(f, n)	/* insert spaces forward into text */
 
 int f, n;	/* default flag and numeric argument */
 
@@ -175,10 +175,10 @@ int f, n;	/* default flag and numeric ar
  */
 
 #if PROTO
-int PASCAL NEAR linstr(char *instr)
+int PASCAL NEAR linstr(CONST char *instr)
 #else
 int PASCAL NEAR linstr( instr)
-char *instr;
+CONST char *instr;
 #endif
 {
 	register int status;
@@ -220,9 +220,9 @@ char *instr;
  */
 
 #if	PROTO
-PASCAL NEAR linsert(int n, char c)
+int PASCAL NEAR linsert(int n, char c)
 #else
-PASCAL NEAR linsert(n, c)
+int PASCAL NEAR linsert(n, c)
 
 int	n;
 char	c;
@@ -341,9 +341,9 @@ char	c;
  */
 
 #if	PROTO
-PASCAL NEAR lowrite(char c)
+int PASCAL NEAR lowrite(char c)
 #else
-PASCAL NEAR lowrite(c)
+int PASCAL NEAR lowrite(c)
 
 char c;		/* character to overwrite on current position */
 #endif
@@ -470,7 +470,7 @@ should be put in the kill buffer.
 
 */
 
-PASCAL NEAR ldelete(n, kflag)
+int PASCAL NEAR ldelete(n, kflag)
 
 long n; 	/* # of chars to delete */
 int kflag;	/* put killed text in kill buffer flag */
@@ -728,7 +728,7 @@ char *rline;
 
 /* putctext:	replace the current line with the passed in text	*/
 
-PASCAL NEAR putctext(iline)
+int PASCAL NEAR putctext(iline)
 
 char *iline;	/* contents of new line */
 
@@ -1066,6 +1066,10 @@ int f,n;	/* prefix flag and argument */
 	LINE *curline;
 	KILL *kptr;		/* pointer into kill buffer */
 
+	/* required by gcc 4.1 */
+	curoff = 0;
+	curline = NULL;
+
 	if (curbp->b_mode&MDVIEW)	/* don't allow this command if	*/
 		return(rdonly());	/* we are in read only mode	*/
 	if (n < 0)