guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 13/15: Remove scm_puts_unlocked.


From: Andy Wingo
Subject: [Guile-commits] 13/15: Remove scm_puts_unlocked.
Date: Tue, 26 Apr 2016 21:38:56 +0000

wingo pushed a commit to branch wip-port-refactor
in repository guile.

commit 105e36543fdc6eecff3189c0b94fca80f5af8480
Author: Andy Wingo <address@hidden>
Date:   Tue Apr 26 23:07:28 2016 +0200

    Remove scm_puts_unlocked.
    
    * libguile/ports.h (scm_puts_unlocked): Remove.
    * libguile/ports.c (scm_puts): Replace implementation with
      scm_puts_unlocked's implementation.
    * libguile/arbiters.c:
    * libguile/backtrace.c:
    * libguile/bitvectors.c:
    * libguile/continuations.c:
    * libguile/deprecation.c:
    * libguile/dynl.c:
    * libguile/eval.c:
    * libguile/filesys.c:
    * libguile/fluids.c:
    * libguile/foreign.c:
    * libguile/fports.c:
    * libguile/frames.c:
    * libguile/guardians.c:
    * libguile/hashtab.c:
    * libguile/hooks.c:
    * libguile/load.c:
    * libguile/macros.c:
    * libguile/mallocs.c:
    * libguile/print.c:
    * libguile/programs.c:
    * libguile/promises.c:
    * libguile/smob.c:
    * libguile/srcprop.c:
    * libguile/srfi-14.c:
    * libguile/stackchk.c:
    * libguile/struct.c:
    * libguile/threads.c:
    * libguile/throw.c:
    * libguile/values.c:
    * libguile/variable.c:
    * libguile/vm.c:
    * libguile/weak-set.c:
    * libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked.
---
 libguile/arbiters.c      |    4 ++--
 libguile/backtrace.c     |    8 ++++----
 libguile/bitvectors.c    |    2 +-
 libguile/continuations.c |    6 +++---
 libguile/deprecation.c   |    2 +-
 libguile/dynl.c          |    4 ++--
 libguile/eval.c          |    2 +-
 libguile/filesys.c       |    6 +++---
 libguile/fluids.c        |    4 ++--
 libguile/foreign.c       |    2 +-
 libguile/fports.c        |    6 +++---
 libguile/frames.c        |    4 ++--
 libguile/guardians.c     |   10 +++++-----
 libguile/hashtab.c       |    4 ++--
 libguile/hooks.c         |    2 +-
 libguile/load.c          |   26 +++++++++++++-------------
 libguile/macros.c        |    4 ++--
 libguile/mallocs.c       |    2 +-
 libguile/ports.c         |   13 +++++--------
 libguile/ports.h         |    8 --------
 libguile/print.c         |   38 +++++++++++++++++++-------------------
 libguile/programs.c      |    6 +++---
 libguile/promises.c      |    2 +-
 libguile/smob.c          |    4 ++--
 libguile/srcprop.c       |    2 +-
 libguile/srfi-14.c       |   18 +++++++++---------
 libguile/stackchk.c      |    6 +++---
 libguile/struct.c        |   12 ++++++------
 libguile/threads.c       |   14 +++++++-------
 libguile/throw.c         |    2 +-
 libguile/values.c        |    4 ++--
 libguile/variable.c      |    4 ++--
 libguile/vm.c            |    4 ++--
 libguile/weak-set.c      |    6 +++---
 libguile/weak-table.c    |    6 +++---
 35 files changed, 118 insertions(+), 129 deletions(-)

