diff options
author | Jim Blandy <jimb@red-bean.com> | 1999-02-06 12:31:04 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1999-02-06 12:31:04 +0000 |
commit | 3eeba8d4f523f0c823a11484a36ac0100eed9be7 (patch) | |
tree | 6912007b7ae065edf41a667bc82ae24e6cf6a54f | |
parent | 3ec93c46a1dca6c0f80c33a1b190ac35417bd7d1 (diff) |
* chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),
eval.c (s_expression, s_test, s_body, s_bindings, s_variable,
s_clauses, s_formals): Variables now const.
* eval.c (promsmob): Now const.
* macros.c (macrosmob): Now const.
* smob.c (scm_newsmob): Smobfuns argument now points to const.
(freecell, flob, bigob): Now const.
* dynl.c (scm_make_argv_from_stringlist, scm_coerce_rostring),
error.c (scm_error, scm_syserror, scm_syserror_msg,
scm_num_overflow, scm_out_of_range, scm_wrong_type_arg,
scm_memory_error, scm_misc_error, scm_wta), macros.c
(scm_make_synt), feature.c (scm_add_feature), filesys.c
(scm_input_waiting_p), gc.c (scm_gc_start, scm_igc,
scm_must_malloc, scm_must_realloc), gsubr.c (scm_make_gsubr),
numbers.c (scm_num2dbl, scm_two_doubles, scm_num2long,
scm_num2long_long, scm_num2ulong),
options.c (scm_options), posix.c (scm_convert_exec_args,
environ_list_to_c), procs.c (scm_make_subr_opt, scm_make_subr),
ramap.c (scm_ramapc), read.c (scm_flush_ws), socket.c
(scm_sock_fd_to_port, scm_fill_sockaddr, scm_addr_vector), stime.c
(setzone, restorezone, bdtime2c), strop.c (scm_i_index),
strports.c (scm_mkstrport), symbols.c (scm_intern_obarray_soft,
scm_intern_obarray, scm_intern, scm_intern0,
scm_sysintern0_no_module_lookup, scm_sysintern, scm_sysintern0,
scm_symbol_value0), unif.c (scm_aind, scm_shap2ra): Argument
indicating calling subr, error message text, reason for error,
symbol name or feature name are now pointer to const.
* snarf.h (SCM_PROC, SCM_PROC1): String variables are now const.
* procs.c (scm_init_iprocs): iproc argument now points to const.
* pairs.c (cxrs): Now const.
* chars.h, error.h, feature.h, filesys.h, gc.h, gsubr.h, macros.h,
numbers.h, options.h, procs.h, ramap.h, read.h, smob.h,
strports.h, symbols.h, unif.h: Update variable declarations and
function prototypes for above changes.
* dynl.c, dynl-dld.c, dynl-dl.c, dynl-shl.c (sysdep_dynl_link,
sysdep_dynl_unlink, sysdep_dynl_func): Arguments FNAME, SUBR, and
SYMB now point to const.
42 files changed, 162 insertions, 154 deletions
diff --git a/libguile/dynl-dl.c b/libguile/dynl-dl.c index ee43db6eb..13401e23b 100644 --- a/libguile/dynl-dl.c +++ b/libguile/dynl-dl.c @@ -55,8 +55,8 @@ static void * sysdep_dynl_link (fname, subr) - char *fname; - char *subr; + const char *fname; + const char *subr; { void *handle = dlopen (fname, DLOPEN_MODE); if (NULL == handle) @@ -70,7 +70,7 @@ sysdep_dynl_link (fname, subr) static void sysdep_dynl_unlink (handle, subr) void *handle; - char *subr; + const char *subr; { if (dlclose (handle)) { @@ -81,9 +81,9 @@ sysdep_dynl_unlink (handle, subr) static void * sysdep_dynl_func (symb, handle, subr) - char *symb; + const char *symb; void *handle; - char *subr; + const char *subr; { void *fptr; char *err; diff --git a/libguile/dynl-dld.c b/libguile/dynl-dld.c index 17d975c83..eef786ffd 100644 --- a/libguile/dynl-dld.c +++ b/libguile/dynl-dld.c @@ -65,8 +65,8 @@ listundefs () static void * sysdep_dynl_link (fname, subr) - char *fname; - char *subr; + const char *fname; + const char *subr; { int status; @@ -82,7 +82,7 @@ sysdep_dynl_link (fname, subr) static void sysdep_dynl_unlink (handle, subr) void *handle; - char *subr; + const char *subr; { int status; @@ -96,9 +96,9 @@ sysdep_dynl_unlink (handle, subr) static void * sysdep_dynl_func (symb, handle, subr) - char *symb; + const char *symb; void *handle; - char *subr; + const char *subr; { void *func; diff --git a/libguile/dynl-shl.c b/libguile/dynl-shl.c index c6c4f97fe..385a8677c 100644 --- a/libguile/dynl-shl.c +++ b/libguile/dynl-shl.c @@ -51,8 +51,8 @@ static void * sysdep_dynl_link (fname, subr) - char *fname; - char *subr; + const char *fname; + const char *subr; { shl_t shl; @@ -71,7 +71,7 @@ sysdep_dynl_link (fname, subr) static void sysdep_dynl_unlink (handle, subr) void *handle; - char *subr; + const char *subr; { if (shl_unload ((shl_t) handle)) { @@ -82,9 +82,9 @@ sysdep_dynl_unlink (handle, subr) static void * sysdep_dynl_func (symb, handle, subr) - char *symb; + const char *symb; void *handle; - char *subr; + const char *subr; { int status, i; struct shl_symbol *sym; diff --git a/libguile/dynl.c b/libguile/dynl.c index 9cc8337ae..31d940449 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -75,13 +75,13 @@ maybe_drag_in_eprintf () This code probably belongs into strings.c */ static char **scm_make_argv_from_stringlist SCM_P ((SCM args, int *argcp, - char *subr, int argn)); + const char *subr, int argn)); static char ** scm_make_argv_from_stringlist (args, argcp, subr, argn) SCM args; int *argcp; - char *subr; + const char *subr; int argn; { char **argv; @@ -124,12 +124,12 @@ scm_must_free_argv(argv) /* Coerce an arbitrary readonly-string into a zero-terminated string. */ -static SCM scm_coerce_rostring SCM_P ((SCM rostr, char *subr, int argn)); +static SCM scm_coerce_rostring SCM_P ((SCM rostr, const char *subr, int argn)); static SCM scm_coerce_rostring (rostr, subr, argn) SCM rostr; - char *subr; + const char *subr; int argn; { SCM_ASSERT (SCM_NIMP (rostr) && SCM_ROSTRINGP (rostr), rostr, argn, subr); @@ -229,9 +229,10 @@ scm_clear_registered_modules () */ static void sysdep_dynl_init SCM_P ((void)); -static void *sysdep_dynl_link SCM_P ((char *filename, char *subr)); -static void sysdep_dynl_unlink SCM_P ((void *handle, char *subr)); -static void *sysdep_dynl_func SCM_P ((char *symbol, void *handle, char *subr)); +static void *sysdep_dynl_link SCM_P ((const char *filename, const char *subr)); +static void sysdep_dynl_unlink SCM_P ((void *handle, const char *subr)); +static void *sysdep_dynl_func SCM_P ((const char *symbol, void *handle, + const char *subr)); #ifdef HAVE_DLOPEN #include "dynl-dl.c" @@ -260,8 +261,8 @@ no_dynl_error (subr) static void * sysdep_dynl_link (filename, subr) - char *filename; - char *subr; + const char *filename; + const char *subr; { no_dynl_error (subr); return NULL; @@ -364,11 +365,11 @@ scm_dynamic_link (fname) return z; } -static struct dynl_obj *get_dynl_obj SCM_P ((SCM obj, char *subr, int argn)); +static struct dynl_obj *get_dynl_obj SCM_P ((SCM obj, const char *subr, int argn)); static struct dynl_obj * get_dynl_obj (dobj, subr, argn) SCM dobj; - char *subr; + const char *subr; int argn; { struct dynl_obj *d; diff --git a/libguile/error.c b/libguile/error.c index 18142599e..59d2af88b 100644 --- a/libguile/error.c +++ b/libguile/error.c @@ -64,8 +64,8 @@ extern int errno; void scm_error (key, subr, message, args, rest) SCM key; - char *subr; - char *message; + const char *subr; + const char *message; SCM args; SCM rest; { @@ -122,7 +122,7 @@ scm_strerror (SCM err) SCM_SYMBOL (scm_system_error_key, "system-error"); void scm_syserror (subr) - char *subr; + const char *subr; { scm_error (scm_system_error_key, subr, @@ -134,8 +134,8 @@ scm_syserror (subr) void scm_syserror_msg (subr, message, args, eno) - char *subr; - char *message; + const char *subr; + const char *message; SCM args; int eno; { @@ -148,7 +148,7 @@ scm_syserror_msg (subr, message, args, eno) void scm_sysmissing (subr) - char *subr; + const char *subr; { #ifdef ENOSYS scm_error (scm_system_error_key, @@ -168,7 +168,7 @@ scm_sysmissing (subr) SCM_SYMBOL (scm_num_overflow_key, "numerical-overflow"); void scm_num_overflow (subr) - char *subr; + const char *subr; { scm_error (scm_num_overflow_key, subr, @@ -180,7 +180,7 @@ scm_num_overflow (subr) SCM_SYMBOL (scm_out_of_range_key, "out-of-range"); void scm_out_of_range (subr, bad_value) - char *subr; + const char *subr; SCM bad_value; { scm_error (scm_out_of_range_key, @@ -205,7 +205,7 @@ scm_wrong_num_args (proc) SCM_SYMBOL (scm_arg_type_key, "wrong-type-arg"); void scm_wrong_type_arg (subr, pos, bad_value) - char *subr; + const char *subr; int pos; SCM bad_value; { @@ -221,7 +221,7 @@ scm_wrong_type_arg (subr, pos, bad_value) SCM_SYMBOL (scm_memory_alloc_key, "memory-allocation-error"); void scm_memory_error (subr) - char *subr; + const char *subr; { scm_error (scm_memory_alloc_key, subr, @@ -233,8 +233,8 @@ scm_memory_error (subr) SCM_SYMBOL (scm_misc_error_key, "misc-error"); void scm_misc_error (subr, message, args) - char *subr; - char *message; + const char *subr; + const char *message; SCM args; { scm_error (scm_misc_error_key, subr, message, args, SCM_BOOL_F); @@ -244,8 +244,8 @@ scm_misc_error (subr, message, args) SCM scm_wta (arg, pos, s_subr) SCM arg; - char *pos; - char *s_subr; + const char *pos; + const char *s_subr; { if (!s_subr || !*s_subr) s_subr = NULL; diff --git a/libguile/error.h b/libguile/error.h index 864ac78b1..6dfbbc230 100644 --- a/libguile/error.h +++ b/libguile/error.h @@ -59,24 +59,25 @@ extern int scm_ints_disabled; #define SCM_NORETURN #endif -extern void scm_error SCM_P ((SCM key, char *subr, char *message, +extern void scm_error SCM_P ((SCM key, const char *subr, const char *message, SCM args, SCM rest)) SCM_NORETURN; extern SCM scm_error_scm SCM_P ((SCM key, SCM subr, SCM message, SCM args, SCM rest)) SCM_NORETURN; extern SCM scm_strerror (SCM err); -extern void scm_syserror SCM_P ((char *subr)) SCM_NORETURN; -extern void scm_syserror_msg SCM_P ((char *subr, char *message, SCM args, - int eno)) SCM_NORETURN; -extern void scm_sysmissing SCM_P ((char *subr)) SCM_NORETURN; -extern void scm_num_overflow SCM_P ((char *subr)) SCM_NORETURN; -extern void scm_out_of_range SCM_P ((char *subr, SCM bad_value)) SCM_NORETURN; +extern void scm_syserror SCM_P ((const char *subr)) SCM_NORETURN; +extern void scm_syserror_msg SCM_P ((const char *subr, const char *message, + SCM args, int eno)) SCM_NORETURN; +extern void scm_sysmissing SCM_P ((const char *subr)) SCM_NORETURN; +extern void scm_num_overflow SCM_P ((const char *subr)) SCM_NORETURN; +extern void scm_out_of_range SCM_P ((const char *subr, SCM bad_value)) + SCM_NORETURN; extern void scm_wrong_num_args SCM_P ((SCM proc)) SCM_NORETURN; -extern void scm_wrong_type_arg SCM_P ((char *subr, int pos, SCM bad_value)) - SCM_NORETURN; -extern void scm_memory_error SCM_P ((char *subr)) SCM_NORETURN; -extern void scm_misc_error SCM_P ((char *subr, char *message, SCM args)) - SCM_NORETURN; -extern SCM scm_wta SCM_P ((SCM arg, char *pos, char *s_subr)); +extern void scm_wrong_type_arg SCM_P ((const char *subr, int pos, + SCM bad_value)) SCM_NORETURN; +extern void scm_memory_error SCM_P ((const char *subr)) SCM_NORETURN; +extern void scm_misc_error SCM_P ((const char *subr, const char *message, + SCM args)) SCM_NORETURN; +extern SCM scm_wta SCM_P ((SCM arg, const char *pos, const char *s_subr)); extern void scm_init_error SCM_P ((void)); #endif /* ERRORH */ diff --git a/libguile/eval.c b/libguile/eval.c index 04575e104..a83bab5b3 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -426,13 +426,13 @@ scm_eval_car (pair, env) * some memoized forms have different syntax */ -char scm_s_expression[] = "missing or extra expression"; -char scm_s_test[] = "bad test"; -char scm_s_body[] = "bad body"; -char scm_s_bindings[] = "bad bindings"; -char scm_s_variable[] = "bad variable"; -char scm_s_clauses[] = "bad or missing clauses"; -char scm_s_formals[] = "bad formals"; +const char scm_s_expression[] = "missing or extra expression"; +const char scm_s_test[] = "bad test"; +const char scm_s_body[] = "bad body"; +const char scm_s_bindings[] = "bad bindings"; +const char scm_s_variable[] = "bad variable"; +const char scm_s_clauses[] = "bad or missing clauses"; +const char scm_s_formals[] = "bad formals"; SCM scm_i_dot, scm_i_arrow, scm_i_else, scm_i_unquote, scm_i_uq_splicing, scm_i_apply; @@ -3318,7 +3318,7 @@ scm_eval_x (obj) scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var))); } -static scm_smobfuns promsmob = {scm_markcdr, scm_free0, prinprom}; +static const scm_smobfuns promsmob = {scm_markcdr, scm_free0, prinprom}; /* At this point, scm_deval and scm_dapply are generated. diff --git a/libguile/eval.h b/libguile/eval.h index 56cb7ec5d..223a7d81d 100644 --- a/libguile/eval.h +++ b/libguile/eval.h @@ -118,13 +118,13 @@ extern SCM scm_eval_options_interface SCM_P ((SCM setting)); #define SCM_EXTEND_ENV scm_acons -extern char scm_s_expression[]; -extern char scm_s_test[]; -extern char scm_s_body[]; -extern char scm_s_bindings[]; -extern char scm_s_variable[]; -extern char scm_s_clauses[]; -extern char scm_s_formals[]; +extern const char scm_s_expression[]; +extern const char scm_s_test[]; +extern const char scm_s_body[]; +extern const char scm_s_bindings[]; +extern const char scm_s_variable[]; +extern const char scm_s_clauses[]; +extern const char scm_s_formals[]; extern SCM scm_i_dot; extern SCM scm_i_quote; diff --git a/libguile/feature.c b/libguile/feature.c index 9ae06b2eb..3f9ffab74 100644 --- a/libguile/feature.c +++ b/libguile/feature.c @@ -57,7 +57,7 @@ static SCM *scm_loc_features; void scm_add_feature (str) - char* str; + const char* str; { *scm_loc_features = scm_cons (SCM_CAR (scm_intern (str, strlen (str))), *scm_loc_features); diff --git a/libguile/feature.h b/libguile/feature.h index 72c10f12e..5879945be 100644 --- a/libguile/feature.h +++ b/libguile/feature.h @@ -46,7 +46,7 @@ #include "libguile/__scm.h" -extern void scm_add_feature (char* str); +extern void scm_add_feature (const char* str); extern SCM scm_program_arguments (void); extern void scm_set_program_arguments (int argc, char **argv, char *first); extern SCM scm_make_hook (SCM n_args); diff --git a/libguile/filesys.c b/libguile/filesys.c index 941f22c94..7c565b078 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -1006,7 +1006,7 @@ scm_select (reads, writes, excepts, secs, usecs) int scm_input_waiting_p (f, caller) FILE *f; - char *caller; + const char *caller; { if (feof (f)) return 1; @@ -1038,7 +1038,7 @@ scm_input_waiting_p (f, caller) int scm_input_waiting_p (f, caller) FILE *f; - char *caller; + const char *caller; { /* Can we return an end-of-file character? */ if (feof (f)) diff --git a/libguile/filesys.h b/libguile/filesys.h index 2a662aed2..12f8a3b01 100644 --- a/libguile/filesys.h +++ b/libguile/filesys.h @@ -74,7 +74,7 @@ extern SCM scm_closedir SCM_P ((SCM port)); extern SCM scm_chdir SCM_P ((SCM str)); extern SCM scm_getcwd SCM_P ((void)); extern SCM scm_select SCM_P ((SCM reads, SCM writes, SCM excepts, SCM secs, SCM msecs)); -extern int scm_input_waiting_p SCM_P ((FILE *file, char *caller)); +extern int scm_input_waiting_p SCM_P ((FILE *file, const char *caller)); extern SCM scm_fcntl (SCM object, SCM cmd, SCM value); extern SCM scm_fsync (SCM object); extern SCM scm_symlink SCM_P ((SCM oldpath, SCM newpath)); diff --git a/libguile/gc.c b/libguile/gc.c index 46b4507ed..e2a09ccc9 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -369,7 +369,7 @@ scm_gc_stats () void scm_gc_start (what) - char *what; + const char *what; { scm_gc_rt = SCM_INUM (scm_get_internal_run_time ()); scm_gc_cells_collected = 0; @@ -437,7 +437,7 @@ scm_gc_for_newcell () void scm_igc (what) - char *what; + const char *what; { int j; @@ -1427,7 +1427,7 @@ scm_gc_sweep () char * scm_must_malloc (len, what) scm_sizet len; - char *what; + const char *what; { char *ptr; scm_sizet size = len; @@ -1470,7 +1470,7 @@ char * scm_must_realloc (char *where, scm_sizet olen, scm_sizet len, - char *what) + const char *what) { char *ptr; scm_sizet size = len; diff --git a/libguile/gc.h b/libguile/gc.h index 05be00bb7..cd1b1fba3 100644 --- a/libguile/gc.h +++ b/libguile/gc.h @@ -84,20 +84,20 @@ extern SCM scm_debug_newcell (void); extern SCM scm_object_addr (SCM obj); extern SCM scm_unhash_name (SCM name); extern SCM scm_gc_stats (void); -extern void scm_gc_start (char *what); +extern void scm_gc_start (const char *what); extern void scm_gc_end (void); extern SCM scm_gc (void); extern void scm_gc_for_alloc (int ncells, SCM * freelistp); extern SCM scm_gc_for_newcell (void); -extern void scm_igc (char *what); +extern void scm_igc (const char *what); extern void scm_gc_mark (SCM p); extern void scm_mark_locations (SCM_STACKITEM x[], scm_sizet n); extern int scm_cellp (SCM value); extern void scm_gc_sweep (void); -extern char * scm_must_malloc (scm_sizet len, char *what); +extern char * scm_must_malloc (scm_sizet len, const char *what); extern char * scm_must_realloc (char *where, scm_sizet olen, scm_sizet len, - char *what); + const char *what); extern void scm_done_malloc (long size); extern void scm_must_free (char *obj); extern void scm_remember (SCM * ptr); diff --git a/libguile/gsubr.c b/libguile/gsubr.c index 10f310a5e..38acf1626 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -63,7 +63,7 @@ SCM scm_f_gsubr_apply; SCM scm_make_gsubr(name, req, opt, rst, fcn) - char *name; + const char *name; int req; int opt; int rst; diff --git a/libguile/gsubr.h b/libguile/gsubr.h index 925bd2b31..09c3cd99b 100644 --- a/libguile/gsubr.h +++ b/libguile/gsubr.h @@ -59,7 +59,8 @@ extern SCM scm_f_gsubr_apply; -extern SCM scm_make_gsubr SCM_P ((char *name, int req, int opt, int rst, SCM (*fcn)())); +extern SCM scm_make_gsubr SCM_P ((const char *name, int req, int opt, int rst, + SCM (*fcn)())); extern SCM scm_gsubr_apply SCM_P ((SCM args)); extern void scm_init_gsubr SCM_P ((void)); diff --git a/libguile/macros.c b/libguile/macros.c index 51e2c4f79..467524df7 100644 --- a/libguile/macros.c +++ b/libguile/macros.c @@ -47,7 +47,7 @@ long scm_tc16_macro; -static scm_smobfuns macrosmob = {scm_markcdr, scm_free0}; +static const scm_smobfuns macrosmob = {scm_markcdr, scm_free0}; SCM_PROC(s_makacro, "procedure->syntax", 1, 0, 0, scm_makacro); @@ -160,7 +160,7 @@ scm_macro_transformer (m) SCM scm_make_synt (name, macroizer, fcn) - char *name; + const char *name; SCM (*macroizer) (); SCM (*fcn) (); { diff --git a/libguile/macros.h b/libguile/macros.h index db8999e45..1156a4b76 100644 --- a/libguile/macros.h +++ b/libguile/macros.h @@ -59,7 +59,7 @@ extern SCM scm_macro_p SCM_P ((SCM obj)); extern SCM scm_macro_type SCM_P ((SCM m)); extern SCM scm_macro_name SCM_P ((SCM m)); extern SCM scm_macro_transformer SCM_P ((SCM m)); -extern SCM scm_make_synt SCM_P ((char *name, +extern SCM scm_make_synt SCM_P ((const char *name, SCM (*macroizer) (SCM), SCM (*fcn) ())); extern void scm_init_macros SCM_P ((void)); diff --git a/libguile/numbers.c b/libguile/numbers.c index 12f83833f..a3fd4cc9c 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -3832,7 +3832,7 @@ scm_product (x, y) double scm_num2dbl (a, why) SCM a; - char *why; + const char *why; { if (SCM_INUMP (a)) return (double) SCM_INUM (a); @@ -4205,15 +4205,15 @@ struct dpair double x, y; }; -static void scm_two_doubles SCM_P ((SCM z1, - SCM z2, - char *sstring, - struct dpair * xy)); +static void scm_two_doubles (SCM z1, + SCM z2, + const char *sstring, + struct dpair * xy); static void scm_two_doubles (z1, z2, sstring, xy) SCM z1, z2; - char *sstring; + const char *sstring; struct dpair *xy; { if (SCM_INUMP (z1)) @@ -4635,7 +4635,7 @@ long scm_num2long (num, pos, s_caller) SCM num; char *pos; - char *s_caller; + const char *s_caller; { long res; if (SCM_INUMP (num)) @@ -4688,7 +4688,7 @@ long_long scm_num2long_long (num, pos, s_caller) SCM num; char *pos; - char *s_caller; + const char *s_caller; { long_long res; if (SCM_INUMP (num)) @@ -4732,7 +4732,7 @@ unsigned long scm_num2ulong (num, pos, s_caller) SCM num; char *pos; - char *s_caller; + const char *s_caller; { unsigned long res; if (SCM_INUMP (num)) diff --git a/libguile/numbers.h b/libguile/numbers.h index 46f70e288..93fa8e317 100644 --- a/libguile/numbers.h +++ b/libguile/numbers.h @@ -311,7 +311,7 @@ extern SCM scm_min SCM_P ((SCM x, SCM y)); extern SCM scm_sum SCM_P ((SCM x, SCM y)); extern SCM scm_difference SCM_P ((SCM x, SCM y)); extern SCM scm_product SCM_P ((SCM x, SCM y)); -extern double scm_num2dbl SCM_P ((SCM a, char * why)); +extern double scm_num2dbl SCM_P ((SCM a, const char * why)); extern SCM scm_divide SCM_P ((SCM x, SCM y)); extern double scm_asinh SCM_P ((double x)); extern double scm_acosh SCM_P ((double x)); @@ -334,9 +334,11 @@ extern double scm_big2dbl SCM_P ((SCM b)); extern SCM scm_long2num SCM_P ((long sl)); extern SCM scm_long_long2num SCM_P ((long_long sl)); extern SCM scm_ulong2num SCM_P ((unsigned long sl)); -extern long scm_num2long SCM_P ((SCM num, char *pos, char *s_caller)); -extern long_long scm_num2long_long SCM_P ((SCM num, char *pos, char *s_caller)); -extern unsigned long scm_num2ulong SCM_P ((SCM num, char *pos, char *s_caller)); +extern long scm_num2long SCM_P ((SCM num, char *pos, const char *s_caller)); +extern long_long scm_num2long_long SCM_P ((SCM num, char *pos, + const char *s_caller)); +extern unsigned long scm_num2ulong SCM_P ((SCM num, char *pos, + const char *s_caller)); extern void scm_init_numbers SCM_P ((void)); #endif /* NUMBERSH */ diff --git a/libguile/options.c b/libguile/options.c index bee2b20eb..ff35c1e26 100644 --- a/libguile/options.c +++ b/libguile/options.c @@ -121,7 +121,7 @@ scm_options (arg, options, n, s) SCM arg; scm_option options[]; int n; - char *s; + const char *s; { int i, docp = (!SCM_UNBNDP (arg) && !SCM_NULLP (arg) diff --git a/libguile/options.h b/libguile/options.h index 499bfddbe..b79d24eca 100644 --- a/libguile/options.h +++ b/libguile/options.h @@ -64,7 +64,7 @@ typedef struct scm_option #define SCM_OPTION_SCM 2 -extern SCM scm_options SCM_P ((SCM new_mode, scm_option options[], int n, char *s)); +extern SCM scm_options SCM_P ((SCM new_mode, scm_option options[], int n, const char *s)); extern void scm_init_opts SCM_P ((SCM (*func) (SCM), scm_option options[], int n)); extern void scm_init_options SCM_P ((void)); diff --git a/libguile/pairs.c b/libguile/pairs.c index afd9b2f5e..e137feaba 100644 --- a/libguile/pairs.c +++ b/libguile/pairs.c @@ -119,7 +119,7 @@ scm_set_cdr_x (pair, value) -static scm_iproc cxrs[] = +static const scm_iproc cxrs[] = { {"car", 0}, {"cdr", 0}, diff --git a/libguile/posix.c b/libguile/posix.c index 7b8ed976e..6b3fe5be6 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -720,7 +720,7 @@ scm_tcsetpgrp (port, pgid) /* Copy exec args from an SCM vector into a new C array. */ static char ** -scm_convert_exec_args (SCM args, int pos, char *subr) +scm_convert_exec_args (SCM args, int pos, const char *subr) { char **execargv; int num_args; @@ -787,7 +787,7 @@ scm_execlp (filename, args) } static char ** -environ_list_to_c (SCM envlist, int arg, char *proc) +environ_list_to_c (SCM envlist, int arg, const char *proc) { int num_strings; char **result; diff --git a/libguile/procs.c b/libguile/procs.c index f448df7b3..1a14f4310 100644 --- a/libguile/procs.c +++ b/libguile/procs.c @@ -55,7 +55,7 @@ SCM scm_make_subr_opt (name, type, fcn, set) - char *name; + const char *name; int type; SCM (*fcn) (); int set; @@ -79,7 +79,7 @@ scm_make_subr_opt (name, type, fcn, set) SCM scm_make_subr (name, type, fcn) - char *name; + const char *name; int type; SCM (*fcn) (); { @@ -222,7 +222,7 @@ scm_procedure_documentation (proc) void scm_init_iprocs(subra, type) - scm_iproc *subra; + const scm_iproc *subra; int type; { for(;subra->scm_string; subra++) diff --git a/libguile/procs.h b/libguile/procs.h index 5b31f50d8..000891cd1 100644 --- a/libguile/procs.h +++ b/libguile/procs.h @@ -90,15 +90,17 @@ typedef struct scm_dsubr -extern SCM scm_make_subr SCM_P ((char *name, int type, SCM (*fcn) ())); -extern SCM scm_make_subr_opt SCM_P ((char *name, int type, SCM (*fcn) (), +extern SCM scm_make_subr SCM_P ((const char *name, int type, SCM (*fcn) ())); +extern SCM scm_make_subr_opt SCM_P ((const char *name, + int type, + SCM (*fcn) (), int set)); extern SCM scm_makcclo SCM_P ((SCM proc, long len)); extern SCM scm_procedure_p SCM_P ((SCM obj)); extern SCM scm_closure_p SCM_P ((SCM obj)); extern SCM scm_thunk_p SCM_P ((SCM obj)); extern SCM scm_procedure_documentation SCM_P ((SCM proc)); -extern void scm_init_iprocs SCM_P ((scm_iproc *subra, int type)); +extern void scm_init_iprocs SCM_P ((const scm_iproc *subra, int type)); extern void scm_init_procs SCM_P ((void)); #ifdef GUILE_DEBUG diff --git a/libguile/ramap.c b/libguile/ramap.c index 43e51b2dd..6c497160a 100644 --- a/libguile/ramap.c +++ b/libguile/ramap.c @@ -264,7 +264,7 @@ scm_ramapc (cproc, data, ra0, lra, what) SCM data; SCM ra0; SCM lra; - char *what; + const char *what; { SCM inds, z; SCM vra0, ra1, vra1; diff --git a/libguile/ramap.h b/libguile/ramap.h index caefc5d3c..38ee5752d 100644 --- a/libguile/ramap.h +++ b/libguile/ramap.h @@ -49,7 +49,8 @@ extern int scm_ra_matchp SCM_P ((SCM ra0, SCM ras)); -extern int scm_ramapc SCM_P ((int (*cproc) (), SCM data, SCM ra0, SCM lra, char *what)); +extern int scm_ramapc SCM_P ((int (*cproc) (), SCM data, SCM ra0, SCM lra, + const char *what)); extern int scm_array_fill_int SCM_P ((SCM ra, SCM fill, SCM ignore)); extern SCM scm_array_fill_x SCM_P ((SCM ra, SCM fill)); extern SCM scm_array_copy_x SCM_P ((SCM src, SCM dst)); diff --git a/libguile/read.c b/libguile/read.c index e6ff1361a..f81922756 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -128,7 +128,7 @@ scm_grow_tok_buf (tok_buf) int scm_flush_ws (port, eoferr) SCM port; - char *eoferr; + const char *eoferr; { register int c; while (1) diff --git a/libguile/read.h b/libguile/read.h index f5e21ca9e..741041b63 100644 --- a/libguile/read.h +++ b/libguile/read.h @@ -80,7 +80,7 @@ extern scm_option scm_read_opts[]; extern SCM scm_read_options SCM_P ((SCM setting)); extern SCM scm_read SCM_P ((SCM port)); extern char * scm_grow_tok_buf SCM_P ((SCM * tok_buf)); -extern int scm_flush_ws SCM_P ((SCM port, char *eoferr)); +extern int scm_flush_ws SCM_P ((SCM port, const char *eoferr)); extern int scm_casei_streq SCM_P ((char * s1, char * s2)); extern SCM scm_lreadr SCM_P ((SCM * tok_buf, SCM port, SCM *copy)); extern scm_sizet scm_read_token SCM_P ((int ic, SCM * tok_buf, SCM port, int weird)); diff --git a/libguile/smob.c b/libguile/smob.c index 4bf826fc2..0e54b504c 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -62,7 +62,7 @@ scm_smobfuns *scm_smobs; long scm_newsmob (smob) - scm_smobfuns *smob; + const scm_smobfuns *smob; { char *tmp; if (255 <= scm_numsmob) @@ -102,7 +102,7 @@ freeprint (SCM exp, } -static scm_smobfuns freecell = +static const scm_smobfuns freecell = { 0, scm_free0, @@ -110,7 +110,7 @@ static scm_smobfuns freecell = 0 }; -static scm_smobfuns flob = +static const scm_smobfuns flob = { 0, /*flofree*/ 0, @@ -118,7 +118,7 @@ static scm_smobfuns flob = scm_floequal }; -static scm_smobfuns bigob = +static const scm_smobfuns bigob = { 0, /*bigfree*/ 0, diff --git a/libguile/smob.h b/libguile/smob.h index 0bf99fd7f..9785a878c 100644 --- a/libguile/smob.h +++ b/libguile/smob.h @@ -72,7 +72,7 @@ extern scm_smobfuns *scm_smobs; #include "libguile/markers.h" -extern long scm_newsmob SCM_P ((scm_smobfuns *smob)); +extern long scm_newsmob SCM_P ((const scm_smobfuns *smob)); extern void scm_smob_prehistory SCM_P ((void)); #endif /* SMOBH */ diff --git a/libguile/snarf.h b/libguile/snarf.h index 4a6c681a6..bf62e6144 100644 --- a/libguile/snarf.h +++ b/libguile/snarf.h @@ -50,9 +50,9 @@ #ifndef SCM_MAGIC_SNARFER #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ - static char RANAME[]=STR + static const char RANAME[]=STR #define SCM_PROC1(RANAME, STR, TYPE, CFN) \ - static char RANAME[]=STR + static const char RANAME[]=STR #else #define SCM_PROC(RANAME, STR, REQ, OPT, VAR, CFN) \ %%% scm_make_gsubr (RANAME, REQ, OPT, VAR, (SCM (*)()) CFN) diff --git a/libguile/socket.c b/libguile/socket.c index 1f9de0079..d31d59d69 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -67,12 +67,12 @@ SCM_SYMBOL (sym_socket, "socket"); -static SCM scm_sock_fd_to_port SCM_P ((int fd, char *proc)); +static SCM scm_sock_fd_to_port SCM_P ((int fd, const char *proc)); static SCM scm_sock_fd_to_port (fd, proc) int fd; - char *proc; + const char *proc; { SCM result; FILE *f; @@ -318,7 +318,7 @@ scm_shutdown (sock, how) size returns the size of the structure allocated. */ -static struct sockaddr * scm_fill_sockaddr SCM_P ((int fam, SCM address, SCM *args, int which_arg, char *proc, scm_sizet *size)); +static struct sockaddr * scm_fill_sockaddr SCM_P ((int fam, SCM address, SCM *args, int which_arg, const char *proc, scm_sizet *size)); static struct sockaddr * scm_fill_sockaddr (fam, address, args, which_arg, proc, size) @@ -326,7 +326,7 @@ scm_fill_sockaddr (fam, address, args, which_arg, proc, size) SCM address; SCM *args; int which_arg; - char *proc; + const char *proc; scm_sizet *size; { switch (fam) @@ -443,12 +443,12 @@ scm_listen (sock, backlog) /* Put the components of a sockaddr into a new SCM vector. */ -static SCM scm_addr_vector SCM_P ((struct sockaddr *address, char *proc)); +static SCM scm_addr_vector SCM_P ((struct sockaddr *address, const char *proc)); static SCM scm_addr_vector (address, proc) struct sockaddr *address; - char *proc; + const char *proc; { short int fam = address->sa_family; SCM result; diff --git a/libguile/stime.c b/libguile/stime.c index 0740f3972..16a444f5b 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -259,7 +259,7 @@ static char tzvar[3] = "TZ"; extern char ** environ; static char ** -setzone (SCM zone, int pos, char *subr) +setzone (SCM zone, int pos, const char *subr) { char **oldenv = 0; @@ -284,7 +284,7 @@ setzone (SCM zone, int pos, char *subr) } static void -restorezone (SCM zone, char **oldenv, char *subr) +restorezone (SCM zone, char **oldenv, const char *subr) { if (!SCM_UNBNDP (zone)) { @@ -380,7 +380,7 @@ scm_gmtime (SCM time) /* copy time components from a Scheme object to a struct tm. */ static void -bdtime2c (SCM sbd_time, struct tm *lt, int pos, char *subr) +bdtime2c (SCM sbd_time, struct tm *lt, int pos, const char *subr) { SCM_ASSERT (SCM_NIMP (sbd_time) && SCM_VECTORP (sbd_time) && SCM_LENGTH (sbd_time) == 11 diff --git a/libguile/strop.c b/libguile/strop.c index f9bda8a49..8d26e0667 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -27,7 +27,7 @@ Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -static int scm_i_index SCM_P ((SCM * str, SCM chr, int direction, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, char * why)); +static int scm_i_index SCM_P ((SCM * str, SCM chr, int direction, SCM sub_start, SCM sub_end, int pos, int pos2, int pos3, int pos4, const char * why)); /* implements index if direction > 0 otherwise rindex. */ static int @@ -42,7 +42,7 @@ scm_i_index (str, chr, direction, sub_start, sub_end, pos, pos2, pos3, pos4, int pos2; int pos3; int pos4; - char * why; + const char * why; { unsigned char * p; int x; diff --git a/libguile/strports.c b/libguile/strports.c index f2eeeaabe..24c6ceb6f 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -131,7 +131,7 @@ scm_mkstrport (pos, str, modes, caller) SCM pos; SCM str; long modes; - char * caller; + const char * caller; { SCM z; SCM stream; diff --git a/libguile/strports.h b/libguile/strports.h index 9bccfe161..0310c6245 100644 --- a/libguile/strports.h +++ b/libguile/strports.h @@ -50,7 +50,7 @@ extern scm_ptobfuns scm_stptob; -extern SCM scm_mkstrport SCM_P ((SCM pos, SCM str, long modes, char * caller)); +extern SCM scm_mkstrport SCM_P ((SCM pos, SCM str, long modes, const char * caller)); extern SCM scm_call_with_output_string SCM_P ((SCM proc)); extern SCM scm_strprint_obj SCM_P ((SCM obj)); extern SCM scm_call_with_input_string SCM_P ((SCM str, SCM proc)); diff --git a/libguile/symbols.c b/libguile/symbols.c index a0904125a..6355b07e8 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -230,7 +230,7 @@ scm_sym2ovcell (sym, obarray) SCM scm_intern_obarray_soft (name, len, obarray, softness) - char *name; + const char *name; scm_sizet len; SCM obarray; int softness; @@ -330,7 +330,7 @@ scm_intern_obarray_soft (name, len, obarray, softness) SCM scm_intern_obarray (name, len, obarray) - char *name; + const char *name; scm_sizet len; SCM obarray; { @@ -340,7 +340,7 @@ scm_intern_obarray (name, len, obarray) SCM scm_intern (name, len) - char *name; + const char *name; scm_sizet len; { return scm_intern_obarray (name, len, scm_symhash); @@ -349,7 +349,7 @@ scm_intern (name, len) SCM scm_intern0 (name) - char * name; + const char * name; { return scm_intern (name, strlen (name)); } @@ -358,7 +358,7 @@ scm_intern0 (name) /* Intern the symbol named NAME in scm_symhash, NAME is null-terminated. */ SCM scm_sysintern0_no_module_lookup (name) - char *name; + const char *name; { SCM easy_answer; SCM_DEFER_INTS; @@ -395,7 +395,7 @@ int scm_can_use_top_level_lookup_closure_var; */ SCM scm_sysintern (name, val) - char *name; + const char *name; SCM val; { SCM vcell = scm_sysintern0 (name); @@ -405,7 +405,7 @@ scm_sysintern (name, val) SCM scm_sysintern0 (name) - char *name; + const char *name; { SCM lookup_proc; if (scm_can_use_top_level_lookup_closure_var && @@ -425,7 +425,7 @@ scm_sysintern0 (name) NAME in the current module. */ SCM scm_symbol_value0 (name) - char *name; + const char *name; { /* This looks silly - we look up the symbol twice. But it is in fact necessary given the current module system because the module diff --git a/libguile/symbols.h b/libguile/symbols.h index 06566a876..deb53fbf7 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -109,14 +109,14 @@ extern unsigned long scm_strhash SCM_P ((unsigned char *str, scm_sizet len, unsi extern SCM scm_sym2vcell SCM_P ((SCM sym, SCM thunk, SCM definep)); extern SCM scm_sym2ovcell_soft SCM_P ((SCM sym, SCM obarray)); extern SCM scm_sym2ovcell SCM_P ((SCM sym, SCM obarray)); -extern SCM scm_intern_obarray_soft SCM_P ((char *name, scm_sizet len, SCM obarray, int softness)); -extern SCM scm_intern_obarray SCM_P ((char *name, scm_sizet len, SCM obarray)); -extern SCM scm_intern SCM_P ((char *name, scm_sizet len)); -extern SCM scm_intern0 SCM_P ((char * name)); -extern SCM scm_sysintern SCM_P ((char *name, SCM val)); -extern SCM scm_sysintern0 SCM_P ((char *name)); -extern SCM scm_sysintern0_no_module_lookup SCM_P ((char *name)); -extern SCM scm_symbol_value0 SCM_P ((char *name)); +extern SCM scm_intern_obarray_soft SCM_P ((const char *name, scm_sizet len, SCM obarray, int softness)); +extern SCM scm_intern_obarray SCM_P ((const char *name, scm_sizet len, SCM obarray)); +extern SCM scm_intern SCM_P ((const char *name, scm_sizet len)); +extern SCM scm_intern0 SCM_P ((const char * name)); +extern SCM scm_sysintern SCM_P ((const char *name, SCM val)); +extern SCM scm_sysintern0 SCM_P ((const char *name)); +extern SCM scm_sysintern0_no_module_lookup SCM_P ((const char *name)); +extern SCM scm_symbol_value0 SCM_P ((const char *name)); extern SCM scm_symbol_p SCM_P ((SCM x)); extern SCM scm_symbol_to_string SCM_P ((SCM s)); extern SCM scm_string_to_symbol SCM_P ((SCM s)); diff --git a/libguile/unif.c b/libguile/unif.c index a613c3e24..8fe0131f4 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -467,7 +467,7 @@ long scm_aind (ra, args, what) SCM ra; SCM args; - char *what; + const char *what; { SCM ind; register long j; @@ -519,7 +519,7 @@ static char s_bad_spec[] = "Bad scm_array dimension"; SCM scm_shap2ra (args, what) SCM args; - char *what; + const char *what; { scm_array_dim *s; SCM ra, spec, sp; diff --git a/libguile/unif.h b/libguile/unif.h index 5da9ac27b..29b2fadce 100644 --- a/libguile/unif.h +++ b/libguile/unif.h @@ -81,9 +81,9 @@ extern SCM scm_uniform_vector_length SCM_P ((SCM v)); extern SCM scm_array_p SCM_P ((SCM v, SCM prot)); extern SCM scm_array_rank SCM_P ((SCM ra)); extern SCM scm_array_dimensions SCM_P ((SCM ra)); -extern long scm_aind SCM_P ((SCM ra, SCM args, char *what)); +extern long scm_aind SCM_P ((SCM ra, SCM args, const char *what)); extern SCM scm_make_ra SCM_P ((int ndim)); -extern SCM scm_shap2ra SCM_P ((SCM args, char *what)); +extern SCM scm_shap2ra SCM_P ((SCM args, const char *what)); extern SCM scm_dimensions_to_uniform_array SCM_P ((SCM dims, SCM prot, SCM fill)); extern void scm_ra_set_contp SCM_P ((SCM ra)); extern SCM scm_make_shared_array SCM_P ((SCM oldra, SCM mapfunc, SCM dims)); |