mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +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_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA, SCM_CONST_LONG,
|
||||||
SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
|
SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
|
||||||
SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
|
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_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
|
||||||
Use scm_memory_error instead of SCM_NALLOC.
|
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_SUBR_DOC, SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA,
|
||||||
SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
|
SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
|
||||||
SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
|
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 scm_vector_set_length_x
|
||||||
- remove function scm_call_catching_errors
|
- remove function scm_call_catching_errors
|
||||||
(replaced by catch functions from throw.[ch])
|
(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>
|
2001-04-17 Gary Houston <ghouston@arglist.com>
|
||||||
|
|
||||||
* some initial support for IPv6:
|
* some initial support for IPv6:
|
||||||
|
|
|
@ -218,11 +218,6 @@ typedef unsigned long scm_c_bvec_limb_t;
|
||||||
(((const scm_bits_t *) SCM2PTR (x)) [0])
|
(((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_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_CARLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 0))
|
||||||
#define SCM_CDRLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 1))
|
#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)
|
#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)\
|
#define SCM_SETAND_CDR(x, y)\
|
||||||
(SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y))))
|
(SCM_SETCDR ((x), SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y))))
|
||||||
#define SCM_SETOR_CDR(x, y)\
|
#define SCM_SETOR_CDR(x, y)\
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* classes: h_files */
|
/* classes: h_files */
|
||||||
|
|
||||||
#ifndef SRCPROPH
|
#ifndef SCM_SOURCE_PROPERTIES_H
|
||||||
#define SRCPROPH
|
#define SCM_SOURCE_PROPERTIES_H
|
||||||
/* Copyright (C) 1995,1996, 2000 Free Software Foundation
|
/* Copyright (C) 1995,1996,2000,2001 Free Software Foundation
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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 srcprops[1];
|
||||||
} scm_srcprops_chunk;
|
} scm_srcprops_chunk;
|
||||||
|
|
||||||
|
#define SCM_SOURCE_PROPERTY_FLAG_BREAK (1L << 16)
|
||||||
|
|
||||||
#define SRCPROPSP(p) (SCM_TYP16_PREDICATE (scm_tc16_srcprops, p))
|
#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 SRCPROPPOS(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->pos
|
||||||
#define SRCPROPLINE(p) (SRCPROPPOS(p) >> 12)
|
#define SRCPROPLINE(p) (SRCPROPPOS(p) >> 12)
|
||||||
#define SRCPROPCOL(p) (SRCPROPPOS(p) & 0x0fffL)
|
#define SRCPROPCOL(p) (SRCPROPPOS(p) & 0x0fffL)
|
||||||
#define SRCPROPFNAME(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->fname
|
#define SRCPROPFNAME(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->fname
|
||||||
#define SRCPROPCOPY(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->copy
|
#define SRCPROPCOPY(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->copy
|
||||||
#define SRCPROPPLIST(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->plist
|
#define SRCPROPPLIST(p) ((scm_srcprops *) SCM_CELL_WORD_1 (p))->plist
|
||||||
#define SETSRCPROPBRK(p) (SCM_SETOR_CAR (p, (1L << 16)))
|
#define SETSRCPROPBRK(p) \
|
||||||
#define CLEARSRCPROPBRK(p) SCM_SETAND_CAR (p, ~(1L << 16))
|
(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 SRCPROPMAKPOS(l,c) (((l) << 12) + (c))
|
||||||
#define SETSRCPROPPOS(p,l,c) (SRCPROPPOS (p) = SRCPROPMAKPOS (l, c))
|
#define SETSRCPROPPOS(p,l,c) (SRCPROPPOS (p) = SRCPROPMAKPOS (l, c))
|
||||||
#define SETSRCPROPLINE(p,l) SETSRCPROPPOS (p, l, SRCPROPCOL (p))
|
#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_finish_srcprop (void);
|
||||||
extern void scm_init_srcprop (void);
|
extern void scm_init_srcprop (void);
|
||||||
|
|
||||||
#endif /* SRCPROPH */
|
#endif /* SCM_SOURCE_PROPERTIES_H */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local Variables:
|
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),
|
SCM_ASSERT (SCM_NULLP (dims) || SCM_CONSP (dims),
|
||||||
dims, SCM_ARG1, FUNC_NAME);
|
dims, SCM_ARG1, FUNC_NAME);
|
||||||
ra = scm_shap2ra (dims, 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);
|
s = SCM_ARRAY_DIMS (ra);
|
||||||
k = SCM_ARRAY_NDIM (ra);
|
k = SCM_ARRAY_NDIM (ra);
|
||||||
while (k--)
|
while (k--)
|
||||||
|
@ -642,14 +642,14 @@ scm_ra_set_contp (SCM ra)
|
||||||
{
|
{
|
||||||
if (inc != SCM_ARRAY_DIMS (ra)[k].inc)
|
if (inc != SCM_ARRAY_DIMS (ra)[k].inc)
|
||||||
{
|
{
|
||||||
SCM_SETAND_CAR (ra, ~SCM_ARRAY_CONTIGUOUS);
|
SCM_CLR_ARRAY_CONTIGUOUS_FLAG (ra);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
inc *= (SCM_ARRAY_DIMS (ra)[k].ubnd
|
inc *= (SCM_ARRAY_DIMS (ra)[k].ubnd
|
||||||
- SCM_ARRAY_DIMS (ra)[k].lbnd + 1);
|
- 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 */
|
/* classes: h_files */
|
||||||
|
|
||||||
#ifndef UNIFH
|
#ifndef SCM_UNIFORM_VECTORS_H
|
||||||
#define UNIFH
|
#define SCM_UNIFORM_VECTORS_H
|
||||||
/* Copyright (C) 1995,1996,1997,1999, 2000 Free Software Foundation, Inc.
|
/* Copyright (C) 1995,1996,1997,1999,2000,2001 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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:
|
an array SCM is a non-immediate pointing to a heap cell with:
|
||||||
|
|
||||||
CAR: bits 0-14 hold the dimension (0 -- 32767)
|
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
|
bits 16-31 hold the smob type id: scm_tc16_array
|
||||||
CDR: pointer to a malloced block containing an scm_array structure
|
CDR: pointer to a malloced block containing an scm_array structure
|
||||||
followed by an scm_array_dim structure for each dimension.
|
followed by an scm_array_dim structure for each dimension.
|
||||||
|
@ -74,12 +74,17 @@ typedef struct scm_array_dim
|
||||||
long inc;
|
long inc;
|
||||||
} scm_array_dim;
|
} scm_array_dim;
|
||||||
|
|
||||||
|
|
||||||
extern scm_bits_t scm_tc16_array;
|
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_FLAG_CONTIGUOUS (1 << 16)
|
||||||
#define SCM_ARRAY_CONTIGUOUS 0x10000
|
|
||||||
#define SCM_ARRAY_CONTP(x) (SCM_ARRAY_CONTIGUOUS & (SCM_CELL_WORD_0 (x)))
|
#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_MEM(a) ((scm_array *) SCM_CELL_WORD_1 (a))
|
||||||
#define SCM_ARRAY_V(a) (SCM_ARRAY_MEM (a)->v)
|
#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 /* SCM_DEBUG_DEPRECATED == 0 */
|
||||||
|
|
||||||
#endif /* UNIFH */
|
#endif /* SCM_UNIFORM_VECTORS_H */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local Variables:
|
Local Variables:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue