1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-18 01:30:27 +02:00

Remove array contp flag

This flag was set, but never used in Guile, and there was no documented
API to access it.

To check if an array is contiguous, use (array-contents <> #t).

* libguile/arrays.h (scm_i_raw_array): New function.
  SCM_I_ARRAY_CONTIGUOUS, SCM_SET_ARRAY_CONTIGUOUS_FLAG,
  SCM_CLR_ARRAY_CONTIGUOUS_FLAG, SCM_I_ARRAY_CONTP: Remove.
  scm_t_array_dim: Declare here, not in array-handle.h.
  SCM_I_ARRAY_NDIM: Shift by one bit since the contp flag isn't there
  anymore.
* module/syste/vm/assembler.scm: Match removal of contp flag.
* libguile/arrays.c (scm_i_make_array): Reuse scm_i_raw_array.
  (scm_i_ra_set_contp): Remove.
  (scm_transpose_array): Don't set or clear the contp flag.
  (scm_make_shared_array): Don't set or clear the contp flag.
  (scm_make_typed_array): Don't set the contp flag.
* libguile/array-map.c (scm_i_array_rebase): Reuse scm_i_raw_array.
This commit is contained in:
Daniel Llorens 2021-08-16 19:02:43 +02:00
parent c60601332e
commit 3df3ba1a2c
6 changed files with 23 additions and 56 deletions

View file

@ -1,7 +1,7 @@
#ifndef SCM_ARRAY_HANDLE_H
#define SCM_ARRAY_HANDLE_H
/* Copyright 1995-1997,1999-2001,2004,2006,2008-2009,2011,2013-2014,2018
/* Copyright 1995-1997,1999-2001,2004,2006,2008-2009,2011,2013-2014,2018,2021
Free Software Foundation, Inc.
This file is part of Guile.
@ -25,19 +25,13 @@
#include "libguile/error.h"
#include "libguile/inline.h"
#include "libguile/numbers.h"
#include "libguile/arrays.h"
typedef SCM (*scm_t_vector_ref) (SCM, size_t);
typedef void (*scm_t_vector_set) (SCM, size_t, SCM);
typedef struct scm_t_array_dim
{
ssize_t lbnd;
ssize_t ubnd;
ssize_t inc;
} scm_t_array_dim;
typedef enum
{
SCM_ARRAY_ELEMENT_TYPE_SCM = 0, /* SCM values */