* Added type-specific replacement macros for SCM_LENGTH.
This commit is contained in:
parent
4fd03f4339
commit
2d349e67ac
6 changed files with 16 additions and 1 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2000-10-06 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
* continuations.h (SCM_CONTINUATION_LENGTH), strings.h
|
||||
(SCM_STRING_LENGTH), symbols.h (SCM_SYMBOL_LENGTH), unif.h
|
||||
(SCM_UVECTOR_LENGTH, SCM_BITVECTOR_LENGTH), vectors.h
|
||||
(SCM_VECTOR_LENGTH): Added as replacements for SCM_LENGTH.
|
||||
|
||||
2000-10-02 Marius Vollmer <mvo@zagadka.ping.de>
|
||||
|
||||
* coop-defs.h (coop_key_create): Don't use the C++ keyword
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ typedef struct
|
|||
|
||||
#define SCM_CONTREGS(x) ((scm_contregs *) SCM_CELL_WORD_1 (x))
|
||||
#define SCM_SET_CONTREGS(x, r) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (r)))
|
||||
#define SCM_CONTINUATION_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
||||
#define SCM_JMPBUF(x) ((SCM_CONTREGS (x))->jmpbuf)
|
||||
#define SCM_DYNENV(x) ((SCM_CONTREGS (x))->dynenv)
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@
|
|||
#define SCM_STRINGP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_string))
|
||||
#define SCM_STRING_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
|
||||
#define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
|
||||
#define SCM_STRING_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
||||
/* Is X a writable string (i.e., not a substring)? */
|
||||
#define SCM_RWSTRINGP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_string))
|
||||
|
|
|
|||
|
|
@ -52,13 +52,14 @@
|
|||
|
||||
extern int scm_symhash_dim;
|
||||
|
||||
/* SCM_LENGTH(SYM) is the length of SYM's name in characters, and
|
||||
/* SCM_SYMBOL_LENGTH(SYM) is the length of SYM's name in characters, and
|
||||
* 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_SYMBOL_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
|
||||
#define SCM_SYMBOL_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
|
||||
#define SCM_SYMBOL_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
||||
#define SCM_LENGTH_MAX (0xffffffL)
|
||||
#define SCM_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ 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_UVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
||||
#define SCM_BITVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
||||
/* apparently it's possible to have more than SCM_LENGTH_MAX elements
|
||||
in an array: if the length is SCM_LENGTH_MAX then the SCM_VELTS
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@
|
|||
|
||||
#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_VECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
||||
#define SCM_VELTS(x) ((SCM *) SCM_CELL_WORD_1 (x))
|
||||
#define SCM_VELTS_AS_STACKITEMS(x) ((SCM_STACKITEM *) SCM_CELL_WORD_1 (x))
|
||||
#define SCM_SETVELTS(x,v) (SCM_SET_CELL_WORD_1 ((x), (v)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue