guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-43-ga5


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-14-43-ga574564
Date: Sat, 08 Jan 2011 06:15:20 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=a574564c24f5d08790f5a429c0f285938363a3f0

The branch, master has been updated
       via  a574564c24f5d08790f5a429c0f285938363a3f0 (commit)
       via  2dd7d8ce7abcec373a9c7389f69456cb1f64a74e (commit)
      from  58baff08bc9daa01b7c9a1ce3eea829b228f9611 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a574564c24f5d08790f5a429c0f285938363a3f0
Author: Andy Wingo <address@hidden>
Date:   Fri Jan 7 22:16:10 2011 -0800

    fix scm_from_stringn empty string case
    
    * libguile/strings.c (scm_from_stringn): Fix empty string case
      (oops...).

commit 2dd7d8ce7abcec373a9c7389f69456cb1f64a74e
Author: Andy Wingo <address@hidden>
Date:   Fri Jan 7 22:01:27 2011 -0800

    fix tab completion in repl (doh)
    
    * libguile/hashtab.c: Fix remaining vector hash table support.
    * module/ice-9/session.scm (apropos-fold): Use a hash table instead of a
      vector for the completions.

-----------------------------------------------------------------------

Summary of changes:
 libguile/hashtab.c       |   44 +++++++++++++++++++-------------------------
 libguile/strings.c       |    6 +++---
 module/ice-9/session.scm |    4 ++--
 3 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/libguile/hashtab.c b/libguile/hashtab.c
