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_NUMBER(n) make_cell (tmp_num_ (NUMBER), 0, tmp_num2_ (n))
#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 vm_call (function0_t f, SCM p1, SCM p2, SCM a);
@ -693,13 +694,6 @@ tmp_num2_ (int x)
return tmp_num2;
}
SCM
make_string (SCM x)
{
g_cells[tmp_num].value = STRING;
return make_cell (tmp_num, x, 0);
}
SCM
cstring_to_list (char const* s)
{

View file

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