1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00

Rename scm_t_array_handle.array to .root

Globally rename this field (after shared-array-root), since it's not an array.
This commit is contained in:
Daniel Llorens 2013-04-29 15:37:52 +02:00 committed by Andy Wingo
parent 99c0a58a2f
commit d0b47b4946
9 changed files with 23 additions and 23 deletions

View file

@ -167,7 +167,7 @@ const SCM *
scm_array_handle_elements (scm_t_array_handle *h)
{
if (h->element_type != SCM_ARRAY_ELEMENT_TYPE_SCM)
scm_wrong_type_arg_msg (NULL, 0, h->array, "non-uniform array");
scm_wrong_type_arg_msg (NULL, 0, h->root, "non-uniform array");
return ((const SCM*)h->elements) + h->base;
}
@ -175,7 +175,7 @@ SCM *
scm_array_handle_writable_elements (scm_t_array_handle *h)
{
if (h->element_type != SCM_ARRAY_ELEMENT_TYPE_SCM)
scm_wrong_type_arg_msg (NULL, 0, h->array, "non-uniform array");
scm_wrong_type_arg_msg (NULL, 0, h->root, "non-uniform array");
return ((SCM*)h->elements) + h->base;
}

View file

@ -92,7 +92,7 @@ SCM_INTERNAL SCM scm_i_array_element_types[];
typedef struct scm_t_array_handle {
SCM array;
SCM root;
scm_t_array_implementation *impl;
/* `Base' is an offset into elements or writable_elements, corresponding to
the first element in the array. It would be nicer just to adjust the
@ -135,7 +135,7 @@ scm_array_handle_ref (scm_t_array_handle *h, ssize_t p)
/* catch overflow */
scm_out_of_range (NULL, scm_from_ssize_t (p));
/* perhaps should catch overflow here too */
return h->impl->vref (h->array, h->base + p);
return h->impl->vref (h->root, h->base + p);
}
SCM_INLINE_IMPLEMENTATION void
@ -145,7 +145,7 @@ scm_array_handle_set (scm_t_array_handle *h, ssize_t p, SCM v)
/* catch overflow */
scm_out_of_range (NULL, scm_from_ssize_t (p));
/* perhaps should catch overflow here too */
h->impl->vset (h->array, h->base + p, v);
h->impl->vset (h->root, h->base + p, v);
}
#endif

View file

@ -55,7 +55,7 @@ AREF (SCM v, size_t pos)
scm_t_array_handle h;
SCM ret;
scm_array_get_handle (v, &h);
ret = h.impl->vref (h.array, h.base + pos * h.dims[0].inc);
ret = h.impl->vref (h.root, h.base + pos * h.dims[0].inc);
scm_array_handle_release (&h);
return ret;
}
@ -66,7 +66,7 @@ ASET (SCM v, size_t pos, SCM val)
{
scm_t_array_handle h;
scm_array_get_handle (v, &h);
h.impl->vset (h.array, pos, val);
h.impl->vset (h.root, pos, val);
scm_array_handle_release (&h);
}
@ -728,7 +728,7 @@ SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0,
scm_array_get_handle (ra, &h);
inc = h.dims[0].inc;
for (i = h.dims[0].lbnd, p = h.base; i <= h.dims[0].ubnd; ++i, p += inc)
h.impl->vset (h.array, p, scm_call_1 (proc, scm_from_ssize_t (i)));
h.impl->vset (h.root, p, scm_call_1 (proc, scm_from_ssize_t (i)));
scm_array_handle_release (&h);
}
else
@ -768,7 +768,7 @@ SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0,
for (; vi[kmax] <= SCM_I_ARRAY_DIMS (ra)[kmax].ubnd;
*q = scm_from_ssize_t (++vi[kmax]))
{
h.impl->vset (h.array, i, scm_apply_0 (proc, args));
h.impl->vset (h.root, i, scm_apply_0 (proc, args));
i += SCM_I_ARRAY_DIMS (ra)[kmax].inc;
}
k--;

View file

