core: Remove make_string.

* mes.c (MAKE_STRING): New macro.
  (make_string): Remove.  Update callers.
* string.c: Update callers.
This commit is contained in:
Jan Nieuwenhuizen 2016-12-23 16:38:07 +01:00
parent faed68ed57
commit 26e3e41357
2 changed files with 7 additions and 13 deletions

8
mes.c
View File

@ -184,6 +184,7 @@ SCM r3 = 0; // param 3
#define MAKE_CHAR(n) make_cell (tmp_num_ (CHAR), 0, tmp_num2_ (n)) #define MAKE_CHAR(n) make_cell (tmp_num_ (CHAR), 0, tmp_num2_ (n))
#define MAKE_NUMBER(n) make_cell (tmp_num_ (NUMBER), 0, tmp_num2_ (n)) #define MAKE_NUMBER(n) make_cell (tmp_num_ (NUMBER), 0, tmp_num2_ (n))
#define MAKE_REF(n) make_cell (tmp_num_ (REF), n, 0); #define MAKE_REF(n) make_cell (tmp_num_ (REF), n, 0);
#define MAKE_STRING(x) make_cell (tmp_num_ (STRING), x, 0);
SCM display_ (FILE* f, SCM x); SCM display_ (FILE* f, SCM x);
SCM vm_call (function0_t f, SCM p1, SCM p2, SCM a); SCM vm_call (function0_t f, SCM p1, SCM p2, SCM a);
@ -693,13 +694,6 @@ tmp_num2_ (int x)
return tmp_num2; return tmp_num2;
} }
SCM
make_string (SCM x)
{
g_cells[tmp_num].value = STRING;
return make_cell (tmp_num, x, 0);
}
SCM SCM
cstring_to_list (char const* s) cstring_to_list (char const* s)
{ {

View File

@ -21,7 +21,7 @@
SCM SCM
string (SCM x) ///((arity . n)) string (SCM x) ///((arity . n))
{ {
return make_string (x); return MAKE_STRING (x);
} }
SCM SCM
@ -35,13 +35,13 @@ string_append (SCM x) ///((arity . n))
p = append2 (p, STRING (s)); p = append2 (p, STRING (s));
x = cdr (x); x = cdr (x);
} }
return make_string (p); return MAKE_STRING (p);
} }
SCM SCM
list_to_string (SCM x) list_to_string (SCM x)
{ {
return make_string (x); return MAKE_STRING (x);
} }
SCM SCM
@ -81,7 +81,7 @@ substring (SCM x) ///((arity . n))
p = append2 (p, cons (MAKE_CHAR (VALUE (car (s))), cell_nil)); p = append2 (p, cons (MAKE_CHAR (VALUE (car (s))), cell_nil));
s = cdr (s); s = cdr (s);
} }
return make_string (p); return MAKE_STRING (p);
} }
SCM SCM
@ -94,7 +94,7 @@ number_to_string (SCM x)
p = cons (MAKE_CHAR (n % 10 + '0'), p); p = cons (MAKE_CHAR (n % 10 + '0'), p);
n = n / 10; n = n / 10;
} while (n); } while (n);
return make_string (p); return MAKE_STRING (p);
} }
SCM SCM
@ -108,7 +108,7 @@ SCM
symbol_to_string (SCM x) symbol_to_string (SCM x)
{ {
assert (TYPE (x) == SYMBOL); assert (TYPE (x) == SYMBOL);
return make_string (STRING (x)); return MAKE_STRING (STRING (x));
} }
SCM SCM