guile-cvs
[Top][All Lists]
Advanced

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

guile/guile-core/libguile ChangeLog print.c


From: Dirk Herrmann
Subject: guile/guile-core/libguile ChangeLog print.c
Date: Mon, 09 Oct 2000 05:39:15 -0700

CVSROOT:        /cvs
Module name:    guile
Changes by:     Dirk Herrmann <address@hidden>  00/10/09 05:39:14

Modified files:
        guile-core/libguile: ChangeLog print.c 

Log message:
        * Eliminate last call to scm_vector_set_length_x within libguile.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/ChangeLog.diff?r1=1.1136&r2=1.1137
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-core/libguile/print.c.diff?r1=1.99&r2=1.100

Patches:
Index: guile/guile-core/libguile/ChangeLog
diff -u guile/guile-core/libguile/ChangeLog:1.1136 
guile/guile-core/libguile/ChangeLog:1.1137
--- guile/guile-core/libguile/ChangeLog:1.1136  Mon Oct  9 02:54:28 2000
+++ guile/guile-core/libguile/ChangeLog Mon Oct  9 05:39:14 2000
@@ -1,5 +1,13 @@
 2000-10-09  Dirk Herrmann  <address@hidden>
 
+       * print.c (make_print_state, scm_iprin1):  Replace SCM_LENGTH with
+       the appropriate SCM_<type>_LENGTH macro.
+
+       (grow_ref_stack):  Don't call scm_vector_set_length_x to resize
+       the print stack.
+
+2000-10-09  Dirk Herrmann  <address@hidden>
+
        * numbers.c (big2str):  Avoid redundant copying.
 
        (scm_bigprint):  Use SCM_STRING_LENGTH instead of SCM_LENGTH.
Index: guile/guile-core/libguile/print.c
diff -u guile/guile-core/libguile/print.c:1.99 
guile/guile-core/libguile/print.c:1.100
--- guile/guile-core/libguile/print.c:1.99      Tue Sep 26 11:37:26 2000
+++ guile/guile-core/libguile/print.c   Mon Oct  9 05:39:14 2000
@@ -215,7 +215,7 @@
   pstate->ref_vect = scm_make_vector (SCM_MAKINUM (PSTATE_SIZE),
                                      SCM_UNDEFINED);
   pstate->ref_stack = SCM_VELTS (pstate->ref_vect);
-  pstate->ceiling = SCM_LENGTH (pstate->ref_vect);
+  pstate->ceiling = SCM_VECTOR_LENGTH (pstate->ref_vect);
   return print_state;
 }
 
@@ -259,9 +259,18 @@
 static void
 grow_ref_stack (scm_print_state *pstate)
 {
-  int new_size = 2 * pstate->ceiling;
-  scm_vector_set_length_x (pstate->ref_vect, SCM_MAKINUM (new_size));
-  pstate->ref_stack = SCM_VELTS (pstate->ref_vect);
+  unsigned long int old_size = SCM_VECTOR_LENGTH (pstate->ref_vect);
+  SCM *old_elts = SCM_VELTS (pstate->ref_vect);
+  unsigned long int new_size = 2 * pstate->ceiling;
+  SCM new_vect = scm_make_vector (new_size, SCM_UNDEFINED);
+  SCM *new_elts = SCM_VELTS (new_vect);
+  unsigned long int i;
+
+  for (i = 0; i != old_size; ++i)
+    new_elts [i] = old_elts [i];
+
+  pstate->ref_vect = new_vect;
+  pstate->ref_stack = new_elts;
   pstate->ceiling = new_size;
 }
 
@@ -494,7 +503,7 @@
              int maybe_weird;
              int mw_pos = 0;
 
-             len = SCM_LENGTH (exp);
+             len = SCM_SYMBOL_LENGTH (exp);
              str = SCM_SYMBOL_CHARS (exp);
              scm_remember (&exp);
              pos = 0;
@@ -577,9 +586,9 @@
        common_vector_printer:
          {
            register long i;
-           int last = SCM_LENGTH (exp) - 1;
+           int last = SCM_VECTOR_LENGTH (exp) - 1;
            int cutp = 0;
-           if (pstate->fancyp && SCM_LENGTH (exp) > pstate->length)
+           if (pstate->fancyp && SCM_VECTOR_LENGTH (exp) > pstate->length)
              {
                last = pstate->length - 1;
                cutp = 1;
@@ -662,7 +671,7 @@
          break;
        case scm_tc7_contin:
          scm_puts ("#<continuation ", port);
-         scm_intprint (SCM_LENGTH (exp), 10, port);
+         scm_intprint (SCM_CONTINUATION_LENGTH (exp), 10, port);
          scm_puts (" @ ", port);
          scm_intprint ((long) SCM_CONTREGS (exp), 16, port);
          scm_putc ('>', port);



reply via email to

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