From 3ebee716532440961a21130834367d93fcf6aa75 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 20 Dec 2018 16:48:45 +0100 Subject: [PATCH] core: Remove string debugging. * src/strings.c (make_bytes, make_string, string_equal_p, symbol_to_string, symbol_to_keyword, make_symbol): Remove string debugging. --- src/mes.c | 6 ----- src/module.c | 12 ---------- src/posix.c | 8 ------- src/strings.c | 65 ++++----------------------------------------------- 4 files changed, 4 insertions(+), 87 deletions(-) diff --git a/src/mes.c b/src/mes.c index 8e33a10c..9f149a90 100644 --- a/src/mes.c +++ b/src/mes.c @@ -2604,12 +2604,6 @@ main (int argc, char *argv[]) write_error_ (r1); eputs ("\n"); } - // if (g_debug > 3) - // { - // eputs ("symbols: "); - // write_error_ (g_symbols); - // eputs ("\n"); - // } r3 = cell_vm_begin_expand; r1 = eval_apply (); if (g_debug) diff --git a/src/module.c b/src/module.c index fcff1149..773e1793 100644 --- a/src/module.c +++ b/src/module.c @@ -60,10 +60,6 @@ make_initial_module (SCM a) ///((internal)) m0 = module; while (TYPE (a) == TPAIR) { - if (g_debug > 3) - { - eputs ("entry="); write_error_ (CAR (a)); eputs ("\n"); - } module_define_x (module, CAAR (a), CDAR (a)); a = CDR (a); } @@ -102,10 +98,6 @@ module_variable (SCM module, SCM name) SCM module_ref (SCM module, SCM name) { - if (g_debug > 3) - { - eputs ("module_ref: "); display_error_ (name); eputs ("\n"); - } SCM x = module_variable (module, name); if (x == cell_f) return cell_undefined; @@ -115,10 +107,6 @@ module_ref (SCM module, SCM name) SCM module_define_x (SCM module, SCM name, SCM value) { - if (g_debug > 4) - { - eputs ("module_define_x: "); display_error_ (name); eputs ("\n"); - } module = m0; SCM globals = struct_ref_ (module, 5); return hashq_set_x (globals, name, value); diff --git a/src/posix.c b/src/posix.c index b7a3dac3..f01002ea 100644 --- a/src/posix.c +++ b/src/posix.c @@ -178,10 +178,6 @@ current_input_port () if (g_stdin >= 0) return MAKE_NUMBER (g_stdin); SCM x = g_ports; - if (g_debug > 2) - { - eputs ("ports:"); write_error_ (g_ports); eputs ("\n"); - } while (x && PORT (CAR (x)) != g_stdin) x = CDR (x); return CAR (x); @@ -197,10 +193,6 @@ SCM open_input_string (SCM string) { SCM port = MAKE_STRING_PORT (string); - if (g_debug > 2) - { - eputs ("new port:"); write_error_ (port); eputs ("\n"); - } g_ports = cons (port, g_ports); return port; } diff --git a/src/strings.c b/src/strings.c index 4aa80f52..adb6feed 100644 --- a/src/strings.c +++ b/src/strings.c @@ -71,14 +71,6 @@ make_bytes (char const* s, size_t length) *(char*)p = 0; else memcpy (p, s, length + 1); - if (g_debug > 2) - { - eputs ("make bytes: "); eputs (s); eputs ("\n"); - eputs (" bytes: "); eputs (CBYTES (x)); eputs ("\n"); - eputs (" length: "); eputs (itoa (length)); eputs ("\n"); - eputs (" ==> "); write_error_ (x); - eputs ("\n"); - } return x; } @@ -106,69 +98,31 @@ string_equal_p (SCM a, SCM b) ///((name . "string=?")) assert ((TYPE (a) == TSTRING && TYPE (b) == TSTRING) || (TYPE (a) == TKEYWORD || TYPE (b) == TKEYWORD)); } - if (g_debug == -1) - { - eputs ("string=?: "); eputs (CSTRING (a)); - eputs (" =? "); eputs (CSTRING (b)); - } if (a == b || STRING (a) == STRING (b) || (!LENGTH (a) && !LENGTH (b)) || (LENGTH (a) == LENGTH (b) && !memcmp (CSTRING (a), CSTRING (b), LENGTH (a)))) - { - if (g_debug == -1) - eputs (" => #t\n"); - return cell_t; - } - if (g_debug == -1) - eputs (" => #f\n"); + return cell_t; return cell_f; } SCM symbol_to_string (SCM symbol) { - SCM x = make_cell__ (TSTRING, CAR (symbol), CDR (symbol)); - - if (g_debug > 2) - { - eputs ("symbol->string: "); eputs (CSTRING (x)); eputs ("\n"); - eputs (" was: "); write_error_ (symbol); - eputs ("==> "); write_error_ (x); - eputs ("\n"); - } - return x; + return make_cell__ (TSTRING, CAR (symbol), CDR (symbol)); } SCM symbol_to_keyword (SCM symbol) { - SCM x = make_cell__ (TKEYWORD, CAR (symbol), CDR (symbol)); - - if (g_debug > 2) - { - eputs ("symbol->keyword: "); eputs (CSTRING (x)); eputs ("\n"); - eputs (" was: "); write_error_ (symbol); - eputs ("==> "); write_error_ (x); - eputs ("\n"); - } - return x; + return make_cell__ (TKEYWORD, CAR (symbol), CDR (symbol)); } SCM keyword_to_string (SCM keyword) { - SCM x = make_cell__ (TSTRING, CAR (keyword), CDR (keyword)); - - if (g_debug > 2) - { - eputs ("keyword->string: "); eputs (CSTRING (x)); eputs ("\n"); - eputs (" was: "); write_error_ (keyword); - eputs ("==> "); write_error_ (x); - eputs ("\n"); - } - return x; + return make_cell__ (TSTRING, CAR (keyword), CDR (keyword)); } SCM @@ -185,17 +139,6 @@ make_symbol (SCM string) { SCM x = make_cell__ (TSYMBOL, LENGTH (string), STRING (string)); hash_set_x (g_symbols, string, x); - - if (g_debug > 3) - hash_table_printer (g_symbols); - - if (g_debug > 2) - { - eputs ("make_symbol: "); eputs (CSTRING (string)); eputs ("\n"); - eputs ("==> "); write_error_ (x); - eputs ("\n"); - } - return x; }