diff options
| author | Paul Eggert | 2011-05-30 19:12:01 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-05-30 19:12:01 -0700 |
| commit | e003a29261f4d1f9263efbcabbeb4e502de5612b (patch) | |
| tree | cde6f0b3913ad763bf3bd27acc5e27799ed89ddb /src/ccl.c | |
| parent | b5244046e1ea76b26b7acd516929502463b05eaf (diff) | |
| download | emacs-e003a29261f4d1f9263efbcabbeb4e502de5612b.tar.gz emacs-e003a29261f4d1f9263efbcabbeb4e502de5612b.zip | |
* ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
(CCL_CODE_MIN): New macro.
Diffstat (limited to 'src/ccl.c')
| -rw-r--r-- | src/ccl.c | 13 |
1 files changed, 7 insertions, 6 deletions
| @@ -79,9 +79,8 @@ static Lisp_Object Vccl_program_table; | |||
| 79 | #define CCL_HEADER_EOF 1 | 79 | #define CCL_HEADER_EOF 1 |
| 80 | #define CCL_HEADER_MAIN 2 | 80 | #define CCL_HEADER_MAIN 2 |
| 81 | 81 | ||
| 82 | /* CCL code is a sequence of 28-bit non-negative integers (i.e. the | 82 | /* CCL code is a sequence of 28-bit integers. Each contains a CCL |
| 83 | MSB is always 0), each contains CCL command and/or arguments in the | 83 | command and/or arguments in the following format: |
| 84 | following format: | ||
| 85 | 84 | ||
| 86 | |----------------- integer (28-bit) ------------------| | 85 | |----------------- integer (28-bit) ------------------| |
| 87 | |------- 17-bit ------|- 3-bit --|- 3-bit --|- 5-bit -| | 86 | |------- 17-bit ------|- 3-bit --|- 3-bit --|- 5-bit -| |
| @@ -94,12 +93,14 @@ static Lisp_Object Vccl_program_table; | |||
| 94 | |------------- constant or other args ----------------| | 93 | |------------- constant or other args ----------------| |
| 95 | cccccccccccccccccccccccccccc | 94 | cccccccccccccccccccccccccccc |
| 96 | 95 | ||
| 97 | where, `cc...c' is a non-negative integer indicating constant value | 96 | where `cc...c' is an integer indicating a constant value or an |
| 98 | (the left most `c' is always 0) or an absolute jump address, `RRR' | 97 | absolute jump address. The context determines whether `cc...c' is |
| 98 | considered to be unsigned, or a signed two's complement number. `RRR' | ||
| 99 | and `rrr' are CCL register number, `XXXXX' is one of the following | 99 | and `rrr' are CCL register number, `XXXXX' is one of the following |
| 100 | CCL commands. */ | 100 | CCL commands. */ |
| 101 | 101 | ||
| 102 | #define CCL_CODE_MAX ((1 << (28 - 1)) - 1) | 102 | #define CCL_CODE_MAX ((1 << (28 - 1)) - 1) |
| 103 | #define CCL_CODE_MIN (-1 - CCL_CODE_MAX) | ||
| 103 | 104 | ||
| 104 | /* CCL commands | 105 | /* CCL commands |
| 105 | 106 | ||
| @@ -756,7 +757,7 @@ while(0) | |||
| 756 | while (0) | 757 | while (0) |
| 757 | 758 | ||
| 758 | #define GET_CCL_CODE(code, ccl_prog, ic) \ | 759 | #define GET_CCL_CODE(code, ccl_prog, ic) \ |
| 759 | GET_CCL_RANGE (code, ccl_prog, ic, 0, CCL_CODE_MAX) | 760 | GET_CCL_RANGE (code, ccl_prog, ic, CCL_CODE_MIN, CCL_CODE_MAX) |
| 760 | 761 | ||
| 761 | #define GET_CCL_INT(var, ccl_prog, ic) \ | 762 | #define GET_CCL_INT(var, ccl_prog, ic) \ |
| 762 | GET_CCL_RANGE (var, ccl_prog, ic, INT_MIN, INT_MAX) | 763 | GET_CCL_RANGE (var, ccl_prog, ic, INT_MIN, INT_MAX) |