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. v2.1.0-639-g2bee653


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. v2.1.0-639-g2bee653
Date: Thu, 06 Feb 2014 20:39:27 +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=2bee653acbc4d0978fc5de3d8027865e19fc6ce9

The branch, master has been updated
       via  2bee653acbc4d0978fc5de3d8027865e19fc6ce9 (commit)
       via  ac350da42c4cc912b9539e50fabc33dfc9fc7d35 (commit)
       via  828ada13268688f3a7da70a113f462a2fdef4582 (commit)
      from  f0521cdabcad69db03edb0db8772572bf539170b (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 2bee653acbc4d0978fc5de3d8027865e19fc6ce9
Author: Daniel Llorens <address@hidden>
Date:   Wed Apr 10 01:07:02 2013 +0200

    Remove unnecessary conditions in array constructors
    
    * libguile/arrays.c: (scm_make_type_array, scm_from_contigous_typed_array,
      scm_from_contigous_array): Remove conditions known to be true.

commit ac350da42c4cc912b9539e50fabc33dfc9fc7d35
Author: Daniel Llorens <address@hidden>
Date:   Tue Apr 9 18:27:29 2013 +0200

    Remove generalized-vectors.h includes
    
    * libguile/srfi-4.c, libguile/uniform.h: ditto.

commit 828ada13268688f3a7da70a113f462a2fdef4582
Author: Andy Wingo <address@hidden>
Date:   Thu Feb 6 21:34:14 2014 +0100

    Fix array-index-map refactor
    
    * libguile/ramap.c (array_index_map_1): Fix to use array handle
      properly.

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

Summary of changes:
 libguile/array-map.c |   23 +++++++++++++----------
 libguile/arrays.c    |    7 ++++---
 libguile/srfi-4.c    |    1 -
 libguile/uniform.h   |    1 -
 4 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/libguile/array-map.c b/libguile/array-map.c
index 658e81e..ad55656 100644
--- a/libguile/array-map.c
+++ b/libguile/array-map.c
@@ -778,24 +778,29 @@ SCM_DEFINE (scm_array_for_each, "array-for-each", 2, 0, 1,
 }
 #undef FUNC_NAME
 
-static SCM
+static void
 array_index_map_1 (SCM ra, SCM proc)
 {
-  unsigned long i;
-  size_t length = scm_c_array_length (ra);
-  for (i = 0; i < length; ++i)
-    ASET (ra, i, scm_call_1 (proc, scm_from_ulong (i)));
-  return SCM_UNSPECIFIED;
+  scm_t_array_handle h;
+  ssize_t i, inc;
+  size_t p;
+  SCM v;
+  scm_array_get_handle (ra, &h);
+  v = h.array;
+  inc = h.dims[0].inc;
+  for (i = h.dims[0].lbnd, p = h.base; i <= h.dims[0].ubnd; ++i, p += inc)
+    h.impl->vset (&h, p, scm_call_1 (proc, scm_from_ulong (i)));
+  scm_array_handle_release (&h);
 }
 
 /* Here we assume that the array is a scm_tc7_array, as that is the only
    kind of array in Guile that supports rank > 1.  */
-static SCM
+static void
 array_index_map_n (SCM ra, SCM proc)
 {
+  size_t i;
   SCM args = SCM_EOL;
   int j, k, kmax = SCM_I_ARRAY_NDIM (ra) - 1;
-  unsigned long i;
   long *vinds;
 
   vinds = scm_gc_malloc_pointerless (sizeof(long) * SCM_I_ARRAY_NDIM (ra),
@@ -830,8 +835,6 @@ array_index_map_n (SCM ra, SCM proc)
       k--;
     }
   while (k >= 0);
-
-  return SCM_UNSPECIFIED;
 }
 
 SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0,
diff --git a/libguile/arrays.c b/libguile/arrays.c
index 4401a97..188dba8 100644
--- a/libguile/arrays.c
+++ b/libguile/arrays.c
@@ -195,8 +195,9 @@ SCM_DEFINE (scm_make_typed_array, "make-typed-array", 2, 0, 
1,
     scm_make_generalized_vector (type, scm_from_size_t (rlen), fill);
 
   if (1 == SCM_I_ARRAY_NDIM (ra) && 0 == SCM_I_ARRAY_BASE (ra))
-    if (s->ubnd < s->lbnd || (0 == s->lbnd && 1 == s->inc))
+    if (0 == s->lbnd)
       return SCM_I_ARRAY_V (ra);
+
   return ra;
 }
 #undef FUNC_NAME
@@ -254,7 +255,7 @@ scm_from_contiguous_typed_array (SCM type, SCM bounds, 
const void *bytes,
   memcpy (elts, bytes, byte_len);
 
   if (1 == SCM_I_ARRAY_NDIM (ra) && 0 == SCM_I_ARRAY_BASE (ra))
-    if (s->ubnd < s->lbnd || (0 == s->lbnd && 1 == s->inc))
+    if (0 == s->lbnd)
       return SCM_I_ARRAY_V (ra);
   return ra;
 }
@@ -289,7 +290,7 @@ scm_from_contiguous_array (SCM bounds, const SCM *elts, 
size_t len)
   scm_array_handle_release (&h);
 
   if (1 == SCM_I_ARRAY_NDIM (ra) && 0 == SCM_I_ARRAY_BASE (ra))
-    if (s->ubnd < s->lbnd || (0 == s->lbnd && 1 == s->inc))
+    if (0 == s->lbnd)
       return SCM_I_ARRAY_V (ra);
   return ra;
 }
diff --git a/libguile/srfi-4.c b/libguile/srfi-4.c
index ff0c414..c45519b 100644
--- a/libguile/srfi-4.c
+++ b/libguile/srfi-4.c
@@ -31,7 +31,6 @@
 #include "libguile/eval.h"
 #include "libguile/extensions.h"
 #include "libguile/uniform.h"
-#include "libguile/generalized-vectors.h"
 #include "libguile/validate.h"
 
 
diff --git a/libguile/uniform.h b/libguile/uniform.h
index f655a29..57e214b 100644
--- a/libguile/uniform.h
+++ b/libguile/uniform.h
@@ -24,7 +24,6 @@
 
 
 #include "libguile/__scm.h"
-#include "libguile/generalized-vectors.h"
 
 
 


hooks/post-receive
-- 
GNU Guile



reply via email to

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