diff options
| author | Kenichi Handa | 2014-07-02 00:31:59 +0900 |
|---|---|---|
| committer | Kenichi Handa | 2014-07-02 00:31:59 +0900 |
| commit | 0782685d43f026b2366dbacbebc79021a9df50c6 (patch) | |
| tree | 3c09803991337a46a0df58fdf4c9bb25555c8e59 /src/coding.c | |
| parent | 7ac67e08e52b7d4c292f17841084f316644ce195 (diff) | |
| download | emacs-0782685d43f026b2366dbacbebc79021a9df50c6.tar.gz emacs-0782685d43f026b2366dbacbebc79021a9df50c6.zip | |
* coding.c (MIN_CHARBUF_SIZE): Delete it.
(MAX_CHARBUF_EXTRA_SIZE): New macro.
(ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE.
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/coding.c b/src/coding.c index 64bad7ccbe8..e68700c099d 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -7266,13 +7266,17 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos) | |||
| 7266 | } | 7266 | } |
| 7267 | 7267 | ||
| 7268 | #define MAX_CHARBUF_SIZE 0x4000 | 7268 | #define MAX_CHARBUF_SIZE 0x4000 |
| 7269 | #define MIN_CHARBUF_SIZE 0x10 | 7269 | /* How many units decoding functions expect in coding->charbuf at |
| 7270 | most. Currently, decode_coding_emacs_mule expects the following | ||
| 7271 | size, and that is the largest value. */ | ||
| 7272 | #define MAX_CHARBUF_EXTRA_SIZE ((MAX_ANNOTATION_LENGTH * 3) + 1) | ||
| 7270 | 7273 | ||
| 7271 | #define ALLOC_CONVERSION_WORK_AREA(coding, size) \ | 7274 | #define ALLOC_CONVERSION_WORK_AREA(coding, size) \ |
| 7272 | do { \ | 7275 | do { \ |
| 7273 | int units = ((size) > MAX_CHARBUF_SIZE ? MAX_CHARBUF_SIZE \ | 7276 | int units = (size) + MAX_CHARBUF_EXTRA_SIZE; \ |
| 7274 | : (size) < MIN_CHARBUF_SIZE ? MIN_CHARBUF_SIZE \ | 7277 | \ |
| 7275 | : size); \ | 7278 | if (units > MAX_CHARBUF_SIZE) \ |
| 7279 | units = MAX_CHARBUF_SIZE; \ | ||
| 7276 | coding->charbuf = SAFE_ALLOCA ((units) * sizeof (int)); \ | 7280 | coding->charbuf = SAFE_ALLOCA ((units) * sizeof (int)); \ |
| 7277 | coding->charbuf_size = (units); \ | 7281 | coding->charbuf_size = (units); \ |
| 7278 | } while (0) | 7282 | } while (0) |