mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
remove SCM_I_LLONG and SCM_I_ULLONG limit defines
* test-suite/standalone/test-num2integral.c (test_long_long): (test_ulong_long): Replace SCM_I_LLONG and SCM_I_ULLONG defines with their counterparts from limits.h. * libguile/__scm.h: Remove SCM_I_LLONG and SCM_I_ULLONG limit defines.
This commit is contained in:
parent
871054f08e
commit
4f1ce27a36
2 changed files with 11 additions and 16 deletions
|
@ -310,12 +310,6 @@
|
|||
#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)
|
||||
|
||||
#if SCM_SIZEOF_LONG_LONG
|
||||
#define SCM_I_ULLONG_MAX SCM_I_UTYPE_MAX(unsigned long long)
|
||||
#define SCM_I_LLONG_MIN SCM_I_TYPE_MIN(long long,SCM_I_ULLONG_MAX)
|
||||
#define SCM_I_LLONG_MAX SCM_I_TYPE_MAX(long long,SCM_I_ULLONG_MAX)
|
||||
#endif
|
||||
|
||||
#define SCM_T_UINTMAX_MAX SCM_I_UTYPE_MAX(scm_t_uintmax)
|
||||
#define SCM_T_INTMAX_MIN SCM_I_TYPE_MIN(scm_t_intmax,SCM_T_UINTMAX_MAX)
|
||||
#define SCM_T_INTMAX_MAX SCM_I_TYPE_MAX(scm_t_intmax,SCM_T_UINTMAX_MAX)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 1999,2000,2001,2003,2004, 2006, 2008, 2010 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1999,2000,2001,2003,2004, 2006, 2008, 2010, 2011 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,6 +24,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
|
||||
SCM out_of_range_handler (void *data, SCM key, SCM args);
|
||||
SCM call_num2long_long_body (void *data);
|
||||
|
@ -56,14 +57,14 @@ static void
|
|||
test_long_long ()
|
||||
{
|
||||
{
|
||||
SCM n = scm_from_long_long (SCM_I_LLONG_MIN);
|
||||
SCM n = scm_from_long_long (LLONG_MIN);
|
||||
long long result = scm_to_long_long(n);
|
||||
assert (result == SCM_I_LLONG_MIN);
|
||||
assert (result == LLONG_MIN);
|
||||
}
|
||||
|
||||
/* LLONG_MIN - 1 */
|
||||
{
|
||||
SCM n = scm_difference (scm_from_long_long (SCM_I_LLONG_MIN), scm_from_int (1));
|
||||
SCM n = scm_difference (scm_from_long_long (LLONG_MIN), scm_from_int (1));
|
||||
SCM caught = scm_internal_catch (SCM_BOOL_T, call_num2long_long_body, &n,
|
||||
out_of_range_handler, NULL);
|
||||
assert (scm_is_true (caught));
|
||||
|
@ -71,8 +72,8 @@ test_long_long ()
|
|||
|
||||
/* SCM_I_LLONG_MIN + SCM_I_LLONG_MIN/2 */
|
||||
{
|
||||
SCM n = scm_sum (scm_from_long_long (SCM_I_LLONG_MIN),
|
||||
scm_from_long_long (SCM_I_LLONG_MIN / 2));
|
||||
SCM n = scm_sum (scm_from_long_long (LLONG_MIN),
|
||||
scm_from_long_long (LLONG_MIN / 2));
|
||||
SCM caught = scm_internal_catch (SCM_BOOL_T, call_num2long_long_body, &n,
|
||||
out_of_range_handler, NULL);
|
||||
assert (scm_is_true (caught));
|
||||
|
@ -80,7 +81,7 @@ test_long_long ()
|
|||
|
||||
/* SCM_I_LLONG_MAX + 1 */
|
||||
{
|
||||
SCM n = scm_sum (scm_from_long_long (SCM_I_LLONG_MAX), scm_from_int (1));
|
||||
SCM n = scm_sum (scm_from_long_long (LLONG_MAX), scm_from_int (1));
|
||||
SCM caught = scm_internal_catch (SCM_BOOL_T, call_num2long_long_body, &n,
|
||||
out_of_range_handler, NULL);
|
||||
assert (scm_is_true (caught));
|
||||
|
@ -108,9 +109,9 @@ static void
|
|||
test_ulong_long ()
|
||||
{
|
||||
{
|
||||
SCM n = scm_from_ulong_long (SCM_I_ULLONG_MAX);
|
||||
SCM n = scm_from_ulong_long (ULLONG_MAX);
|
||||
unsigned long long result = scm_to_ulong_long(n);
|
||||
assert (result == SCM_I_ULLONG_MAX);
|
||||
assert (result == ULLONG_MAX);
|
||||
}
|
||||
|
||||
/* -1 */
|
||||
|
@ -123,7 +124,7 @@ test_ulong_long ()
|
|||
|
||||
/* SCM_I_ULLONG_MAX + 1 */
|
||||
{
|
||||
SCM n = scm_sum (scm_from_ulong_long (SCM_I_ULLONG_MAX), scm_from_int (1));
|
||||
SCM n = scm_sum (scm_from_ulong_long (ULLONG_MAX), scm_from_int (1));
|
||||
SCM caught = scm_internal_catch (SCM_BOOL_T, call_num2ulong_long_body, &n,
|
||||
out_of_range_handler, NULL);
|
||||
assert (scm_is_true (caught));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue