1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-23 20:05:32 +02:00

* __scm.h (SCM_ASSERT, SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1,

SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_n):  Don't call scm_wta, call
scm_wrong_type_arg instead.

(SCM_WNA):  Deprecated.

* error.[ch] (scm_wta):  Deprecated.

* numbers.c (s_i_log):  Minor comment fix.

* read.c (scm_lreadr), unif.c (scm_aind, scm_shap2ra,
scm_make_shared_array, scm_transpose_array, scm_enclose_array,
scm_array_in_bounds_p): Don't use SCM_ASSERT to check for
wrong-num-args or misc errors.

* unif.c (scm_make_shared_array, scm_transpose_array,
scm_enclose_array, scm_array_in_bounds_p, scm_array_set_x):
Validate the rest argument (note: this is only done when guile is
built with SCM_DEBUG_REST_ARGUMENT=1)

(scm_array_in_bounds_p, scm_uniform_vector_ref, scm_array_set_x):
Replace calls to scm_wrong_num_args by SCM_WRONG_NUM_ARGS.

* validate.h (SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
SCM_VALIDATE_NUMBER_DEF_COPY):  Deprecated.
This commit is contained in:
Dirk Herrmann 2001-03-17 13:34:21 +00:00
parent 68baa7e7f8
commit b3fcac341b
10 changed files with 140 additions and 85 deletions

View file

@ -1,4 +1,4 @@
/* $Id: validate.h,v 1.29 2001-03-17 12:20:36 dirk Exp $ */
/* $Id: validate.h,v 1.30 2001-03-17 13:34:21 dirk Exp $ */
/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
@ -45,8 +45,6 @@
#ifndef SCM_VALIDATE_H__
#define SCM_VALIDATE_H__
#define SCM_FUNC_NAME (scm_makfrom0str (FUNC_NAME))
#define SCM_SYSERROR do { scm_syserror (FUNC_NAME); } while (0)
#define SCM_MEMORY_ERROR do { scm_memory_error (FUNC_NAME); } while (0)
@ -149,29 +147,6 @@
#define SCM_VALIDATE_NUMBER(pos, z) SCM_MAKE_VALIDATE (pos, z, NUMBERP)
#define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \
do { \
if (SCM_INUMP (z)) \
cvar = (double) SCM_INUM (z); \
else if (SCM_REALP (z)) \
cvar = SCM_REAL_VALUE (z); \
else if (SCM_BIGP (z)) \
cvar = scm_big2dbl (z); \
else \
{ \
cvar = 0.0; \
SCM_WRONG_TYPE_ARG (pos, z); \
} \
} while (0)
#define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \
do { \
if (SCM_UNBNDP (number)) \
cvar = def; \
else \
SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \
} while (0)
#define SCM_VALIDATE_INUM(pos, k) SCM_MAKE_VALIDATE (pos, k, INUMP)
#define SCM_VALIDATE_INUM_COPY(pos, k, cvar) \
@ -405,12 +380,37 @@
#if (SCM_DEBUG_DEPRECATED == 0)
#define SCM_FUNC_NAME (scm_makfrom0str (FUNC_NAME))
#define SCM_WTA(pos, scm) \
do { scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
#define RETURN_SCM_WTA(pos, scm) \
do { return scm_wta (scm, (char *) pos, FUNC_NAME); } while (0)
#define SCM_VALIDATE_NUMBER_COPY(pos, z, cvar) \
do { \
if (SCM_INUMP (z)) \
cvar = (double) SCM_INUM (z); \
else if (SCM_REALP (z)) \
cvar = SCM_REAL_VALUE (z); \
else if (SCM_BIGP (z)) \
cvar = scm_big2dbl (z); \
else \
{ \
cvar = 0.0; \
SCM_WRONG_TYPE_ARG (pos, z); \
} \
} while (0)
#define SCM_VALIDATE_NUMBER_DEF_COPY(pos, number, def, cvar) \
do { \
if (SCM_UNBNDP (number)) \
cvar = def; \
else \
SCM_VALIDATE_NUMBER_COPY(pos, number, cvar); \
} while (0)
#define SCM_VALIDATE_STRINGORSUBSTR SCM_VALIDATE_STRING
#define SCM_VALIDATE_ROSTRING(pos, str) SCM_MAKE_VALIDATE (pos, str, ROSTRINGP)