From 2d25ec198134d707af9e51525ef0312df778f2d9 Mon Sep 17 00:00:00 2001 From: Kevin Ryde Date: Tue, 21 Mar 2006 00:45:09 +0000 Subject: [PATCH] =?UTF-8?q?2006-03-21=20=20Ludovic=20Court=C3=A8s=20=20=20=20=20=20=20=20=20=20=20*=20numbers.c?= =?UTF-8?q?=20(scm=5Fi=5Fmem2number):=20Renamed=20to=20=09scm=5Fc=5Flocale?= =?UTF-8?q?=5Fstringn=5Fto=5Fnumber.=20=09*=20numbers.c,=20print.c,=20read?= =?UTF-8?q?.c:=20Updated=20callers.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libguile/numbers.c | 9 +++++---- libguile/print.c | 2 +- libguile/read.c | 7 ++++--- 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 == '#')