@ -165,12 +165,12 @@ scm_array_handle_bit_elements (scm_t_array_handle *h)
scm_t_uint32 *
scm_array_handle_bit_writable_elements (scm_t_array_handle *h)
{
SCM vec = h->array;
SCM vec = h->root;
if (SCM_I_ARRAYP (vec))
vec = SCM_I_ARRAY_V (vec);
if (IS_BITVECTOR (vec))
return BITVECTOR_BITS (vec) + h->base/32;
scm_wrong_type_arg_msg (NULL, 0, h->array, "bit array");
scm_wrong_type_arg_msg (NULL, 0, h->root, "bit array");
}
size_t
@ -869,7 +869,7 @@ static void
bitvector_get_handle (SCM bv, scm_t_array_handle *h)
{
h->base = 0;
h->array = bv;
h->root = bv;
h->ndims = 1;
h->dims = &h->dim0;
h->dim0.lbnd = 0;

View file

@ -2204,7 +2204,7 @@ static void
bytevector_get_handle (SCM v, scm_t_array_handle *h)
{
h->base = 0;
h->array = v;
h->root = v;
h->ndims = 1;
h->dims = &h->dim0;
h->dim0.lbnd = 0;

View file

@ -118,13 +118,13 @@
const ctype* scm_array_handle_##tag##_elements (scm_t_array_handle *h) \
{ \
if (h->element_type != ETYPE (TAG)) \
scm_wrong_type_arg_msg (NULL, 0, h->array, #tag "vector"); \
scm_wrong_type_arg_msg (NULL, 0, h->root, #tag "vector"); \
return ((const ctype*) h->elements) + h->base*width; \
} \
ctype* scm_array_handle_##tag##_writable_elements (scm_t_array_handle *h) \
{ \
if (h->element_type != ETYPE (TAG)) \
scm_wrong_type_arg_msg (NULL, 0, h->array, #tag "vector"); \
scm_wrong_type_arg_msg (NULL, 0, h->root, #tag "vector"); \
return ((ctype*) h->writable_elements) + h->base*width; \
} \
const ctype *scm_##tag##vector_elements (SCM uvec, \
@ -142,7 +142,7 @@
return ((ctype*)h->writable_elements) + h->base*width; \
/* otherwise... */ \
else \
scm_wrong_type_arg_msg (NULL, 0, h->array, #tag "vector"); \
scm_wrong_type_arg_msg (NULL, 0, h->root, #tag "vector"); \
}

View file

@ -2477,7 +2477,7 @@ static void
string_get_handle (SCM v, scm_t_array_handle *h)
{
h->base = 0;
h->array = v;
h->root = v;
h->ndims = 1;
h->dims = &h->dim0;
h->dim0.lbnd = 0;

View file

@ -49,9 +49,9 @@ scm_array_handle_uniform_element_size (scm_t_array_handle *h)
if (ret && ret % 8 == 0)
return ret / 8;
else if (ret)
scm_wrong_type_arg_msg (NULL, 0, h->array, "byte-aligned uniform array");
scm_wrong_type_arg_msg (NULL, 0, h->root, "byte-aligned uniform array");
else
scm_wrong_type_arg_msg (NULL, 0, h->array, "uniform array");
scm_wrong_type_arg_msg (NULL, 0, h->root, "uniform array");
}
size_t
@ -61,7 +61,7 @@ scm_array_handle_uniform_element_bit_size (scm_t_array_handle *h)
if (ret)
return ret;
else
scm_wrong_type_arg_msg (NULL, 0, h->array, "uniform array");
scm_wrong_type_arg_msg (NULL, 0, h->root, "uniform array");
}
const void *
@ -184,7 +184,7 @@ scm_c_uniform_vector_ref (SCM v, size_t pos)
/* need the handle for bitvectors only */
scm_array_get_handle (v, &h);
ret = h.impl->vref (h.array, pos);
ret = h.impl->vref (h.root, pos);
scm_array_handle_release (&h);
return ret;
@ -210,7 +210,7 @@ scm_c_uniform_vector_set_x (SCM v, size_t pos, SCM val)
/* need the handle for bitvectors only */
scm_array_get_handle (v, &h);
h.impl->vset (h.array, pos, val);
h.impl->vset (h.root, pos, val);
scm_array_handle_release (&h);
}

View file

@ -451,7 +451,7 @@ static void
vector_get_handle (SCM v, scm_t_array_handle *h)
{
h->base = 0;
h->array = v;
h->root = v;
h->ndims = 1;
h->dims = &h->dim0;
h->dim0.lbnd = 0;