1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

use scm_from_latin1_symboln for string literals and load-symbol

* libguile/bytevectors.c:
* libguile/eval.c:
* libguile/goops.c:
* libguile/i18n.c:
* libguile/load.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/ports.c:
* libguile/print.c:
* libguile/procs.c:
* libguile/programs.c:
* libguile/read.c:
* libguile/script.c:
* libguile/srfi-14.c:
* libguile/stacks.c:
* libguile/strings.c:
* libguile/throw.c:
* libguile/vm.c: Use scm_from_latin1_symboln to make symbols from string
  literals, because they aren't in the user's locale -- they are in
  ASCII, and we can optimize this case.

* libguile/vm-i-loader.c: Also use scm_from_latin1_symboln when loading
  narrow symbols.
This commit is contained in:
Andy Wingo 2011-01-07 09:08:58 -08:00
parent 30c282bf93
commit 4a655e50a3
19 changed files with 104 additions and 104 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -2221,9 +2221,9 @@ scm_bootstrap_bytevectors (void)
scm_null_bytevector = make_bytevector (0, SCM_ARRAY_ELEMENT_TYPE_VU8); scm_null_bytevector = make_bytevector (0, SCM_ARRAY_ELEMENT_TYPE_VU8);
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
scm_i_native_endianness = scm_from_locale_symbol ("big"); scm_i_native_endianness = scm_from_latin1_symbol ("big");
#else #else
scm_i_native_endianness = scm_from_locale_symbol ("little"); scm_i_native_endianness = scm_from_latin1_symbol ("little");
#endif #endif
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION, scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011
* Free Software Foundation, Inc. * Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -162,14 +162,14 @@ static void error_used_before_defined (void)
static void error_invalid_keyword (SCM proc) static void error_invalid_keyword (SCM proc)
{ {
scm_error_scm (scm_from_locale_symbol ("keyword-argument-error"), proc, scm_error_scm (scm_from_latin1_symbol ("keyword-argument-error"), proc,
scm_from_locale_string ("Invalid keyword"), SCM_EOL, scm_from_locale_string ("Invalid keyword"), SCM_EOL,
SCM_BOOL_F); SCM_BOOL_F);
} }
static void error_unrecognized_keyword (SCM proc) static void error_unrecognized_keyword (SCM proc)
{ {
scm_error_scm (scm_from_locale_symbol ("keyword-argument-error"), proc, scm_error_scm (scm_from_latin1_symbol ("keyword-argument-error"), proc,
scm_from_locale_string ("Unrecognized keyword"), SCM_EOL, scm_from_locale_string ("Unrecognized keyword"), SCM_EOL,
SCM_BOOL_F); SCM_BOOL_F);
} }
@ -1012,9 +1012,9 @@ boot_closure_print (SCM closure, SCM port, scm_print_state *pstate)
scm_uintprint ((scm_t_bits)SCM2PTR (closure), 16, port); scm_uintprint ((scm_t_bits)SCM2PTR (closure), 16, port);
scm_putc (' ', port); scm_putc (' ', port);
args = scm_make_list (scm_from_int (BOOT_CLOSURE_NUM_REQUIRED_ARGS (closure)), args = scm_make_list (scm_from_int (BOOT_CLOSURE_NUM_REQUIRED_ARGS (closure)),
scm_from_locale_symbol ("_")); scm_from_latin1_symbol ("_"));
if (!BOOT_CLOSURE_IS_FIXED (closure) && BOOT_CLOSURE_HAS_REST_ARGS (closure)) if (!BOOT_CLOSURE_IS_FIXED (closure) && BOOT_CLOSURE_HAS_REST_ARGS (closure))
args = scm_cons_star (scm_from_locale_symbol ("_"), args); args = scm_cons_star (scm_from_latin1_symbol ("_"), args);
/* FIXME: optionals and rests */ /* FIXME: optionals and rests */
scm_display (args, port); scm_display (args, port);
scm_putc ('>', port); scm_putc ('>', port);

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2008,2009,2010 /* Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2008,2009,2010,2011
* Free Software Foundation, Inc. * Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -896,7 +896,7 @@ create_basic_classes (void)
/**** <class> ****/ /**** <class> ****/
SCM cs = scm_from_locale_string (SCM_CLASS_CLASS_LAYOUT); SCM cs = scm_from_locale_string (SCM_CLASS_CLASS_LAYOUT);
SCM name = scm_from_locale_symbol ("<class>"); SCM name = scm_from_latin1_symbol ("<class>");
scm_class_class = scm_make_vtable_vtable (cs, SCM_INUM0, SCM_EOL); scm_class_class = scm_make_vtable_vtable (cs, SCM_INUM0, SCM_EOL);
SCM_SET_CLASS_FLAGS (scm_class_class, (SCM_CLASSF_GOOPS_OR_VALID SCM_SET_CLASS_FLAGS (scm_class_class, (SCM_CLASSF_GOOPS_OR_VALID
| SCM_CLASSF_METACLASS)); | SCM_CLASSF_METACLASS));
@ -918,14 +918,14 @@ create_basic_classes (void)
DEFVAR(name, scm_class_class); DEFVAR(name, scm_class_class);
/**** <top> ****/ /**** <top> ****/
name = scm_from_locale_symbol ("<top>"); name = scm_from_latin1_symbol ("<top>");
scm_class_top = scm_basic_make_class (scm_class_class, name, scm_class_top = scm_basic_make_class (scm_class_class, name,
SCM_EOL, SCM_EOL); SCM_EOL, SCM_EOL);
DEFVAR(name, scm_class_top); DEFVAR(name, scm_class_top);
/**** <object> ****/ /**** <object> ****/
name = scm_from_locale_symbol ("<object>"); name = scm_from_latin1_symbol ("<object>");
scm_class_object = scm_basic_make_class (scm_class_class, name, scm_class_object = scm_basic_make_class (scm_class_class, name,
scm_list_1 (scm_class_top), SCM_EOL); scm_list_1 (scm_class_top), SCM_EOL);
@ -1089,7 +1089,7 @@ SCM_DEFINE (scm_method_generic_function, "method-generic-function", 1, 0, 0,
#define FUNC_NAME s_scm_method_generic_function #define FUNC_NAME s_scm_method_generic_function
{ {
SCM_VALIDATE_METHOD (1, obj); SCM_VALIDATE_METHOD (1, obj);
return scm_slot_ref (obj, scm_from_locale_symbol ("generic-function")); return scm_slot_ref (obj, scm_from_latin1_symbol ("generic-function"));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1099,7 +1099,7 @@ SCM_DEFINE (scm_method_specializers, "method-specializers", 1, 0, 0,
#define FUNC_NAME s_scm_method_specializers #define FUNC_NAME s_scm_method_specializers
{ {
SCM_VALIDATE_METHOD (1, obj); SCM_VALIDATE_METHOD (1, obj);
return scm_slot_ref (obj, scm_from_locale_symbol ("specializers")); return scm_slot_ref (obj, scm_from_latin1_symbol ("specializers"));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -2158,7 +2158,7 @@ SCM_DEFINE (scm_make, "make", 0, 0, 1,
scm_i_get_keyword (k_name, scm_i_get_keyword (k_name,
args, args,
len - 1, len - 1,
scm_from_locale_symbol ("???"), scm_from_latin1_symbol ("???"),
FUNC_NAME)); FUNC_NAME));
SCM_SET_SLOT (z, scm_si_direct_supers, SCM_SET_SLOT (z, scm_si_direct_supers,
scm_i_get_keyword (k_dsupers, scm_i_get_keyword (k_dsupers,
@ -2286,26 +2286,26 @@ static void
create_standard_classes (void) create_standard_classes (void)
{ {
SCM slots; SCM slots;
SCM method_slots = scm_list_n (scm_from_locale_symbol ("generic-function"), SCM method_slots = scm_list_n (scm_from_latin1_symbol ("generic-function"),
scm_from_locale_symbol ("specializers"), scm_from_latin1_symbol ("specializers"),
sym_procedure, sym_procedure,
scm_from_locale_symbol ("formals"), scm_from_latin1_symbol ("formals"),
scm_from_locale_symbol ("body"), scm_from_latin1_symbol ("body"),
scm_from_locale_symbol ("make-procedure"), scm_from_latin1_symbol ("make-procedure"),
SCM_UNDEFINED); SCM_UNDEFINED);
SCM amethod_slots = scm_list_1 (scm_list_3 (scm_from_locale_symbol ("slot-definition"), SCM amethod_slots = scm_list_1 (scm_list_3 (scm_from_latin1_symbol ("slot-definition"),
k_init_keyword, k_init_keyword,
k_slot_definition)); k_slot_definition));
SCM gf_slots = scm_list_4 (scm_from_locale_symbol ("methods"), SCM gf_slots = scm_list_4 (scm_from_latin1_symbol ("methods"),
scm_list_3 (scm_from_locale_symbol ("n-specialized"), scm_list_3 (scm_from_latin1_symbol ("n-specialized"),
k_init_value, k_init_value,
SCM_INUM0), SCM_INUM0),
scm_list_3 (scm_from_locale_symbol ("extended-by"), scm_list_3 (scm_from_latin1_symbol ("extended-by"),
k_init_value, k_init_value,
SCM_EOL), SCM_EOL),
scm_from_locale_symbol ("effective-methods")); scm_from_latin1_symbol ("effective-methods"));
SCM setter_slots = scm_list_1 (sym_setter); SCM setter_slots = scm_list_1 (sym_setter);
SCM egf_slots = scm_list_1 (scm_list_3 (scm_from_locale_symbol ("extends"), SCM egf_slots = scm_list_1 (scm_list_3 (scm_from_latin1_symbol ("extends"),
k_init_value, k_init_value,
SCM_EOL)); SCM_EOL));
/* Foreign class slot classes */ /* Foreign class slot classes */
@ -2745,7 +2745,7 @@ scm_init_goops_builtins (void)
create_port_classes (); create_port_classes ();
{ {
SCM name = scm_from_locale_symbol ("no-applicable-method"); SCM name = scm_from_latin1_symbol ("no-applicable-method");
scm_no_applicable_method = scm_no_applicable_method =
scm_make (scm_list_3 (scm_class_generic, k_name, name)); scm_make (scm_list_3 (scm_class_generic, k_name, name));
DEFVAR (name, scm_no_applicable_method); DEFVAR (name, scm_no_applicable_method);

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -1629,27 +1629,27 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
switch (*c_result) switch (*c_result)
{ {
case 0: case 0:
result = scm_from_locale_symbol ("parenthesize"); result = scm_from_latin1_symbol ("parenthesize");
break; break;
case 1: case 1:
result = scm_from_locale_symbol ("sign-before"); result = scm_from_latin1_symbol ("sign-before");
break; break;
case 2: case 2:
result = scm_from_locale_symbol ("sign-after"); result = scm_from_latin1_symbol ("sign-after");
break; break;
case 3: case 3:
result = scm_from_locale_symbol ("sign-before-currency-symbol"); result = scm_from_latin1_symbol ("sign-before-currency-symbol");
break; break;
case 4: case 4:
result = scm_from_locale_symbol ("sign-after-currency-symbol"); result = scm_from_latin1_symbol ("sign-after-currency-symbol");
break; break;
default: default:
result = scm_from_locale_symbol ("unspecified"); result = scm_from_latin1_symbol ("unspecified");
} }
break; break;
#endif #endif

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1998,1999,2000,2001, 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1998,1999,2000,2001, 2004, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -680,7 +680,7 @@ do_try_autocompile (void *data)
comp_mod = scm_c_resolve_module ("system base compile"); comp_mod = scm_c_resolve_module ("system base compile");
compile_file = scm_module_variable compile_file = scm_module_variable
(comp_mod, scm_from_locale_symbol ("compile-file")); (comp_mod, scm_from_latin1_symbol ("compile-file"));
if (scm_is_true (compile_file)) if (scm_is_true (compile_file))
{ {

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011
* Free Software Foundation, Inc. * Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -496,8 +496,8 @@ static SCM m_apply (SCM proc, SCM arg, SCM rest)
while (scm_is_pair (rest)) while (scm_is_pair (rest))
{ {
tail = MAKMEMO_CALL (MAKMEMO_MOD_REF (scm_list_1 (scm_from_locale_symbol ("guile")), tail = MAKMEMO_CALL (MAKMEMO_MOD_REF (scm_list_1 (scm_from_latin1_symbol ("guile")),
scm_from_locale_symbol ("cons"), scm_from_latin1_symbol ("cons"),
SCM_BOOL_F), SCM_BOOL_F),
2, 2,
scm_list_2 (scm_car (rest), tail)); scm_list_2 (scm_car (rest), tail));
@ -868,7 +868,7 @@ scm_init_memoize ()
#include "libguile/memoize.x" #include "libguile/memoize.x"
list_of_guile = scm_list_1 (scm_from_locale_symbol ("guile")); list_of_guile = scm_list_1 (scm_from_latin1_symbol ("guile"));
} }
/* /*

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1998,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc. /* Copyright (C) 1998,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -59,7 +59,7 @@ static SCM default_duplicate_binding_procedures_var;
static SCM unbound_variable (const char *func, SCM sym) static SCM unbound_variable (const char *func, SCM sym)
{ {
scm_error (scm_from_locale_symbol ("unbound-variable"), func, scm_error (scm_from_latin1_symbol ("unbound-variable"), func,
"Unbound variable: ~S", scm_list_1 (sym), SCM_BOOL_F); "Unbound variable: ~S", scm_list_1 (sym), SCM_BOOL_F);
} }

View file

@ -2233,11 +2233,11 @@ SCM_DEFINE (scm_port_conversion_strategy, "port-conversion-strategy",
h = scm_i_get_conversion_strategy (port); h = scm_i_get_conversion_strategy (port);
if (h == SCM_FAILED_CONVERSION_ERROR) if (h == SCM_FAILED_CONVERSION_ERROR)
return scm_from_locale_symbol ("error"); return scm_from_latin1_symbol ("error");
else if (h == SCM_FAILED_CONVERSION_QUESTION_MARK) else if (h == SCM_FAILED_CONVERSION_QUESTION_MARK)
return scm_from_locale_symbol ("substitute"); return scm_from_latin1_symbol ("substitute");
else if (h == SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE) else if (h == SCM_FAILED_CONVERSION_ESCAPE_SEQUENCE)
return scm_from_locale_symbol ("escape"); return scm_from_latin1_symbol ("escape");
else else
abort (); abort ();
@ -2275,14 +2275,14 @@ SCM_DEFINE (scm_set_port_conversion_strategy_x, "set-port-conversion-strategy!",
SCM_VALIDATE_OPPORT (1, port); SCM_VALIDATE_OPPORT (1, port);
} }
err = scm_from_locale_symbol ("error"); err = scm_from_latin1_symbol ("error");
if (scm_is_true (scm_eqv_p (sym, err))) if (scm_is_true (scm_eqv_p (sym, err)))
{ {
scm_i_set_conversion_strategy_x (port, SCM_FAILED_CONVERSION_ERROR); scm_i_set_conversion_strategy_x (port, SCM_FAILED_CONVERSION_ERROR);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
qm = scm_from_locale_symbol ("substitute"); qm = scm_from_latin1_symbol ("substitute");
if (scm_is_true (scm_eqv_p (sym, qm))) if (scm_is_true (scm_eqv_p (sym, qm)))
{ {
scm_i_set_conversion_strategy_x (port, scm_i_set_conversion_strategy_x (port,
@ -2290,7 +2290,7 @@ SCM_DEFINE (scm_set_port_conversion_strategy_x, "set-port-conversion-strategy!",
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
esc = scm_from_locale_symbol ("escape"); esc = scm_from_latin1_symbol ("escape");
if (scm_is_true (scm_eqv_p (sym, esc))) if (scm_is_true (scm_eqv_p (sym, esc)))
{ {
scm_i_set_conversion_strategy_x (port, scm_i_set_conversion_strategy_x (port,

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995-1999,2000,2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 1995-1999,2000,2001, 2002, 2003, 2004, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -1363,9 +1363,9 @@ scm_init_print ()
scm_init_opts (scm_print_options, scm_print_opts); scm_init_opts (scm_print_options, scm_print_opts);
scm_print_options (scm_list_4 (scm_from_locale_symbol ("highlight-prefix"), scm_print_options (scm_list_4 (scm_from_latin1_symbol ("highlight-prefix"),
scm_from_locale_string ("{"), scm_from_locale_string ("{"),
scm_from_locale_symbol ("highlight-suffix"), scm_from_latin1_symbol ("highlight-suffix"),
scm_from_locale_string ("}"))); scm_from_locale_string ("}")));
scm_gc_register_root (&print_state_pool); scm_gc_register_root (&print_state_pool);
@ -1374,7 +1374,7 @@ scm_init_print ()
layout = layout =
scm_make_struct_layout (scm_from_locale_string (SCM_PRINT_STATE_LAYOUT)); scm_make_struct_layout (scm_from_locale_string (SCM_PRINT_STATE_LAYOUT));
type = scm_make_struct (vtable, SCM_INUM0, scm_list_1 (layout)); type = scm_make_struct (vtable, SCM_INUM0, scm_list_1 (layout));
scm_set_struct_vtable_name_x (type, scm_from_locale_symbol ("print-state")); scm_set_struct_vtable_name_x (type, scm_from_latin1_symbol ("print-state"));
scm_print_state_vtable = type; scm_print_state_vtable = type;
/* Don't want to bind a wrapper class in GOOPS, so pass 0 as arg1. */ /* Don't want to bind a wrapper class in GOOPS, so pass 0 as arg1. */

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1997,1999,2000,2001, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1997,1999,2000,2001, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -165,7 +165,7 @@ scm_init_procs ()
scm_c_make_struct (scm_applicable_struct_with_setter_vtable_vtable, scm_c_make_struct (scm_applicable_struct_with_setter_vtable_vtable,
0, 0,
1, 1,
SCM_UNPACK (scm_from_locale_symbol ("pwpw"))); SCM_UNPACK (scm_from_latin1_symbol ("pwpw")));
#include "libguile/procs.x" #include "libguile/procs.x"
} }

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -77,7 +77,7 @@ scm_i_program_print (SCM program, SCM port, scm_print_state *pstate)
if (scm_is_false (write_program) && scm_module_system_booted_p) if (scm_is_false (write_program) && scm_module_system_booted_p)
write_program = scm_module_local_variable write_program = scm_module_local_variable
(scm_c_resolve_module ("system vm program"), (scm_c_resolve_module ("system vm program"),
scm_from_locale_symbol ("write-program")); scm_from_latin1_symbol ("write-program"));
if (SCM_PROGRAM_IS_CONTINUATION (program)) if (SCM_PROGRAM_IS_CONTINUATION (program))
{ {

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004, 2006, 2007, 2008, 2009, 2010 Free Software /* Copyright (C) 1995,1996,1997,1999,2000,2001,2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
* Foundation, Inc. * Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
@ -111,7 +111,7 @@ scm_i_input_error (char const *function,
string = scm_get_output_string (string_port); string = scm_get_output_string (string_port);
scm_close_output_port (string_port); scm_close_output_port (string_port);
scm_error_scm (scm_from_locale_symbol ("read-error"), scm_error_scm (scm_from_latin1_symbol ("read-error"),
function? scm_from_locale_string (function) : SCM_BOOL_F, function? scm_from_locale_string (function) : SCM_BOOL_F,
string, string,
arg, arg,

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3 of * as published by the Free Software Foundation; either version 3 of
@ -803,9 +803,9 @@ scm_compile_shell_switches (int argc, char **argv)
/* Wrap the expression in a prompt. */ /* Wrap the expression in a prompt. */
val = scm_list_2 (scm_list_3 (scm_sym_at, val = scm_list_2 (scm_list_3 (scm_sym_at,
scm_list_2 (scm_from_locale_symbol ("ice-9"), scm_list_2 (scm_from_latin1_symbol ("ice-9"),
scm_from_locale_symbol ("control")), scm_from_latin1_symbol ("control")),
scm_from_locale_symbol ("%")), scm_from_latin1_symbol ("%")),
val); val);
#if 0 #if 0

View file

@ -1,6 +1,6 @@
/* srfi-14.c --- SRFI-14 procedures for Guile /* srfi-14.c --- SRFI-14 procedures for Guile
* *
* Copyright (C) 2001, 2004, 2006, 2007, 2009 Free Software Foundation, Inc. * Copyright (C) 2001, 2004, 2006, 2007, 2009, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -2036,9 +2036,9 @@ SCM_DEFINE (scm_sys_char_set_dump, "%char-set-dump", 1, 0, 0, (SCM charset),
SCM_VALIDATE_SMOB (1, charset, charset); SCM_VALIDATE_SMOB (1, charset, charset);
cs = SCM_CHARSET_DATA (charset); cs = SCM_CHARSET_DATA (charset);
e1 = scm_cons (scm_from_locale_symbol ("char-set"), e1 = scm_cons (scm_from_latin1_symbol ("char-set"),
charset); charset);
e2 = scm_cons (scm_from_locale_symbol ("n"), e2 = scm_cons (scm_from_latin1_symbol ("n"),
scm_from_size_t (cs->len)); scm_from_size_t (cs->len));
for (i = 0; i < cs->len; i++) for (i = 0; i < cs->len; i++)
@ -2059,7 +2059,7 @@ SCM_DEFINE (scm_sys_char_set_dump, "%char-set-dump", 1, 0, 0, (SCM charset),
ranges = scm_append (scm_list_2 (ranges, ranges = scm_append (scm_list_2 (ranges,
scm_list_1 (elt))); scm_list_1 (elt)));
} }
e3 = scm_cons (scm_from_locale_symbol ("ranges"), e3 = scm_cons (scm_from_latin1_symbol ("ranges"),
ranges); ranges);
return scm_list_3 (e1, e2, e3); return scm_list_3 (e1, e2, e3);

View file

@ -1,5 +1,5 @@
/* A stack holds a frame chain /* A stack holds a frame chain
* Copyright (C) 1996,1997,2000,2001, 2006, 2007, 2008, 2009, 2010 Free Software Foundation * Copyright (C) 1996,1997,2000,2001, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -393,7 +393,7 @@ scm_init_stacks ()
scm_stack_type = scm_make_vtable (scm_from_locale_string (SCM_STACK_LAYOUT), scm_stack_type = scm_make_vtable (scm_from_locale_string (SCM_STACK_LAYOUT),
SCM_UNDEFINED); SCM_UNDEFINED);
scm_set_struct_vtable_name_x (scm_stack_type, scm_set_struct_vtable_name_x (scm_stack_type,
scm_from_locale_symbol ("stack")); scm_from_latin1_symbol ("stack"));
#include "libguile/stacks.x" #include "libguile/stacks.x"
} }

View file

@ -857,31 +857,31 @@ SCM_DEFINE (scm_sys_string_dump, "%string-dump", 1, 0, 0, (SCM str),
SCM_VALIDATE_STRING (1, str); SCM_VALIDATE_STRING (1, str);
/* String info */ /* String info */
e1 = scm_cons (scm_from_locale_symbol ("string"), e1 = scm_cons (scm_from_latin1_symbol ("string"),
str); str);
e2 = scm_cons (scm_from_locale_symbol ("start"), e2 = scm_cons (scm_from_latin1_symbol ("start"),
scm_from_size_t (STRING_START (str))); scm_from_size_t (STRING_START (str)));
e3 = scm_cons (scm_from_locale_symbol ("length"), e3 = scm_cons (scm_from_latin1_symbol ("length"),
scm_from_size_t (STRING_LENGTH (str))); scm_from_size_t (STRING_LENGTH (str)));
if (IS_SH_STRING (str)) if (IS_SH_STRING (str))
{ {
e4 = scm_cons (scm_from_locale_symbol ("shared"), e4 = scm_cons (scm_from_latin1_symbol ("shared"),
SH_STRING_STRING (str)); SH_STRING_STRING (str));
buf = STRING_STRINGBUF (SH_STRING_STRING (str)); buf = STRING_STRINGBUF (SH_STRING_STRING (str));
} }
else else
{ {
e4 = scm_cons (scm_from_locale_symbol ("shared"), e4 = scm_cons (scm_from_latin1_symbol ("shared"),
SCM_BOOL_F); SCM_BOOL_F);
buf = STRING_STRINGBUF (str); buf = STRING_STRINGBUF (str);
} }
if (IS_RO_STRING (str)) if (IS_RO_STRING (str))
e5 = scm_cons (scm_from_locale_symbol ("read-only"), e5 = scm_cons (scm_from_latin1_symbol ("read-only"),
SCM_BOOL_T); SCM_BOOL_T);
else else
e5 = scm_cons (scm_from_locale_symbol ("read-only"), e5 = scm_cons (scm_from_latin1_symbol ("read-only"),
SCM_BOOL_F); SCM_BOOL_F);
/* Stringbuf info */ /* Stringbuf info */
@ -891,7 +891,7 @@ SCM_DEFINE (scm_sys_string_dump, "%string-dump", 1, 0, 0, (SCM str),
char *cbuf; char *cbuf;
SCM sbc = scm_i_make_string (len, &cbuf); SCM sbc = scm_i_make_string (len, &cbuf);
memcpy (cbuf, STRINGBUF_CHARS (buf), len); memcpy (cbuf, STRINGBUF_CHARS (buf), len);
e6 = scm_cons (scm_from_locale_symbol ("stringbuf-chars"), e6 = scm_cons (scm_from_latin1_symbol ("stringbuf-chars"),
sbc); sbc);
} }
else else
@ -901,22 +901,22 @@ SCM_DEFINE (scm_sys_string_dump, "%string-dump", 1, 0, 0, (SCM str),
SCM sbc = scm_i_make_wide_string (len, &cbuf); SCM sbc = scm_i_make_wide_string (len, &cbuf);
u32_cpy ((scm_t_uint32 *) cbuf, u32_cpy ((scm_t_uint32 *) cbuf,
(scm_t_uint32 *) STRINGBUF_WIDE_CHARS (buf), len); (scm_t_uint32 *) STRINGBUF_WIDE_CHARS (buf), len);
e6 = scm_cons (scm_from_locale_symbol ("stringbuf-chars"), e6 = scm_cons (scm_from_latin1_symbol ("stringbuf-chars"),
sbc); sbc);
} }
e7 = scm_cons (scm_from_locale_symbol ("stringbuf-length"), e7 = scm_cons (scm_from_latin1_symbol ("stringbuf-length"),
scm_from_size_t (STRINGBUF_LENGTH (buf))); scm_from_size_t (STRINGBUF_LENGTH (buf)));
if (STRINGBUF_SHARED (buf)) if (STRINGBUF_SHARED (buf))
e8 = scm_cons (scm_from_locale_symbol ("stringbuf-shared"), e8 = scm_cons (scm_from_latin1_symbol ("stringbuf-shared"),
SCM_BOOL_T); SCM_BOOL_T);
else else
e8 = scm_cons (scm_from_locale_symbol ("stringbuf-shared"), e8 = scm_cons (scm_from_latin1_symbol ("stringbuf-shared"),
SCM_BOOL_F); SCM_BOOL_F);
if (STRINGBUF_WIDE (buf)) if (STRINGBUF_WIDE (buf))
e9 = scm_cons (scm_from_locale_symbol ("stringbuf-wide"), e9 = scm_cons (scm_from_latin1_symbol ("stringbuf-wide"),
SCM_BOOL_T); SCM_BOOL_T);
else else
e9 = scm_cons (scm_from_locale_symbol ("stringbuf-wide"), e9 = scm_cons (scm_from_latin1_symbol ("stringbuf-wide"),
SCM_BOOL_F); SCM_BOOL_F);
return scm_list_n (e1, e2, e3, e4, e5, e6, e7, e8, e9, SCM_UNDEFINED); return scm_list_n (e1, e2, e3, e4, e5, e6, e7, e8, e9, SCM_UNDEFINED);
@ -949,11 +949,11 @@ SCM_DEFINE (scm_sys_symbol_dump, "%symbol-dump", 1, 0, 0, (SCM sym),
SCM e1, e2, e3, e4, e5, e6, e7; SCM e1, e2, e3, e4, e5, e6, e7;
SCM buf; SCM buf;
SCM_VALIDATE_SYMBOL (1, sym); SCM_VALIDATE_SYMBOL (1, sym);
e1 = scm_cons (scm_from_locale_symbol ("symbol"), e1 = scm_cons (scm_from_latin1_symbol ("symbol"),
sym); sym);
e2 = scm_cons (scm_from_locale_symbol ("hash"), e2 = scm_cons (scm_from_latin1_symbol ("hash"),
scm_from_ulong (scm_i_symbol_hash (sym))); scm_from_ulong (scm_i_symbol_hash (sym)));
e3 = scm_cons (scm_from_locale_symbol ("interned"), e3 = scm_cons (scm_from_latin1_symbol ("interned"),
scm_symbol_interned_p (sym)); scm_symbol_interned_p (sym));
buf = SYMBOL_STRINGBUF (sym); buf = SYMBOL_STRINGBUF (sym);
@ -964,7 +964,7 @@ SCM_DEFINE (scm_sys_symbol_dump, "%symbol-dump", 1, 0, 0, (SCM sym),
char *cbuf; char *cbuf;
SCM sbc = scm_i_make_string (len, &cbuf); SCM sbc = scm_i_make_string (len, &cbuf);
memcpy (cbuf, STRINGBUF_CHARS (buf), len); memcpy (cbuf, STRINGBUF_CHARS (buf), len);
e4 = scm_cons (scm_from_locale_symbol ("stringbuf-chars"), e4 = scm_cons (scm_from_latin1_symbol ("stringbuf-chars"),
sbc); sbc);
} }
else else
@ -974,22 +974,22 @@ SCM_DEFINE (scm_sys_symbol_dump, "%symbol-dump", 1, 0, 0, (SCM sym),
SCM sbc = scm_i_make_wide_string (len, &cbuf); SCM sbc = scm_i_make_wide_string (len, &cbuf);
u32_cpy ((scm_t_uint32 *) cbuf, u32_cpy ((scm_t_uint32 *) cbuf,
(scm_t_uint32 *) STRINGBUF_WIDE_CHARS (buf), len); (scm_t_uint32 *) STRINGBUF_WIDE_CHARS (buf), len);
e4 = scm_cons (scm_from_locale_symbol ("stringbuf-chars"), e4 = scm_cons (scm_from_latin1_symbol ("stringbuf-chars"),
sbc); sbc);
} }
e5 = scm_cons (scm_from_locale_symbol ("stringbuf-length"), e5 = scm_cons (scm_from_latin1_symbol ("stringbuf-length"),
scm_from_size_t (STRINGBUF_LENGTH (buf))); scm_from_size_t (STRINGBUF_LENGTH (buf)));
if (STRINGBUF_SHARED (buf)) if (STRINGBUF_SHARED (buf))
e6 = scm_cons (scm_from_locale_symbol ("stringbuf-shared"), e6 = scm_cons (scm_from_latin1_symbol ("stringbuf-shared"),
SCM_BOOL_T); SCM_BOOL_T);
else else
e6 = scm_cons (scm_from_locale_symbol ("stringbuf-shared"), e6 = scm_cons (scm_from_latin1_symbol ("stringbuf-shared"),
SCM_BOOL_F); SCM_BOOL_F);
if (STRINGBUF_WIDE (buf)) if (STRINGBUF_WIDE (buf))
e7 = scm_cons (scm_from_locale_symbol ("stringbuf-wide"), e7 = scm_cons (scm_from_latin1_symbol ("stringbuf-wide"),
SCM_BOOL_T); SCM_BOOL_T);
else else
e7 = scm_cons (scm_from_locale_symbol ("stringbuf-wide"), e7 = scm_cons (scm_from_latin1_symbol ("stringbuf-wide"),
SCM_BOOL_F); SCM_BOOL_F);
return scm_list_n (e1, e2, e3, e4, e5, e6, e7, SCM_UNDEFINED); return scm_list_n (e1, e2, e3, e4, e5, e6, e7, SCM_UNDEFINED);

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1997,1998,2000,2001, 2003, 2004, 2006, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -341,7 +341,7 @@ handler_message (void *handler_data, SCM tag, SCM args)
char *prog_name = (char *) handler_data; char *prog_name = (char *) handler_data;
SCM p = scm_current_error_port (); SCM p = scm_current_error_port ();
if (scm_is_eq (tag, scm_from_locale_symbol ("syntax-error")) if (scm_is_eq (tag, scm_from_latin1_symbol ("syntax-error"))
&& scm_ilength (args) >= 5) && scm_ilength (args) >= 5)
{ {
SCM who = SCM_CAR (args); SCM who = SCM_CAR (args);
@ -465,7 +465,7 @@ handler_message (void *handler_data, SCM tag, SCM args)
SCM SCM
scm_handle_by_message (void *handler_data, SCM tag, SCM args) scm_handle_by_message (void *handler_data, SCM tag, SCM args)
{ {
if (scm_is_true (scm_eq_p (tag, scm_from_locale_symbol ("quit")))) if (scm_is_true (scm_eq_p (tag, scm_from_latin1_symbol ("quit"))))
exit (scm_exit_status (args)); exit (scm_exit_status (args));
handler_message (handler_data, tag, args); handler_message (handler_data, tag, args);
@ -485,7 +485,7 @@ scm_handle_by_message (void *handler_data, SCM tag, SCM args)
SCM SCM
scm_handle_by_message_noexit (void *handler_data, SCM tag, SCM args) scm_handle_by_message_noexit (void *handler_data, SCM tag, SCM args)
{ {
if (scm_is_true (scm_eq_p (tag, scm_from_locale_symbol ("quit")))) if (scm_is_true (scm_eq_p (tag, scm_from_latin1_symbol ("quit"))))
exit (scm_exit_status (args)); exit (scm_exit_status (args));
handler_message (handler_data, tag, args); handler_message (handler_data, tag, args);

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2001,2008,2009,2010 Free Software Foundation, Inc. /* Copyright (C) 2001,2008,2009,2010,2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -52,7 +52,7 @@ VM_DEFINE_LOADER (103, load_symbol, "load-symbol")
FETCH_LENGTH (len); FETCH_LENGTH (len);
SYNC_REGISTER (); SYNC_REGISTER ();
/* FIXME: should be scm_from_latin1_symboln */ /* FIXME: should be scm_from_latin1_symboln */
PUSH (scm_from_locale_symboln ((const char*)ip, len)); PUSH (scm_from_latin1_symboln ((const char*)ip, len));
ip += len; ip += len;
NEXT; NEXT;
} }

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc. /* Copyright (C) 2001, 2009, 2010, 2011 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -883,11 +883,11 @@ scm_bootstrap_vm (void)
"scm_init_vm", "scm_init_vm",
(scm_t_extension_init_func)scm_init_vm, NULL); (scm_t_extension_init_func)scm_init_vm, NULL);
sym_vm_run = scm_from_locale_symbol ("vm-run"); sym_vm_run = scm_from_latin1_symbol ("vm-run");
sym_vm_error = scm_from_locale_symbol ("vm-error"); sym_vm_error = scm_from_latin1_symbol ("vm-error");
sym_keyword_argument_error = scm_from_locale_symbol ("keyword-argument-error"); sym_keyword_argument_error = scm_from_latin1_symbol ("keyword-argument-error");
sym_regular = scm_from_locale_symbol ("regular"); sym_regular = scm_from_latin1_symbol ("regular");
sym_debug = scm_from_locale_symbol ("debug"); sym_debug = scm_from_latin1_symbol ("debug");
#ifdef VM_ENABLE_PRECISE_STACK_GC_SCAN #ifdef VM_ENABLE_PRECISE_STACK_GC_SCAN
vm_stack_gc_kind = vm_stack_gc_kind =