From: Kenichi Handa Date: Tue, 18 Mar 1997 23:31:34 +0000 (+0000) Subject: Adjusted for the change of MAX_CHARSET. X-Git-Tag: emacs-20.1~2755 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=467e7675540bdf5f21379a0ee5d7f92627e3ead3;p=emacs.git Adjusted for the change of MAX_CHARSET. --- diff --git a/src/coding.c b/src/coding.c index 277a9b16678..6e20b47ee34 100644 --- a/src/coding.c +++ b/src/coding.c @@ -2146,7 +2146,7 @@ setup_coding_system (coding_system, coding) elements (if integer) is designated to REG on request, if an element is t, REG can be used by any charset, nil: REG is never used. */ - for (charset = 0; charset < MAX_CHARSET; charset++) + for (charset = 0; charset <= MAX_CHARSET; charset++) CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) = -1; for (i = 0; i < 4; i++) { @@ -2207,7 +2207,7 @@ setup_coding_system (coding_system, coding) default_reg_bits &= 3; } - for (charset = 0; charset < MAX_CHARSET; charset++) + for (charset = 0; charset <= MAX_CHARSET; charset++) if (CHARSET_VALID_P (charset) && CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) < 0) { diff --git a/src/coding.h b/src/coding.h index 6008557cbf2..3facc43547b 100644 --- a/src/coding.h +++ b/src/coding.h @@ -149,7 +149,7 @@ struct iso2022_spec int initial_designation[4]; /* A graphic register to which each charset should be designated. */ - char requested_designation[MAX_CHARSET]; + char requested_designation[MAX_CHARSET + 1]; /* Set to 1 temporarily only when graphic register 2 or 3 is invoked by single-shift while encoding. */ diff --git a/src/fontset.c b/src/fontset.c index 93fdbfeccd1..e136c09b763 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -96,7 +96,7 @@ free_fontset_data (fontset_data) int j; xfree (fontset_data->fontset_table[i]->name); - for (j = 0; j < MAX_CHARSET; j++) + for (j = 0; j <= MAX_CHARSET; j++) if (fontset_data->fontset_table[i]->fontname[j]) xfree (fontset_data->fontset_table[i]->fontname[j]); xfree (fontset_data->fontset_table[i]); @@ -172,7 +172,7 @@ fs_load_font (f, font_table, charset, fontname, fontset) int i; fontp->encoding[0] = fontp->encoding[1]; - for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i < MAX_CHARSET; i++) + for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i <= MAX_CHARSET; i++) fontp->encoding[i] = fontp->encoding[1]; } else @@ -182,7 +182,7 @@ fs_load_font (f, font_table, charset, fontname, fontset) /* At first, set 1 (means 0xA0..0xFF) as the default. */ fontp->encoding[0] = 1; - for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i < MAX_CHARSET; i++) + for (i = MIN_CHARSET_OFFICIAL_DIMENSION1; i <= MAX_CHARSET; i++) fontp->encoding[i] = 1; /* Then override them by a specification in Vfont_encoding_alist. */ for (list = Vfont_encoding_alist; CONSP (list); list = XCONS (list)->cdr) @@ -242,7 +242,7 @@ fs_load_font (f, font_table, charset, fontname, fontset) fontsetp->size = fontp->size; fontsetp->height = fontp->height; - for (i = CHARSET_ASCII + 1; i < MAX_CHARSET; i++) + for (i = CHARSET_ASCII + 1; i <= MAX_CHARSET; i++) { font_idx = fontsetp->font_indexes[i]; if (font_idx >= 0) @@ -317,7 +317,7 @@ fs_register_fontset (f, fontset_info) fontsetp->size = fontsetp->height = 0; - for (i = 0; i < MAX_CHARSET; i++) + for (i = 0; i <= MAX_CHARSET; i++) { fontsetp->fontname[i] = (char *) 0; fontsetp->font_indexes[i] = FONT_NOT_OPENED; @@ -521,7 +521,7 @@ list_fontsets (f, pattern, size) one with SIZE. */ int j; - for (j = 0; j < MAX_CHARSET; j++) + for (j = 0; j <= MAX_CHARSET; j++) if (fontsetp->fontname[j]) { if ((*load_font_func) (f, fontsetp->fontname[j], size)) @@ -764,7 +764,7 @@ loading failed.") XVECTOR (info)->contents[0] = make_number (fontsetp->size); XVECTOR (info)->contents[1] = make_number (fontsetp->height); val = Qnil; - for (i = 0; i < MAX_CHARSET; i++) + for (i = 0; i <= MAX_CHARSET; i++) if (fontsetp->fontname[i]) { int font_idx = fontsetp->font_indexes[i]; diff --git a/src/fontset.h b/src/fontset.h index ecdc1a7f0a0..54b9999ffe4 100644 --- a/src/fontset.h +++ b/src/fontset.h @@ -71,7 +71,7 @@ struct font_info whose default value is defined in lisp/fontset.el. Since there's no charset whose id is 1, we use encoding[1] to store the encoding information decided by the font itself. */ - char encoding[MAX_CHARSET]; + char encoding[MAX_CHARSET + 1]; /* The baseline position of a font is normally `ascent' value of the font. However, there exists many fonts which don't set `ascent' @@ -114,7 +114,7 @@ struct font_info height). In this case, the character is drawn beneath the previous glyphs. - This value is take from a private font property + This value is taken from a private font property `_MULE_RELATIVE_COMPOSE' which is introduced by Emacs. */ int relative_compose; @@ -142,12 +142,12 @@ struct fontset_info int height; /* Table of font name for each character set. */ - char *fontname[MAX_CHARSET]; + char *fontname[MAX_CHARSET + 1]; /* Table of index numbers of fonts indexed by charset. If a font is not yet loaded, the value is -1 (FONT_NOT_OPENED). If font loading is failed, the value is -2 (FONT_NOT_FOUND). */ - int font_indexes[MAX_CHARSET]; + int font_indexes[MAX_CHARSET + 1]; }; /* This data type is used for the fontset_data field of struct frame. */ diff --git a/src/xselect.c b/src/xselect.c index 3de9748b7b5..2ba3d869019 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1582,13 +1582,13 @@ lisp_data_to_selection_data (display, obj, { /* Since we are now handling multilingual text, we must consider sending back compound text. */ - char charsets[MAX_CHARSET]; + char charsets[MAX_CHARSET + 1]; int num; *format_ret = 8; *size_ret = XSTRING (obj)->size; *data_ret = XSTRING (obj)->data; - bzero (charsets, MAX_CHARSET); + bzero (charsets, MAX_CHARSET + 1); num = ((*size_ret <= 1) /* Check the possibility of short cut. */ ? 0 : find_charset_in_str (*data_ret, *size_ret, charsets));