* SCM_SETCHARS deprecated.

This commit is contained in:
Dirk Herrmann 2000-11-23 13:54:49 +00:00
commit 6a0476fd11
14 changed files with 42 additions and 16 deletions

9
NEWS
View file

@ -255,6 +255,12 @@ SCM_ARRAY_MEM
Use these instead of SCM_CHARS or SCM_VELTS.
** New macros: SCM_SET_BIGNUM_BASE, SCM_SET_STRING_CHARS,
SCM_SET_SYMBOL_CHARS, SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE,
SCM_SET_VECTOR_BASE
Use these instead of SCM_SETCHARS.
** New macro: SCM_BITVECTOR_P
** New macro: SCM_STRING_COERCE_0TERMINATION_X
@ -270,7 +276,7 @@ SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR,
SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING, SCM_ROCHARS,
SCM_ROUCHARS, SCM_SETLENGTH
SCM_ROUCHARS, SCM_SETLENGTH, SCM_SETCHARS
Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
Use scm_memory_error instead of SCM_NALLOC.
@ -287,6 +293,7 @@ Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_RWSTRING.
Use SCM_STRING_CHARS instead of SCM_ROCHARS.
Use SCM_STRING_UCHARS instead of SCM_ROUCHARS.
Use a type specific setter macro instead of SCM_SETLENGTH.
Use a type specific setter macro instead of SCM_SETCHARS.
** Removed function: scm_struct_init

View file

@ -50,7 +50,7 @@ In release 1.6:
SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH,
SCM_LENGTH, SCM_HUGE_LENGTH, SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET,
SCM_COERCE_SUBSTR, SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING,
SCM_ROCHARS, SCM_ROUCHARS, SCM_SETLENGTH
SCM_ROCHARS, SCM_ROUCHARS, SCM_SETLENGTH, SCM_SETCHARS
- remove scm_vector_set_length_x
- remove function scm_call_catching_errors
(replaced by catch functions from throw.[ch])

View file

@ -1,3 +1,18 @@
2000-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
* gh_data.c (makvect), numbers.c (scm_mkbig, scm_adjbig),
strings.c (scm_makstr, scm_take_str), symbols.c
(scm_intern_obarray_soft, scm_sysintern0_no_module_lookup), unif.c
(scm_make_uve), vectors.c (scm_make_vector): Use appropriate
SCM_SET_<type>_(CHARS|BASE) macro instead of SCM_SETCHARS.
* numbers.h (SCM_SET_BIGNUM_BASE), strings.h
(SCM_SET_STRING_CHARS), symbols.h (SCM_SET_SYMBOL_CHARS), unif.h
(SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE), vectors.h
(SCM_SET_VECTOR_BASE): Added.
* symbols.c (SCM_SETCHARS): Deprecated.
2000-11-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
* gc.c (scm_gc_sweep), unif.c (scm_make_uve): Don't allocate or

View file

@ -169,7 +169,7 @@ makvect (char* m, int len, int type)
SCM ans;
SCM_NEWCELL (ans);
SCM_DEFER_INTS;
SCM_SETCHARS (ans, m);
SCM_SET_UVECTOR_BASE (ans, m);
SCM_SET_UVECTOR_LENGTH (ans, len, type);
SCM_ALLOW_INTS;
return ans;

View file

@ -1323,8 +1323,7 @@ scm_mkbig (scm_sizet nlen, int sign)
SCM_NEWCELL (v);
SCM_DEFER_INTS;
SCM_SETCHARS (v, scm_must_malloc ((long) (nlen * sizeof (SCM_BIGDIG)),
s_bignum));
SCM_SET_BIGNUM_BASE (v, scm_must_malloc (nlen * sizeof (SCM_BIGDIG), s_bignum));
SCM_SETNUMDIGS (v, nlen, sign);
SCM_ALLOW_INTS;
return v;
@ -1366,7 +1365,7 @@ scm_adjbig (SCM b, scm_sizet nlen)
(long) (SCM_NUMDIGS (b) * sizeof (SCM_BIGDIG)),
(long) (nsiz * sizeof (SCM_BIGDIG)), s_bignum));
SCM_SETCHARS (b, digits);
SCM_SET_BIGNUM_BASE (b, digits);
SCM_SETNUMDIGS (b, nsiz, SCM_BIGSIGN (b));
}
SCM_ALLOW_INTS;

