mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 22:10:21 +02:00
* Eliminate some further applications of SCM_C[AD]R to non pair cells.
This commit is contained in:
parent
31e74a57aa
commit
e038c04203
7 changed files with 64 additions and 27 deletions
2
NEWS
2
NEWS
|
@ -679,7 +679,7 @@ SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR, SCM_SUBR_DOC,
|
|||
SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA, SCM_CONST_LONG,
|
||||
SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
|
||||
SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
|
||||
SCM_SETAND_CDR, SCM_SETOR_CDR
|
||||
SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_SETAND_CAR, SCM_SETOR_CAR
|
||||
|
||||
Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
|
||||
Use scm_memory_error instead of SCM_NALLOC.
|
||||
|
|
2
RELEASE
2
RELEASE
|
@ -69,7 +69,7 @@ In release 1.6:
|
|||
SCM_SUBR_DOC, SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA,
|
||||
SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
|
||||
SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
|
||||
SCM_SETAND_CDR, SCM_SETOR_CDR
|
||||
SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_SETAND_CAR, SCM_SETOR_CAR
|
||||
- remove scm_vector_set_length_x
|
||||
- remove function scm_call_catching_errors
|
||||
(replaced by catch functions from throw.[ch])
|
||||
|
|
|
@ -1,3 +1,29 @@
|
|||
2001-04-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
|
||||
|
||||
This patch eliminates some further applications of SCM_C[AD]R to
|
||||
non pair cells.
|
||||
|
||||
* gc.h (SCM_SETAND_CAR, SCM_SETOR_CAR): Deprecated. These have
|
||||
never been applied to real pairs.
|
||||
|
||||
* srcprop.h (SCM_SOURCE_PROPERTY_FLAG_BREAK): Added.
|
||||
|
||||
(SRCPROPBRK): Use SCM_SOURCE_PROPERTY_FLAG_BREAK.
|
||||
|
||||
* unif.h (SCM_ARRAY_CONTIGUOUS, SCM_ARRAY_FLAG_CONTIGUOUS,
|
||||
SCM_ARRAY_CONTP): Renamed SCM_ARRAY_CONTIGUOUS to
|
||||
SCM_ARRAY_FLAG_CONTIGUOUS and use it.
|
||||
|
||||
(SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG):
|
||||
Added.
|
||||
|
||||
* srcprop.h (SRCPROPH), unif.h (UNIFH): Renamed to
|
||||
SCM_SOURCE_PROPERTIES_H and SCM_UNIFORM_VECTORS_H, respectively.
|
||||
|
||||
* srcprop.h (SETSRCPROPBRK, CLEARSRCPROPBRK), unif.c
|
||||
(scm_dimensions_to_uniform_array, scm_ra_set_contp): Don't use
|
||||
SCM_SET{AND,OR}_CAR.
|
||||
|
||||
2001-04-17 Gary Houston <ghouston@arglist.com>
|
||||
|
||||
* some initial support for IPv6:
|
||||
|
|
|
@ -218,11 +218,6 @@ typedef unsigned long scm_c_bvec_limb_t;
|
|||
(((const scm_bits_t *) SCM2PTR (x)) [0])
|
||||
|
||||
|
||||
#define SCM_SETAND_CAR(x, y) \
|
||||
(SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y))))
|
||||
#define SCM_SETOR_CAR(x, y)\
|
||||
(SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y))))
|
||||
|
||||
#define SCM_CELL_WORD_LOC(x, n) ((scm_bits_t *) & SCM_CELL_WORD (x, n))
|
||||
#define SCM_CARLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 0))
|
||||
#define SCM_CDRLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 1))
|
||||
|
@ -394,6 +389,10 @@ extern void scm_init_gc (void);
|
|||
|
||||
#if (SCM_DEBUG_DEPRECATED == 0)
|
||||
|
||||
#define SCM_SETAND_CAR(x, y) \
|
||||
(SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y))))
|
||||
#define SCM_SETOR_CAR(x, y)\
|
||||
(SCM_SETCAR ((x), SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y))))
|
||||
#define SCM_SETAND_CDR(x, y)\
|
||||
(SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y))))
|
||||
#define SCM_SETOR_CDR(x, y)\
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* classes: h_files */
|
||||
|
||||
#ifndef SRCPROPH
|
||||
#define SRCPROPH
|
||||
/* Copyright (C) 1995,1996, 2000 Free Software Foundation
|
||||
#ifndef SCM_SOURCE_PROPERTIES_H
|
||||
#define SCM_SOURCE_PROPERTIES_H
|
||||
/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -95,16 +95,23 @@ typedef struct scm_srcprops_chunk
|
|||
scm_srcprops srcprops[1];
|
||||
} scm_srcprops_chunk;
|
||||
|
||||
#define SCM_SOURCE_PROPERTY_FLAG_BREAK (1L << 16)
|
||||
|
||||
#define SRCPROPSP(p) (SCM_TYP16_PREDICATE (scm_tc16_srcprops, p))
|
||||
#define SRCPROPBRK(p) (SCM_BOOL (SCM_CELL_WORD_0 (p) & (1L << 16)))
|
||||
#define SRCPROPBRK(p) \
|
||||
(SCM_BOOL (SCM_CELL_WORD_0 (p) & SCM_SOURCE_PROPERTY_FLAG_BREAK))
|
||||
#define SRCPROPPOS(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->pos
|
||||
#define SRCPROPLINE(p) (SRCPROPPOS(p) >> 12)
|
||||
#define SRCPROPCOL(p) (SRCPROPPOS(p) & 0x0fffL)
|
||||
#define SRCPROPFNAME(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->fname
|
||||
#define SRCPROPCOPY(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->copy
|
||||
#define SRCPROPPLIST(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->plist
|
||||
#define SETSRCPROPBRK(p) (SCM_SETOR_CAR (p, (1L << 16)))
|
||||
#define CLEARSRCPROPBRK(p) SCM_SETAND_CAR (p, ~(1L << 16))
|
||||
#define SETSRCPROPBRK(p) \
|
||||
(SCM_SET_CELL_WORD_0 ((p), SCM_CELL_WORD_0 (p) \
|
||||
| SCM_SOURCE_PROPERTY_FLAG_BREAK))
|
||||
#define CLEARSRCPROPBRK(p) \
|
||||
(SCM_SET_CELL_WORD_0 ((p), SCM_CELL_WORD_0 (p) \
|
||||
& ~SCM_SOURCE_PROPERTY_FLAG_BREAK))
|
||||
#define SRCPROPMAKPOS(l,c) (((l) << 12) + (c))
|
||||
#define SETSRCPROPPOS(p,l,c) (SRCPROPPOS (p) = SRCPROPMAKPOS (l, c))
|
||||
#define SETSRCPROPLINE(p,l) SETSRCPROPPOS (p, l, SRCPROPCOL (p))
|
||||
|
@ -134,7 +141,7 @@ extern SCM scm_set_source_properties_x (SCM obj, SCM props);
|
|||
extern void scm_finish_srcprop (void);
|
||||
extern void scm_init_srcprop (void);
|
||||
|
||||
#endif /* SRCPROPH */
|
||||
#endif /* SCM_SOURCE_PROPERTIES_H */
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
|
|
|
@ -604,7 +604,7 @@ SCM_DEFINE (scm_dimensions_to_uniform_array, "dimensions->uniform-array", 2, 1,
|
|||
SCM_ASSERT (SCM_NULLP (dims) || SCM_CONSP (dims),
|
||||
dims, SCM_ARG1, FUNC_NAME);
|
||||
ra = scm_shap2ra (dims, FUNC_NAME);
|
||||
SCM_SETOR_CAR (ra, SCM_ARRAY_CONTIGUOUS);
|
||||
SCM_SET_ARRAY_CONTIGUOUS_FLAG (ra);
|
||||
s = SCM_ARRAY_DIMS (ra);
|
||||
k = SCM_ARRAY_NDIM (ra);
|
||||
while (k--)
|
||||
|
@ -642,14 +642,14 @@ scm_ra_set_contp (SCM ra)
|
|||
{
|
||||
if (inc != SCM_ARRAY_DIMS (ra)[k].inc)
|
||||
{
|
||||
SCM_SETAND_CAR (ra, ~SCM_ARRAY_CONTIGUOUS);
|
||||
SCM_CLR_ARRAY_CONTIGUOUS_FLAG (ra);
|
||||
return;
|
||||
}
|
||||
inc *= (SCM_ARRAY_DIMS (ra)[k].ubnd
|
||||
- SCM_ARRAY_DIMS (ra)[k].lbnd + 1);
|
||||
}
|
||||
}
|
||||
SCM_SETOR_CAR (ra, SCM_ARRAY_CONTIGUOUS);
|
||||
SCM_SET_ARRAY_CONTIGUOUS_FLAG (ra);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* classes: h_files */
|
||||
|
||||
#ifndef UNIFH
|
||||
#define UNIFH
|
||||
/* Copyright (C) 1995,1996,1997,1999, 2000 Free Software Foundation, Inc.
|
||||
#ifndef SCM_UNIFORM_VECTORS_H
|
||||
#define SCM_UNIFORM_VECTORS_H
|
||||
/* Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -55,7 +55,7 @@
|
|||
an array SCM is a non-immediate pointing to a heap cell with:
|
||||
|
||||
CAR: bits 0-14 hold the dimension (0 -- 32767)
|
||||
bit 15 is the SCM_ARRAY_CONTIGUOUS flag
|
||||
bit 15 is the SCM_ARRAY_FLAG_CONTIGUOUS flag
|
||||
bits 16-31 hold the smob type id: scm_tc16_array
|
||||
CDR: pointer to a malloced block containing an scm_array structure
|
||||
followed by an scm_array_dim structure for each dimension.
|
||||
|
@ -74,12 +74,17 @@ typedef struct scm_array_dim
|
|||
long inc;
|
||||
} scm_array_dim;
|
||||
|
||||
|
||||
extern scm_bits_t scm_tc16_array;
|
||||
#define SCM_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc16_array, a)
|
||||
#define SCM_ARRAY_NDIM(x) ((scm_sizet) (SCM_CELL_WORD_0 (x) >> 17))
|
||||
#define SCM_ARRAY_CONTIGUOUS 0x10000
|
||||
#define SCM_ARRAY_CONTP(x) (SCM_ARRAY_CONTIGUOUS & (SCM_CELL_WORD_0 (x)))
|
||||
|
||||
#define SCM_ARRAY_FLAG_CONTIGUOUS (1 << 16)
|
||||
|
||||
#define SCM_ARRAYP(a) SCM_TYP16_PREDICATE (scm_tc16_array, a)
|
||||
#define SCM_ARRAY_NDIM(x) ((scm_sizet) (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))
|
||||
#define SCM_CLR_ARRAY_CONTIGUOUS_FLAG(x) \
|
||||
(SCM_SET_CELL_WORD_0 ((x), SCM_CELL_WORD_0 (x) & ~SCM_ARRAY_FLAG_CONTIGUOUS))
|
||||
|
||||
#define SCM_ARRAY_MEM(a) ((scm_array *) SCM_CELL_WORD_1 (a))
|
||||
#define SCM_ARRAY_V(a) (SCM_ARRAY_MEM (a)->v)
|
||||
|
@ -151,7 +156,7 @@ extern void scm_init_unif (void);
|
|||
|
||||
#endif /* SCM_DEBUG_DEPRECATED == 0 */
|
||||
|
||||
#endif /* UNIFH */
|
||||
#endif /* SCM_UNIFORM_VECTORS_H */
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue