summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--srfi/srfi-13.c87
-rw-r--r--srfi/srfi-14.c38
-rw-r--r--srfi/srfi-4.c70
3 files changed, 90 insertions, 105 deletions
diff --git a/srfi/srfi-13.c b/srfi/srfi-13.c
index 945d6d5ef..0efd24abb 100644
--- a/srfi/srfi-13.c
+++ b/srfi/srfi-13.c
@@ -97,13 +97,13 @@ SCM_DEFINE (scm_string_tabulate, "string-tabulate", 2, 0, 0,
"@var{proc} is applied to the indices is not specified.")
#define FUNC_NAME s_scm_string_tabulate
{
- int clen, i;
+ size_t clen, i;
SCM res;
SCM ch;
char * p;
SCM_VALIDATE_PROC (1, proc);
- SCM_VALIDATE_INUM_COPY (2, len, clen);
+ clen = scm_to_size_t (len);
SCM_ASSERT_RANGE (2, len, clen >= 0);
res = scm_allocate_string (clen);
@@ -111,7 +111,7 @@ SCM_DEFINE (scm_string_tabulate, "string-tabulate", 2, 0, 0,
i = 0;
while (i < clen)
{
- ch = scm_call_1 (proc, SCM_I_MAKINUM (i));
+ ch = scm_call_1 (proc, scm_from_int (i));
if (!SCM_CHARP (ch))
SCM_MISC_ERROR ("procedure ~S returned non-char", scm_list_1 (proc));
*p++ = SCM_CHAR (ch);
@@ -365,16 +365,17 @@ SCM_DEFINE (scm_substring_shared, "substring/shared", 2, 1, 0,
"argument @var{str}.")
#define FUNC_NAME s_scm_substring_shared
{
+ size_t s, e;
SCM_VALIDATE_STRING (1, str);
- SCM_VALIDATE_INUM (2, start);
+ s = scm_to_size_t (start);
if (SCM_UNBNDP (end))
- end = SCM_I_MAKINUM (SCM_STRING_LENGTH (str));
+ e = SCM_STRING_LENGTH (str);
else
- SCM_VALIDATE_INUM (3, end);
- if (SCM_INUM (start) == 0 &&
- SCM_INUM (end) == SCM_STRING_LENGTH (str))
+ e = scm_to_size_t (end);
+ if (s == 0 && e == SCM_STRING_LENGTH (str))
return str;
- return scm_substring (str, start, end);
+ else
+ return scm_substring (str, start, end);
}
#undef FUNC_NAME
@@ -418,11 +419,10 @@ SCM_DEFINE (scm_string_take, "string-take", 2, 0, 0,
#define FUNC_NAME s_scm_string_take
{
char * cstr;
- int cn;
+ size_t cn;
SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
+ cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr, cn);
}
@@ -435,11 +435,10 @@ SCM_DEFINE (scm_string_drop, "string-drop", 2, 0, 0,
#define FUNC_NAME s_scm_string_drop
{
char * cstr;
- int cn;
+ size_t cn;
SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
+ cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr + cn, SCM_STRING_LENGTH (s) - cn);
}
@@ -452,11 +451,10 @@ SCM_DEFINE (scm_string_take_right, "string-take-right", 2, 0, 0,
#define FUNC_NAME s_scm_string_take_right
{
char * cstr;
- int cn;
+ size_t cn;
SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
+ cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr + SCM_STRING_LENGTH (s) - cn, cn);
}
@@ -469,11 +467,10 @@ SCM_DEFINE (scm_string_drop_right, "string-drop-right", 2, 0, 0,
#define FUNC_NAME s_scm_string_drop_right
{
char * cstr;
- int cn;
+ size_t cn;
SCM_VALIDATE_STRING_COPY (1, s, cstr);
- SCM_VALIDATE_INUM_COPY (2, n, cn);
- SCM_ASSERT_RANGE (2, n, cn >= 0 && cn <= SCM_STRING_LENGTH (s));
+ cn = scm_to_unsigned_integer (n, 0, SCM_STRING_LENGTH (s));
return scm_mem2string (cstr, SCM_STRING_LENGTH (s) - cn);
}
@@ -490,13 +487,14 @@ SCM_DEFINE (scm_string_pad, "string-pad", 2, 3, 0,
{
char cchr;
char * cstr;
- int cstart, cend, clen;
+ size_t cstart, cend, clen;
SCM result;
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
4, start, cstart,
5, end, cend);
- SCM_VALIDATE_INUM_COPY (2, len, clen);
+ clen = scm_to_size_t (len);
+
if (SCM_UNBNDP (chr))
cchr = ' ';
else
@@ -532,13 +530,14 @@ SCM_DEFINE (scm_string_pad_right, "string-pad-right", 2, 3, 0,
{
char cchr;
char * cstr;
- int cstart, cend, clen;
+ size_t cstart, cend, clen;
SCM result;
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
4, start, cstart,
5, end, cend);
- SCM_VALIDATE_INUM_COPY (2, len, clen);
+ clen = scm_to_size_t (len);
+
if (SCM_UNBNDP (chr))
cchr = ' ';
else
@@ -584,7 +583,7 @@ SCM_DEFINE (scm_string_trim, "string-trim", 1, 3, 0,
#define FUNC_NAME s_scm_string_trim
{
char * cstr;
- int cstart, cend;
+ size_t cstart, cend;
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
3, start, cstart,
@@ -2281,9 +2280,9 @@ SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2,
{
long strings;
SCM tmp, result;
- int len = 0;
+ size_t len = 0;
char * p;
- int cend = 0;
+ size_t cend = 0;
/* Check the optional arguments and calculate the additional length
of the result string. */
@@ -2292,10 +2291,8 @@ SCM_DEFINE (scm_string_concatenate_reverse, "string-concatenate-reverse", 1, 2,
SCM_VALIDATE_STRING (2, final_string);
if (!SCM_UNBNDP (end))
{
- SCM_VALIDATE_INUM_COPY (3, end, cend);
- SCM_ASSERT_RANGE (3, end,
- (cend >= 0) &&
- (cend <= SCM_STRING_LENGTH (final_string)));
+ cend = scm_to_unsigned_integer (end,
+ 0, SCM_STRING_LENGTH (final_string));
}
else
{
@@ -2674,14 +2671,17 @@ SCM_DEFINE (scm_xsubstring, "xsubstring", 2, 3, 0,
#define FUNC_NAME s_scm_xsubstring
{
char * cs, * p;
- int cstart, cend, cfrom, cto;
+ size_t cstart, cend, cfrom, cto;
SCM result;
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cs,
4, start, cstart,
5, end, cend);
- SCM_VALIDATE_INUM_COPY (2, from, cfrom);
- SCM_VALIDATE_INUM_DEF_COPY (3, to, cfrom + (cend - cstart), cto);
+ cfrom = scm_to_size_t (from);
+ if (SCM_UNBNDP (to))
+ cto = cfrom + (cend - cstart);
+ else
+ cto = scm_to_size_t (to);
if (cstart == cend && cfrom != cto)
SCM_MISC_ERROR ("start and end indices must not be equal", SCM_EOL);
@@ -2713,7 +2713,7 @@ SCM_DEFINE (scm_string_xcopy_x, "string-xcopy!", 4, 3, 0,
#define FUNC_NAME s_scm_string_xcopy_x
{
char * ctarget, * cs, * p;
- int ctstart, csfrom, csto, cstart, cend;
+ size_t ctstart, csfrom, csto, cstart, cend;
SCM dummy = SCM_UNDEFINED;
int cdummy;
@@ -2723,8 +2723,11 @@ SCM_DEFINE (scm_string_xcopy_x, "string-xcopy!", 4, 3, 0,
SCM_VALIDATE_SUBSTRING_SPEC_COPY (3, s, cs,
6, start, cstart,
7, end, cend);
- SCM_VALIDATE_INUM_COPY (4, sfrom, csfrom);
- SCM_VALIDATE_INUM_DEF_COPY (5, sto, csfrom + (cend - cstart), csto);
+ csfrom = scm_to_size_t (sfrom);
+ if (SCM_UNBNDP (sto))
+ csto = csfrom + (cend - cstart);
+ else
+ csto = scm_to_size_t (sto);
if (cstart == cend && csfrom != csto)
SCM_MISC_ERROR ("start and end indices must not be equal", SCM_EOL);
SCM_ASSERT_RANGE (1, tstart,
@@ -2754,7 +2757,7 @@ SCM_DEFINE (scm_string_replace, "string-replace", 2, 4, 0,
#define FUNC_NAME s_scm_string_replace
{
char * cstr1, * cstr2, * p;
- int cstart1, cend1, cstart2, cend2;
+ size_t cstart1, cend1, cstart2, cend2;
SCM result;
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
@@ -2788,7 +2791,7 @@ SCM_DEFINE (scm_string_tokenize, "string-tokenize", 1, 3, 0,
#define FUNC_NAME s_scm_string_tokenize
{
char * cstr;
- int cstart, cend;
+ size_t cstart, cend;
SCM result = SCM_EOL;
static SCM charset_graphic = SCM_BOOL_F;
@@ -2850,7 +2853,7 @@ SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0,
#define FUNC_NAME s_scm_string_filter
{
char * cstr;
- int cstart, cend;
+ size_t cstart, cend;
SCM result;
int idx;
@@ -2916,7 +2919,7 @@ SCM_DEFINE (scm_string_delete, "string-delete", 2, 2, 0,
#define FUNC_NAME s_scm_string_delete
{
char * cstr;
- int cstart, cend;
+ size_t cstart, cend;
SCM result;
int idx;
diff --git a/srfi/srfi-14.c b/srfi/srfi-14.c
index 551514aba..f9e961c9c 100644
--- a/srfi/srfi-14.c
+++ b/srfi/srfi-14.c
@@ -163,8 +163,8 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0,
"returned value to the range 0 @dots{} @var{bound - 1}.")
#define FUNC_NAME s_scm_char_set_hash
{
- const int default_bnd = 871;
- int bnd;
+ const unsigned long default_bnd = 871;
+ unsigned long bnd;
long * p;
unsigned long val = 0;
int k;
@@ -175,7 +175,7 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0,
bnd = default_bnd;
else
{
- SCM_VALIDATE_INUM_MIN_COPY (2, bound, 0, bnd);
+ bnd = scm_to_ulong (bound);
if (bnd == 0)
bnd = default_bnd;
}
@@ -186,7 +186,7 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0,
if (p[k] != 0)
val = p[k] + (val << 1);
}
- return SCM_I_MAKINUM (val % bnd);
+ return scm_from_ulong (val % bnd);
}
#undef FUNC_NAME
@@ -216,10 +216,8 @@ SCM_DEFINE (scm_char_set_ref, "char-set-ref", 2, 0, 0,
"pass a cursor for which @code{end-of-char-set?} returns true.")
#define FUNC_NAME s_scm_char_set_ref
{
- int ccursor;
-
+ size_t ccursor = scm_to_size_t (cursor);
SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_INUM_MIN_COPY (2, cursor, 0, ccursor);
if (ccursor >= SCM_CHARSET_SIZE || !SCM_CHARSET_GET (cs, ccursor))
SCM_MISC_ERROR ("invalid character set cursor: ~A", scm_list_1 (cursor));
@@ -235,10 +233,8 @@ SCM_DEFINE (scm_char_set_cursor_next, "char-set-cursor-next", 2, 0, 0,
"cursor given satisfies @code{end-of-char-set?}.")
#define FUNC_NAME s_scm_char_set_cursor_next
{
- int ccursor;
-
+ size_t ccursor = scm_to_size_t (cursor);
SCM_VALIDATE_SMOB (1, cs, charset);
- SCM_VALIDATE_INUM_MIN_COPY (2, cursor, 0, ccursor);
if (ccursor >= SCM_CHARSET_SIZE || !SCM_CHARSET_GET (cs, ccursor))
SCM_MISC_ERROR ("invalid character set cursor: ~A", scm_list_1 (cursor));
@@ -258,9 +254,7 @@ SCM_DEFINE (scm_end_of_char_set_p, "end-of-char-set?", 1, 0, 0,
"character set, @code{#f} otherwise.")
#define FUNC_NAME s_scm_end_of_char_set_p
{
- int ccursor;
-
- SCM_VALIDATE_INUM_MIN_COPY (1, cursor, 0, ccursor);
+ size_t ccursor = scm_to_size_t (cursor);
return scm_from_bool (ccursor >= SCM_CHARSET_SIZE);
}
#undef FUNC_NAME
@@ -661,13 +655,12 @@ SCM_DEFINE (scm_ucs_range_to_char_set, "ucs-range->char-set", 2, 2, 0,
#define FUNC_NAME s_scm_ucs_range_to_char_set
{
SCM cs;
- int clower, cupper;
+ size_t clower, cupper;
long * p;
- SCM_VALIDATE_INUM_COPY (1, lower, clower);
- SCM_VALIDATE_INUM_COPY (2, upper, cupper);
- SCM_ASSERT_RANGE (1, lower, clower >= 0);
- SCM_ASSERT_RANGE (2, upper, cupper >= 0 && cupper >= clower);
+ clower = scm_to_size_t (lower);
+ cupper = scm_to_size_t (upper);
+ SCM_ASSERT_RANGE (2, upper, cupper >= clower);
if (!SCM_UNBNDP (error))
{
if (scm_is_true (error))
@@ -714,13 +707,12 @@ SCM_DEFINE (scm_ucs_range_to_char_set_x, "ucs-range->char-set!", 4, 0, 0,
"returned.")
#define FUNC_NAME s_scm_ucs_range_to_char_set_x
{
- int clower, cupper;
+ size_t clower, cupper;
long * p;
- SCM_VALIDATE_INUM_COPY (1, lower, clower);
- SCM_VALIDATE_INUM_COPY (2, upper, cupper);
- SCM_ASSERT_RANGE (1, lower, clower >= 0);
- SCM_ASSERT_RANGE (2, upper, cupper >= 0 && cupper >= clower);
+ clower = scm_to_size_t (lower);
+ cupper = scm_to_size_t (upper);
+ SCM_ASSERT_RANGE (2, upper, cupper >= clower);
if (scm_is_true (error))
{
SCM_ASSERT_RANGE (1, lower, clower <= SCM_CHARSET_SIZE);
diff --git a/srfi/srfi-4.c b/srfi/srfi-4.c
index 45efe728f..a70d96850 100644
--- a/srfi/srfi-4.c
+++ b/srfi/srfi-4.c
@@ -286,7 +286,7 @@ SCM_DEFINE (scm_u8vector_p, "u8vector?", 1, 0, 0,
SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -296,10 +296,9 @@ SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0,
SCM uvec;
int_u8 * p;
int_u8 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_U8, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -472,7 +471,7 @@ SCM_DEFINE (scm_s8vector_p, "s8vector?", 1, 0, 0,
SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -482,10 +481,9 @@ SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0,
SCM uvec;
int_s8 * p;
int_s8 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_S8, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -660,7 +658,7 @@ SCM_DEFINE (scm_u16vector_p, "u16vector?", 1, 0, 0,
SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -670,10 +668,9 @@ SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0,
SCM uvec;
int_u16 * p;
int_u16 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_U16, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -830,7 +827,7 @@ SCM_DEFINE (scm_s16vector_p, "s16vector?", 1, 0, 0,
SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -840,10 +837,9 @@ SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0,
SCM uvec;
int_s16 * p;
int_s16 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_S16, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -1003,7 +999,7 @@ SCM_DEFINE (scm_u32vector_p, "u32vector?", 1, 0, 0,
SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -1013,10 +1009,9 @@ SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0,
SCM uvec;
int_u32 * p;
int_u32 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_U32, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -1174,7 +1169,7 @@ SCM_DEFINE (scm_s32vector_p, "s32vector?", 1, 0, 0,
SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -1184,10 +1179,9 @@ SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0,
SCM uvec;
int_s32 * p;
int_s32 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_S32, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -1347,7 +1341,7 @@ SCM_DEFINE (scm_u64vector_p, "u64vector?", 1, 0, 0,
SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -1357,10 +1351,9 @@ SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0,
SCM uvec;
int_u64 * p;
int_u64 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_U64, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -1518,7 +1511,7 @@ SCM_DEFINE (scm_s64vector_p, "s64vector?", 1, 0, 0,
SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -1528,10 +1521,9 @@ SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0,
SCM uvec;
int_s64 * p;
int_s64 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_S64, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -1691,7 +1683,7 @@ SCM_DEFINE (scm_f32vector_p, "f32vector?", 1, 0, 0,
SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -1701,10 +1693,9 @@ SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0,
SCM uvec;
float_f32 * p;
float_f32 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_F32, count);
if (SCM_UNBNDP (fill))
f = 0;
@@ -1887,7 +1878,7 @@ SCM_DEFINE (scm_f64vector_p, "f64vector?", 1, 0, 0,
SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0,
- (SCM n, SCM fill),
+ (SCM len, SCM fill),
"Create a newly allocated homogeneous numeric vector which can\n"
"hold @var{len} elements. If @var{fill} is given, it is used to\n"
"initialize the elements, otherwise the contents of the vector\n"
@@ -1897,10 +1888,9 @@ SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0,
SCM uvec;
float_f64 * p;
float_f64 f;
- int count;
+ size_t count;
- SCM_VALIDATE_INUM (1, n);
- count = SCM_INUM (n);
+ count = scm_to_size_t (len);
uvec = make_uvec (FUNC_NAME, SCM_UVEC_F64, count);
if (SCM_UNBNDP (fill))
f = 0;