View file

@ -179,6 +179,7 @@
#define SCM_BIGSIZEFIELD 17
#define SCM_BIGSIGN(x) (SCM_CELL_WORD_0 (x) & SCM_BIGSIGNFLAG)
#define SCM_BDIGITS(x) ((SCM_BIGDIG *) (SCM_CELL_WORD_1 (x)))
#define SCM_SET_BIGNUM_BASE(n, b) (SCM_SET_CELL_WORD_1 ((n), (b)))
#define SCM_NUMDIGS(x) ((scm_sizet) (SCM_CELL_WORD_0 (x) >> SCM_BIGSIZEFIELD))
#define SCM_SETNUMDIGS(x, v, sign) \
SCM_SET_CELL_WORD_0 (x, \

View file

@ -132,7 +132,7 @@ scm_makstr (long len, int dummy)
mem[len] = 0;
SCM_NEWCELL (s);
SCM_SETCHARS (s, mem);
SCM_SET_STRING_CHARS (s, mem);
SCM_SET_STRING_LENGTH (s, len);
return s;
@ -170,7 +170,7 @@ scm_take_str (char *s, int len)
SCM_DEFER_INTS;
SCM_SET_STRING_LENGTH (answer, len);
scm_done_malloc (len + 1);
SCM_SETCHARS (answer, s);
SCM_SET_STRING_CHARS (answer, s);
SCM_ALLOW_INTS;
return answer;
}

View file

@ -56,6 +56,7 @@
#define SCM_STRING_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
#define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
#endif
#define SCM_SET_STRING_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c)))
#define SCM_STRING_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_string))

View file

@ -291,7 +291,7 @@ scm_intern_obarray_soft (const char *name,scm_sizet len,SCM obarray,unsigned int
}
SCM_NEWCELL2 (lsym);
SCM_SETCHARS (lsym, duplicate_string (name, len));
SCM_SET_SYMBOL_CHARS (lsym, duplicate_string (name, len));
SCM_SET_SYMBOL_HASH (lsym, raw_hash);
SCM_SET_PROP_SLOTS (lsym, scm_cons (SCM_BOOL_F, SCM_EOL));
SCM_SET_SYMBOL_LENGTH (lsym, (long) len);
@ -366,7 +366,7 @@ scm_sysintern0_no_module_lookup (const char *name)
scm_sizet hash = raw_hash % scm_symhash_dim;
SCM_NEWCELL2 (lsym);
SCM_SETCHARS (lsym, name);
SCM_SET_SYMBOL_CHARS (lsym, name);
SCM_SET_SYMBOL_HASH (lsym, raw_hash);
SCM_SET_PROP_SLOTS (lsym, scm_cons (SCM_BOOL_F, SCM_EOL));
SCM_SET_SYMBOL_LENGTH (lsym, (long) len);

View file

@ -59,13 +59,12 @@ extern int scm_symhash_dim;
#define SCM_SYMBOLP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_symbol))
#define SCM_SYMBOL_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
#define SCM_SYMBOL_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
#define SCM_SET_SYMBOL_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c)))
#define SCM_SYMBOL_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
#define SCM_SET_SYMBOL_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_symbol))
#define SCM_LENGTH_MAX (0xffffffL)
#define SCM_SETCHARS(x, v) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (v)))
#define SCM_PROP_SLOTS(X) (SCM_CELL_WORD_3 (X))
#define SCM_SET_PROP_SLOTS(X, v) (SCM_SET_CELL_WORD_3 ((X), (v)))
#define SCM_SYMBOL_FUNC(X) (SCM_CAR (SCM_CELL_WORD_3 (X)))
@ -116,6 +115,7 @@ extern void scm_init_symbols (void);
#define SCM_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
#define SCM_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
#define SCM_SETCHARS(x, v) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (v)))
#define SCM_SLOPPY_SUBSTRP(x) (SCM_SUBSTRP (x))
#define SCM_SUBSTR_STR(x) (SCM_CDDR (x))
#define SCM_SUBSTR_OFFSET(x) (SCM_CADR (x))

