1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

always having scm_t_uint64

* libguile/gen-scmconfig.c:
* libguile/random.c:
* libguile/srfi-4.c:
* libguile/srfi-4.h:
* libguile/__scm.h:
* libguile/numbers.c:
* libguile/numbers.h:
* test-suite/standalone/test-conversion.c: Since we always require
  scm_t_uint64 and friends, remove some conditional compiles.
This commit is contained in:
Andy Wingo 2010-07-26 14:23:43 +02:00
parent 33290f52ef
commit db6e848d19
8 changed files with 9 additions and 193 deletions

View file

@ -3,7 +3,7 @@
#ifndef SCM___SCM_H #ifndef SCM___SCM_H
#define SCM___SCM_H #define SCM___SCM_H
/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003, 2006, 2007, 2008 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1998,1999,2000,2001,2002,2003, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -359,11 +359,9 @@
#define SCM_T_INT32_MIN SCM_I_TYPE_MIN(scm_t_int32,SCM_T_UINT32_MAX) #define SCM_T_INT32_MIN SCM_I_TYPE_MIN(scm_t_int32,SCM_T_UINT32_MAX)
#define SCM_T_INT32_MAX SCM_I_TYPE_MAX(scm_t_int32,SCM_T_UINT32_MAX) #define SCM_T_INT32_MAX SCM_I_TYPE_MAX(scm_t_int32,SCM_T_UINT32_MAX)
#if SCM_HAVE_T_INT64
#define SCM_T_UINT64_MAX SCM_I_UTYPE_MAX(scm_t_uint64) #define SCM_T_UINT64_MAX SCM_I_UTYPE_MAX(scm_t_uint64)
#define SCM_T_INT64_MIN SCM_I_TYPE_MIN(scm_t_int64,SCM_T_UINT64_MAX) #define SCM_T_INT64_MIN SCM_I_TYPE_MIN(scm_t_int64,SCM_T_UINT64_MAX)
#define SCM_T_INT64_MAX SCM_I_TYPE_MAX(scm_t_int64,SCM_T_UINT64_MAX) #define SCM_T_INT64_MAX SCM_I_TYPE_MAX(scm_t_int64,SCM_T_UINT64_MAX)
#endif
#if SCM_SIZEOF_LONG_LONG #if SCM_SIZEOF_LONG_LONG
#define SCM_I_ULLONG_MAX SCM_I_UTYPE_MAX(unsigned long long) #define SCM_I_ULLONG_MAX SCM_I_UTYPE_MAX(unsigned long long)

View file

