Implement 'scm_c_bind_keyword_arguments'.
[bpt/guile.git] / libguile / srfi-4.c
index 005a5a0..af8126d 100644 (file)
@@ -187,14 +187,10 @@ DEFINE_SRFI_4_PROXIES (s32);
 DEFINE_SRFI_4_C_FUNCS (S32, s32, scm_t_int32, 1);
 
 DEFINE_SRFI_4_PROXIES (u64);
-#if SCM_HAVE_T_INT64
 DEFINE_SRFI_4_C_FUNCS (U64, u64, scm_t_uint64, 1);
-#endif
 
 DEFINE_SRFI_4_PROXIES (s64);
-#if SCM_HAVE_T_INT64
 DEFINE_SRFI_4_C_FUNCS (S64, s64, scm_t_int64, 1);
-#endif
 
 DEFINE_SRFI_4_PROXIES (f32);
 DEFINE_SRFI_4_C_FUNCS (F32, f32, float, 1);
@@ -257,7 +253,8 @@ SCM_DEFINE (scm_make_srfi_4_vector, "make-srfi-4-vector", 2, 1, 0,
     case SCM_ARRAY_ELEMENT_TYPE_C64:
       {
         SCM ret = scm_i_make_typed_bytevector (scm_to_size_t (len), i);
-        if (SCM_UNBNDP (fill))
+
+        if (SCM_UNBNDP (fill) || scm_is_eq (len, SCM_INUM0))
           ; /* pass */
         else if (scm_is_true (scm_zero_p (fill)))
           memset (SCM_BYTEVECTOR_CONTENTS (ret), 0,
@@ -267,9 +264,15 @@ SCM_DEFINE (scm_make_srfi_4_vector, "make-srfi-4-vector", 2, 1, 0,
             scm_t_array_handle h;
             size_t len;
             ssize_t pos, inc;
+
             scm_uniform_vector_writable_elements (ret, &h, &len, &inc);
+
             for (pos = 0; pos != h.dims[0].ubnd; pos += inc)
               scm_array_handle_set (&h, pos, fill);
+
+           /* Initialize the last element.  */
+           scm_array_handle_set (&h, pos, fill);
+
             scm_array_handle_release (&h);
           }
         return ret;