1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-03 13:20:26 +02:00

* ports.c (scm_port_line, scm_set_port_line_x), read.c

(scm_i_input_error, scm_lreadr, scm_lreadrecparen): Corrections to
	port line number type, should be "long" not "int", as per line_number
	field of scm_t_port.  (Makes a difference only on 64-bit systems, and
	only then for a linenum above 2Gig.)
This commit is contained in:
Kevin Ryde 2007-01-26 23:50:57 +00:00
parent 34d4f03c54
commit e00abb1fe0
2 changed files with 6 additions and 6 deletions

View file

@ -1539,7 +1539,7 @@ SCM_DEFINE (scm_port_line, "port-line", 1, 0, 0,
{
port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT (1, port);
return scm_from_int (SCM_LINUM (port));
return scm_from_long (SCM_LINUM (port));
}
#undef FUNC_NAME
@ -1551,7 +1551,7 @@ SCM_DEFINE (scm_set_port_line_x, "set-port-line!", 2, 0, 0,
{
port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT (1, port);
SCM_PTAB_ENTRY (port)->line_number = scm_to_int (line);
SCM_PTAB_ENTRY (port)->line_number = scm_to_long (line);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME

View file

@ -89,7 +89,7 @@ scm_i_input_error (char const *function,
scm_simple_format (string_port,
scm_from_locale_string ("~A:~S:~S: ~A"),
scm_list_4 (fn,
scm_from_int (SCM_LINUM (port) + 1),
scm_from_long (SCM_LINUM (port) + 1),
scm_from_int (SCM_COL (port) + 1),
scm_from_locale_string (message)));
@ -406,7 +406,7 @@ scm_lreadr (SCM *tok_buf, SCM port, SCM *copy)
SCM sharp = scm_get_hash_procedure (c);
if (scm_is_true (sharp))
{
int line = SCM_LINUM (port);
long line = SCM_LINUM (port);
int column = SCM_COL (port) - 2;
SCM got;
@ -532,7 +532,7 @@ scm_lreadr (SCM *tok_buf, SCM port, SCM *copy)
if (scm_is_true (sharp))
{
int line = SCM_LINUM (port);
long line = SCM_LINUM (port);
int column = SCM_COL (port) - 2;
SCM got;
@ -822,7 +822,7 @@ scm_lreadrecparen (SCM *tok_buf, SCM port, char *name, SCM *copy)
register SCM tl, tl2 = SCM_EOL;
SCM ans, ans2 = SCM_EOL;
/* Need to capture line and column numbers here. */
int line = SCM_LINUM (port);
long line = SCM_LINUM (port);
int column = SCM_COL (port) - 1;
c = scm_flush_ws (port, name);