@ -315,28 +315,10 @@ main (int argc, char *argv[])
return 1; return 1;
pf ("\n"); pf ("\n");
pf ("/* 64-bit integer -- if available SCM_HAVE_T_INT64 will be 1 and\n" pf ("#define SCM_HAVE_T_INT64 1 /* 0 or 1 */\n");
" scm_t_int64 will be a suitable type, otherwise SCM_HAVE_T_INT64\n" pf ("typedef %s scm_t_int64;\n", SCM_I_GSC_T_INT64);
" will be 0. */\n"); pf ("#define SCM_HAVE_T_UINT64 1 /* 0 or 1 */\n");
if (SCM_I_GSC_T_INT64) pf ("typedef %s scm_t_uint64;\n", SCM_I_GSC_T_UINT64);
{
pf ("#define SCM_HAVE_T_INT64 1 /* 0 or 1 */\n");
pf ("typedef %s scm_t_int64;\n", SCM_I_GSC_T_INT64);
}
else
pf ("#define SCM_HAVE_T_INT64 0 /* 0 or 1 */\n");
pf ("\n");
pf ("/* 64-bit unsigned integer -- if available SCM_HAVE_T_UINT64 will\n"
" be 1 and scm_t_uint64 will be a suitable type, otherwise\n"
" SCM_HAVE_T_UINT64 will be 0. */\n");
if (SCM_I_GSC_T_UINT64)
{
pf ("#define SCM_HAVE_T_UINT64 1 /* 0 or 1 */\n");
pf ("typedef %s scm_t_uint64;\n", SCM_I_GSC_T_UINT64);
}
else
pf ("#define SCM_HAVE_T_UINT64 0 /* 0 or 1 */\n");
pf ("\n"); pf ("\n");
pf ("/* scm_t_ptrdiff_t and size, always defined -- defined to long if\n" pf ("/* scm_t_ptrdiff_t and size, always defined -- defined to long if\n"

View file

@ -5898,8 +5898,6 @@ scm_i_range_error (SCM bad_val, SCM min, SCM max)
#define SCM_FROM_TYPE_PROTO(arg) scm_from_uint32 (arg) #define SCM_FROM_TYPE_PROTO(arg) scm_from_uint32 (arg)
#include "libguile/conv-uinteger.i.c" #include "libguile/conv-uinteger.i.c"
#if SCM_HAVE_T_INT64
#define TYPE scm_t_int64 #define TYPE scm_t_int64
#define TYPE_MIN SCM_T_INT64_MIN #define TYPE_MIN SCM_T_INT64_MIN
#define TYPE_MAX SCM_T_INT64_MAX #define TYPE_MAX SCM_T_INT64_MAX
@ -5916,8 +5914,6 @@ scm_i_range_error (SCM bad_val, SCM min, SCM max)
#define SCM_FROM_TYPE_PROTO(arg) scm_from_uint64 (arg) #define SCM_FROM_TYPE_PROTO(arg) scm_from_uint64 (arg)
#include "libguile/conv-uinteger.i.c" #include "libguile/conv-uinteger.i.c"
#endif
void void
scm_to_mpz (SCM val, mpz_t rop) scm_to_mpz (SCM val, mpz_t rop)
{ {

View file

@ -3,7 +3,7 @@
#ifndef SCM_NUMBERS_H #ifndef SCM_NUMBERS_H
#define SCM_NUMBERS_H #define SCM_NUMBERS_H
/* Copyright (C) 1995,1996,1998,2000,2001,2002,2003,2004,2005, 2006 Free Software Foundation, Inc. /* Copyright (C) 1995,1996,1998,2000,2001,2002,2003,2004,2005, 2006, 2010 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -321,16 +321,12 @@ SCM_API SCM scm_from_int32 (scm_t_int32 x);
SCM_API scm_t_uint32 scm_to_uint32 (SCM x); SCM_API scm_t_uint32 scm_to_uint32 (SCM x);
SCM_API SCM scm_from_uint32 (scm_t_uint32 x); SCM_API SCM scm_from_uint32 (scm_t_uint32 x);
#if SCM_HAVE_T_INT64
SCM_API scm_t_int64 scm_to_int64 (SCM x); SCM_API scm_t_int64 scm_to_int64 (SCM x);
SCM_API SCM scm_from_int64 (scm_t_int64 x); SCM_API SCM scm_from_int64 (scm_t_int64 x);
SCM_API scm_t_uint64 scm_to_uint64 (SCM x); SCM_API scm_t_uint64 scm_to_uint64 (SCM x);
SCM_API SCM scm_from_uint64 (scm_t_uint64 x); SCM_API SCM scm_from_uint64 (scm_t_uint64 x);
#endif
SCM_API void scm_to_mpz (SCM x, mpz_t rop); SCM_API void scm_to_mpz (SCM x, mpz_t rop);
SCM_API SCM scm_from_mpz (mpz_t rop); SCM_API SCM scm_from_mpz (mpz_t rop);

View file

@ -75,8 +75,6 @@ scm_t_rng scm_the_rng;
#define M_PI 3.14159265359 #define M_PI 3.14159265359
#endif #endif
#if SCM_HAVE_T_UINT64
unsigned long unsigned long
scm_i_uniform32 (scm_t_i_rstate *state) scm_i_uniform32 (scm_t_i_rstate *state)
{ {
@ -87,38 +85,6 @@ scm_i_uniform32 (scm_t_i_rstate *state)
return w; return w;
} }
#else
/* ww This is a portable version of the same RNG without 64 bit
* * aa arithmetic.
* ----
* xx It is only intended to provide identical behaviour on
* xx platforms without 8 byte longs or long longs until
* xx someone has implemented the routine in assembler code.
* xxcc
* ----
* ccww
*/
#define L(x) ((x) & 0xffff)
#define H(x) ((x) >> 16)
unsigned long
scm_i_uniform32 (scm_t_i_rstate *state)
{
scm_t_uint32 x1 = L (A) * L (state->w);
scm_t_uint32 x2 = L (A) * H (state->w);
scm_t_uint32 x3 = H (A) * L (state->w);
scm_t_uint32 w = L (x1) + L (state->c);
scm_t_uint32 m = H (x1) + L (x2) + L (x3) + H (state->c) + H (w);
scm_t_uint32 x4 = H (A) * H (state->w);
state->w = w = (L (m) << 16) + L (w);
state->c = H (x2) + H (x3) + x4 + H (m);
return w;
}
#endif
void void
scm_i_init_rstate (scm_t_i_rstate *state, const char *seed, int n) scm_i_init_rstate (scm_t_i_rstate *state, const char *seed, int n)
{ {

View file

@ -1,6 +1,6 @@
/* srfi-4.c --- Uniform numeric vector datatypes. /* srfi-4.c --- Uniform numeric vector datatypes.
* *
* Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. * Copyright (C) 2001, 2004, 2006, 2010 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -84,11 +84,7 @@ static const int uvec_sizes[12] = {
1, 1, 1, 1,
2, 2, 2, 2,
4, 4, 4, 4,
#if SCM_HAVE_T_INT64
8, 8, 8, 8,
#else
sizeof (SCM), sizeof (SCM),
#endif
sizeof(float), sizeof(double), sizeof(float), sizeof(double),
2*sizeof(float), 2*sizeof(double) 2*sizeof(float), 2*sizeof(double)
}; };
@ -127,10 +123,8 @@ uvec_print (SCM uvec, SCM port, scm_print_state *pstate)
scm_t_int16 *s16; scm_t_int16 *s16;
scm_t_uint32 *u32; scm_t_uint32 *u32;
scm_t_int32 *s32; scm_t_int32 *s32;
#if SCM_HAVE_T_INT64
scm_t_uint64 *u64; scm_t_uint64 *u64;
scm_t_int64 *s64; scm_t_int64 *s64;
#endif
float *f32; float *f32;
double *f64; double *f64;
SCM *fake_64; SCM *fake_64;
@ -148,13 +142,8 @@ uvec_print (SCM uvec, SCM port, scm_print_state *pstate)
case SCM_UVEC_S16: np.s16 = (scm_t_int16 *) uptr; break; case SCM_UVEC_S16: np.s16 = (scm_t_int16 *) uptr; break;
case SCM_UVEC_U32: np.u32 = (scm_t_uint32 *) uptr; break; case SCM_UVEC_U32: np.u32 = (scm_t_uint32 *) uptr; break;
case SCM_UVEC_S32: np.s32 = (scm_t_int32 *) uptr; break; case SCM_UVEC_S32: np.s32 = (scm_t_int32 *) uptr; break;
#if SCM_HAVE_T_INT64
case SCM_UVEC_U64: np.u64 = (scm_t_uint64 *) uptr; break; case SCM_UVEC_U64: np.u64 = (scm_t_uint64 *) uptr; break;
case SCM_UVEC_S64: np.s64 = (scm_t_int64 *) uptr; break; case SCM_UVEC_S64: np.s64 = (scm_t_int64 *) uptr; break;
#else
case SCM_UVEC_U64:
case SCM_UVEC_S64: np.fake_64 = (SCM *) uptr; break;
#endif
case SCM_UVEC_F32: np.f32 = (float *) uptr; break; case SCM_UVEC_F32: np.f32 = (float *) uptr; break;
case SCM_UVEC_F64: np.f64 = (double *) uptr; break; case SCM_UVEC_F64: np.f64 = (double *) uptr; break;
case SCM_UVEC_C32: np.f32 = (float *) uptr; break; case SCM_UVEC_C32: np.f32 = (float *) uptr; break;
@ -179,14 +168,8 @@ uvec_print (SCM uvec, SCM port, scm_print_state *pstate)
case SCM_UVEC_S16: scm_intprint (*np.s16, 10, port); np.s16++; break; case SCM_UVEC_S16: scm_intprint (*np.s16, 10, port); np.s16++; break;
case SCM_UVEC_U32: scm_uintprint (*np.u32, 10, port); np.u32++; break; case SCM_UVEC_U32: scm_uintprint (*np.u32, 10, port); np.u32++; break;
case SCM_UVEC_S32: scm_intprint (*np.s32, 10, port); np.s32++; break; case SCM_UVEC_S32: scm_intprint (*np.s32, 10, port); np.s32++; break;
#if SCM_HAVE_T_INT64
case SCM_UVEC_U64: scm_uintprint (*np.u64, 10, port); np.u64++; break; case SCM_UVEC_U64: scm_uintprint (*np.u64, 10, port); np.u64++; break;
case SCM_UVEC_S64: scm_intprint (*np.s64, 10, port); np.s64++; break; case SCM_UVEC_S64: scm_intprint (*np.s64, 10, port); np.s64++; break;
#else
case SCM_UVEC_U64:
case SCM_UVEC_S64: scm_iprin1 (*np.fake_64, port, pstate);
np.fake_64++; break;
#endif
case SCM_UVEC_F32: scm_i_print_double (*np.f32, port); np.f32++; break; case SCM_UVEC_F32: scm_i_print_double (*np.f32, port); np.f32++; break;
case SCM_UVEC_F64: scm_i_print_double (*np.f64, port); np.f64++; break; case SCM_UVEC_F64: scm_i_print_double (*np.f64, port); np.f64++; break;
case SCM_UVEC_C32: case SCM_UVEC_C32:
@ -222,20 +205,6 @@ uvec_equalp (SCM a, SCM b)
result = SCM_BOOL_F; result = SCM_BOOL_F;
else if (SCM_UVEC_LENGTH (a) != SCM_UVEC_LENGTH (b)) else if (SCM_UVEC_LENGTH (a) != SCM_UVEC_LENGTH (b))
result = SCM_BOOL_F; result = SCM_BOOL_F;
#if SCM_HAVE_T_INT64 == 0
else if (SCM_UVEC_TYPE (a) == SCM_UVEC_U64
|| SCM_UVEC_TYPE (a) == SCM_UVEC_S64)
{
SCM *aptr = (SCM *)SCM_UVEC_BASE (a), *bptr = (SCM *)SCM_UVEC_BASE (b);
size_t len = SCM_UVEC_LENGTH (a), i;
for (i = 0; i < len; i++)
if (scm_is_false (scm_num_eq_p (*aptr++, *bptr++)))
{
result = SCM_BOOL_F;
break;
}
}
#endif
else if (memcmp (SCM_UVEC_BASE (a), SCM_UVEC_BASE (b), else if (memcmp (SCM_UVEC_BASE (a), SCM_UVEC_BASE (b),
SCM_UVEC_LENGTH (a) * uvec_sizes[SCM_UVEC_TYPE(a)]) != 0) SCM_UVEC_LENGTH (a) * uvec_sizes[SCM_UVEC_TYPE(a)]) != 0)
result = SCM_BOOL_F; result = SCM_BOOL_F;
@ -244,24 +213,6 @@ uvec_equalp (SCM a, SCM b)
return result; return result;
} }
/* Mark hook. Only used when U64 and S64 are implemented as SCMs. */
#if SCM_HAVE_T_INT64 == 0
static SCM
uvec_mark (SCM uvec)
{
if (SCM_UVEC_TYPE (uvec) == SCM_UVEC_U64
|| SCM_UVEC_TYPE (uvec) == SCM_UVEC_S64)
{
SCM *ptr = (SCM *)SCM_UVEC_BASE (uvec);
size_t len = SCM_UVEC_LENGTH (uvec), i;
for (i = 0; i < len; i++)
scm_gc_mark (*ptr++);
}
return SCM_BOOL_F;
}
#endif
/* Smob free hook for uniform numeric vectors. */ /* Smob free hook for uniform numeric vectors. */
static size_t static size_t
uvec_free (SCM uvec) uvec_free (SCM uvec)
@ -318,15 +269,6 @@ alloc_uvec (int type, size_t len)
if (len > SCM_I_SIZE_MAX / uvec_sizes[type]) if (len > SCM_I_SIZE_MAX / uvec_sizes[type])
scm_out_of_range (NULL, scm_from_size_t (len)); scm_out_of_range (NULL, scm_from_size_t (len));
base = scm_gc_malloc (len * uvec_sizes[type], uvec_names[type]); base = scm_gc_malloc (len * uvec_sizes[type], uvec_names[type]);
#if SCM_HAVE_T_INT64 == 0
if (type == SCM_UVEC_U64 || type == SCM_UVEC_S64)
{
SCM *ptr = (SCM *)base;
size_t i;
for (i = 0; i < len; i++)
*ptr++ = SCM_UNSPECIFIED;
}
#endif
return take_uvec (type, base, len); return take_uvec (type, base, len);
} }
@ -349,17 +291,10 @@ uvec_fast_ref (int type, const void *base, size_t c_idx)
return scm_from_uint32 (((scm_t_uint32*)base)[c_idx]); return scm_from_uint32 (((scm_t_uint32*)base)[c_idx]);
else if (type == SCM_UVEC_S32) else if (type == SCM_UVEC_S32)
return scm_from_int32 (((scm_t_int32*)base)[c_idx]); return scm_from_int32 (((scm_t_int32*)base)[c_idx]);
#if SCM_HAVE_T_INT64
else if (type == SCM_UVEC_U64) else if (type == SCM_UVEC_U64)
return scm_from_uint64 (((scm_t_uint64*)base)[c_idx]); return scm_from_uint64 (((scm_t_uint64*)base)[c_idx]);
else if (type == SCM_UVEC_S64) else if (type == SCM_UVEC_S64)
return scm_from_int64 (((scm_t_int64*)base)[c_idx]); return scm_from_int64 (((scm_t_int64*)base)[c_idx]);
#else
else if (type == SCM_UVEC_U64)
return ((SCM *)base)[c_idx];
else if (type == SCM_UVEC_S64)
return ((SCM *)base)[c_idx];
#endif
else if (type == SCM_UVEC_F32) else if (type == SCM_UVEC_F32)
return scm_from_double (((float*)base)[c_idx]); return scm_from_double (((float*)base)[c_idx]);
else if (type == SCM_UVEC_F64) else if (type == SCM_UVEC_F64)
@ -374,22 +309,6 @@ uvec_fast_ref (int type, const void *base, size_t c_idx)
return SCM_BOOL_F; return SCM_BOOL_F;
} }
#if SCM_HAVE_T_INT64 == 0
static SCM scm_uint64_min, scm_uint64_max;
static SCM scm_int64_min, scm_int64_max;
static void
assert_exact_integer_range (SCM val, SCM min, SCM max)
{
if (!scm_is_integer (val)
|| scm_is_false (scm_exact_p (val)))
scm_wrong_type_arg_msg (NULL, 0, val, "exact integer");
if (scm_is_true (scm_less_p (val, min))
|| scm_is_true (scm_gr_p (val, max)))
scm_out_of_range (NULL, val);
}
#endif
static SCM_C_INLINE_KEYWORD void static SCM_C_INLINE_KEYWORD void
uvec_fast_set_x (int type, void *base, size_t c_idx, SCM val) uvec_fast_set_x (int type, void *base, size_t c_idx, SCM val)
{ {
@ -405,23 +324,10 @@ uvec_fast_set_x (int type, void *base, size_t c_idx, SCM val)
(((scm_t_uint32*)base)[c_idx]) = scm_to_uint32 (val); (((scm_t_uint32*)base)[c_idx]) = scm_to_uint32 (val);
else if (type == SCM_UVEC_S32) else if (type == SCM_UVEC_S32)
(((scm_t_int32*)base)[c_idx]) = scm_to_int32 (val); (((scm_t_int32*)base)[c_idx]) = scm_to_int32 (val);
#if SCM_HAVE_T_INT64
else if (type == SCM_UVEC_U64) else if (type == SCM_UVEC_U64)
(((scm_t_uint64*)base)[c_idx]) = scm_to_uint64 (val); (((scm_t_uint64*)base)[c_idx]) = scm_to_uint64 (val);
else if (type == SCM_UVEC_S64) else if (type == SCM_UVEC_S64)
(((scm_t_int64*)base)[c_idx]) = scm_to_int64 (val); (((scm_t_int64*)base)[c_idx]) = scm_to_int64 (val);
#else
else if (type == SCM_UVEC_U64)
{
assert_exact_integer_range (val, scm_uint64_min, scm_uint64_max);
((SCM *)base)[c_idx] = val;
}
else if (type == SCM_UVEC_S64)
{
assert_exact_integer_range (val, scm_int64_min, scm_int64_max);
((SCM *)base)[c_idx] = val;
}
#endif
else if (type == SCM_UVEC_F32) else if (type == SCM_UVEC_F32)
(((float*)base)[c_idx]) = scm_to_double (val); (((float*)base)[c_idx]) = scm_to_double (val);
else if (type == SCM_UVEC_F64) else if (type == SCM_UVEC_F64)
@ -1027,16 +933,12 @@ SCM_DEFINE (scm_uniform_vector_write, "uniform-vector-write", 1, 3, 0,
#define TYPE SCM_UVEC_U64 #define TYPE SCM_UVEC_U64
#define TAG u64 #define TAG u64
#if SCM_HAVE_T_UINT64
#define CTYPE scm_t_uint64 #define CTYPE scm_t_uint64
#endif
#include "libguile/srfi-4.i.c" #include "libguile/srfi-4.i.c"
#define TYPE SCM_UVEC_S64 #define TYPE SCM_UVEC_S64
#define TAG s64 #define TAG s64
#if SCM_HAVE_T_INT64
#define CTYPE scm_t_int64 #define CTYPE scm_t_int64
#endif
#include "libguile/srfi-4.i.c" #include "libguile/srfi-4.i.c"
#define TYPE SCM_UVEC_F32 #define TYPE SCM_UVEC_F32
@ -1094,23 +996,9 @@ scm_init_srfi_4 (void)
{ {
scm_tc16_uvec = scm_make_smob_type ("uvec", 0); scm_tc16_uvec = scm_make_smob_type ("uvec", 0);
scm_set_smob_equalp (scm_tc16_uvec, uvec_equalp); scm_set_smob_equalp (scm_tc16_uvec, uvec_equalp);
#if SCM_HAVE_T_INT64 == 0
scm_set_smob_mark (scm_tc16_uvec, uvec_mark);
#endif
scm_set_smob_free (scm_tc16_uvec, uvec_free); scm_set_smob_free (scm_tc16_uvec, uvec_free);
scm_set_smob_print (scm_tc16_uvec, uvec_print); scm_set_smob_print (scm_tc16_uvec, uvec_print);
#if SCM_HAVE_T_INT64 == 0
scm_uint64_min =
scm_permanent_object (scm_from_int (0));
scm_uint64_max =
scm_permanent_object (scm_c_read_string ("18446744073709551615"));
scm_int64_min =
scm_permanent_object (scm_c_read_string ("-9223372036854775808"));
scm_int64_max =
scm_permanent_object (scm_c_read_string ("9223372036854775807"));
#endif
#include "libguile/srfi-4.x" #include "libguile/srfi-4.x"
} }

View file

@ -2,7 +2,7 @@
#define SCM_SRFI_4_H #define SCM_SRFI_4_H
/* srfi-4.c --- Homogeneous numeric vector datatypes. /* srfi-4.c --- Homogeneous numeric vector datatypes.
* *
* Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. * Copyright (C) 2001, 2004, 2006, 2010 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -186,7 +186,6 @@ SCM_API SCM scm_u64vector_to_list (SCM uvec);
SCM_API SCM scm_list_to_u64vector (SCM l); SCM_API SCM scm_list_to_u64vector (SCM l);
SCM_API SCM scm_any_to_u64vector (SCM obj); SCM_API SCM scm_any_to_u64vector (SCM obj);
#if SCM_HAVE_T_UINT64
SCM_API SCM scm_take_u64vector (scm_t_uint64 *data, size_t n); SCM_API SCM scm_take_u64vector (scm_t_uint64 *data, size_t n);
SCM_API const scm_t_uint64 *scm_array_handle_u64_elements (scm_t_array_handle *h); SCM_API const scm_t_uint64 *scm_array_handle_u64_elements (scm_t_array_handle *h);
SCM_API scm_t_uint64 *scm_array_handle_u64_writable_elements (scm_t_array_handle *h); SCM_API scm_t_uint64 *scm_array_handle_u64_writable_elements (scm_t_array_handle *h);
@ -198,7 +197,6 @@ SCM_API scm_t_uint64 *scm_u64vector_writable_elements (SCM uvec,
scm_t_array_handle *h, scm_t_array_handle *h,
size_t *lenp, size_t *lenp,
ssize_t *incp); ssize_t *incp);
#endif
SCM_API SCM scm_s64vector_p (SCM obj); SCM_API SCM scm_s64vector_p (SCM obj);
SCM_API SCM scm_make_s64vector (SCM n, SCM fill); SCM_API SCM scm_make_s64vector (SCM n, SCM fill);
@ -210,7 +208,6 @@ SCM_API SCM scm_s64vector_to_list (SCM uvec);
SCM_API SCM scm_list_to_s64vector (SCM l); SCM_API SCM scm_list_to_s64vector (SCM l);
SCM_API SCM scm_any_to_s64vector (SCM obj); SCM_API SCM scm_any_to_s64vector (SCM obj);
#if SCM_HAVE_T_INT64
SCM_API SCM scm_take_s64vector (scm_t_int64 *data, size_t n); SCM_API SCM scm_take_s64vector (scm_t_int64 *data, size_t n);
SCM_API const scm_t_int64 *scm_array_handle_s64_elements (scm_t_array_handle *h); SCM_API const scm_t_int64 *scm_array_handle_s64_elements (scm_t_array_handle *h);
SCM_API scm_t_int64 *scm_array_handle_s64_writable_elements (scm_t_array_handle *h); SCM_API scm_t_int64 *scm_array_handle_s64_writable_elements (scm_t_array_handle *h);
@ -221,7 +218,6 @@ SCM_API scm_t_int64 *scm_s64vector_writable_elements (SCM uvec,
scm_t_array_handle *h, scm_t_array_handle *h,
size_t *lenp, size_t *lenp,
ssize_t *incp); ssize_t *incp);
#endif
SCM_API SCM scm_f32vector_p (SCM obj); SCM_API SCM scm_f32vector_p (SCM obj);
SCM_API SCM scm_make_f32vector (SCM n, SCM fill); SCM_API SCM scm_make_f32vector (SCM n, SCM fill);

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1999,2000,2001,2003,2004, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. /* Copyright (C) 1999,2000,2001,2003,2004, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -702,10 +702,8 @@ DEFSTST (scm_to_int16)
DEFUTST (scm_to_uint16) DEFUTST (scm_to_uint16)
DEFSTST (scm_to_int32) DEFSTST (scm_to_int32)
DEFUTST (scm_to_uint32) DEFUTST (scm_to_uint32)
#ifdef SCM_HAVE_T_INT64
DEFSTST (scm_to_int64) DEFSTST (scm_to_int64)
DEFUTST (scm_to_uint64) DEFUTST (scm_to_uint64)
#endif
#define TEST_8S(v,f,r,re,te) test_8s (v, tst_##f, #f, r, re, te) #define TEST_8S(v,f,r,re,te) test_8s (v, tst_##f, #f, r, re, te)
#define TEST_8U(v,f,r,re,te) test_8u (v, tst_##f, #f, r, re, te) #define TEST_8U(v,f,r,re,te) test_8u (v, tst_##f, #f, r, re, te)
@ -745,11 +743,9 @@ test_int_sizes ()
TEST_7S (scm_from_int32, SCM_T_INT32_MAX+1LL, "-2147483648"); TEST_7S (scm_from_int32, SCM_T_INT32_MAX+1LL, "-2147483648");
TEST_7U (scm_from_uint32, SCM_T_UINT32_MAX, "4294967295"); TEST_7U (scm_from_uint32, SCM_T_UINT32_MAX, "4294967295");
#if SCM_HAVE_T_INT64
TEST_7S (scm_from_int64, SCM_T_INT64_MIN, "-9223372036854775808"); TEST_7S (scm_from_int64, SCM_T_INT64_MIN, "-9223372036854775808");
TEST_7S (scm_from_int64, SCM_T_INT64_MAX, "9223372036854775807"); TEST_7S (scm_from_int64, SCM_T_INT64_MAX, "9223372036854775807");
TEST_7U (scm_from_uint64, SCM_T_UINT64_MAX, "18446744073709551615"); TEST_7U (scm_from_uint64, SCM_T_UINT64_MAX, "18446744073709551615");
#endif
TEST_8S ("91", scm_to_schar, 91, 0, 0); TEST_8S ("91", scm_to_schar, 91, 0, 0);
TEST_8U ("91", scm_to_uchar, 91, 0, 0); TEST_8U ("91", scm_to_uchar, 91, 0, 0);
@ -794,7 +790,6 @@ test_int_sizes ()
TEST_8U ("-1", scm_to_uint32, 0, 1, 0); TEST_8U ("-1", scm_to_uint32, 0, 1, 0);
TEST_8U ("#f", scm_to_uint32, 0, 0, 1); TEST_8U ("#f", scm_to_uint32, 0, 0, 1);
#if SCM_HAVE_T_INT64
TEST_8S ("-9223372036854775808", scm_to_int64, SCM_T_INT64_MIN, 0, 0); TEST_8S ("-9223372036854775808", scm_to_int64, SCM_T_INT64_MIN, 0, 0);
TEST_8S ("9223372036854775807", scm_to_int64, SCM_T_INT64_MAX, 0, 0); TEST_8S ("9223372036854775807", scm_to_int64, SCM_T_INT64_MAX, 0, 0);
TEST_8S ("9223372036854775808", scm_to_int64, 0, 1, 0); TEST_8S ("9223372036854775808", scm_to_int64, 0, 1, 0);
@ -803,7 +798,6 @@ test_int_sizes ()
TEST_8U ("18446744073709551616", scm_to_uint64, 0, 1, 0); TEST_8U ("18446744073709551616", scm_to_uint64, 0, 1, 0);
TEST_8U ("-1", scm_to_uint64, 0, 1, 0); TEST_8U ("-1", scm_to_uint64, 0, 1, 0);
TEST_8U ("#f", scm_to_uint64, 0, 0, 1); TEST_8U ("#f", scm_to_uint64, 0, 0, 1);
#endif
} }