diff options
| author | Kenichi Handa | 2000-08-16 01:38:32 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-08-16 01:38:32 +0000 |
| commit | d2fdb076c0e052a54ad55c2d38a764b6780a27fb (patch) | |
| tree | 575b8b05830fe253da3f4cb08e43846f4302a9e6 /src | |
| parent | 648648a9cb9c7444c7e914d7835090869441c487 (diff) | |
| download | emacs-d2fdb076c0e052a54ad55c2d38a764b6780a27fb.tar.gz emacs-d2fdb076c0e052a54ad55c2d38a764b6780a27fb.zip | |
(write_glyphs): Use a locally declared conversion_buffer.
(insert_glyphs): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/term.c b/src/term.c index 11bbd8a11ec..d3b1b250072 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1050,6 +1050,8 @@ write_glyphs (string, len) | |||
| 1050 | int produced, consumed; | 1050 | int produced, consumed; |
| 1051 | struct frame *sf = XFRAME (selected_frame); | 1051 | struct frame *sf = XFRAME (selected_frame); |
| 1052 | struct frame *f = updating_frame ? updating_frame : sf; | 1052 | struct frame *f = updating_frame ? updating_frame : sf; |
| 1053 | unsigned char conversion_buffer[1024]; | ||
| 1054 | int conversion_buffer_size = sizeof conversion_buffer; | ||
| 1053 | 1055 | ||
| 1054 | if (write_glyphs_hook | 1056 | if (write_glyphs_hook |
| 1055 | && ! FRAME_TERMCAP_P (f)) | 1057 | && ! FRAME_TERMCAP_P (f)) |
| @@ -1092,9 +1094,9 @@ write_glyphs (string, len) | |||
| 1092 | 1094 | ||
| 1093 | while (n > 0) | 1095 | while (n > 0) |
| 1094 | { | 1096 | { |
| 1095 | /* We use a shared conversion buffer of the current size | 1097 | /* We use a fixed size (1024 bytes) of conversion buffer. |
| 1096 | (1024 bytes at least). Usually it is sufficient, but if | 1098 | Usually it is sufficient, but if not, we just repeat the |
| 1097 | not, we just repeat the loop. */ | 1099 | loop. */ |
| 1098 | produced = encode_terminal_code (string, conversion_buffer, | 1100 | produced = encode_terminal_code (string, conversion_buffer, |
| 1099 | n, conversion_buffer_size, | 1101 | n, conversion_buffer_size, |
| 1100 | &consumed); | 1102 | &consumed); |
| @@ -1176,6 +1178,8 @@ insert_glyphs (start, len) | |||
| 1176 | while (len-- > 0) | 1178 | while (len-- > 0) |
| 1177 | { | 1179 | { |
| 1178 | int produced, consumed; | 1180 | int produced, consumed; |
| 1181 | unsigned char conversion_buffer[1024]; | ||
| 1182 | int conversion_buffer_size = sizeof conversion_buffer; | ||
| 1179 | 1183 | ||
| 1180 | OUTPUT1_IF (TS_ins_char); | 1184 | OUTPUT1_IF (TS_ins_char); |
| 1181 | if (!start) | 1185 | if (!start) |
| @@ -1200,8 +1204,8 @@ insert_glyphs (start, len) | |||
| 1200 | /* This is the last glyph. */ | 1204 | /* This is the last glyph. */ |
| 1201 | terminal_coding.mode |= CODING_MODE_LAST_BLOCK; | 1205 | terminal_coding.mode |= CODING_MODE_LAST_BLOCK; |
| 1202 | 1206 | ||
| 1203 | /* We use shared conversion buffer of the current size (1024 | 1207 | /* The size of conversion buffer (1024 bytes) is surely |
| 1204 | bytes at least). It is surely sufficient for just one glyph. */ | 1208 | sufficient for just one glyph. */ |
| 1205 | produced = encode_terminal_code (glyph, conversion_buffer, 1, | 1209 | produced = encode_terminal_code (glyph, conversion_buffer, 1, |
| 1206 | conversion_buffer_size, &consumed); | 1210 | conversion_buffer_size, &consumed); |
| 1207 | } | 1211 | } |