index ce155e9..f3887c2 100644
--- a/libguile/hashtab.c
+++ b/libguile/hashtab.c
@@ -1146,8 +1146,7 @@ SCM_DEFINE (scm_hash_fold, "hash-fold", 3, 0, 0,
 #define FUNC_NAME s_scm_hash_fold
 {
   SCM_VALIDATE_PROC (1, proc);
-  if (!SCM_HASHTABLE_P (table))
-    SCM_VALIDATE_VECTOR (3, table);
+  SCM_VALIDATE_HASHTABLE (3, table);
   return scm_internal_hash_fold ((scm_t_hash_fold_fn) scm_call_3,
                                 (void *) SCM_UNPACK (proc), init, table);
 }
@@ -1168,8 +1167,7 @@ SCM_DEFINE (scm_hash_for_each, "hash-for-each", 2, 0, 0,
 #define FUNC_NAME s_scm_hash_for_each
 {
   SCM_VALIDATE_PROC (1, proc);
-  if (!SCM_HASHTABLE_P (table))
-    SCM_VALIDATE_VECTOR (2, table);
+  SCM_VALIDATE_HASHTABLE (2, table);
   
   scm_internal_hash_for_each_handle (for_each_proc,
                                     (void *) SCM_UNPACK (proc),
@@ -1185,8 +1183,7 @@ SCM_DEFINE (scm_hash_for_each_handle, 
"hash-for-each-handle", 2, 0, 0,
 #define FUNC_NAME s_scm_hash_for_each_handle
 {
   SCM_ASSERT (scm_is_true (scm_procedure_p (proc)), proc, 1, FUNC_NAME);
-  if (!SCM_HASHTABLE_P (table))
-    SCM_VALIDATE_VECTOR (2, table);
+  SCM_VALIDATE_HASHTABLE (2, table);
   
   scm_internal_hash_for_each_handle ((scm_t_hash_handle_fn) scm_call_1,
                                     (void *) SCM_UNPACK (proc),
@@ -1210,8 +1207,7 @@ SCM_DEFINE (scm_hash_map_to_list, "hash-map->list", 2, 0, 
0,
 #define FUNC_NAME s_scm_hash_map_to_list
 {
   SCM_VALIDATE_PROC (1, proc);
-  if (!SCM_HASHTABLE_P (table))
-    SCM_VALIDATE_VECTOR (2, table);
+  SCM_VALIDATE_HASHTABLE (2, table);
   return scm_internal_hash_fold (map_proc,
                                 (void *) SCM_UNPACK (proc),
                                 SCM_EOL,
@@ -1224,15 +1220,13 @@ SCM_DEFINE (scm_hash_map_to_list, "hash-map->list", 2, 
0, 0,
 SCM
 scm_internal_hash_fold (scm_t_hash_fold_fn fn, void *closure,
                        SCM init, SCM table)
+#define FUNC_NAME s_scm_hash_fold
 {
   long i, n;
   SCM buckets, result = init;
   
-  if (SCM_HASHTABLE_P (table))
-    buckets = SCM_HASHTABLE_VECTOR (table);
-  else
-    /* Weak alist vector.  */
-    buckets = table;
+  SCM_VALIDATE_HASHTABLE (0, table);
+  buckets = SCM_HASHTABLE_VECTOR (table);
   
   n = SCM_SIMPLE_VECTOR_LENGTH (buckets);
   for (i = 0; i < n; ++i)
@@ -1246,11 +1240,11 @@ scm_internal_hash_fold (scm_t_hash_fold_fn fn, void 
*closure,
          SCM handle;
 
          if (!scm_is_pair (ls))
-           scm_wrong_type_arg (s_scm_hash_fold, SCM_ARG3, buckets);
+           SCM_WRONG_TYPE_ARG (SCM_ARG3, buckets);
 
          handle = SCM_CAR (ls);
          if (!scm_is_pair (handle))
-           scm_wrong_type_arg (s_scm_hash_fold, SCM_ARG3, buckets);
+           SCM_WRONG_TYPE_ARG (SCM_ARG3, buckets);
 
          if (SCM_HASHTABLE_WEAK_P (table))
            {
@@ -1263,9 +1257,8 @@ scm_internal_hash_fold (scm_t_hash_fold_fn fn, void 
*closure,
                  else
                    SCM_SIMPLE_VECTOR_SET (buckets, i, SCM_CDR (ls));
 
-                 if (SCM_HASHTABLE_P (table))
-                   /* Update the item count.  */
-                   SCM_HASHTABLE_DECREMENT (table);
+                  /* Update the item count.  */
+                  SCM_HASHTABLE_DECREMENT (table);
 
                  continue;
                }
@@ -1277,6 +1270,7 @@ scm_internal_hash_fold (scm_t_hash_fold_fn fn, void 
*closure,
 
   return result;
 }
+#undef FUNC_NAME
 
 /* The following redundant code is here in order to be able to support
    hash-for-each-handle.  An alternative would have been to replace
@@ -1287,31 +1281,31 @@ scm_internal_hash_fold (scm_t_hash_fold_fn fn, void 
*closure,
 void
 scm_internal_hash_for_each_handle (scm_t_hash_handle_fn fn, void *closure,
                                   SCM table)
+#define FUNC_NAME s_scm_hash_for_each
 {
   long i, n;
   SCM buckets;
   
-  if (SCM_HASHTABLE_P (table))
-    buckets = SCM_HASHTABLE_VECTOR (table);
-  else
-    buckets = table;
-  
+  SCM_VALIDATE_HASHTABLE (0, table);
+  buckets = SCM_HASHTABLE_VECTOR (table);
   n = SCM_SIMPLE_VECTOR_LENGTH (buckets);
+
   for (i = 0; i < n; ++i)
     {
       SCM ls = SCM_SIMPLE_VECTOR_REF (buckets, i), handle;
       while (!scm_is_null (ls))
        {
          if (!scm_is_pair (ls))
-           scm_wrong_type_arg (s_scm_hash_for_each, SCM_ARG3, buckets);
+           SCM_WRONG_TYPE_ARG (SCM_ARG3, buckets);
          handle = SCM_CAR (ls);
          if (!scm_is_pair (handle))
-           scm_wrong_type_arg (s_scm_hash_for_each, SCM_ARG3, buckets);
+           SCM_WRONG_TYPE_ARG (SCM_ARG3, buckets);
          fn (closure, handle);
          ls = SCM_CDR (ls);
        }
     }
 }
+#undef FUNC_NAME
 
 
 
diff --git a/libguile/strings.c b/libguile/strings.c
index 4760f33..abe4a7b 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -1438,12 +1438,12 @@ scm_from_stringn (const char *str, size_t len, const 
char *encoding,
   SCM res;
 
   /* The order of these checks is important. */
-  if (len == 0)
-    return scm_nullstr;
-  if (!str)
+  if (!str && len != 0)
     scm_misc_error ("scm_from_stringn", "NULL string pointer", SCM_EOL);
   if (len == (size_t) -1)
     len = strlen (str);
+  if (len == 0)
+    return scm_nullstr;
 
   if (encoding == NULL)
     {
diff --git a/module/ice-9/session.scm b/module/ice-9/session.scm
index 36aeb99..e895743 100644
--- a/module/ice-9/session.scm
+++ b/module/ice-9/session.scm
@@ -1,4 +1,4 @@
-;;;;   Copyright (C) 1997, 2000, 2001, 2003, 2006, 2009, 2010 Free Software 
Foundation, Inc.
+;;;;   Copyright (C) 1997, 2000, 2001, 2003, 2006, 2009, 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
@@ -355,7 +355,7 @@ Fourth arg FOLDER is one of
   apropos-fold-exported                   ;fold over all exported bindings
   apropos-fold-all                ;fold over all bindings"
   (let ((match (make-regexp rgx))
-       (recorded (make-vector 61 '())))
+       (recorded (make-hash-table)))
     (let ((fold-module
           (lambda (module data)
             (let* ((obarray-filter


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]