mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
* Removed SCM_SYMBOL_UCHARS.
This commit is contained in:
parent
4e15fee80f
commit
e51fe79c72
5 changed files with 28 additions and 19 deletions
3
NEWS
3
NEWS
|
@ -257,7 +257,8 @@ Use these instead of SCM_SETLENGTH
|
||||||
SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
|
SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
|
||||||
SCM_ARRAY_MEM
|
SCM_ARRAY_MEM
|
||||||
|
|
||||||
Use these instead of SCM_CHARS or SCM_VELTS.
|
Use these instead of SCM_CHARS, SCM_UCHARS, SCM_ROCHARS, SCM_ROUCHARS or
|
||||||
|
SCM_VELTS.
|
||||||
|
|
||||||
** New macros: SCM_SET_BIGNUM_BASE, SCM_SET_STRING_CHARS,
|
** New macros: SCM_SET_BIGNUM_BASE, SCM_SET_STRING_CHARS,
|
||||||
SCM_SET_SYMBOL_CHARS, SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE,
|
SCM_SET_SYMBOL_CHARS, SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE,
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
2000-11-28 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||||
|
|
||||||
|
* struct.c (scm_struct_ref, scm_struct_set_x), symbols.c
|
||||||
|
(scm_intern_obarray_soft), symbols.h (SCM_ROUCHARS): Eliminate
|
||||||
|
use of SCM_SYMBOL_UCHARS by using chars instead of unsigned
|
||||||
|
chars.
|
||||||
|
|
||||||
|
(SCM_SYMBOL_UCHARS): Removed.
|
||||||
|
|
||||||
2000-11-26 Gary Houston <ghouston@arglist.com>
|
2000-11-26 Gary Houston <ghouston@arglist.com>
|
||||||
|
|
||||||
* reimplementation of values, call-with-values as primitives:
|
* reimplementation of values, call-with-values as primitives:
|
||||||
|
|
|
@ -566,8 +566,8 @@ SCM_DEFINE (scm_struct_ref, "struct-ref", 2, 0, 0,
|
||||||
SCM layout;
|
SCM layout;
|
||||||
int p;
|
int p;
|
||||||
scm_bits_t n_fields;
|
scm_bits_t n_fields;
|
||||||
unsigned char * fields_desc;
|
char * fields_desc;
|
||||||
unsigned char field_type = 0;
|
char field_type = 0;
|
||||||
|
|
||||||
|
|
||||||
SCM_VALIDATE_STRUCT (1,handle);
|
SCM_VALIDATE_STRUCT (1,handle);
|
||||||
|
@ -577,14 +577,14 @@ SCM_DEFINE (scm_struct_ref, "struct-ref", 2, 0, 0,
|
||||||
data = SCM_STRUCT_DATA (handle);
|
data = SCM_STRUCT_DATA (handle);
|
||||||
p = SCM_INUM (pos);
|
p = SCM_INUM (pos);
|
||||||
|
|
||||||
fields_desc = SCM_SYMBOL_UCHARS (layout);
|
fields_desc = SCM_SYMBOL_CHARS (layout);
|
||||||
n_fields = data[scm_struct_i_n_words];
|
n_fields = data[scm_struct_i_n_words];
|
||||||
|
|
||||||
SCM_ASSERT_RANGE(1,pos, p < n_fields);
|
SCM_ASSERT_RANGE(1,pos, p < n_fields);
|
||||||
|
|
||||||
if (p * 2 < SCM_SYMBOL_LENGTH (layout))
|
if (p * 2 < SCM_SYMBOL_LENGTH (layout))
|
||||||
{
|
{
|
||||||
unsigned char ref;
|
char ref;
|
||||||
field_type = fields_desc[p * 2];
|
field_type = fields_desc[p * 2];
|
||||||
ref = fields_desc[p * 2 + 1];
|
ref = fields_desc[p * 2 + 1];
|
||||||
if ((ref != 'r') && (ref != 'w'))
|
if ((ref != 'r') && (ref != 'w'))
|
||||||
|
@ -644,8 +644,8 @@ SCM_DEFINE (scm_struct_set_x, "struct-set!", 3, 0, 0,
|
||||||
SCM layout;
|
SCM layout;
|
||||||
int p;
|
int p;
|
||||||
int n_fields;
|
int n_fields;
|
||||||
unsigned char * fields_desc;
|
char * fields_desc;
|
||||||
unsigned char field_type = 0;
|
char field_type = 0;
|
||||||
|
|
||||||
SCM_VALIDATE_STRUCT (1,handle);
|
SCM_VALIDATE_STRUCT (1,handle);
|
||||||
SCM_VALIDATE_INUM (2,pos);
|
SCM_VALIDATE_INUM (2,pos);
|
||||||
|
@ -654,14 +654,14 @@ SCM_DEFINE (scm_struct_set_x, "struct-set!", 3, 0, 0,
|
||||||
data = SCM_STRUCT_DATA (handle);
|
data = SCM_STRUCT_DATA (handle);
|
||||||
p = SCM_INUM (pos);
|
p = SCM_INUM (pos);
|
||||||
|
|
||||||
fields_desc = SCM_SYMBOL_UCHARS (layout);
|
fields_desc = SCM_SYMBOL_CHARS (layout);
|
||||||
n_fields = data[scm_struct_i_n_words];
|
n_fields = data[scm_struct_i_n_words];
|
||||||
|
|
||||||
SCM_ASSERT_RANGE (1,pos, p < n_fields);
|
SCM_ASSERT_RANGE (1,pos, p < n_fields);
|
||||||
|
|
||||||
if (p * 2 < SCM_SYMBOL_LENGTH (layout))
|
if (p * 2 < SCM_SYMBOL_LENGTH (layout))
|
||||||
{
|
{
|
||||||
unsigned char set_x;
|
char set_x;
|
||||||
field_type = fields_desc[p * 2];
|
field_type = fields_desc[p * 2];
|
||||||
set_x = fields_desc [p * 2 + 1];
|
set_x = fields_desc [p * 2 + 1];
|
||||||
if (set_x != 'w')
|
if (set_x != 'w')
|
||||||
|
|
|
@ -262,13 +262,13 @@ scm_intern_obarray_soft (const char *name,scm_sizet len,SCM obarray,unsigned int
|
||||||
scm_sizet i;
|
scm_sizet i;
|
||||||
SCM a = SCM_CAR (lsym);
|
SCM a = SCM_CAR (lsym);
|
||||||
SCM z = SCM_CAR (a);
|
SCM z = SCM_CAR (a);
|
||||||
unsigned char *tmp = SCM_SYMBOL_UCHARS (z);
|
char *tmp = SCM_SYMBOL_CHARS (z);
|
||||||
if (SCM_SYMBOL_HASH (z) != raw_hash)
|
if (SCM_SYMBOL_HASH (z) != raw_hash)
|
||||||
goto trynext;
|
goto trynext;
|
||||||
if (SCM_SYMBOL_LENGTH (z) != len)
|
if (SCM_SYMBOL_LENGTH (z) != len)
|
||||||
goto trynext;
|
goto trynext;
|
||||||
for (i = len; i--;)
|
for (i = len; i--;)
|
||||||
if (((unsigned char *) name)[i] != tmp[i])
|
if (name[i] != tmp[i])
|
||||||
goto trynext;
|
goto trynext;
|
||||||
{
|
{
|
||||||
SCM_REALLOW_INTS;
|
SCM_REALLOW_INTS;
|
||||||
|
|
|
@ -56,12 +56,13 @@ extern int scm_symhash_dim;
|
||||||
* SCM_SYMBOL_CHARS(SYM) is the address of the first character of SYM's name.
|
* SCM_SYMBOL_CHARS(SYM) is the address of the first character of SYM's name.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SCM_SYMBOLP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_symbol))
|
#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_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||||
#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_SET_SYMBOL_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_symbol))
|
||||||
|
#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_HASH(X) ((unsigned long) SCM_CELL_WORD_2 (X))
|
||||||
|
#define SCM_SET_SYMBOL_HASH(X, v) (SCM_SET_CELL_WORD_2 ((X), (v)))
|
||||||
|
|
||||||
#define SCM_PROP_SLOTS(X) (SCM_CELL_WORD_3 (X))
|
#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_SET_PROP_SLOTS(X, v) (SCM_SET_CELL_WORD_3 ((X), (v)))
|
||||||
|
@ -69,8 +70,6 @@ extern int scm_symhash_dim;
|
||||||
#define SCM_SET_SYMBOL_FUNC(X, v) (SCM_SETCAR (SCM_CELL_WORD_3 (X), (v)))
|
#define SCM_SET_SYMBOL_FUNC(X, v) (SCM_SETCAR (SCM_CELL_WORD_3 (X), (v)))
|
||||||
#define SCM_SYMBOL_PROPS(X) (SCM_CDR (SCM_CELL_WORD_3 (X)))
|
#define SCM_SYMBOL_PROPS(X) (SCM_CDR (SCM_CELL_WORD_3 (X)))
|
||||||
#define SCM_SET_SYMBOL_PROPS(X, v) (SCM_SETCDR (SCM_CELL_WORD_3 (X), (v)))
|
#define SCM_SET_SYMBOL_PROPS(X, v) (SCM_SETCDR (SCM_CELL_WORD_3 (X), (v)))
|
||||||
#define SCM_SYMBOL_HASH(X) (SCM_CELL_WORD_2 (X))
|
|
||||||
#define SCM_SET_SYMBOL_HASH(X, v) (SCM_SET_CELL_WORD_2 ((X), (v)))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,7 +131,7 @@ extern void scm_init_symbols (void);
|
||||||
? (SCM_INUM (SCM_CADR (x)) + SCM_STRING_UCHARS (SCM_CDDR (x))) \
|
? (SCM_INUM (SCM_CADR (x)) + SCM_STRING_UCHARS (SCM_CDDR (x))) \
|
||||||
: ((SCM_TYP7 (x) == scm_tc7_string) \
|
: ((SCM_TYP7 (x) == scm_tc7_string) \
|
||||||
? SCM_STRING_UCHARS (x) \
|
? SCM_STRING_UCHARS (x) \
|
||||||
: SCM_SYMBOL_UCHARS (x)))
|
: (unsigned char *) SCM_SYMBOL_CHARS (x)))
|
||||||
#define SCM_SUBSTRP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_substring))
|
#define SCM_SUBSTRP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_substring))
|
||||||
#define SCM_COERCE_SUBSTR(x) SCM_STRING_COERCE_0TERMINATION_X (x)
|
#define SCM_COERCE_SUBSTR(x) SCM_STRING_COERCE_0TERMINATION_X (x)
|
||||||
#define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))
|
#define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue