diff options
| author | Paul Eggert | 2011-04-04 12:46:32 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-04 12:46:32 -0700 |
| commit | b13a45c6f92b2489ddd16ba2af9f19ebf46d3a2a (patch) | |
| tree | ef4d445ec413a6638c438b5952a617dc57ba322f /src/composite.h | |
| parent | 1e792e4d80f58bdb5b460518729eb0585b10f8d3 (diff) | |
| download | emacs-b13a45c6f92b2489ddd16ba2af9f19ebf46d3a2a.tar.gz emacs-b13a45c6f92b2489ddd16ba2af9f19ebf46d3a2a.zip | |
* composite.h (COMPOSITION_DECODE_REFS): New macro,
breaking out part of COMPOSITION_DECODE_RULE.
(COMPOSITION_DECODE_RULE): Use it.
* composite.c (get_composition_id): Remove unused local vars,
by using the new macro.
Diffstat (limited to 'src/composite.h')
| -rw-r--r-- | src/composite.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/composite.h b/src/composite.h index b8943fbfdc3..fa8e1164e4a 100644 --- a/src/composite.h +++ b/src/composite.h | |||
| @@ -126,21 +126,28 @@ extern Lisp_Object composition_temp; | |||
| 126 | ->contents[(n) * 2 - 1]) | 126 | ->contents[(n) * 2 - 1]) |
| 127 | 127 | ||
| 128 | /* Decode encoded composition rule RULE_CODE into GREF (global | 128 | /* Decode encoded composition rule RULE_CODE into GREF (global |
| 129 | reference point code), NREF (new reference point code), XOFF | 129 | reference point code), NREF (new ref. point code). Don't check RULE_CODE; |
| 130 | (horizontal offset) YOFF (vertical offset). Don't check RULE_CODE, | ||
| 131 | always set GREF and NREF to valid values. By side effect, | 130 | always set GREF and NREF to valid values. By side effect, |
| 132 | RULE_CODE is modified. */ | 131 | RULE_CODE is modified. */ |
| 133 | 132 | ||
| 134 | #define COMPOSITION_DECODE_RULE(rule_code, gref, nref, xoff, yoff) \ | 133 | #define COMPOSITION_DECODE_REFS(rule_code, gref, nref) \ |
| 135 | do { \ | 134 | do { \ |
| 136 | xoff = (rule_code) >> 16; \ | ||
| 137 | yoff = ((rule_code) >> 8) & 0xFF; \ | ||
| 138 | rule_code &= 0xFF; \ | 135 | rule_code &= 0xFF; \ |
| 139 | gref = (rule_code) / 12; \ | 136 | gref = (rule_code) / 12; \ |
| 140 | if (gref > 12) gref = 11; \ | 137 | if (gref > 12) gref = 11; \ |
| 141 | nref = (rule_code) % 12; \ | 138 | nref = (rule_code) % 12; \ |
| 142 | } while (0) | 139 | } while (0) |
| 143 | 140 | ||
| 141 | /* Like COMPOSITION_DECODE_REFS (RULE_CODE, GREF, NREF), but also | ||
| 142 | decode RULE_CODE into XOFF and YOFF (vertical offset). */ | ||
| 143 | |||
| 144 | #define COMPOSITION_DECODE_RULE(rule_code, gref, nref, xoff, yoff) \ | ||
| 145 | do { \ | ||
| 146 | xoff = (rule_code) >> 16; \ | ||
| 147 | yoff = ((rule_code) >> 8) & 0xFF; \ | ||
| 148 | COMPOSITION_DECODE_REFS (rule_code, gref, nref); \ | ||
| 149 | } while (0) | ||
| 150 | |||
| 144 | /* Return encoded composition rule for the pair of global reference | 151 | /* Return encoded composition rule for the pair of global reference |
| 145 | point GREF and new reference point NREF. If arguments are invalid, | 152 | point GREF and new reference point NREF. If arguments are invalid, |
| 146 | return -1. */ | 153 | return -1. */ |
| @@ -281,7 +288,7 @@ enum lglyph_indices | |||
| 281 | else \ | 288 | else \ |
| 282 | ASET ((g), LGLYPH_IX_CODE, make_number (val)); \ | 289 | ASET ((g), LGLYPH_IX_CODE, make_number (val)); \ |
| 283 | } while (0) | 290 | } while (0) |
| 284 | 291 | ||
| 285 | #define LGLYPH_SET_WIDTH(g, val) ASET ((g), LGLYPH_IX_WIDTH, make_number (val)) | 292 | #define LGLYPH_SET_WIDTH(g, val) ASET ((g), LGLYPH_IX_WIDTH, make_number (val)) |
| 286 | #define LGLYPH_SET_LBEARING(g, val) ASET ((g), LGLYPH_IX_LBEARING, make_number (val)) | 293 | #define LGLYPH_SET_LBEARING(g, val) ASET ((g), LGLYPH_IX_LBEARING, make_number (val)) |
| 287 | #define LGLYPH_SET_RBEARING(g, val) ASET ((g), LGLYPH_IX_RBEARING, make_number (val)) | 294 | #define LGLYPH_SET_RBEARING(g, val) ASET ((g), LGLYPH_IX_RBEARING, make_number (val)) |
| @@ -321,4 +328,3 @@ extern EMACS_INT composition_adjust_point (EMACS_INT, EMACS_INT); | |||
| 321 | EXFUN (Fcomposition_get_gstring, 4); | 328 | EXFUN (Fcomposition_get_gstring, 4); |
| 322 | 329 | ||
| 323 | #endif /* not EMACS_COMPOSITE_H */ | 330 | #endif /* not EMACS_COMPOSITE_H */ |
| 324 | |||