View file

@ -166,12 +166,12 @@ scm_make_uve (long k, SCM prot)
if (k > 0)
{
i = sizeof (long) * ((k + SCM_LONG_BIT - 1) / SCM_LONG_BIT);
SCM_SETCHARS (v, (char *) scm_must_malloc (i, "vector"));
SCM_SET_BITVECTOR_BASE (v, (char *) scm_must_malloc (i, "vector"));
SCM_SET_BITVECTOR_LENGTH (v, k);
}
else
{
SCM_SETCHARS (v, 0);
SCM_SET_BITVECTOR_BASE (v, 0);
SCM_SET_BITVECTOR_LENGTH (v, 0);
}
return v;
@ -239,7 +239,7 @@ scm_make_uve (long k, SCM prot)
SCM_NEWCELL (v);
SCM_DEFER_INTS;
SCM_SETCHARS (v, (char *) scm_must_malloc (i ? i : 1, "vector"));
SCM_SET_UVECTOR_BASE (v, (char *) scm_must_malloc (i ? i : 1, "vector"));
SCM_SET_UVECTOR_LENGTH (v, k, type);
SCM_ALLOW_INTS;
return v;

View file

@ -87,11 +87,13 @@ extern long scm_tc16_array;
#define SCM_ARRAY_DIMS(a) ((scm_array_dim *)((char *) SCM_ARRAY_MEM (a) + sizeof (scm_array)))
#define SCM_UVECTOR_BASE(x) ((void *) (SCM_CELL_WORD_1 (x)))
#define SCM_SET_UVECTOR_BASE(v, b) (SCM_SET_CELL_WORD_1 ((v), (b)))
#define SCM_UVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
#define SCM_SET_UVECTOR_LENGTH(v, l, t) (SCM_SET_CELL_WORD_0 ((v), ((l) << 8) + (t)))
#define SCM_BITVECTOR_P(x) (!SCM_IMP (x) && (SCM_TYP7 (x) == scm_tc7_bvect))
#define SCM_BITVECTOR_BASE(x) ((void *) (SCM_CELL_WORD_1 (x)))
#define SCM_SET_BITVECTOR_BASE(v, b) (SCM_SET_CELL_WORD_1 ((v), (b)))
#define SCM_BITVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
#define SCM_SET_BITVECTOR_LENGTH(v, l) (SCM_SET_CELL_WORD_0 ((v), ((l) << 8) + scm_tc7_bvect))

View file

@ -292,7 +292,7 @@ SCM_DEFINE (scm_make_vector, "make-vector", 1, 1, 0,
for (j = 0; j != i; ++j)
velts[j] = SCM_UNPACK (fill);
SCM_SETCHARS (v, velts);
SCM_SET_VECTOR_BASE (v, velts);
SCM_SET_VECTOR_LENGTH (v, i, scm_tc7_vector);
}
SCM_ALLOW_INTS;

View file

@ -53,6 +53,7 @@
#define SCM_VECTORP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_vector))
#define SCM_VECTOR_BASE(x) ((scm_bits_t *) SCM_CELL_WORD_1 (x))
#define SCM_SET_VECTOR_BASE(v, b) (SCM_SET_CELL_WORD_1 ((v), (b)))
#define SCM_VECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
#define SCM_SET_VECTOR_LENGTH(v, l, t) (SCM_SET_CELL_WORD_0 ((v), ((l) << 8) + (t)))