mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
* unif.h (SCM_ARRAY_NDIM): Shift then cast so that the no sign
extension takes place. * strings.h (SCM_STRING_LENGTH): Likewise. (SCM_STRING_MAX_LENGTH): Use unsigned numbers.
This commit is contained in:
parent
3d968b4e8b
commit
2635d5efb9
2 changed files with 3 additions and 3 deletions
|
@ -57,8 +57,8 @@
|
|||
#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_MAX_LENGTH ((1L << 24) - 1)
|
||||
#define SCM_STRING_LENGTH(x) (((size_t) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
#define SCM_STRING_MAX_LENGTH ((1UL << 24) - 1UL)
|
||||
#define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8))
|
||||
#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), ((l) << 8) + scm_tc7_string))
|
||||
|
||||
#define SCM_STRING_COERCE_0TERMINATION_X(x) \
|
||||
|
|
|
@ -88,7 +88,7 @@ extern scm_bits_t scm_tc16_array;
|
|||
#endif
|
||||
|
||||
#define SCM_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc16_array, a)
|
||||
#define SCM_ARRAY_NDIM(x) ((size_t) (SCM_CELL_WORD_0 (x)) >> 17)
|
||||
#define SCM_ARRAY_NDIM(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 17))
|
||||
#define SCM_ARRAY_CONTP(x) (SCM_CELL_WORD_0 (x) & SCM_ARRAY_FLAG_CONTIGUOUS)
|
||||
#define SCM_SET_ARRAY_CONTIGUOUS_FLAG(x) \
|
||||
(SCM_SET_CELL_WORD_0 ((x), SCM_CELL_WORD_0 (x) | SCM_ARRAY_FLAG_CONTIGUOUS))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue