guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core/libguile ChangeLog numbers.c v...


From: Dirk Herrmann
Subject: guile/guile-core/libguile ChangeLog numbers.c v...
Date: Tue, 26 Sep 2000 12:40:10 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/09/26 12:40:10

Modified files:
        guile-core/libguile: ChangeLog numbers.c vectors.c 

Log message:
        * More references to SCM_CHARS removed.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1121&r2=1.1122
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/numbers.c.diff?r1=1.102&r2=1.103
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/vectors.c.diff?r1=1.35&r2=1.36

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1121 
guile/guile-core/libguile/ChangeLog:1.1122
--- guile/guile-core/libguile/ChangeLog:1.1121  Tue Sep 26 12:20:39 2000
+++ guile/guile-core/libguile/ChangeLog Tue Sep 26 12:40:10 2000
@@ -1,5 +1,16 @@
 2000-09-26  Dirk Herrmann  <address@hidden>
 
+       * numbers.c (scm_adjbig):  Use SCM_BDIGITS instead of SCM_CHARS.
+
+       (big2str, scm_bigprint):  Use SCM_STRING_CHARS instead of
+       SCM_CHARS.
+
+       * vectors.c (scm_vector_set_length_x):  Distinguish between
+       strings, scheme vectors and uniform vectors, thus getting rid of
+       references to SCM_CHARS.  (The code still needs improvement.)
+
+2000-09-26  Dirk Herrmann  <address@hidden>
+
        * eval.c (scm_m_letrec1, SCM_CEVAL, SCM_APPLY):  Use
        SCM_STRING_U?CHARS or SCM_SYMBOL_U?CHARS instead of SCM_U?CHARS.
 
Index: guile/guile-core/libguile/numbers.c
diff -u guile/guile-core/libguile/numbers.c:1.102 
guile/guile-core/libguile/numbers.c:1.103
--- guile/guile-core/libguile/numbers.c:1.102   Wed Sep 20 14:04:19 2000
+++ guile/guile-core/libguile/numbers.c Tue Sep 26 12:40:10 2000
@@ -1363,7 +1363,7 @@
   {
     SCM_BIGDIG *digits
       = ((SCM_BIGDIG *)
-        scm_must_realloc ((char *) SCM_CHARS (b),
+        scm_must_realloc ((char *) SCM_BDIGITS (b),
                           (long) (SCM_NUMDIGS (b) * sizeof (SCM_BIGDIG)),
                           (long) (nsiz * sizeof (SCM_BIGDIG)), s_bignum));
 
@@ -2179,7 +2179,7 @@
   scm_sizet ch;                        /* jeh */
   SCM_BIGDIG radpow = 1, radmod = 0;
   SCM ss = scm_makstr ((long) j, 0);
-  char *s = SCM_CHARS (ss), c;
+  char *s = SCM_STRING_CHARS (ss), c;
   while ((long) radpow * radix < SCM_BIGRAD)
     {
       radpow *= radix;
@@ -2271,7 +2271,7 @@
 {
 #ifdef SCM_BIGDIG
   exp = big2str (exp, (unsigned int) 10);
-  scm_lfwrite (SCM_CHARS (exp), (scm_sizet) SCM_LENGTH (exp), port);
+  scm_lfwrite (SCM_STRING_CHARS (exp), (scm_sizet) SCM_LENGTH (exp), port);
 #else
   scm_ipruk ("bignum", exp, port);
 #endif
Index: guile/guile-core/libguile/vectors.c
diff -u guile/guile-core/libguile/vectors.c:1.35 
guile/guile-core/libguile/vectors.c:1.36
--- guile/guile-core/libguile/vectors.c:1.35    Sat Sep  2 16:13:33 2000
+++ guile/guile-core/libguile/vectors.c Tue Sep 26 12:40:10 2000
@@ -71,6 +71,7 @@
   long l;
   scm_sizet siz;
   scm_sizet sz;
+  char *base;
 
   l = SCM_INUM (len);
   SCM_ASRTGO (SCM_NIMP (vect), badarg1);
@@ -81,7 +82,9 @@
       l = (l + SCM_LONG_BIT - 1) / SCM_LONG_BIT;
     }
   sz = scm_uniform_element_size (vect);
-  if (sz == 0)
+  if (sz != 0)
+    base = SCM_UVECTOR_BASE (vect);
+  else
 #endif
   switch (SCM_TYP7 (vect))
     {
@@ -90,12 +93,14 @@
     case scm_tc7_string:
       SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullstr), badarg1);
       sz = sizeof (char);
+      base = SCM_STRING_CHARS (vect);
       l++;
       break;
     case scm_tc7_vector:
     case scm_tc7_wvect:
       SCM_ASRTGO (!SCM_EQ_P (vect, scm_nullvect), badarg1);
       sz = sizeof (SCM);
+      base = (char *) SCM_VECTOR_BASE (vect);
       break;
     }
   SCM_ASSERT (SCM_INUMP (len), len, SCM_ARG2, s_vector_set_length_x);
@@ -107,7 +112,7 @@
   SCM_REDEFER_INTS;
   SCM_SETCHARS (vect,
            ((char *)
-            scm_must_realloc (SCM_CHARS (vect),
+            scm_must_realloc (base,
                               (long) SCM_LENGTH (vect) * sz,
                               (long) siz,
                               s_vector_set_length_x)));
@@ -118,7 +123,7 @@
        SCM_VELTS (vect)[--l] = SCM_UNSPECIFIED;
     }
   else if (SCM_STRINGP (vect))
-    SCM_CHARS (vect)[l - 1] = 0;
+    SCM_STRING_CHARS (vect)[l - 1] = 0;
   SCM_SETLENGTH (vect, SCM_INUM (len), SCM_TYP7 (vect));
   SCM_REALLOW_INTS;
   return vect;



reply via email to

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