diff options
| author | Paul Eggert | 2011-04-04 23:41:53 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-04 23:41:53 -0700 |
| commit | d5efd1d1b54595db795d6fddb32404cc74923d77 (patch) | |
| tree | 23ea4fd384e74bebe571c176e13ecec3f07fa9d3 /src/composite.h | |
| parent | b25d760e185c85e190402eddd0d756ddc014a58c (diff) | |
| download | emacs-d5efd1d1b54595db795d6fddb32404cc74923d77.tar.gz emacs-d5efd1d1b54595db795d6fddb32404cc74923d77.zip | |
* coding.c (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
directly, rather than having caller test rule sign. This avoids
some unnecessary tests.
* composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
(COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
Diffstat (limited to 'src/composite.h')
| -rw-r--r-- | src/composite.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/composite.h b/src/composite.h index ffdb57a571e..cfb5db0dc6a 100644 --- a/src/composite.h +++ b/src/composite.h | |||
| @@ -148,12 +148,15 @@ extern Lisp_Object composition_temp; | |||
| 148 | COMPOSITION_DECODE_REFS (rule_code, gref, nref); \ | 148 | COMPOSITION_DECODE_REFS (rule_code, gref, nref); \ |
| 149 | } while (0) | 149 | } while (0) |
| 150 | 150 | ||
| 151 | /* Nonzero if the global reference point GREF and new reference point NREF are | ||
| 152 | valid. */ | ||
| 153 | #define COMPOSITION_ENCODE_RULE_VALID(gref, nref) \ | ||
| 154 | ((unsigned) (gref) < 12 && (unsigned) (nref) < 12) | ||
| 155 | |||
| 151 | /* Return encoded composition rule for the pair of global reference | 156 | /* Return encoded composition rule for the pair of global reference |
| 152 | point GREF and new reference point NREF. If arguments are invalid, | 157 | point GREF and new reference point NREF. Arguments must be valid. */ |
| 153 | return -1. */ | ||
| 154 | #define COMPOSITION_ENCODE_RULE(gref, nref) \ | 158 | #define COMPOSITION_ENCODE_RULE(gref, nref) \ |
| 155 | ((unsigned) (gref) < 12 && (unsigned) (nref) < 12 \ | 159 | ((gref) * 12 + (nref)) |
| 156 | ? (gref) * 12 + (nref) : -1) | ||
| 157 | 160 | ||
| 158 | /* Data structure that records information about a composition | 161 | /* Data structure that records information about a composition |
| 159 | currently used in some buffers or strings. | 162 | currently used in some buffers or strings. |