diff --git a/libguile/arbiters.c b/libguile/arbiters.c
index e25be44..f1ace57 100644
--- a/libguile/arbiters.c
+++ b/libguile/arbiters.c
@@ -89,9 +89,9 @@ static scm_t_bits scm_tc16_arbiter;
 static int 
 arbiter_print (SCM exp, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<arbiter ", port);
+  scm_puts ("#<arbiter ", port);
   if (SCM_ARB_LOCKED (exp))
-    scm_puts_unlocked ("locked ", port);
+    scm_puts ("locked ", port);
   scm_iprin1 (SCM_PACK (SCM_SMOB_DATA (exp)), port, pstate);
   scm_putc ('>', port);
   return !0;
diff --git a/libguile/backtrace.c b/libguile/backtrace.c
index 36ef594..495a68b 100644
--- a/libguile/backtrace.c
+++ b/libguile/backtrace.c
@@ -58,9 +58,9 @@ static SCM
 boot_print_exception (SCM port, SCM frame, SCM key, SCM args)
 #define FUNC_NAME "boot-print-exception"
 {
-  scm_puts_unlocked ("Throw to key ", port);
+  scm_puts ("Throw to key ", port);
   scm_write (key, port);
-  scm_puts_unlocked (" with args ", port);
+  scm_puts (" with args ", port);
   scm_write (args, port);
   return SCM_UNSPECIFIED;
 }
@@ -253,7 +253,7 @@ error_during_backtrace (void *data, SCM tag, SCM throw_args)
 {
   SCM port = SCM_PACK_POINTER (data);
   
-  scm_puts_unlocked ("Exception thrown while printing backtrace:\n", port);
+  scm_puts ("Exception thrown while printing backtrace:\n", port);
   scm_print_exception (port, SCM_BOOL_F, tag, throw_args);
 
   return SCM_UNSPECIFIED;
@@ -311,7 +311,7 @@ SCM_DEFINE (scm_backtrace_with_highlights, "backtrace", 0, 
1, 0,
     highlights = SCM_EOL;
 
   scm_newline (port);
-  scm_puts_unlocked ("Backtrace:\n", port);
+  scm_puts ("Backtrace:\n", port);
   scm_display_backtrace_with_highlights (stack, port, SCM_BOOL_F, SCM_BOOL_F,
                                          highlights);
   scm_newline (port);
diff --git a/libguile/bitvectors.c b/libguile/bitvectors.c
index baa5e5e..7a4ed9b 100644
--- a/libguile/bitvectors.c
+++ b/libguile/bitvectors.c
@@ -57,7 +57,7 @@ scm_i_print_bitvector (SCM vec, SCM port, scm_print_state 
*pstate)
   scm_t_uint32 *bits = BITVECTOR_BITS (vec);
   size_t i, j;
 
-  scm_puts_unlocked ("#*", port);
+  scm_puts ("#*", port);
   for (i = 0; i < word_len; i++, bit_len -= 32)
     {
       scm_t_uint32 mask = 1;
diff --git a/libguile/continuations.c b/libguile/continuations.c
index 9efa435..3ce794b 100644
--- a/libguile/continuations.c
+++ b/libguile/continuations.c
@@ -92,9 +92,9 @@ continuation_print (SCM obj, SCM port, scm_print_state *state 
SCM_UNUSED)
 {
   scm_t_contregs *continuation = SCM_CONTREGS (obj);
 
-  scm_puts_unlocked ("#<continuation ", port);
+  scm_puts ("#<continuation ", port);
   scm_intprint (continuation->num_stack_items, 10, port);
-  scm_puts_unlocked (" @ ", port);
+  scm_puts (" @ ", port);
   scm_uintprint (SCM_SMOB_DATA_1 (obj), 16, port);
   scm_putc ('>', port);
   return 1;
@@ -404,7 +404,7 @@ print_exception_and_backtrace (SCM port, SCM tag, SCM args)
 
   if (should_print_backtrace (tag, stack))
     {
-      scm_puts_unlocked ("Backtrace:\n", port);
+      scm_puts ("Backtrace:\n", port);
       scm_display_backtrace_with_highlights (stack, port,
                                              SCM_BOOL_F, SCM_BOOL_F,
                                              SCM_EOL);
diff --git a/libguile/deprecation.c b/libguile/deprecation.c
index 1be3aea..aa50eaf 100644
--- a/libguile/deprecation.c
+++ b/libguile/deprecation.c
@@ -83,7 +83,7 @@ scm_c_issue_deprecation_warning (const char *msg)
             fprintf (stderr, "%s\n", msg);
           else
             {
-              scm_puts_unlocked (msg, scm_current_warning_port ());
+              scm_puts (msg, scm_current_warning_port ());
               scm_newline (scm_current_warning_port ());
             }
         }
diff --git a/libguile/dynl.c b/libguile/dynl.c
index d557faa..0061234 100644
--- a/libguile/dynl.c
+++ b/libguile/dynl.c
@@ -229,10 +229,10 @@ scm_t_bits scm_tc16_dynamic_obj;
 static int
 dynl_obj_print (SCM exp, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<dynamic-object ", port);
+  scm_puts ("#<dynamic-object ", port);
   scm_iprin1 (DYNL_FILENAME (exp), port, pstate);
   if (DYNL_HANDLE (exp) == NULL)
-    scm_puts_unlocked (" (unlinked)", port);
+    scm_puts (" (unlinked)", port);
   scm_putc ('>', port);
   return 1;
 }
diff --git a/libguile/eval.c b/libguile/eval.c
index dca790c..a20572f 100644
--- a/libguile/eval.c
+++ b/libguile/eval.c
@@ -920,7 +920,7 @@ static int
 boot_closure_print (SCM closure, SCM port, scm_print_state *pstate)
 {
   SCM args;
-  scm_puts_unlocked ("#<boot-closure ", port);
+  scm_puts ("#<boot-closure ", port);
   scm_uintprint (SCM_UNPACK (closure), 16, port);
   scm_putc (' ', port);
   args = scm_make_list (scm_from_int (BOOT_CLOSURE_NUM_REQUIRED_ARGS 
(closure)),
diff --git a/libguile/filesys.c b/libguile/filesys.c
index c0acb8d..3264b29 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -1820,10 +1820,10 @@ SCM_DEFINE (scm_closedir, "closedir", 1, 0, 0,
 static int
 scm_dir_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
-  scm_puts_unlocked ("#<", port);
+  scm_puts ("#<", port);
   if (!SCM_DIR_OPEN_P (exp))
-    scm_puts_unlocked ("closed: ", port);
-  scm_puts_unlocked ("directory stream ", port);
+    scm_puts ("closed: ", port);
+  scm_puts ("directory stream ", port);
   scm_uintprint (SCM_SMOB_DATA_1 (exp), 16, port);
   scm_putc ('>', port);
   return 1;
diff --git a/libguile/fluids.c b/libguile/fluids.c
index d50fc54..5ff92a8 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -79,7 +79,7 @@ grow_dynamic_state (SCM state)
 void
 scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
-  scm_puts_unlocked ("#<fluid ", port);
+  scm_puts ("#<fluid ", port);
   scm_intprint ((int) FLUID_NUM (exp), 10, port);
   scm_putc ('>', port);
 }
@@ -87,7 +87,7 @@ scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
 void
 scm_i_dynamic_state_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
 {
-  scm_puts_unlocked ("#<dynamic-state ", port);
+  scm_puts ("#<dynamic-state ", port);
   scm_intprint (SCM_UNPACK (exp), 16, port);
   scm_putc ('>', port);
 }
diff --git a/libguile/foreign.c b/libguile/foreign.c
index 1f30cd8..e6ba533 100644
--- a/libguile/foreign.c
+++ b/libguile/foreign.c
@@ -313,7 +313,7 @@ SCM_DEFINE (scm_set_pointer_finalizer_x, 
"set-pointer-finalizer!", 2, 0, 0,
 void
 scm_i_pointer_print (SCM pointer, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<pointer 0x", port);
+  scm_puts ("#<pointer 0x", port);
   scm_uintprint (scm_to_uintptr_t (scm_pointer_address (pointer)), 16, port);
   scm_putc ('>', port);
 }
diff --git a/libguile/fports.c b/libguile/fports.c
index 59cabf2..c6071fe 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -546,7 +546,7 @@ SCM_DEFINE (scm_adjust_port_revealed_x, 
"adjust-port-revealed!", 2, 0, 0,
 static int 
 fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
-  scm_puts_unlocked ("#<", port);
+  scm_puts ("#<", port);
   scm_print_port_mode (exp, port);    
   if (SCM_OPFPORTP (exp))
     {
@@ -555,7 +555,7 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
       if (scm_is_string (name) || scm_is_symbol (name))
        scm_display (name, port);
       else
-       scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
+       scm_puts (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
       scm_putc (' ', port);
       fdes = (SCM_FSTREAM (exp))->fdes;
 
@@ -568,7 +568,7 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
     }
   else
     {
-      scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
+      scm_puts (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
       scm_putc (' ', port);
       scm_uintprint ((scm_t_bits) SCM_PTAB_ENTRY (exp), 16, port);
     }
diff --git a/libguile/frames.c b/libguile/frames.c
index 221964f..bc2e501 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -41,7 +41,7 @@ scm_c_make_frame (enum scm_vm_frame_kind kind, const struct 
scm_frame *frame)
 void
 scm_i_frame_print (SCM frame, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<frame ", port);
+  scm_puts ("#<frame ", port);
   scm_uintprint (SCM_UNPACK (frame), 16, port);
   if (scm_module_system_booted_p)
     {
@@ -54,7 +54,7 @@ scm_i_frame_print (SCM frame, SCM port, scm_print_state 
*pstate)
         }
     }
   /* Don't write args, they can be ridiculously long. */
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
 }
 
 static union scm_vm_stack_element*
diff --git a/libguile/guardians.c b/libguile/guardians.c
index 86e39ee..63b8ec0 100644
--- a/libguile/guardians.c
+++ b/libguile/guardians.c
@@ -86,16 +86,16 @@ guardian_print (SCM guardian, SCM port, scm_print_state 
*pstate SCM_UNUSED)
 {
   t_guardian *g = GUARDIAN_DATA (guardian);
   
-  scm_puts_unlocked ("#<guardian ", port);
+  scm_puts ("#<guardian ", port);
   scm_uintprint ((scm_t_bits) g, 16, port);
 
-  scm_puts_unlocked (" (reachable: ", port);
+  scm_puts (" (reachable: ", port);
   scm_display (scm_from_uint (g->live), port);
-  scm_puts_unlocked (" unreachable: ", port);
+  scm_puts (" unreachable: ", port);
   scm_display (scm_length (g->zombies), port);
-  scm_puts_unlocked (")", port);
+  scm_puts (")", port);
 
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
 
   return 1;
 }
diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index cbeaed7..4b98744 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -168,14 +168,14 @@ scm_i_rehash (SCM table,
 void
 scm_i_hashtable_print (SCM exp, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<hash-table ", port);
+  scm_puts ("#<hash-table ", port);
   scm_uintprint (SCM_UNPACK (exp), 16, port);
   scm_putc (' ', port);
   scm_uintprint (SCM_HASHTABLE_N_ITEMS (exp), 10, port);
   scm_putc ('/', port);
   scm_uintprint (SCM_SIMPLE_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)),
                 10, port);
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
 }
 
 
diff --git a/libguile/hooks.c b/libguile/hooks.c
index 39b92ec..14335f8 100644
--- a/libguile/hooks.c
+++ b/libguile/hooks.c
@@ -134,7 +134,7 @@ static int
 hook_print (SCM hook, SCM port, scm_print_state *pstate)
 {
   SCM ls, name;
-  scm_puts_unlocked ("#<hook ", port);
+  scm_puts ("#<hook ", port);
   scm_intprint (SCM_HOOK_ARITY (hook), 10, port);
   scm_putc (' ', port);
   scm_uintprint (SCM_UNPACK (hook), 16, port);
diff --git a/libguile/load.c b/libguile/load.c
index d26f9fc..8975414 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -560,11 +560,11 @@ compiled_is_fresh (SCM full_filename, SCM 
compiled_filename,
   else
     {
       compiled_is_newer = 0;
-      scm_puts_unlocked (";;; note: source file ", scm_current_warning_port 
());
+      scm_puts (";;; note: source file ", scm_current_warning_port ());
       scm_display (full_filename, scm_current_warning_port ());
-      scm_puts_unlocked ("\n;;;       newer than compiled ", 
scm_current_warning_port ());
+      scm_puts ("\n;;;       newer than compiled ", scm_current_warning_port 
());
       scm_display (compiled_filename, scm_current_warning_port ());
-      scm_puts_unlocked ("\n", scm_current_warning_port ());
+      scm_puts ("\n", scm_current_warning_port ());
     }
 
   return compiled_is_newer;
@@ -704,7 +704,7 @@ search_path (SCM path, SCM filename, SCM extensions, SCM 
require_exts,
 
               if (found_stale_file && *found_stale_file)
                 {
-                  scm_puts_unlocked (";;; found fresh compiled file at ",
+                  scm_puts (";;; found fresh compiled file at ",
                                      scm_current_warning_port ());
                   scm_display (found, scm_current_warning_port ());
                   scm_newline (scm_current_warning_port ());
@@ -823,7 +823,7 @@ do_try_auto_compile (void *data)
   SCM source = SCM_PACK_POINTER (data);
   SCM comp_mod, compile_file;
 
-  scm_puts_unlocked (";;; compiling ", scm_current_warning_port ());
+  scm_puts (";;; compiling ", scm_current_warning_port ());
   scm_display (source, scm_current_warning_port ());
   scm_newline (scm_current_warning_port ());
 
@@ -852,16 +852,16 @@ do_try_auto_compile (void *data)
       /* Assume `*current-warning-prefix*' has an appropriate value.  */
       res = scm_call_n (scm_variable_ref (compile_file), args, 5);
 
-      scm_puts_unlocked (";;; compiled ", scm_current_warning_port ());
+      scm_puts (";;; compiled ", scm_current_warning_port ());
       scm_display (res, scm_current_warning_port ());
       scm_newline (scm_current_warning_port ());
       return res;
     }
   else
     {
-      scm_puts_unlocked (";;; it seems ", scm_current_warning_port ());
+      scm_puts (";;; it seems ", scm_current_warning_port ());
       scm_display (source, scm_current_warning_port ());
-      scm_puts_unlocked ("\n;;; is part of the compiler; skipping 
auto-compilation\n",
+      scm_puts ("\n;;; is part of the compiler; skipping auto-compilation\n",
                 scm_current_warning_port ());
       return SCM_BOOL_F;
     }
@@ -876,16 +876,16 @@ auto_compile_catch_handler (void *data, SCM tag, SCM 
throw_args)
   oport = scm_open_output_string ();
   scm_print_exception (oport, SCM_BOOL_F, tag, throw_args);
 
-  scm_puts_unlocked (";;; WARNING: compilation of ", scm_current_warning_port 
());
+  scm_puts (";;; WARNING: compilation of ", scm_current_warning_port ());
   scm_display (source, scm_current_warning_port ());
-  scm_puts_unlocked (" failed:\n", scm_current_warning_port ());
+  scm_puts (" failed:\n", scm_current_warning_port ());
 
   lines = scm_string_split (scm_get_output_string (oport),
                             SCM_MAKE_CHAR ('\n'));
   for (; scm_is_pair (lines); lines = scm_cdr (lines))
     if (scm_c_string_length (scm_car (lines)))
       {
-        scm_puts_unlocked (";;; ", scm_current_warning_port ());
+        scm_puts (";;; ", scm_current_warning_port ());
         scm_display (scm_car (lines), scm_current_warning_port ());
         scm_newline (scm_current_warning_port ());
       }
@@ -903,7 +903,7 @@ SCM_DEFINE (scm_sys_warn_auto_compilation_enabled, 
"%warn-auto-compilation-enabl
 
   if (!message_shown)
     {
-      scm_puts_unlocked (";;; note: auto-compilation is enabled, set 
GUILE_AUTO_COMPILE=0\n"
+      scm_puts (";;; note: auto-compilation is enabled, set 
GUILE_AUTO_COMPILE=0\n"
                 ";;;       or pass the --no-auto-compile argument to 
disable.\n",
                 scm_current_warning_port ());
       message_shown = 1;
@@ -1040,7 +1040,7 @@ SCM_DEFINE (scm_primitive_load_path, 
"primitive-load-path", 0, 0, 1,
         {
           if (found_stale_compiled_file)
             {
-              scm_puts_unlocked (";;; found fresh local cache at ",
+              scm_puts (";;; found fresh local cache at ",
                                  scm_current_warning_port ());
               scm_display (fallback, scm_current_warning_port ());
               scm_newline (scm_current_warning_port ());
diff --git a/libguile/macros.c b/libguile/macros.c
index c5807b6..94421c1 100644
--- a/libguile/macros.c
+++ b/libguile/macros.c
@@ -49,9 +49,9 @@ static int
 macro_print (SCM macro, SCM port, scm_print_state *pstate)
 {
   if (scm_is_false (SCM_MACRO_TYPE (macro)))
-    scm_puts_unlocked ("#<primitive-syntax-transformer ", port);
+    scm_puts ("#<primitive-syntax-transformer ", port);
   else
-    scm_puts_unlocked ("#<syntax-transformer ", port);
+    scm_puts ("#<syntax-transformer ", port);
   scm_iprin1 (scm_macro_name (macro), port, pstate);
   scm_putc ('>', port);
 
diff --git a/libguile/mallocs.c b/libguile/mallocs.c
index 1dc751e..23c1a60 100644
--- a/libguile/mallocs.c
+++ b/libguile/mallocs.c
@@ -44,7 +44,7 @@ scm_t_bits scm_tc16_malloc;
 static int
 malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
-  scm_puts_unlocked ("#<malloc ", port);
+  scm_puts ("#<malloc ", port);
   scm_uintprint (SCM_SMOB_DATA (exp), 16, port);
   scm_putc ('>', port);
   return 1;
diff --git a/libguile/ports.c b/libguile/ports.c
index 1076d76..77dfc83 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -2486,11 +2486,8 @@ scm_putc (char c, SCM port)
 void
 scm_puts (const char *s, SCM port)
 {
-  scm_i_pthread_mutex_t *lock;
-  scm_c_lock_port (port, &lock);
-  scm_puts_unlocked (s, port);
-  if (lock)
-    scm_i_pthread_mutex_unlock (lock);
+  SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port");
+  scm_lfwrite_unlocked (s, strlen (s), port);
 }
   
 static void
@@ -2999,7 +2996,7 @@ SCM_DEFINE (scm_set_port_filename_x, 
"set-port-filename!", 2, 0, 0,
 void
 scm_print_port_mode (SCM exp, SCM port)
 {
-  scm_puts_unlocked (SCM_CLOSEDP (exp)
+  scm_puts (SCM_CLOSEDP (exp)
            ? "closed: "
            : (SCM_RDNG & SCM_CELL_WORD_0 (exp)
               ? (SCM_WRTNG & SCM_CELL_WORD_0 (exp)
@@ -3017,9 +3014,9 @@ scm_port_print (SCM exp, SCM port, scm_print_state 
*pstate SCM_UNUSED)
   char *type = SCM_PTOBNAME (SCM_PTOBNUM (exp));
   if (!type)
     type = "port";
-  scm_puts_unlocked ("#<", port);
+  scm_puts ("#<", port);
   scm_print_port_mode (exp, port);
-  scm_puts_unlocked (type, port);
+  scm_puts (type, port);
   scm_putc (' ', port);
   scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
   scm_putc ('>', port);
diff --git a/libguile/ports.h b/libguile/ports.h
index 70bf3ad..4019821 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -325,7 +325,6 @@ SCM_INTERNAL SCM scm_port_write_buffer (SCM port);
 /* Output.  */
 SCM_API void scm_putc (char c, SCM port);
 SCM_API void scm_puts (const char *str_data, SCM port);
-SCM_INLINE void scm_puts_unlocked (const char *str_data, SCM port);
 SCM_API void scm_c_write (SCM port, const void *buffer, size_t size);
 SCM_API void scm_c_write_unlocked (SCM port, const void *buffer, size_t size);
 SCM_API void scm_c_write_bytes (SCM port, SCM src, size_t start, size_t count);
@@ -394,13 +393,6 @@ scm_c_try_lock_port (SCM port, scm_i_pthread_mutex_t 
**lock)
   else
     return 0;
 }
-
-SCM_INLINE_IMPLEMENTATION void
-scm_puts_unlocked (const char *s, SCM port)
-{
-  SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port");
-  scm_lfwrite_unlocked (s, strlen (s), port);
-}
 #endif  /* SCM_CAN_INLINE || defined SCM_INLINE_C_IMPLEMENTING_INLINES */
 
 #endif  /* SCM_PORTS_H */
diff --git a/libguile/print.c b/libguile/print.c
index 8c6b999..2f03d0c 100644
--- a/libguile/print.c
+++ b/libguile/print.c
@@ -566,7 +566,7 @@ static void iprin1 (SCM exp, SCM port, scm_print_state 
*pstate);
         scm_intprint (i, 8, port);              \
       else                                      \
         {                                       \
-          scm_puts_unlocked ("x", port);                 \
+          scm_puts ("x", port);                 \
           scm_intprint (i, 16, port);           \
         }                                       \
     }                                           \
@@ -610,7 +610,7 @@ print_vector_or_weak_vector (SCM v, size_t len, SCM (*ref) 
(SCM, size_t),
       scm_iprin1 (ref (v, i), port, pstate);
     }
   if (cutp)
-    scm_puts_unlocked (" ...", port);
+    scm_puts (" ...", port);
   scm_putc (')', port);
 }
 
@@ -648,7 +648,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
       else if (SCM_IFLAGP (exp)
               && ((size_t) SCM_IFLAGNUM (exp) < (sizeof iflagnames / sizeof 
(char *))))
         {
-          scm_puts_unlocked (iflagnames [SCM_IFLAGNUM (exp)], port);
+          scm_puts (iflagnames [SCM_IFLAGNUM (exp)], port);
         }
       else
        {
@@ -742,7 +742,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
            }
          else
            {
-             scm_puts_unlocked ("#<uninterned-symbol ", port);
+             scm_puts ("#<uninterned-symbol ", port);
              print_symbol (exp, port);
              scm_putc (' ', port);
              scm_uintprint (SCM_UNPACK (exp), 16, port);
@@ -777,7 +777,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
          scm_i_frame_print (exp, port, pstate);
          break;
         case scm_tc7_keyword:
-          scm_puts_unlocked ("#:", port);
+          scm_puts ("#:", port);
           scm_iprin1 (scm_keyword_to_symbol (exp), port, pstate);
           break;
        case scm_tc7_vm_cont:
@@ -796,14 +796,14 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
          break;
        case scm_tc7_wvect:
          ENTER_NESTED_DATA (pstate, exp, circref);
-          scm_puts_unlocked ("#w(", port);
+          scm_puts ("#w(", port);
           print_vector_or_weak_vector (exp, scm_c_weak_vector_length (exp),
                                        scm_c_weak_vector_ref, port, pstate);
          EXIT_NESTED_DATA (pstate);
          break;
        case scm_tc7_vector:
          ENTER_NESTED_DATA (pstate, exp, circref);
-         scm_puts_unlocked ("#(", port);
+         scm_puts ("#(", port);
           print_vector_or_weak_vector (exp, SCM_SIMPLE_VECTOR_LENGTH (exp),
                                        scm_c_vector_ref, port, pstate);
          EXIT_NESTED_DATA (pstate);
@@ -1282,7 +1282,7 @@ write_character_escaped (scm_t_wchar ch, int 
string_escapes_p, SCM port)
 
       name = scm_i_charname (SCM_MAKE_CHAR (ch));
       if (name != NULL)
-       scm_puts_unlocked (name, port);
+       scm_puts (name, port);
       else
        PRINT_CHAR_ESCAPE (ch, port);
     }
@@ -1392,17 +1392,17 @@ scm_uintprint (scm_t_uintmax n, int radix, SCM port)
 void 
 scm_ipruk (char *hdr, SCM ptr, SCM port)
 {
-  scm_puts_unlocked ("#<unknown-", port);
-  scm_puts_unlocked (hdr, port);
+  scm_puts ("#<unknown-", port);
+  scm_puts (hdr, port);
   if (1) /* (scm_in_heap_p (ptr)) */ /* FIXME */
     {
-      scm_puts_unlocked (" (0x", port);
+      scm_puts (" (0x", port);
       scm_uintprint (SCM_CELL_WORD_0 (ptr), 16, port);
-      scm_puts_unlocked (" . 0x", port);
+      scm_puts (" . 0x", port);
       scm_uintprint (SCM_CELL_WORD_1 (ptr), 16, port);
-      scm_puts_unlocked (") @", port);
+      scm_puts (") @", port);
     }
-  scm_puts_unlocked (" 0x", port);
+  scm_puts (" 0x", port);
   scm_uintprint (SCM_UNPACK (ptr), 16, port);
   scm_putc ('>', port);
 }
@@ -1415,7 +1415,7 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, 
scm_print_state *pstate)
 {
   register SCM hare, tortoise;
   long floor = pstate->top - 2;
-  scm_puts_unlocked (hdr, port);
+  scm_puts (hdr, port);
   /* CHECK_INTS; */
   if (pstate->fancyp)
     goto fancy_printing;
@@ -1451,7 +1451,7 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, 
scm_print_state *pstate)
     }
   if (!SCM_NULL_OR_NIL_P (exp))
     {
-      scm_puts_unlocked (" . ", port);
+      scm_puts (" . ", port);
       scm_iprin1 (exp, port, pstate);
     }
 
@@ -1477,7 +1477,7 @@ fancy_printing:
          {
            if (n == 0)
              {
-               scm_puts_unlocked (" ...", port);
+               scm_puts (" ...", port);
                goto skip_tail;
              }
            else
@@ -1492,7 +1492,7 @@ fancy_printing:
   }
   if (!SCM_NULL_OR_NIL_P (exp))
     {
-      scm_puts_unlocked (" . ", port);
+      scm_puts (" . ", port);
       scm_iprin1 (exp, port, pstate);
     }
 skip_tail:
@@ -1503,7 +1503,7 @@ fancy_circref:
   pstate->list_offset -= pstate->top - floor - 2;
   
 circref:
-  scm_puts_unlocked (" . ", port);
+  scm_puts (" . ", port);
   print_circref (port, pstate, exp);
   goto end;
 }
diff --git a/libguile/programs.c b/libguile/programs.c
index 72990d4..49d4c77 100644
--- a/libguile/programs.c
+++ b/libguile/programs.c
@@ -103,20 +103,20 @@ scm_i_program_print (SCM program, SCM port, 
scm_print_state *pstate)
   if (SCM_PROGRAM_IS_CONTINUATION (program))
     {
       /* twingliness */
-      scm_puts_unlocked ("#<continuation ", port);
+      scm_puts ("#<continuation ", port);
       scm_uintprint (SCM_UNPACK (program), 16, port);
       scm_putc ('>', port);
     }
   else if (SCM_PROGRAM_IS_PARTIAL_CONTINUATION (program))
     {
       /* twingliness */
-      scm_puts_unlocked ("#<partial-continuation ", port);
+      scm_puts ("#<partial-continuation ", port);
       scm_uintprint (SCM_UNPACK (program), 16, port);
       scm_putc ('>', port);
     }
   else if (scm_is_false (write_program) || print_error)
     {
-      scm_puts_unlocked ("#<program ", port);
+      scm_puts ("#<program ", port);
       scm_uintprint (SCM_UNPACK (program), 16, port);
       scm_putc (' ', port);
       scm_uintprint ((scm_t_uintptr) SCM_PROGRAM_CODE (program), 16, port);
diff --git a/libguile/promises.c b/libguile/promises.c
index 2435d80..3bbb489 100644
--- a/libguile/promises.c
+++ b/libguile/promises.c
@@ -88,7 +88,7 @@ static int
 promise_print (SCM exp, SCM port, scm_print_state *pstate)
 {
   int writingp = SCM_WRITINGP (pstate);
-  scm_puts_unlocked ("#<promise ", port);
+  scm_puts ("#<promise ", port);
   SCM_SET_WRITINGP (pstate, 1);
   scm_iprin1 (SCM_PROMISE_DATA (exp), port, pstate);
   SCM_SET_WRITINGP (pstate, writingp);
diff --git a/libguile/smob.c b/libguile/smob.c
index 7bcd044..6a97caa 100644
--- a/libguile/smob.c
+++ b/libguile/smob.c
@@ -105,8 +105,8 @@ int
 scm_smob_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   long n = SCM_SMOBNUM (exp);
-  scm_puts_unlocked ("#<", port);
-  scm_puts_unlocked (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port);
+  scm_puts ("#<", port);
+  scm_puts (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port);
   scm_putc (' ', port);
   if (scm_smobs[n].size)
     scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
diff --git a/libguile/srcprop.c b/libguile/srcprop.c
index 1f6e59a..963b2f8 100644
--- a/libguile/srcprop.c
+++ b/libguile/srcprop.c
@@ -104,7 +104,7 @@ static int
 srcprops_print (SCM obj, SCM port, scm_print_state *pstate)
 {
   int writingp = SCM_WRITINGP (pstate);
-  scm_puts_unlocked ("#<srcprops ", port);
+  scm_puts ("#<srcprops ", port);
   SCM_SET_WRITINGP (pstate, 1);
   scm_iprin1 (scm_srcprops_to_alist (obj), port, pstate);
   SCM_SET_WRITINGP (pstate, writingp);
diff --git a/libguile/srfi-14.c b/libguile/srfi-14.c
index bf95ce9..af7c1d9 100644
--- a/libguile/srfi-14.c
+++ b/libguile/srfi-14.c
@@ -597,27 +597,27 @@ charset_print (SCM charset, SCM port, scm_print_state 
*pstate SCM_UNUSED)
 
   p = SCM_CHARSET_DATA (charset);
 
-  scm_puts_unlocked ("#<charset {", port);
+  scm_puts ("#<charset {", port);
   for (i = 0; i < p->len; i++)
     {
       if (first)
         first = 0;
       else
-        scm_puts_unlocked (" ", port);
+        scm_puts (" ", port);
       scm_write (SCM_MAKE_CHAR (p->ranges[i].lo), port);
       if (p->ranges[i].lo != p->ranges[i].hi)
         {
-          scm_puts_unlocked ("..", port);
+          scm_puts ("..", port);
           scm_write (SCM_MAKE_CHAR (p->ranges[i].hi), port);
         }
       if (i >= max_ranges_to_print)
         {
           /* Too many to print here.  Quit early.  */
-          scm_puts_unlocked (" ...", port);
+          scm_puts (" ...", port);
           break;
         }
     }
-  scm_puts_unlocked ("}>", port);
+  scm_puts ("}>", port);
   return 1;
 }
 
@@ -630,16 +630,16 @@ charset_cursor_print (SCM cursor, SCM port,
 
   cur = (scm_t_char_set_cursor *) SCM_SMOB_DATA (cursor);
 
-  scm_puts_unlocked ("#<charset-cursor ", port);
+  scm_puts ("#<charset-cursor ", port);
   if (cur->range == (size_t) (-1))
-    scm_puts_unlocked ("(empty)", port);
+    scm_puts ("(empty)", port);
   else
     {
       scm_write (scm_from_size_t (cur->range), port);
-      scm_puts_unlocked (":", port);
+      scm_puts (":", port);
       scm_write (scm_from_int32 (cur->n), port);
     }
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
   return 1;
 }
 
diff --git a/libguile/stackchk.c b/libguile/stackchk.c
index 6a88c3e..146dac5 100644
--- a/libguile/stackchk.c
+++ b/libguile/stackchk.c
@@ -58,11 +58,11 @@ scm_stack_report ()
   scm_uintprint ((scm_stack_size (thread->continuation_base) 
                  * sizeof (SCM_STACKITEM)),
                 16, port);
-  scm_puts_unlocked (" of stack: 0x", port);
+  scm_puts (" of stack: 0x", port);
   scm_uintprint ((scm_t_bits) thread->continuation_base, 16, port);
-  scm_puts_unlocked (" - 0x", port);
+  scm_puts (" - 0x", port);
   scm_uintprint ((scm_t_bits) &stack, 16, port);
-  scm_puts_unlocked ("\n", port);
+  scm_puts ("\n", port);
 }
 
 
diff --git a/libguile/struct.c b/libguile/struct.c
index 4c9d8da..51c0f11 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -936,7 +936,7 @@ scm_print_struct (SCM exp, SCM port, scm_print_state 
*pstate)
     {
       SCM vtable = SCM_STRUCT_VTABLE (exp);
       SCM name = scm_struct_vtable_name (vtable);
-      scm_puts_unlocked ("#<", port);
+      scm_puts ("#<", port);
       if (scm_is_true (name))
        {
           scm_display (name, port);
@@ -945,9 +945,9 @@ scm_print_struct (SCM exp, SCM port, scm_print_state 
*pstate)
       else
        {
           if (SCM_VTABLE_FLAG_IS_SET (vtable, SCM_VTABLE_FLAG_VTABLE))
-            scm_puts_unlocked ("vtable:", port);
+            scm_puts ("vtable:", port);
           else
-            scm_puts_unlocked ("struct:", port);
+            scm_puts ("struct:", port);
           scm_uintprint (SCM_UNPACK (vtable), 16, port);
           scm_putc (' ', port);
           scm_write (SCM_VTABLE_LAYOUT (vtable), port);
@@ -959,15 +959,15 @@ scm_print_struct (SCM exp, SCM port, scm_print_state 
*pstate)
         {
           if (scm_is_true (SCM_STRUCT_PROCEDURE (exp)))
             {
-              scm_puts_unlocked (" proc: ", port);
+              scm_puts (" proc: ", port);
               if (scm_is_true (scm_procedure_p (SCM_STRUCT_PROCEDURE (exp))))
                 scm_write (SCM_STRUCT_PROCEDURE (exp), port);
               else
-                scm_puts_unlocked ("(not a procedure?)", port);
+                scm_puts ("(not a procedure?)", port);
             }
           if (SCM_STRUCT_SETTER_P (exp))
             {
-              scm_puts_unlocked (" setter: ", port);
+              scm_puts (" setter: ", port);
               scm_write (SCM_STRUCT_SETTER (exp), port);
             }
         }
diff --git a/libguile/threads.c b/libguile/threads.c
index 3dc0f40..b609930 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -264,11 +264,11 @@ thread_print (SCM exp, SCM port, scm_print_state *pstate 
SCM_UNUSED)
   else
     id = u.um;
 
-  scm_puts_unlocked ("#<thread ", port);
+  scm_puts ("#<thread ", port);
   scm_uintprint (id, 10, port);
-  scm_puts_unlocked (" (", port);
+  scm_puts (" (", port);
   scm_uintprint ((scm_t_bits)t, 16, port);
-  scm_puts_unlocked (")>", port);
+  scm_puts (")>", port);
   return 1;
 }
 
@@ -1197,9 +1197,9 @@ static int
 fat_mutex_print (SCM mx, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   fat_mutex *m = SCM_MUTEX_DATA (mx);
-  scm_puts_unlocked ("#<mutex ", port);
+  scm_puts ("#<mutex ", port);
   scm_uintprint ((scm_t_bits)m, 16, port);
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
   return 1;
 }
 
@@ -1658,9 +1658,9 @@ static int
 fat_cond_print (SCM cv, SCM port, scm_print_state *pstate SCM_UNUSED)
 {
   fat_cond *c = SCM_CONDVAR_DATA (cv);
-  scm_puts_unlocked ("#<condition-variable ", port);
+  scm_puts ("#<condition-variable ", port);
   scm_uintprint ((scm_t_bits)c, 16, port);
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
   return 1;
 }
 
diff --git a/libguile/throw.c b/libguile/throw.c
index 773ac27..38fe149 100644
--- a/libguile/throw.c
+++ b/libguile/throw.c
@@ -527,7 +527,7 @@ handler_message (void *handler_data, SCM tag, SCM args)
 
   if (should_print_backtrace (tag, stack))
     {
-      scm_puts_unlocked ("Backtrace:\n", p);
+      scm_puts ("Backtrace:\n", p);
       scm_display_backtrace_with_highlights (stack, p,
                                              SCM_BOOL_F, SCM_BOOL_F,
                                              SCM_EOL);
diff --git a/libguile/values.c b/libguile/values.c
index 670e222..ef27cad 100644
--- a/libguile/values.c
+++ b/libguile/values.c
@@ -60,9 +60,9 @@ print_values (SCM obj, SCM pwps)
   SCM port = SCM_PORT_WITH_PS_PORT (pwps);
   scm_print_state *ps = SCM_PRINT_STATE (SCM_PORT_WITH_PS_PS (pwps));
 
-  scm_puts_unlocked ("#<values ", port);
+  scm_puts ("#<values ", port);
   scm_iprin1 (values, port, ps);
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
 
   return SCM_UNSPECIFIED;
 }
diff --git a/libguile/variable.c b/libguile/variable.c
index 41f9c4d..b377b41 100644
--- a/libguile/variable.c
+++ b/libguile/variable.c
@@ -36,9 +36,9 @@
 void
 scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<variable ", port);
+  scm_puts ("#<variable ", port);
   scm_uintprint (SCM_UNPACK (exp), 16, port);
-  scm_puts_unlocked (" value: ", port);
+  scm_puts (" value: ", port);
   scm_iprin1 (SCM_VARIABLE_REF (exp), port, pstate);
   scm_putc ('>', port);
 }
diff --git a/libguile/vm.c b/libguile/vm.c
index 33f12b4..4899a80 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -106,9 +106,9 @@ vm_restore_sp (struct scm_vm *vp, union 
scm_vm_stack_element *new_sp)
 void
 scm_i_vm_cont_print (SCM x, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<vm-continuation ", port);
+  scm_puts ("#<vm-continuation ", port);
   scm_uintprint (SCM_UNPACK (x), 16, port);
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
 }
 
 int
diff --git a/libguile/weak-set.c b/libguile/weak-set.c
index 6e42cdd..d2e4744 100644
--- a/libguile/weak-set.c
+++ b/libguile/weak-set.c
@@ -675,12 +675,12 @@ make_weak_set (unsigned long k)
 void
 scm_i_weak_set_print (SCM exp, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<", port);
-  scm_puts_unlocked ("weak-set ", port);
+  scm_puts ("#<", port);
+  scm_puts ("weak-set ", port);
   scm_uintprint (SCM_WEAK_SET (exp)->n_items, 10, port);
   scm_putc ('/', port);
   scm_uintprint (SCM_WEAK_SET (exp)->size, 10, port);
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
 }
 
 static void
diff --git a/libguile/weak-table.c b/libguile/weak-table.c
index 082d796..cd7d8c8 100644
--- a/libguile/weak-table.c
+++ b/libguile/weak-table.c
@@ -790,12 +790,12 @@ make_weak_table (unsigned long k, scm_t_weak_table_kind 
kind)
 void
 scm_i_weak_table_print (SCM exp, SCM port, scm_print_state *pstate)
 {
-  scm_puts_unlocked ("#<", port);
-  scm_puts_unlocked ("weak-table ", port);
+  scm_puts ("#<", port);
+  scm_puts ("weak-table ", port);
   scm_uintprint (SCM_WEAK_TABLE (exp)->n_items, 10, port);
   scm_putc ('/', port);
   scm_uintprint (SCM_WEAK_TABLE (exp)->size, 10, port);
-  scm_puts_unlocked (">", port);
+  scm_puts (">", port);
 }
 
 static void



reply via email to

[Prev in Thread] Current Thread [Next in Thread]