changeset 24688:7b170d2184a4

(ccl_prog_stack_struct): Declare it as static. (ccl_driver): Setup stack_idx and ccl_prog correctly. Update them before returing. (setup_ccl_program): Initialize ccl->stack_idx to 0.
author Kenichi Handa <handa@m17n.org>
date Tue, 04 May 1999 05:42:55 +0000
parents 8d4b8adc3c98
children 46d2dc61ec31
files src/ccl.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ccl.c	Mon May 03 22:27:11 1999 +0000
+++ b/src/ccl.c	Tue May 04 05:42:55 1999 +0000
@@ -727,6 +727,9 @@
     int ic;			/* Instruction Counter.  */
   };
 
+/* For the moment, we only support depth 256 of stack.  */ 
+static struct ccl_prog_stack ccl_prog_stack_struct[256];
+
 int
 ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed)
      struct ccl_program *ccl;
@@ -742,9 +745,7 @@
   unsigned char *dst = destination, *dst_end = dst + dst_bytes;
   int jump_address;
   int i, j, op;
-  int stack_idx = 0;
-  /* For the moment, we only support depth 256 of stack.  */ 
-  struct ccl_prog_stack ccl_prog_stack_struct[256];
+  int stack_idx = ccl->stack_idx;
   /* Instruction counter of the current CCL code. */
   int this_ic;
 
@@ -1211,7 +1212,7 @@
 	    case CCL_WriteMultibyteChar2:
 	      i = reg[RRR]; /* charset */
 	      if (i == CHARSET_ASCII)
-		i = reg[rrr] & 0x8F;
+		i = reg[rrr] & 0xFF;
 	      else if (i == CHARSET_COMPOSITION)
 		i = MAKE_COMPOSITE_CHAR (reg[rrr]);
 	      else if (CHARSET_DIMENSION (i) == 1)
@@ -1612,6 +1613,8 @@
 
  ccl_finish:
   ccl->ic = ic;
+  ccl->stack_idx = stack_idx;
+  ccl->prog = ccl_prog;
   if (consumed) *consumed = src - source;
   return (dst ? dst - destination : 0);
 }
@@ -1641,6 +1644,7 @@
   ccl->last_block = 0;
   ccl->private_state = 0;
   ccl->status = 0;
+  ccl->stack_idx = 0;
 }
 
 /* Resolve symbols in the specified CCL code (Lisp vector).  This