Lines 1-5
Link Here
|
1 |
--- siod.h 2014-03-25 04:10:42.000000000 -0400 |
1 |
--- siod.h 2014-03-25 04:10:42.000000000 -0400 |
2 |
+++ siod.h 2021-02-22 11:41:33.795507000 -0500 |
2 |
+++ siod.h 2024-11-26 09:55:05.742339000 -0500 |
3 |
@@ -9,9 +9,11 @@ |
3 |
@@ -9,9 +9,11 @@ |
4 |
*/ |
4 |
*/ |
5 |
|
5 |
|
Lines 13-40
Link Here
|
13 |
- |
13 |
- |
14 |
struct obj |
14 |
struct obj |
15 |
{short gc_mark; |
15 |
{short gc_mark; |
16 |
@@ -20,5 +22,5 @@ |
16 |
@@ -20,26 +22,26 @@ |
17 |
struct obj * cdr;} cons; |
17 |
struct obj * cdr;} cons; |
18 |
struct {double data;} flonum; |
18 |
struct {double data;} flonum; |
19 |
- struct {char *pname; |
19 |
- struct {char *pname; |
20 |
+ struct {const char *pname; |
20 |
+ struct {const char *pname; |
21 |
struct obj * vcell;} symbol; |
21 |
struct obj * vcell;} symbol; |
22 |
struct {char *name; |
22 |
- struct {char *name; |
23 |
@@ -41,5 +43,5 @@ |
23 |
+ struct {const char *name; |
24 |
struct {char *name; |
24 |
struct obj * (*f)(void);} subr0; |
|
|
25 |
- struct {char *name; |
26 |
+ struct {const char *name; |
27 |
struct obj * (*f)(struct obj *);} subr1; |
28 |
- struct {char *name; |
29 |
+ struct {const char *name; |
30 |
struct obj * (*f)(struct obj *, struct obj *);} subr2; |
31 |
- struct {char *name; |
32 |
+ struct {const char *name; |
33 |
struct obj * (*f)(struct obj *, struct obj *, struct obj *); |
34 |
} subr3; |
35 |
- struct {char *name; |
36 |
+ struct {const char *name; |
37 |
struct obj * (*f)(struct obj *, struct obj *, struct obj *, |
38 |
struct obj *); |
39 |
} subr4; |
40 |
- struct {char *name; |
41 |
+ struct {const char *name; |
42 |
struct obj * (*f)(struct obj *, struct obj *, struct obj *, |
43 |
struct obj *,struct obj *); |
44 |
} subr5; |
45 |
- struct {char *name; |
46 |
+ struct {const char *name; |
25 |
struct obj * (*f)(struct obj **, struct obj **);} subrm; |
47 |
struct obj * (*f)(struct obj **, struct obj **);} subrm; |
26 |
- struct {char *name; |
48 |
- struct {char *name; |
27 |
+ struct {const char *name; |
49 |
+ struct {const char *name; |
28 |
struct obj * (*f)(void *,...);} subr; |
50 |
struct obj * (*f)(void *,...);} subr; |
29 |
struct {struct obj *env; |
51 |
struct {struct obj *env; |
30 |
@@ -151,5 +153,5 @@ |
52 |
@@ -125,5 +127,20 @@ |
|
|
53 |
|
54 |
typedef struct obj* LISP; |
55 |
-typedef LISP (*SUBR_FUNC)(void); |
56 |
+typedef LISP (*SUBR_FUNC0)(void); |
57 |
+typedef LISP (*SUBR_FUNC1)(LISP); |
58 |
+typedef LISP (*SUBR_FUNC2)(LISP, LISP); |
59 |
+typedef LISP (*SUBR_FUNC3)(LISP, LISP, LISP); |
60 |
+typedef LISP (*SUBR_FUNC4)(LISP, LISP, LISP, LISP); |
61 |
+typedef LISP (*SUBR_FUNC5)(LISP, LISP, LISP, LISP, LISP); |
62 |
+typedef LISP (*SUBR_FUNCm)(LISP *, LISP *); |
63 |
+typedef union { |
64 |
+ SUBR_FUNC0 subr0; |
65 |
+ SUBR_FUNC1 subr1; |
66 |
+ SUBR_FUNC2 subr2; |
67 |
+ SUBR_FUNC3 subr3; |
68 |
+ SUBR_FUNC4 subr4; |
69 |
+ SUBR_FUNC5 subr5; |
70 |
+ SUBR_FUNCm subrm; |
71 |
+} SUBR_FUNC; |
72 |
|
73 |
#define CONSP(x) TYPEP(x,tc_cons) |
74 |
@@ -151,5 +168,5 @@ |
31 |
struct gen_printio |
75 |
struct gen_printio |
32 |
{int (*putc_fcn)(int,void *); |
76 |
{int (*putc_fcn)(int,void *); |
33 |
- int (*puts_fcn)(char *,void *); |
77 |
- int (*puts_fcn)(char *,void *); |
34 |
+ int (*puts_fcn)(const char *, void *); |
78 |
+ int (*puts_fcn)(const char *, void *); |
35 |
void *cb_argument;}; |
79 |
void *cb_argument;}; |
36 |
|
80 |
|
37 |
@@ -160,10 +162,10 @@ |
81 |
@@ -160,10 +177,10 @@ |
38 |
|
82 |
|
39 |
struct repl_hooks |
83 |
struct repl_hooks |
40 |
-{void (*repl_puts)(char *); |
84 |
-{void (*repl_puts)(char *); |
Lines 47-53
Link Here
|
47 |
+void __stdcall process_cla(int argc, const char **argv, int warnflag); |
91 |
+void __stdcall process_cla(int argc, const char **argv, int warnflag); |
48 |
void __stdcall print_welcome(void); |
92 |
void __stdcall print_welcome(void); |
49 |
void __stdcall print_hs_1(void); |
93 |
void __stdcall print_hs_1(void); |
50 |
@@ -172,6 +174,6 @@ |
94 |
@@ -172,6 +189,6 @@ |
51 |
LISP get_eof_val(void); |
95 |
LISP get_eof_val(void); |
52 |
long repl_driver(long want_sigint,long want_init,struct repl_hooks *); |
96 |
long repl_driver(long want_sigint,long want_init,struct repl_hooks *); |
53 |
-void set_stdout_hooks(void (*puts_f)(char *)); |
97 |
-void set_stdout_hooks(void (*puts_f)(char *)); |
Lines 56-62
Link Here
|
56 |
+void set_repl_hooks(void (*puts_f)(const char *), |
100 |
+void set_repl_hooks(void (*puts_f)(const char *), |
57 |
LISP (*read_f)(void), |
101 |
LISP (*read_f)(void), |
58 |
LISP (*eval_f)(LISP), |
102 |
LISP (*eval_f)(LISP), |
59 |
@@ -180,7 +182,8 @@ |
103 |
@@ -180,7 +197,8 @@ |
60 |
LISP err(const char *message, LISP x); |
104 |
LISP err(const char *message, LISP x); |
61 |
LISP errswitch(void); |
105 |
LISP errswitch(void); |
62 |
-char *get_c_string(LISP x); |
106 |
-char *get_c_string(LISP x); |
Lines 68-74
Link Here
|
68 |
+const char *try_get_c_string(LISP x); |
112 |
+const char *try_get_c_string(LISP x); |
69 |
long get_c_long(LISP x); |
113 |
long get_c_long(LISP x); |
70 |
double get_c_double(LISP x); |
114 |
double get_c_double(LISP x); |
71 |
@@ -204,30 +207,30 @@ |
115 |
@@ -204,30 +222,30 @@ |
72 |
LISP eq(LISP x,LISP y); |
116 |
LISP eq(LISP x,LISP y); |
73 |
LISP eql(LISP x,LISP y); |
117 |
LISP eql(LISP x,LISP y); |
74 |
-LISP symcons(char *pname,LISP vcell); |
118 |
-LISP symcons(char *pname,LISP vcell); |
Lines 115-128
Link Here
|
115 |
+void init_msubr(const char *name, LISP (*fcn)(LISP *, LISP *)); |
159 |
+void init_msubr(const char *name, LISP (*fcn)(LISP *, LISP *)); |
116 |
|
160 |
|
117 |
LISP assq(LISP x,LISP alist); |
161 |
LISP assq(LISP x,LISP alist); |
118 |
@@ -256,5 +259,5 @@ |
162 |
@@ -256,5 +274,5 @@ |
119 |
LISP (*fcn2)(char *,long, int *)); |
163 |
LISP (*fcn2)(char *,long, int *)); |
120 |
LISP apropos(LISP); |
164 |
LISP apropos(LISP); |
121 |
-LISP vload(char *fname,long cflag,long rflag); |
165 |
-LISP vload(char *fname,long cflag,long rflag); |
122 |
+LISP vload(const char *fname, long cflag, long rflag); |
166 |
+LISP vload(const char *fname, long cflag, long rflag); |
123 |
LISP load(LISP fname,LISP cflag,LISP rflag); |
167 |
LISP load(LISP fname,LISP cflag,LISP rflag); |
124 |
LISP require(LISP fname); |
168 |
LISP require(LISP fname); |
125 |
@@ -293,5 +296,6 @@ |
169 |
@@ -293,5 +311,6 @@ |
126 |
void __stdcall init_trace(void); |
170 |
void __stdcall init_trace(void); |
127 |
long __stdcall repl_c_string(char *,long want_sigint,long want_init,long want_print); |
171 |
long __stdcall repl_c_string(char *,long want_sigint,long want_init,long want_print); |
128 |
-char * __stdcall siod_version(void); |
172 |
-char * __stdcall siod_version(void); |
Lines 130-136
Link Here
|
130 |
+const char * __stdcall siod_version(void); |
174 |
+const char * __stdcall siod_version(void); |
131 |
LISP nreverse(LISP); |
175 |
LISP nreverse(LISP); |
132 |
LISP number2string(LISP,LISP,LISP,LISP); |
176 |
LISP number2string(LISP,LISP,LISP,LISP); |
133 |
@@ -316,8 +320,8 @@ |
177 |
@@ -316,8 +335,8 @@ |
134 |
LISP lapply(LISP fcn,LISP args); |
178 |
LISP lapply(LISP fcn,LISP args); |
135 |
LISP mallocl(void *lplace,long size); |
179 |
LISP mallocl(void *lplace,long size); |
136 |
-void gput_st(struct gen_printio *,char *); |
180 |
-void gput_st(struct gen_printio *,char *); |
Lines 142-175
Link Here
|
142 |
+void *must_malloc(unsigned long size); |
186 |
+void *must_malloc(unsigned long size); |
143 |
LISP lstrbreakup(LISP str,LISP lmarker); |
187 |
LISP lstrbreakup(LISP str,LISP lmarker); |
144 |
LISP lstrunbreakup(LISP elems,LISP lmarker); |
188 |
LISP lstrunbreakup(LISP elems,LISP lmarker); |
145 |
@@ -337,6 +341,4 @@ |
189 |
@@ -337,6 +356,4 @@ |
146 |
size_t safe_strlen(const char *s,size_t size); |
190 |
size_t safe_strlen(const char *s,size_t size); |
147 |
LISP memq(LISP x,LISP il); |
191 |
LISP memq(LISP x,LISP il); |
148 |
-LISP lstrbreakup(LISP,LISP); |
192 |
-LISP lstrbreakup(LISP,LISP); |
149 |
-LISP lstrbreakup(LISP,LISP); |
193 |
-LISP lstrbreakup(LISP,LISP); |
150 |
LISP nth(LISP,LISP); |
194 |
LISP nth(LISP,LISP); |
151 |
LISP butlast(LISP); |
195 |
LISP butlast(LISP); |
152 |
@@ -356,5 +358,5 @@ |
196 |
@@ -356,5 +373,5 @@ |
153 |
|
197 |
|
154 |
|
198 |
|
155 |
-LISP symalist(char *item,...); |
199 |
-LISP symalist(char *item,...); |
156 |
+LISP symalist(const char *item, ...); |
200 |
+LISP symalist(const char *item, ...); |
157 |
|
201 |
|
158 |
LISP encode_st_mode(LISP l); |
202 |
LISP encode_st_mode(LISP l); |
159 |
@@ -363,5 +365,5 @@ |
203 |
@@ -363,5 +380,5 @@ |
160 |
int __stdcall siod_main(int argc,char **argv, char **env); |
204 |
int __stdcall siod_main(int argc,char **argv, char **env); |
161 |
void __stdcall siod_shuffle_args(int *pargc,char ***pargv); |
205 |
void __stdcall siod_shuffle_args(int *pargc,char ***pargv); |
162 |
-void __stdcall siod_init(int argc,char **argv); |
206 |
-void __stdcall siod_init(int argc,char **argv); |
163 |
+void __stdcall siod_init(int argc, const char **argv); |
207 |
+void __stdcall siod_init(int argc, const char **argv); |
164 |
|
208 |
|
165 |
#if defined(WIN32) && defined(_WINDOWS_) |
209 |
#if defined(WIN32) && defined(_WINDOWS_) |
166 |
@@ -374,3 +376,3 @@ |
210 |
@@ -374,3 +391,3 @@ |
167 |
#endif |
211 |
#endif |
168 |
|
212 |
|
169 |
- |
213 |
- |
170 |
+#endif |
214 |
+#endif |
171 |
--- siodp.h 2014-03-25 04:10:42.000000000 -0400 |
215 |
--- siodp.h 2014-03-25 04:10:42.000000000 -0400 |
172 |
+++ siodp.h 2021-02-22 11:50:39.297014000 -0500 |
216 |
+++ siodp.h 2024-11-26 10:06:20.562343000 -0500 |
173 |
@@ -12,4 +12,6 @@ |
217 |
@@ -12,4 +12,6 @@ |
174 |
*/ |
218 |
*/ |
175 |
|
219 |
|
Lines 227-233
Link Here
|
227 |
+int flush_ws(struct gen_readio *f, const char *eoferr); |
271 |
+int flush_ws(struct gen_readio *f, const char *eoferr); |
228 |
int f_getc(FILE *f); |
272 |
int f_getc(FILE *f); |
229 |
void f_ungetc(int c, FILE *f); |
273 |
void f_ungetc(int c, FILE *f); |
230 |
@@ -164,6 +164,6 @@ |
274 |
@@ -155,6 +155,4 @@ |
|
|
275 |
long array_sxhash(LISP,long); |
276 |
|
277 |
-int rfs_getc(unsigned char **p); |
278 |
-void rfs_ungetc(unsigned char c,unsigned char **p); |
279 |
void err1_aset1(LISP i); |
280 |
void err2_aset1(LISP v); |
281 |
@@ -164,6 +162,6 @@ |
231 |
void file_gc_free(LISP ptr); |
282 |
void file_gc_free(LISP ptr); |
232 |
void file_prin1(LISP ptr,struct gen_printio *f); |
283 |
void file_prin1(LISP ptr,struct gen_printio *f); |
233 |
-LISP fopen_c(char *name,char *how); |
284 |
-LISP fopen_c(char *name,char *how); |
Lines 236-248
Link Here
|
236 |
+LISP fopen_cg(FILE *(*)(const char *, const char *), const char *, const char *); |
287 |
+LISP fopen_cg(FILE *(*)(const char *, const char *), const char *, const char *); |
237 |
LISP fopen_l(LISP name,LISP how); |
288 |
LISP fopen_l(LISP name,LISP how); |
238 |
LISP fclose_l(LISP p); |
289 |
LISP fclose_l(LISP p); |
239 |
@@ -206,3 +206,3 @@ |
290 |
@@ -206,3 +204,3 @@ |
240 |
|
291 |
|
241 |
#define VLOAD_OFFSET_HACK_CHAR '|' |
292 |
#define VLOAD_OFFSET_HACK_CHAR '|' |
242 |
- |
293 |
- |
243 |
+#endif |
294 |
+#endif |
244 |
--- slib.c 2014-03-25 04:40:18.000000000 -0400 |
295 |
--- slib.c 2014-03-25 04:40:18.000000000 -0400 |
245 |
+++ slib.c 2021-02-22 11:46:46.903090000 -0500 |
296 |
+++ slib.c 2024-11-26 09:53:15.451978000 -0500 |
246 |
@@ -77,8 +77,12 @@ |
297 |
@@ -77,8 +77,12 @@ |
247 |
#include <errno.h> |
298 |
#include <errno.h> |
248 |
|
299 |
|
Lines 362-368
Link Here
|
362 |
|
413 |
|
363 |
char *stack_limit_ptr = NULL; |
414 |
char *stack_limit_ptr = NULL; |
364 |
-long stack_size = |
415 |
-long stack_size = |
365 |
+static long stack_size = |
416 |
+static long stack_size = |
366 |
#ifdef THINK_C |
417 |
#ifdef THINK_C |
367 |
10000; |
418 |
10000; |
368 |
@@ -159,5 +163,5 @@ |
419 |
@@ -159,5 +163,5 @@ |
Lines 692-704
Link Here
|
692 |
+LISP rintern(const char *name) |
743 |
+LISP rintern(const char *name) |
693 |
{return(gen_intern(name,1));} |
744 |
{return(gen_intern(name,1));} |
694 |
|
745 |
|
695 |
@@ -969,5 +997,5 @@ |
746 |
@@ -969,9 +997,9 @@ |
696 |
{return(rintern(get_c_string(name)));} |
747 |
{return(rintern(get_c_string(name)));} |
697 |
|
748 |
|
698 |
-LISP subrcons(long type, char *name, SUBR_FUNC f) |
749 |
-LISP subrcons(long type, char *name, SUBR_FUNC f) |
699 |
+LISP subrcons(long type, const char *name, SUBR_FUNC f) |
750 |
+LISP subrcons(long type, const char *name, SUBR_FUNC f) |
700 |
{LISP z; |
751 |
{LISP z; |
701 |
NEWCELL(z,type); |
752 |
NEWCELL(z,type); |
|
|
753 |
(*z).storage_as.subr.name = name; |
754 |
- (*z).storage_as.subr0.f = f; |
755 |
+ (*z).storage_as.subr0.f = f.subr0; |
756 |
return(z);} |
757 |
|
702 |
@@ -988,5 +1016,5 @@ |
758 |
@@ -988,5 +1016,5 @@ |
703 |
void gc_protect_n(LISP *location,long n) |
759 |
void gc_protect_n(LISP *location,long n) |
704 |
{struct gc_protected *reg; |
760 |
{struct gc_protected *reg; |
Lines 1075-1081
Link Here
|
1075 |
{return(leval(cintern("read"),NIL));} |
1131 |
{return(leval(cintern("read"),NIL));} |
1076 |
|
1132 |
|
1077 |
--- sliba.c 2014-03-25 04:10:42.000000000 -0400 |
1133 |
--- sliba.c 2014-03-25 04:10:42.000000000 -0400 |
1078 |
+++ sliba.c 2021-02-22 12:01:55.507489000 -0500 |
1134 |
+++ sliba.c 2024-11-26 10:14:19.038656000 -0500 |
1079 |
@@ -16,4 +16,8 @@ |
1135 |
@@ -16,4 +16,8 @@ |
1080 |
#include <math.h> |
1136 |
#include <math.h> |
1081 |
|
1137 |
|
Lines 1091-1101
Link Here
|
1091 |
+ /* FALLTHROUGH */ |
1147 |
+ /* FALLTHROUGH */ |
1092 |
case tc_byte_array: |
1148 |
case tc_byte_array: |
1093 |
sprintf(tkbuffer,"#%ld\"",ptr->storage_as.string.dim); |
1149 |
sprintf(tkbuffer,"#%ld\"",ptr->storage_as.string.dim); |
|
|
1150 |
@@ -177,5 +182,5 @@ |
1151 |
return(s);} |
1152 |
|
1153 |
-int rfs_getc(unsigned char **p) |
1154 |
+static int rfs_getc(unsigned char **p) |
1155 |
{int i; |
1156 |
i = **p; |
1094 |
@@ -184,9 +189,9 @@ |
1157 |
@@ -184,9 +189,9 @@ |
1095 |
return(i);} |
1158 |
return(i);} |
1096 |
|
1159 |
|
1097 |
-void rfs_ungetc(unsigned char c,unsigned char **p) |
1160 |
-void rfs_ungetc(unsigned char c,unsigned char **p) |
1098 |
+void rfs_ungetc(unsigned char c __unused, unsigned char **p) |
1161 |
+static void rfs_ungetc(int c __unused, unsigned char **p) |
1099 |
{*p = *p - 1;} |
1162 |
{*p = *p - 1;} |
1100 |
|
1163 |
|
1101 |
LISP read_from_string(LISP x) |
1164 |
LISP read_from_string(LISP x) |