summarylogtreecommitdiffstats
path: root/sc-7.16-compilation.patch
blob: b2790d258406243b7374d9a358cd88b8d9882885 (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
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
diff -rauN sc-7.16/cmds.c sc-7.16-compilation-patch/cmds.c
--- sc-7.16/cmds.c	2025-05-15 21:14:09.808351237 +0200
+++ sc-7.16-compilation-patch/cmds.c	2025-05-15 21:15:19.275567109 +0200
@@ -1468,7 +1468,7 @@
 }
 
 void
-formatcol(arg)
+formatcol(int arg)
 {
     int c, i;
     int mf = modflg;
@@ -1603,7 +1603,7 @@
 }
 
 void
-ljustify(sr, sc, er, ec)
+ljustify(int sr, int sc, int er, int ec)
 {
     struct ent *p;
     int i, j;
@@ -1632,7 +1632,7 @@
 }
 
 void
-rjustify(sr, sc, er, ec)
+rjustify(int sr, int sc, int er, int ec)
 {
     struct ent *p;
     int i, j;
@@ -1661,7 +1661,7 @@
 }
 
 void
-center(sr, sc, er, ec)
+center(int sr, int sc, int er, int ec)
 {
     struct ent *p;
     int i, j;
@@ -3310,7 +3310,7 @@
 }
 
 void
-gotonote()
+gotonote(void)
 {
     register struct ent *p;
 
diff -rauN sc-7.16/format.c sc-7.16-compilation-patch/format.c
--- sc-7.16/format.c	2002-02-02 07:23:20.000000000 +0100
+++ sc-7.16-compilation-patch/format.c	2025-05-15 21:16:04.893119053 +0200
@@ -93,6 +93,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <time.h>
+#include <math.h>
 #include "sc.h"
 
 #define bool	int
@@ -501,7 +502,7 @@
 	"+03", "+06", "+09", "+12", "+15", "+18"
     };
     int engind = 0;
-    double engmant, pow(), engabs, engexp;
+    double engmant, engabs, engexp;
 
     if (buflen < width) return (false);
     if (fmt >= 0 && fmt < COLFORMATS && colformat[fmt])
diff -rauN sc-7.16/gram.y sc-7.16-compilation-patch/gram.y
--- sc-7.16/gram.y	2002-08-21 01:47:56.000000000 +0200
+++ sc-7.16-compilation-patch/gram.y	2025-05-15 21:15:19.275844944 +0200
@@ -28,6 +28,20 @@
 #endif
 
 #define ENULL (struct enode *)0
+
+void ljustify(int sr, int sc, int er, int ec);
+void rjustify(int sr, int sc, int er, int ec);
+void yankrow(int arg);
+void yankcol(int arg);
+void center(int sr, int sc, int er, int ec);
+void add_abbr(char *string);
+void getframe(int fd);
+void getrange(char *name, int fd);
+void doeval(struct enode *e, char *fmt, int row, int col, int fd);
+void doseval(struct enode *e, int row, int col, int fd);
+void dogetkey(void);
+extern int macrofd;
+
 %}
 
 %union {
@@ -968,7 +982,7 @@
 						macrofd); }
 	|	S_EVAL e STRING '|' NUMBER
 					{ doeval($2, $3, currow, curcol,
-						$3); }
+						macrofd); }
 	|	S_SEVAL e		{ doseval($2, currow, curcol, macrofd); }
 	|	S_QUERY STRING STRING	{ doquery($2, $3, macrofd); }
 	|	S_QUERY STRING STRING '|' NUMBER
diff -rauN sc-7.16/help.c sc-7.16-compilation-patch/help.c
--- sc-7.16/help.c	2025-05-15 21:14:09.809942099 +0200
+++ sc-7.16-compilation-patch/help.c	2025-05-15 21:15:19.275946714 +0200
@@ -7,6 +7,7 @@
 
 #ifdef QREF
 #include <stdio.h>
+#include <stdlib.h>
 char	*header = " Quick Reference";
 char	*revision = "$Revision: 7.16 $";
 #else
diff -rauN sc-7.16/interp.c sc-7.16-compilation-patch/interp.c
--- sc-7.16/interp.c	2025-05-15 21:14:09.809793327 +0200
+++ sc-7.16-compilation-patch/interp.c	2025-05-15 21:40:12.398558289 +0200
@@ -59,9 +59,9 @@
 #endif
 
 #ifdef SIGVOID
-    void doquit();
+    void doquit(int signum);
 #else
-    int doquit();
+    int doquit(int signum);
 #endif
 
 /* Use this structure to save the last 'g' command */
@@ -93,8 +93,8 @@
 
 double	dolookup(struct enode * val, int minr, int minc, int maxr,
 	int maxc, int offr, int offc);
-double	fn1_eval(double (*fn)(), double arg);
-double	fn2_eval(double (*fn)(), double arg1, double arg2);
+double	fn1_eval(double (*fn)(double), double arg);
+double	fn2_eval(double (*fn)(double, double), double arg1, double arg2);
 int	RealEvalAll();
 int	constant(register struct enode *e);
 void	RealEvalOne(register struct ent *p, int i, int j, int *chgct);
@@ -972,7 +972,8 @@
 #else
 int
 #endif
-eval_fpe() /* Trap for FPE errors in eval */
+
+eval_fpe(int signum) /* Trap for FPE errors in eval */
 {
 #if defined(i386) && !defined(M_XENIX)
     asm("	fnclex");
@@ -991,7 +992,7 @@
 }
 
 double
-fn1_eval(double (*fn)(), double arg)
+fn1_eval(double (*fn)(double), double arg)
 {
     double res;
     errno = 0;
@@ -1003,7 +1004,7 @@
 }
 
 double
