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

Remove scm_generalized_vector_get_handle

This was deprecated in 2.0.9 (118ff892be).

* libguile/bitvectors.c (scm_bitvector_writable_elements): Replace
  scm_generalized_vector_get_handle.
  Remove unnecessary #includes.
* libguile/vectors.c (scm_vector_writable_elements): Replace
  scm_generalized_vector_get_handle.
  Remove unnecessary #includes.
* libguile/random.c (scm_random_normal_vector_x): Replace
  scm_generalized_vector_get_handle.
* libguile/generalized-vectors.h, libguile/generalized-vectors.c
  (scm_generalized_vector_get_handle): Remove.
  Remove unnecessary #includes.
* NEWS: Add removal notice.
This commit is contained in:
Daniel Llorens 2017-02-13 13:41:45 +01:00
parent 4267a8b6d5
commit 2d8c75f9f2
6 changed files with 28 additions and 30 deletions

5
NEWS
View file

@ -42,6 +42,11 @@ All code deprecated in Guile 2.2 has been removed. See older NEWS, and
check that your programs can compile without linker warnings and run
without runtime warnings. See "Deprecation" in the manual.
In particular, the function `scm_generalized_vector_get_handle' which
was deprecated in 2.0.9 but remained in 2.2, has now finally been
removed. As a replacement, use `scm_array_get_handle' to get a handle
and `scm_array_handle_rank' to check the rank.
** Remove "self" field from vtables and "redefined" field from classes
These fields were used as part of the machinery for class redefinition

View file

@ -27,12 +27,9 @@
#include "libguile/_scm.h"
#include "libguile/__scm.h"
#include "libguile/strings.h"
#include "libguile/array-handle.h"
#include "libguile/bitvectors.h"
#include "libguile/arrays.h"
#include "libguile/generalized-vectors.h"
#include "libguile/srfi-4.h"
/* Bit vectors. Would be nice if they were implemented on top of bytevectors,
* but alack, all we have is this crufty C.
@ -205,7 +202,12 @@ scm_bitvector_elements (SCM vec,
size_t *lenp,
ssize_t *incp)
{
scm_generalized_vector_get_handle (vec, h);
scm_array_get_handle (vec, h);
if (1 != scm_array_handle_rank (h))
{
scm_array_handle_release (h);
scm_wrong_type_arg_msg (NULL, 0, vec, "rank 1 bit array");
}
if (offp)
{
scm_t_array_dim *dim = scm_array_handle_dims (h);

View file

@ -27,8 +27,6 @@
#include "libguile/_scm.h"
#include "libguile/__scm.h"
#include "libguile/array-handle.h"
#include "libguile/generalized-arrays.h"
#include "libguile/generalized-vectors.h"
@ -69,17 +67,6 @@ SCM_DEFINE (scm_make_generalized_vector, "make-generalized-vector", 2, 1, 0,
}
#undef FUNC_NAME
void
scm_generalized_vector_get_handle (SCM vec, scm_t_array_handle *h)
{
scm_array_get_handle (vec, h);
if (scm_array_handle_rank (h) != 1)
{
scm_array_handle_release (h);
scm_wrong_type_arg_msg (NULL, 0, vec, "vector");
}
}
void
scm_init_generalized_vectors ()
{

View file

@ -3,7 +3,8 @@
#ifndef SCM_GENERALIZED_VECTORS_H
#define SCM_GENERALIZED_VECTORS_H
/* Copyright (C) 1995,1996,1997,1999,2000,2001, 2004, 2006, 2008, 2009, 2013 Free Software Foundation, Inc.
/* Copyright (C) 1995,1996,1997,1999,2000,2001, 2004, 2006, 2008, 2009, 2013
* Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -24,15 +25,11 @@
#include "libguile/__scm.h"
#include "libguile/array-handle.h"
/* Generalized vectors */
SCM_API void scm_generalized_vector_get_handle (SCM vec,
scm_t_array_handle *h);
SCM_API SCM scm_make_generalized_vector (SCM type, SCM len, SCM fill);
SCM_INTERNAL void scm_i_register_vector_constructor (SCM type, SCM (*ctor)(SCM, SCM));

View file

@ -621,7 +621,13 @@ SCM_DEFINE (scm_random_normal_vector_x, "random:normal-vector!", 1, 1, 0,
state = SCM_VARIABLE_REF (scm_var_random_state);
SCM_VALIDATE_RSTATE (2, state);
scm_generalized_vector_get_handle (v, &handle);
scm_array_get_handle (v, &handle);
if (1 != scm_array_handle_rank (&handle))
{
scm_array_handle_release (&handle);
scm_wrong_type_arg_msg (NULL, 0, v, "rank 1 array");
}
dim = scm_array_handle_dims (&handle);
if (handle.element_type == SCM_ARRAY_ELEMENT_TYPE_SCM)

View file

@ -25,15 +25,10 @@
#include "libguile/_scm.h"
#include "libguile/eq.h"
#include "libguile/strings.h"
#include "libguile/validate.h"
#include "libguile/vectors.h"
#include "libguile/arrays.h" /* Hit me with the ugly stick */
#include "libguile/generalized-vectors.h"
#include "libguile/strings.h"
#include "libguile/srfi-13.h"
#include "libguile/dynwind.h"
#include "libguile/array-handle.h"
#include "libguile/bdw-gc.h"
@ -68,7 +63,13 @@ scm_vector_elements (SCM vec, scm_t_array_handle *h,
if (SCM_I_WVECTP (vec))
scm_wrong_type_arg_msg (NULL, 0, vec, "non-weak vector");
scm_generalized_vector_get_handle (vec, h);
scm_array_get_handle (vec, h);
if (1 != scm_array_handle_rank (h))
{
scm_array_handle_release (h);
scm_wrong_type_arg_msg (NULL, 0, vec, "rank 1 array of Scheme values");
}
if (lenp)
{
scm_t_array_dim *dim = scm_array_handle_dims (h);