summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2006-03-21 00:45:09 +0000
committerKevin Ryde <user42@zip.com.au>2006-03-21 00:45:09 +0000
commit2d25ec198134d707af9e51525ef0312df778f2d9 (patch)
tree8b14d29447bea3459fee2781edd6a5b1be864b0d
parentd0a9429acccddb25815e81b061ff5461a3f731ba (diff)
downloadguile-2d25ec198134d707af9e51525ef0312df778f2d9.tar.gz
2006-03-21 Ludovic Courtès <ludovic.courtes@laas.fr>
* numbers.c (scm_i_mem2number): Renamed to scm_c_locale_stringn_to_number. * numbers.c, print.c, read.c: Updated callers.
-rw-r--r--libguile/numbers.c9
-rw-r--r--libguile/print.c2
-rw-r--r--libguile/read.c7
3 files changed, 10 insertions, 8 deletions
diff --git a/libguile/numbers.c b/libguile/numbers.c
index 7471ab0fd..e07e5ce24 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -2937,7 +2937,8 @@ mem2complex (const char* mem, size_t len, unsigned int idx,
enum t_radix {NO_RADIX=0, DUAL=2, OCT=8, DEC=10, HEX=16};
SCM
-scm_i_mem2number (const char* mem, size_t len, unsigned int default_radix)
+scm_c_locale_stringn_to_number (const char* mem, size_t len,
+ unsigned int default_radix)
{
unsigned int idx = 0;
unsigned int radix = NO_RADIX;
@@ -3043,9 +3044,9 @@ SCM_DEFINE (scm_string_to_number, "string->number", 1, 1, 0,
else
base = scm_to_unsigned_integer (radix, 2, INT_MAX);
- answer = scm_i_mem2number (scm_i_string_chars (string),
- scm_i_string_length (string),
- base);
+ answer = scm_c_locale_stringn_to_number (scm_i_string_chars (string),
+ scm_i_string_length (string),
+ base);
scm_remember_upto_here_1 (string);
return answer;
}
diff --git a/libguile/print.c b/libguile/print.c
index d15aad362..efd51ce06 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -327,7 +327,7 @@ scm_print_symbol_name (const char *str, size_t len, SCM port)
if (len == 0 || str[0] == '\'' || str[0] == '`' || str[0] == ','
|| quote_keywordish_symbol (str, len)
|| (str[0] == '.' && len == 1)
- || scm_is_true (scm_i_mem2number(str, len, 10)))
+ || scm_is_true (scm_c_locale_stringn_to_number (str, len, 10)))
{
scm_lfwrite ("#{", 2, port);
weird = 1;
diff --git a/libguile/read.c b/libguile/read.c
index fa0fd7133..0714e3f84 100644
--- a/libguile/read.c
+++ b/libguile/read.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004 Free Software
+/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004, 2006 Free Software
* Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -506,7 +506,8 @@ scm_lreadr (SCM *tok_buf, SCM port, SCM *copy)
* does only consist of octal digits. Finally, it should be
* checked whether the resulting fixnum is in the range of
* characters. */
- p = scm_i_mem2number (scm_i_string_chars (*tok_buf), j, 8);
+ p = scm_c_locale_stringn_to_number (scm_i_string_chars (*tok_buf),
+ j, 8);
if (SCM_I_INUMP (p))
return SCM_MAKE_CHAR (SCM_I_INUM (p));
}
@@ -644,7 +645,7 @@ scm_lreadr (SCM *tok_buf, SCM port, SCM *copy)
/* Shortcut: Detected symbol '+ or '- */
goto tok;
- p = scm_i_mem2number (scm_i_string_chars (*tok_buf), j, 10);
+ p = scm_c_locale_stringn_to_number (scm_i_string_chars (*tok_buf), j, 10);
if (scm_is_true (p))
return p;
if (c == '#')