1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

114 commits

Author SHA1 Message Date
Mikael Djurfeldt
4bfdf1584d 1997-10-03 Mikael Djurfeldt <mdj@nada.kth.se>
* print.h (SCM_PRINT_STATE_P): Removed SCM_NIMP test.  (NIMP
	macros should by convention not test for NIMPness.)
	(SCM_COERCE_OPORT): Adjust indentation.

	* print.c (scm_valid_oport_value_p): Adjusted indentation; Added
	SCM_NIMP test before SCM_PRINT_STATE_P.

	* struct.c, struct.h, gc.c: Renamed:
	scm_struct_i_layout	   --> scm_vtable_index_layout
	scm_struct_i_vcell	   --> scm_vtable_index_vcell
	scm_struct_i_vtable	   --> scm_vtable_index_vtable
	scm_struct_i_printer	   --> scm_vtable_index_printer
	scm_struct_i_vtable_offset --> scm_vtable_offset_user

	* struct.c (scm_print_struct): Use new printer slot; Default
	printing: Also output hex code of vtable so that type identity
	will be indicated as well.
	(scm_init_struct): Updated required_vtable_fields to "pruosrpw";
	Removed struct_printer_var; Removed struct-vtable-offset;
	(vtable-index-layout, vtable-index-vtable, vtable-index-printer,
	vtable-offset-user): New constants.

	* struct.h (scm_struct_i_vtable_offset): Bumped from 3 to 4.
	(scm_struct_i_printer, SCM_STRUCT_PRINTER): New slot in vtables.
  	If this slot contains a procedure, use that to print structures of
 	the type represented by this vtable.

	* print.c (scm_iprin1): Don't print arguments of macro
 	transformers.  (They are always: exp env.); Bugfix: Unmemoize
 	transformer source with correct environment.
1997-10-03 00:44:28 +00:00
Marius Vollmer
1e8f77cd7b * struct.c (scm_print_struct): Use scm_printer_apply to call the
user defined struct printer.
1997-07-27 09:09:54 +00:00
Marius Vollmer
916d65b1d1 * struct.c (struct_printer): New variable that holds a handle on
the Scheme variable *struct-printer*.  This variable can be set by
Scheme code to override the printing of structures.
(scm_print_struct): If struct_printer is set, call it.  If it is
not set, or returns #f, print the structure in the old fashion.
Include "eval.h" for scm_apply.
1997-06-04 22:40:58 +00:00
Marius Vollmer
bafcafb270 * struct.c (scm_struct_ref, scm_struct_set_x): Use
scm_struct_i_n_words to get the number of fields, not
-scm_struct_n_extra_words.

On the route to fancier struct printing:
* struct.c (scm_print_struct): New function to print a structure.
Include "genio.h" to support it.  This function doesn't do
anything interesting right now, but I think it should be here
anyway.
* struct.h: Include "print.h" and add prototype for
scm_print_struct.
* print.c (scm_iprin1): Call scm_print_struct instead of trying to
print structures ourself.
1997-06-03 21:49:52 +00:00
Jim Blandy
82892beda5 * Lots of files: New address for FSF. 1997-05-26 22:34:48 +00:00
Jim Blandy
35de7ebe4a Give GCC more control flow information, so it can be sure that
variables aren't used uninitialized.
* error.h (scm_error, scm_syserror, scm_syserror_msg,
scm_sysmissing, scm_num_overflow, scm_out_of_range,
scm_wrong_num_args, scm_wrong_type_arg, scm_memory_error,
scm_misc_error): Tell GCC that these functions never return.
* struct.c (scm_struct_ref, scm_struct_set_x): If we can't figure
out the field type, call abort if SCM_ASSERT returns, to placate
the optimizer.
* stacks.c (scm_make_stack, scm_last_stack_frame): abort if
scm_wta ever returns.  We can't handle this case anyway, and this
gives the optimizer more information.
* unif.c (scm_uniform_vector_ref, scm_array_set_x): Abort if
scm_wta ever returns.

