diff options
| author | Kenichi Handa | 1999-05-04 05:42:55 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1999-05-04 05:42:55 +0000 |
| commit | c13362d808154b5d609578d551f835dfe81d7e78 (patch) | |
| tree | 9f243d543a4f21d5b4145b7ed2dc404c3e307e69 /src | |
| parent | e3e0e526a7fdcba220dc74193b5b7d81590d5804 (diff) | |
| download | emacs-c13362d808154b5d609578d551f835dfe81d7e78.tar.gz emacs-c13362d808154b5d609578d551f835dfe81d7e78.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ccl.c | 12 |
1 files changed, 8 insertions, 4 deletions
| @@ -727,6 +727,9 @@ struct ccl_prog_stack | |||
| 727 | int ic; /* Instruction Counter. */ | 727 | int ic; /* Instruction Counter. */ |
| 728 | }; | 728 | }; |
| 729 | 729 | ||
| 730 | /* For the moment, we only support depth 256 of stack. */ | ||
| 731 | static struct ccl_prog_stack ccl_prog_stack_struct[256]; | ||
| 732 | |||
| 730 | int | 733 | int |
| 731 | ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | 734 | ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) |
| 732 | struct ccl_program *ccl; | 735 | struct ccl_program *ccl; |
| @@ -742,9 +745,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 742 | unsigned char *dst = destination, *dst_end = dst + dst_bytes; | 745 | unsigned char *dst = destination, *dst_end = dst + dst_bytes; |
| 743 | int jump_address; | 746 | int jump_address; |
| 744 | int i, j, op; | 747 | int i, j, op; |
| 745 | int stack_idx = 0; | 748 | int stack_idx = ccl->stack_idx; |
| 746 | /* For the moment, we only support depth 256 of stack. */ | ||
| 747 | struct ccl_prog_stack ccl_prog_stack_struct[256]; | ||
| 748 | /* Instruction counter of the current CCL code. */ | 749 | /* Instruction counter of the current CCL code. */ |
| 749 | int this_ic; | 750 | int this_ic; |
| 750 | 751 | ||
| @@ -1211,7 +1212,7 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 1211 | case CCL_WriteMultibyteChar2: | 1212 | case CCL_WriteMultibyteChar2: |
| 1212 | i = reg[RRR]; /* charset */ | 1213 | i = reg[RRR]; /* charset */ |
| 1213 | if (i == CHARSET_ASCII) | 1214 | if (i == CHARSET_ASCII) |
| 1214 | i = reg[rrr] & 0x8F; | 1215 | i = reg[rrr] & 0xFF; |
| 1215 | else if (i == CHARSET_COMPOSITION) | 1216 | else if (i == CHARSET_COMPOSITION) |
| 1216 | i = MAKE_COMPOSITE_CHAR (reg[rrr]); | 1217 | i = MAKE_COMPOSITE_CHAR (reg[rrr]); |
| 1217 | else if (CHARSET_DIMENSION (i) == 1) | 1218 | else if (CHARSET_DIMENSION (i) == 1) |
| @@ -1612,6 +1613,8 @@ ccl_driver (ccl, source, destination, src_bytes, dst_bytes, consumed) | |||
| 1612 | 1613 | ||
| 1613 | ccl_finish: | 1614 | ccl_finish: |
| 1614 | ccl->ic = ic; | 1615 | ccl->ic = ic; |
| 1616 | ccl->stack_idx = stack_idx; | ||
| 1617 | ccl->prog = ccl_prog; | ||
| 1615 | if (consumed) *consumed = src - source; | 1618 | if (consumed) *consumed = src - source; |
| 1616 | return (dst ? dst - destination : 0); | 1619 | return (dst ? dst - destination : 0); |
| 1617 | } | 1620 | } |
| @@ -1641,6 +1644,7 @@ setup_ccl_program (ccl, vec) | |||
| 1641 | ccl->last_block = 0; | 1644 | ccl->last_block = 0; |
| 1642 | ccl->private_state = 0; | 1645 | ccl->private_state = 0; |
| 1643 | ccl->status = 0; | 1646 | ccl->status = 0; |
| 1647 | ccl->stack_idx = 0; | ||
| 1644 | } | 1648 | } |
| 1645 | 1649 | ||
| 1646 | /* Resolve symbols in the specified CCL code (Lisp vector). This | 1650 | /* Resolve symbols in the specified CCL code (Lisp vector). This |