-fn2_eval(double (*fn)(), double arg1, double arg2)
+fn2_eval(double (*fn)(double, double), double arg1, double arg2)
 {
     double res;
     errno = 0;
diff -rauN sc-7.16/lex.c sc-7.16-compilation-patch/lex.c
--- sc-7.16/lex.c	2025-05-15 21:14:09.809676516 +0200
+++ sc-7.16-compilation-patch/lex.c	2025-05-15 21:39:54.832519253 +0200
@@ -200,9 +200,9 @@
 	}
     } else if ((*p == '.') || isdigit(*p)) {
 #ifdef SIGVOID
-	void (*sig_save)();
+	void (*sig_save)(int signum);
 #else
-	int (*sig_save)();
+	int (*sig_save)(int signum);
 #endif
 	double v = 0.0;
 	int temp;
diff -rauN sc-7.16/pipe.c sc-7.16-compilation-patch/pipe.c
--- sc-7.16/pipe.c	2002-08-21 02:30:31.000000000 +0200
+++ sc-7.16-compilation-patch/pipe.c	2025-05-15 21:15:19.276017305 +0200
@@ -315,7 +315,7 @@
 }
 
 void
-dogetkey()
+dogetkey(void)
 {
     int c, len;
 
diff -rauN sc-7.16/sc.c sc-7.16-compilation-patch/sc.c
--- sc-7.16/sc.c	2025-05-15 21:14:09.809349745 +0200
+++ sc-7.16-compilation-patch/sc.c	2025-05-15 21:45:04.299189673 +0200
@@ -40,6 +40,14 @@
 #define	SAVENAME "SC.SAVE" /* file name to use for emergency saves */
 #endif /* SAVENAME */
 
+void list_frames(FILE *f);
+void yankrow(int arg);
+void yankcol(int arg);
+void ljustify(int sr, int sc, int er, int ec);
+void rjustify(int sr, int sc, int er, int ec);
+void center(int sr, int sc, int er, int ec);
+void gotonote(void);
+
 /* Globals defined in sc.h */
 
 struct ent ***tbl;
@@ -84,8 +92,8 @@
 int	wasforw	= FALSE;
 #endif
 
-void		update();
-void		repaint();
+void		update(int anychanged);
+void		repaint(int x, int y, int len, int attron, int attroff);
 extern void	doshell();
 extern void	gohome();
 extern void	leftlimit();
@@ -827,7 +835,7 @@
 			    break;
 			case 'c':
 			    showcell = (!showcell);
-			    repaint(lastmx, lastmy, fwidth[lastcol]);
+			    repaint(lastmx, lastmy, fwidth[lastcol], 0, A_STANDOUT);
 			    error("Cell highlighting %sabled.",
 				    showcell ? "en" : "dis");
 			    --modflg;	/* negate the modflg++ */
@@ -2110,20 +2118,20 @@
 signals()
 {
 #ifdef SIGVOID
-    void doquit();
-    void time_out();
-    void dump_me();
-    void nopipe();
+    void doquit(int signum);
+    void time_out(int signmum);
+    void dump_me(int signum);
+    void nopipe(int signum);
 #ifdef	SIGWINCH
-    void winchg();
+    void winchg(int signum);
 #endif
 #else
-    int doquit();
-    int time_out();
-    int dump_me();
-    int nopipe();
+    int doquit(int signum);
+    int time_out(int signum);
+    int dump_me(int signum);
+    int nopipe(int signum);
 #ifdef	SIGWINCH
-    int winchg();
+    int winchg(int signum);
 #endif
 #endif
 
@@ -2148,7 +2156,7 @@
 #else
 int
 #endif
-nopipe()
+nopipe(int signum)
 {
     brokenpipe = TRUE;
 }
@@ -2158,7 +2166,7 @@
 #else
 int
 #endif
-winchg()
+winchg(int signum)
 {
     stopdisp();
     startdisp();
@@ -2182,7 +2190,7 @@
 #else
 int
 #endif
-doquit()
+doquit(int signum)
 {
     if (usecurses) {
 	diesave();
@@ -2197,7 +2205,7 @@
 #else
 int
 #endif
-dump_me()
+dump_me(int signum)
 {
     if (usecurses)
 	diesave();
diff -rauN sc-7.16/vi.c sc-7.16-compilation-patch/vi.c
--- sc-7.16/vi.c	2025-05-15 21:14:09.808738081 +0200
+++ sc-7.16-compilation-patch/vi.c	2025-05-15 21:15:19.276274829 +0200
@@ -40,6 +40,8 @@
 void gototop();
 void gotobottom();
 
+void gotonote(void);
+
 #define istext(a) (isalnum(a) || ((a) == '_'))
 
 /*#define bool	int*/
@@ -1126,7 +1128,7 @@
 }
 
 static void
-change_case(arg)
+change_case(int arg)
 {
     if (linelim < 0) {
     	linelim = 0;
diff -rauN sc-7.16/xmalloc.c sc-7.16-compilation-patch/xmalloc.c
--- sc-7.16/xmalloc.c	2025-05-15 21:14:09.809507042 +0200
+++ sc-7.16-compilation-patch/xmalloc.c	2025-05-15 21:47:05.415425031 +0200
@@ -10,11 +10,11 @@
 /* extern char	*malloc();
 extern char	*realloc();
 extern void	free(); */
-void		fatal();
+void		fatal(char *str);
 
 #ifdef SYSV3
-extern void	free();
-extern void	exit();
+extern void	free(void *ptr);
+extern void	exit(int status);
 #endif
 
 #define	MAGIC	(double)1234567890.12344