[gimp] Commented call to file_pop() left in inchar() by mistake. Fixes bug #553337.



commit 01e27e8d6fbf994850f6f3843ee4317705e9608e
Author: Kevin Cozens <kcozens cvs gnome org>
Date:   Sun Aug 9 15:18:25 2009 -0400

    Commented call to file_pop() left in inchar() by mistake. Fixes bug #553337.
    Several changes to reduce some formatting differences to official TinyScheme.
    De-tabified init.scm file.

 plug-ins/script-fu/tinyscheme/init.scm |  152 ++++++++++++++++----------------
 plug-ins/script-fu/tinyscheme/scheme.c |   16 ++--
 2 files changed, 84 insertions(+), 84 deletions(-)
---
diff --git a/plug-ins/script-fu/tinyscheme/init.scm b/plug-ins/script-fu/tinyscheme/init.scm
index f33b887..5a205df 100644
--- a/plug-ins/script-fu/tinyscheme/init.scm
+++ b/plug-ins/script-fu/tinyscheme/init.scm
@@ -316,23 +316,23 @@
 
 ;;;;;Helper for the dynamic-wind definition.  By Tom Breton (Tehom)
 (define (shared-tail x y)
-   (let (  (len-x (length x)) 
-	   (len-y (length y)))
+   (let (  (len-x (length x))
+           (len-y (length y)))
       (define (shared-tail-helper x y)
-	 (if
-	    (eq? x y) 
-	    x
-	    (shared-tail-helper (cdr x) (cdr y))))
+         (if
+            (eq? x y)
+            x
+            (shared-tail-helper (cdr x) (cdr y))))
       (cond
-	 ((> len-x len-y) 
-	    (shared-tail-helper
-	       (list-tail x (- len-x len-y))
-	       y))
-	 ((< len-x len-y) 
-	    (shared-tail-helper
-	       x
-	       (list-tail y (- len-y len-x))))
-	 (#t (shared-tail-helper x y)))))
+         ((> len-x len-y)
+            (shared-tail-helper
+               (list-tail x (- len-x len-y))
+               y))
+         ((< len-x len-y)
+            (shared-tail-helper
+               x
+               (list-tail y (- len-y len-x))))
+         (#t (shared-tail-helper x y)))))
 
 ;;;;;Dynamic-wind by Tom Breton (Tehom)
 
@@ -343,9 +343,9 @@
       ;;These functions are defined in the context of a private list of
       ;;pairs of before/after procs.
       (  (*active-windings* '())
-	 ;;We'll define some functions into the larger environment, so
-	 ;;we need to know it.
-	 (outer-env (current-environment)))
+         ;;We'll define some functions into the larger environment, so
+         ;;we need to know it.
+         (outer-env (current-environment)))
 
       ;;Poor-man's structure operations
       (define before-func car)
@@ -353,73 +353,73 @@
       (define make-winding cons)
 
       ;;Manage active windings
-      (define (activate-winding! new) 
-	 ((before-func new))
-	 (set! *active-windings* (cons new *active-windings*)))
+      (define (activate-winding! new)
+         ((before-func new))
+         (set! *active-windings* (cons new *active-windings*)))
       (define (deactivate-top-winding!)
-	 (let ((old-top (car *active-windings*)))
-	    ;;Remove it from the list first so it's not active during its
-	    ;;own exit.
-	    (set! *active-windings* (cdr *active-windings*))
-	    ((after-func old-top))))
+         (let ((old-top (car *active-windings*)))
+            ;;Remove it from the list first so it's not active during its
+            ;;own exit.
+            (set! *active-windings* (cdr *active-windings*))
+            ((after-func old-top))))
 
       (define (set-active-windings! new-ws)
-	 (unless (eq? new-ws *active-windings*)
-	    (let ((shared (shared-tail new-ws *active-windings*)))
-
-	       ;;Define the looping functions.
-	       ;;Exit the old list.  Do deeper ones last.  Don't do
-	       ;;any shared ones.
-	       (define (pop-many)
-		  (unless (eq? *active-windings* shared)
-		     (deactivate-top-winding!)
-		     (pop-many)))
-	       ;;Enter the new list.  Do deeper ones first so that the
-	       ;;deeper windings will already be active.  Don't do any
-	       ;;shared ones.
-	       (define (push-many new-ws)
-		  (unless (eq? new-ws shared)
-		     (push-many (cdr new-ws))
-		     (activate-winding! (car new-ws))))
-
-	       ;;Do it.
-	       (pop-many)
-	       (push-many new-ws))))
+         (unless (eq? new-ws *active-windings*)
+            (let ((shared (shared-tail new-ws *active-windings*)))
+
+               ;;Define the looping functions.
+               ;;Exit the old list.  Do deeper ones last.  Don't do
+               ;;any shared ones.
+               (define (pop-many)
+                  (unless (eq? *active-windings* shared)
+                     (deactivate-top-winding!)
+                     (pop-many)))
+               ;;Enter the new list.  Do deeper ones first so that the
+               ;;deeper windings will already be active.  Don't do any
+               ;;shared ones.
+               (define (push-many new-ws)
+                  (unless (eq? new-ws shared)
+                     (push-many (cdr new-ws))
+                     (activate-winding! (car new-ws))))
+
+               ;;Do it.
+               (pop-many)
+               (push-many new-ws))))
 
       ;;The definitions themselves.
       (eval
-	 `(define call-with-current-continuation 
-	     ;;It internally uses the built-in call/cc, so capture it.
-	     ,(let ((old-c/cc call-with-current-continuation))
-		 (lambda (func)
-		    ;;Use old call/cc to get the continuation.
-		    (old-c/cc 
-		       (lambda (continuation)
-			  ;;Call func with not the continuation itself
-			  ;;but a procedure that adjusts the active
-			  ;;windings to what they were when we made
-			  ;;this, and only then calls the
-			  ;;continuation.
-			  (func 
-			     (let ((current-ws *active-windings*))
-				(lambda (x)
-				   (set-active-windings! current-ws)
-				   (continuation x)))))))))
-	 outer-env)
+         `(define call-with-current-continuation
+             ;;It internally uses the built-in call/cc, so capture it.
+             ,(let ((old-c/cc call-with-current-continuation))
+                 (lambda (func)
+                    ;;Use old call/cc to get the continuation.
+                    (old-c/cc
+                       (lambda (continuation)
+                          ;;Call func with not the continuation itself
+                          ;;but a procedure that adjusts the active
+                          ;;windings to what they were when we made
+                          ;;this, and only then calls the
+                          ;;continuation.
+                          (func
+                             (let ((current-ws *active-windings*))
+                                (lambda (x)
+                                   (set-active-windings! current-ws)
+                                   (continuation x)))))))))
+         outer-env)
       ;;We can't just say "define (dynamic-wind before thunk after)"
       ;;because the lambda it's defined to lives in this environment,
       ;;not in the global environment.
-      (eval 
-	 `(define dynamic-wind
-	     ,(lambda (before thunk after)
-		 ;;Make a new winding
-		 (activate-winding! (make-winding before after))
-		 (let ((result (thunk)))
-		    ;;Get rid of the new winding.
-		    (deactivate-top-winding!)
-		    ;;The return value is that of thunk.
-		    result)))
-	 outer-env)))
+      (eval
+         `(define dynamic-wind
+             ,(lambda (before thunk after)
+                 ;;Make a new winding
+                 (activate-winding! (make-winding before after))
+                 (let ((result (thunk)))
+                    ;;Get rid of the new winding.
+                    (deactivate-top-winding!)
+                    ;;The return value is that of thunk.
+                    result)))
+         outer-env)))
 
 (define call/cc call-with-current-continuation)
 
diff --git a/plug-ins/script-fu/tinyscheme/scheme.c b/plug-ins/script-fu/tinyscheme/scheme.c
index fdb6d5c..c3fce32 100644
--- a/plug-ins/script-fu/tinyscheme/scheme.c
+++ b/plug-ins/script-fu/tinyscheme/scheme.c
@@ -17,7 +17,7 @@
 /* character strings. As a result, the length of a string in bytes  */
 /* may not be the same as the length of a string in characters. You */
 /* must keep this in mind at all times while making any changes to  */
-/* the routines in this file, or when adding new features.          */
+/* the routines in this file and when adding new features.          */
 /*                                                                  */
 /* UTF-8 modifications made by Kevin Cozens (kcozens interlog com)  */
 /* **************************************************************** */
@@ -392,6 +392,7 @@ static port *port_rep_from_string(scheme *sc, char *start, char *past_the_end, i
 static void port_close(scheme *sc, pointer p, int flag);
 static void mark(pointer a);
 static void gc(scheme *sc, pointer a, pointer b);
+static gunichar basic_inchar(port *pt);
 static gunichar inchar(scheme *sc);
 static void backchar(scheme *sc, gunichar c);
 static char *readstr_upto(scheme *sc, char *delim);
@@ -723,7 +724,7 @@ static pointer reserve_cells(scheme *sc, int n) {
 static pointer get_consecutive_cells(scheme *sc, int n) {
   pointer x;
 
-  if (sc->no_memory) { return sc->sink; }
+  if(sc->no_memory) { return sc->sink; }
 
   /* Are there any cells available? */
   x=find_consecutive_cells(sc,n);
@@ -1655,7 +1656,7 @@ static gunichar inchar(scheme *sc) {
     /* Instead, set port_saw_EOF */
     pt->kind |= port_saw_EOF;
 
-    file_pop(sc);
+    /* file_pop(sc); */
     return EOF;
     /* NOTREACHED */
   }
@@ -1957,9 +1958,9 @@ static int token(scheme *sc) {
      case BACKQUOTE:
           return (TOK_BQUOTE);
      case ',':
-          if ((c=inchar(sc)) == '@')
+          if ((c=inchar(sc)) == '@') {
                return (TOK_ATMARK);
-          else {
+          } else {
                backchar(sc,c);
                return (TOK_COMMA);
           }
@@ -2803,6 +2804,7 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) {
      case OP_DEF0:  /* define */
           if(is_immutable(car(sc->code)))
                 Error_1(sc,"define: unable to alter immutable", car(sc->code));
+
           if (is_pair(car(sc->code))) {
                x = caar(sc->code);
                sc->code = cons(sc, sc->LAMBDA, cons(sc, cdar(sc->code), cdr(sc->code)));
@@ -4309,7 +4311,7 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
           pointer vec=car(sc->args);
           int len=ivalue_unchecked(vec);
           if(i==len) {
-               putstr(sc," )");
+               putstr(sc,")");
                s_return(sc,sc->T);
           } else {
                pointer elem=vector_elem(vec,i);
@@ -4644,9 +4646,7 @@ static struct scheme_interface vtbl ={
   fill_vector,
   vector_elem,
   set_vector_elem,
-
   is_port,
-
   is_pair,
   pair_car,
   pair_cdr,



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