In some cases, the code is fine, but GCC isn't smart enough to
figure that out; this usually happens when one variable is only
initialized and used when a particular condition holds true, and
we know that condition will never change within a given invocation
of the function.  In this case, we simply initialize the variables
to placate the compiler, hopefully to a value which will cause a
crash if it is ever actually used.
* print.c (scm_iprin1): Initialize mw_pos.
* read.c (scm_lreadrecparen): Initialize tl2, ans2.
* throw.c (scm_ithrow): Initialize dynpair.
* unif.c (scm_uniform_vector_ref): Initialize cra.
* struct.c (init_struct): Initialize prot.
* mbstrings.c (scm_print_mb_symbol): Initialize mw_pos and inc.
1996-12-18 21:41:44 +00:00
Jim Blandy
14d1400fa7 Allocate data for structures on an eight-byte boundary, as
required by the tagging system.
* struct.c (alloc_struct): New function.
(scm_make_struct, scm_make_vtable_vtable): Call it.
* struct.h (scm_struct_n_extra_words): Bump to 3.
(scm_struct_i_ptr): New "field".
* gc.c (scm_gc_sweep): When we need to free the data, use the
information stored by alloc_struct to find the beginning of the
block allocated to the structure, so we can free it.
1996-10-15 00:10:59 +00:00
Jim Blandy
1cc91f1b29 * __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes.  (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
Jim Blandy
35457f1e68 * struct.c (scm_make_struct, scm_make_vtable_vtable): Use the
symbolic name for the tag, scm_tc3_cons_gloc, instead of just
saying "1".
1996-10-11 07:56:34 +00:00
Mikael Djurfeldt
2c36c351d0 * struct.c (scm_make_struct_layout, init_struct, scm_struct_ref,
scm_struct_set_x), struct.h, gc.c (scm_gc_mark): Completed Tom
Lord's implementation of structs, allowing for tail arrays as
described in the manual. Also fixed some bugs. (Both the interface
and the implementation should be improved.)
1996-09-22 22:38:56 +00:00
Jim Blandy
5e840c2e1a * numbers.h: Repeated declarations removed.
* ports.h (scm_close_all_ports_except): Declaration for the
function defined in ports.c added.

* posix.h: Missing declarations added.

* procs.h (scm_make_subr_opt): Missing declaration added.

* socket.h (scm_sys_gethost): Missing declaration added.

* socket.h: Redundant declarations removed (they are in fdsocket.h).

* srcprop.h (scm_set_source_property_x, scm_finish_srcprop):
Missing declarations added.

* stime.h (scm_get_internal_real_time): Repeated declarations removed.

* struct.c: Uninitialized variable `SCM answer' may be used.

* unif.c (l2ra): Declaration prototype.

* unif.c (scm_array_equal_p): Dummy definition removed (it is
defined in ramap.c).

* unif.h (scm_raprin1, scm_istr2bve, scm_array_equal_p):
Redundant declarations removed (they are in ramap.h).

* variable.h (scm_make_udvariable,
scm_make_undefined_variable): Declaration corrected to
correspond variable.c.

* vectors.h (scm_vector_move_left_x, scm_vector_move_right_x):
Missing declarations added.
1996-09-11 20:29:44 +00:00
Jim Blandy
20e6290e38 C files should #include only the header files they need, not
libguile.h (which #includes all the header files); the pointless
recompilation was wasting my time.
* Makefile.in (all .o dependency lists): Regenerated.
* libguile.h: Don't try to get a definition for size_t here...
* __scm.h: Do it here.
* _scm.h: Since this is the internal libguile header, put things
here that all (or a majority) of the libguile files will want.
Don't #include <libguile.h> here; that generates dependencies on
way too much.  Instead, get "__scm.h", "error.h", "pairs.h",
"list.h", "gc.h", "gsubr.h", "procs.h", "numbers.h", "symbols.h",
"boolean.h", "strings.h", "vectors.h", "root.h", "ports.h", and
"async.h".
* alist.c: Get "eq.h", "list.h", "alist.h".
* append.c: Get "append.h", "list.h".
* arbiters.c: Get "arbiters.h", "smob.h".
* async.c: Get "async.h", "smob.h", "throw.h", "eval.h".
* boolean.c: Get "boolean.h".
* chars.c: Get "chars.h".
* continuations.c: Get "continuations.h", "dynwind.h", "debug.h",
"stackchk.h".
* debug.c: Get "debug.h", "feature.h", "read.h", "strports.h",
"continuations.h", "alist.h", "srcprop.h", "procprop.h", "smob.h",
"genio.h", "throw.h", "eval.h".
* dynwind.c: Get "dynwind.h", "alist.h", "eval.h".
* eq.c: Get "eq.h", "unif.h", "smob.h", "strorder.h",
"stackchk.h".
* error.c: Get "error.h", "throw.h", "genio.h", "pairs.h".
* eval.c: Get "eval.h", "stackchk.h", "srcprop.h", "debug.h",
"hashtab.h", "procprop.h", "markers.h", "smob.h", "throw.h",
"continuations.h", "eq.h", "sequences.h", "alist.h", "append.h",
"debug.h".
* fdsocket.c: Get "fdsocket.h", "unif.h", "filesys.h".
* feature.c: Get "feature.h".
* files.c: Get "files.h".
* filesys.c: Get "filesys.h", "smob.h", "genio.h".
* fports.c: Get "fports.h", "markers.h".
* gc.c: Get "async.h", "unif.h", "smob.h", "weaks.h",
"genio.h", "struct.h", "stackchk.h", "stime.h".
* gdbint.c: Get "gdbint.h", "chars.h", "eval.h", "print.h",
"read.h", "strports.h", "tag.h".
* genio.c: Get "genio.h", "chars.h".
* gsubr.c: Get "gsubr.h", "genio.h".
* hash.c: Get "hash.h", "chars.h".
* hashtab.c: Get "hashtab.h", "eval.h", "hash.h", "alist.h".
* init.c: Get everyone who has an scm_init_mumble function:
"weaks.h", "vports.h", "version.h", "vectors.h", "variable.h",
"unif.h", "throw.h", "tag.h", "symbols.h", "struct.h",
"strports.h", "strorder.h", "strop.h", "strings.h", "stime.h",
"stackchk.h", "srcprop.h", "socket.h", "simpos.h", "sequences.h",
"scmsigs.h", "read.h", "ramap.h", "procs.h", "procprop.h",
"print.h", "posix.h", "ports.h", "pairs.h", "options.h",
"objprop.h", "numbers.h", "mbstrings.h", "mallocs.h", "load.h",
"list.h", "kw.h", "ioext.h", "hashtab.h", "hash.h", "gsubr.h",
"gdbint.h", "gc.h", "fports.h", "filesys.h", "files.h",
"feature.h", "fdsocket.h", "eval.h", "error.h", "eq.h",
"dynwind.h", "debug.h", "continuations.h", "chars.h", "boolean.h",
"async.h", "arbiters.h", "append.h", "alist.h".
* ioext.c: Get "ioext.h", "fports.h".
* kw.c: Get "kw.h", "smob.h", "mbstrings.h", "genio.h".
* list.c: Get "list.h", "eq.h".
* load.c: Get "load.h", "eval.h", "read.h", "fports.h".
* mallocs.c: Get "smob.h", "genio.h".
* markers.c: Get "markers.h".
* mbstrings.c: Get "mbstrings.h", "read.h", "genio.h", "unif.h",
"chars.h".
* numbers.c: Get "unif.h", "genio.h".
* objprop.c: Get "objprop.h", "weaks.h", "alist.h", "hashtab.h".
* options.c: Get "options.h".
* ports.c: Get "ports.h", "vports.h", "strports.h", "fports.h",
"markers.h", "chars.h", "genio.h".
* posix.c: Get "posix.h", "sequences.h", "feature.h", "unif.h",
"read.h", "scmsigs.h", "genio.h", "fports.h".
* print.c: Get "print.h",  "unif.h", "weaks.h", "read.h",
"procprop.h", "eval.h", "smob.h", "mbstrings.h", "genio.h",
"chars.h".
* procprop.c: Get "procprop.h", "eval.h", "alist.h".
* procs.c: Get "procs.h".
* ramap.c: Get "ramap.h", "feature.h", "eval.h", "eq.h",
"chars.h", "smob.h", "unif.h".
* read.c: Get "alist.h", "kw.h", "mbstrings.h", "unif.h",
"eval.h", "genio.h", "chars.h".
* root.c: Get "root.h", "stackchk.h".
* scmsigs.c: Get "scmsigs.h".
* sequences.c: Get "sequences.h".
* simpos.c: Get "simpos.h", "scmsigs.h".
* smob.c: Get "smob.h".
* socket.c: Get "socket.h", "feature.h".
* srcprop.c: Get "srcprop.h", "weaks.h", "hashtab.h", "debug.h",
"alist.h", "smob.h".
* stackchk.c: Get "stackchk.h", "genio.h".
* stime.c: Get "stime.h"."libguile/continuations.h".
* strings.c: Get "strings.h", "chars.h".
* strop.c: Get "strop.h", "chars.h".
* strorder.c: Get "strorder.h", "chars.h".
* strports.c: Get "strports.h", "print.h", "eval.h", "unif.h".
* struct.c: Get "struct.h", "chars.h".
* symbols.c: Get "symbols.h", "mbstrings.h", "alist.h",
"variable.h", "eval.h", "chars.h".
* tag.c: Get "tag.h", "struct.h", "chars.h".
* throw.c: Get "throw.h", "continuations.h", "debug.h",
"dynwind.h", "eval.h", "alist.h", "smob.h", "genio.h".
* unif.c: Get "unif.h", "feature.h", "strop.h", "sequences.h",
"smob.h", "genio.h", "eval.h", "chars.h".
* variable.c: Get "variable.h", "smob.h", "genio.h".
* vectors.c: Get "vectors.h", "eq.h".
* version.c: Get "version.h".
* vports.c: Get "vports.h", "fports.h", "chars.h", "eval.h".
* weaks.c: Get "weaks.h".
1996-09-10 02:26:07 +00:00
Gary Houston
95b8881908 portability fixes for header inclusion etc. 1996-08-07 09:46:41 +00:00
Jim Blandy
0f2d19dd46 maintainer changed: was lord, now jimb; first import 1996-07-25 22:56:11 +00:00