[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117479: * coding.c (MIN_CHARBUF_SIZE): Delete it.
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] trunk r117479: * coding.c (MIN_CHARBUF_SIZE): Delete it. |
Date: |
Sat, 05 Jul 2014 14:12:42 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117479 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: K. Handa <address@hidden>
branch nick: trunk
timestamp: Sat 2014-07-05 23:12:23 +0900
message:
* coding.c (MIN_CHARBUF_SIZE): Delete it.
(MAX_CHARBUF_EXTRA_SIZE): New macro.
(ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/coding.c coding.c-20091113204419-o5vbwnq5f7feedwu-1077
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-07-04 02:28:54 +0000
+++ b/src/ChangeLog 2014-07-05 14:07:57 +0000
@@ -1,3 +1,9 @@
+2014-07-04 K. Handa <address@hidden>
+
+ * coding.c (MIN_CHARBUF_SIZE): Delete it.
+ (MAX_CHARBUF_EXTRA_SIZE): New macro.
+ (ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE.
+
2014-07-04 Dmitry Antipov <address@hidden>
* font.h (struct font_driver): Remove get_outline and free_outline;
=== modified file 'src/coding.c'
--- a/src/coding.c 2014-06-30 15:39:29 +0000
+++ b/src/coding.c 2014-07-01 15:34:58 +0000
@@ -7266,14 +7266,17 @@
}
#define MAX_CHARBUF_SIZE 0x4000
-/* emacs-mule decoding requires more than 16 bytes. */
-#define MIN_CHARBUF_SIZE 0x20
+/* How many units decoding functions expect in coding->charbuf at
+ most. Currently, decode_coding_emacs_mule expects the following
+ size, and that is the largest value. */
+#define MAX_CHARBUF_EXTRA_SIZE ((MAX_ANNOTATION_LENGTH * 3) + 1)
#define ALLOC_CONVERSION_WORK_AREA(coding, size) \
do { \
- int units = ((size) > MAX_CHARBUF_SIZE ? MAX_CHARBUF_SIZE \
- : (size) < MIN_CHARBUF_SIZE ? MIN_CHARBUF_SIZE \
- : size); \
+ int units = (size) + MAX_CHARBUF_EXTRA_SIZE; \
+ \
+ if (units > MAX_CHARBUF_SIZE) \
+ units = MAX_CHARBUF_SIZE; \
coding->charbuf = SAFE_ALLOCA ((units) * sizeof (int)); \
coding->charbuf_size = (units); \
} while (0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117479: * coding.c (MIN_CHARBUF_SIZE): Delete it.,
Kenichi Handa <=