Commit 467e7675 authored by Kenichi Handa's avatar Kenichi Handa

Adjusted for the change of MAX_CHARSET.

parent 1df19f02
...@@ -2146,7 +2146,7 @@ setup_coding_system (coding_system, coding) ...@@ -2146,7 +2146,7 @@ setup_coding_system (coding_system, coding)
elements (if integer) is designated to REG on request, elements (if integer) is designated to REG on request,
if an element is t, REG can be used by any charset, if an element is t, REG can be used by any charset,
nil: REG is never used. */ 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; CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) = -1;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
...@@ -2207,7 +2207,7 @@ setup_coding_system (coding_system, coding) ...@@ -2207,7 +2207,7 @@ setup_coding_system (coding_system, coding)
default_reg_bits &= 3; default_reg_bits &= 3;
} }
for (charset = 0; charset < MAX_CHARSET; charset++) for (charset = 0; charset <= MAX_CHARSET; charset++)
if (CHARSET_VALID_P (charset) if (CHARSET_VALID_P (charset)
&& CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) < 0) && CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) < 0)
{ {
......
...@@ -149,7 +149,7 @@ struct iso2022_spec ...@@ -149,7 +149,7 @@ struct iso2022_spec
int initial_designation[4]; int initial_designation[4];
/* A graphic register to which each charset should be designated. */ /* 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 /* Set to 1 temporarily only when graphic register 2 or 3 is invoked
by single-shift while encoding. */ by single-shift while encoding. */
......
...@@ -96,7 +96,7 @@ free_fontset_data (fontset_data) ...@@ -96,7 +96,7 @@ free_fontset_data (fontset_data)
int j; int j;
xfree (fontset_data->fontset_table[i]->name); 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]) if (fontset_data->fontset_table[i]->fontname[j])
xfree (fontset_data->fontset_table[i]->fontname[j]); xfree (fontset_data->fontset_table[i]->fontname[j]);
xfree (fontset_data->fontset_table[i]); xfree (fontset_data->fontset_table[i]);
...@@ -172,7 +172,7 @@ fs_load_font (f, font_table, charset, fontname, fontset) ...@@ -172,7 +172,7 @@ fs_load_font (f, font_table, charset, fontname, fontset)
int i; int i;
fontp->encoding[0] = fontp->encoding[1]; 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]; fontp->encoding[i] = fontp->encoding[1];
} }
else else
...@@ -182,7 +182,7 @@ fs_load_font (f, font_table, charset, fontname, fontset) ...@@ -182,7 +182,7 @@ fs_load_font (f, font_table, charset, fontname, fontset)
/* At first, set 1 (means 0xA0..0xFF) as the default. */ /* At first, set 1 (means 0xA0..0xFF) as the default. */
fontp->encoding[0] = 1; 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; fontp->encoding[i] = 1;
/* Then override them by a specification in Vfont_encoding_alist. */ /* Then override them by a specification in Vfont_encoding_alist. */
for (list = Vfont_encoding_alist; CONSP (list); list = XCONS (list)->cdr) for (list = Vfont_encoding_alist; CONSP (list); list = XCONS (list)->cdr)
...@@ -242,7 +242,7 @@ fs_load_font (f, font_table, charset, fontname, fontset) ...@@ -242,7 +242,7 @@ fs_load_font (f, font_table, charset, fontname, fontset)
fontsetp->size = fontp->size; fontsetp->size = fontp->size;
fontsetp->height = fontp->height; 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]; font_idx = fontsetp->font_indexes[i];
if (font_idx >= 0) if (font_idx >= 0)
...@@ -317,7 +317,7 @@ fs_register_fontset (f, fontset_info) ...@@ -317,7 +317,7 @@ fs_register_fontset (f, fontset_info)
fontsetp->size = fontsetp->height = 0; 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->fontname[i] = (char *) 0;
fontsetp->font_indexes[i] = FONT_NOT_OPENED; fontsetp->font_indexes[i] = FONT_NOT_OPENED;
...@@ -521,7 +521,7 @@ list_fontsets (f, pattern, size) ...@@ -521,7 +521,7 @@ list_fontsets (f, pattern, size)
one with SIZE. */ one with SIZE. */
int j; int j;
for (j = 0; j < MAX_CHARSET; j++) for (j = 0; j <= MAX_CHARSET; j++)
if (fontsetp->fontname[j]) if (fontsetp->fontname[j])
{ {
if ((*load_font_func) (f, fontsetp->fontname[j], size)) if ((*load_font_func) (f, fontsetp->fontname[j], size))
...@@ -764,7 +764,7 @@ loading failed.") ...@@ -764,7 +764,7 @@ loading failed.")
XVECTOR (info)->contents[0] = make_number (fontsetp->size); XVECTOR (info)->contents[0] = make_number (fontsetp->size);
XVECTOR (info)->contents[1] = make_number (fontsetp->height); XVECTOR (info)->contents[1] = make_number (fontsetp->height);
val = Qnil; val = Qnil;
for (i = 0; i < MAX_CHARSET; i++) for (i = 0; i <= MAX_CHARSET; i++)
if (fontsetp->fontname[i]) if (fontsetp->fontname[i])
{ {
int font_idx = fontsetp->font_indexes[i]; int font_idx = fontsetp->font_indexes[i];
......
...@@ -71,7 +71,7 @@ struct font_info ...@@ -71,7 +71,7 @@ struct font_info
whose default value is defined in lisp/fontset.el. Since there's 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 no charset whose id is 1, we use encoding[1] to store the
encoding information decided by the font itself. */ 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 /* The baseline position of a font is normally `ascent' value of the
font. However, there exists many fonts which don't set `ascent' font. However, there exists many fonts which don't set `ascent'
...@@ -114,7 +114,7 @@ struct font_info ...@@ -114,7 +114,7 @@ struct font_info
height). In this case, the character is drawn beneath the height). In this case, the character is drawn beneath the
previous glyphs. 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. */ `_MULE_RELATIVE_COMPOSE' which is introduced by Emacs. */
int relative_compose; int relative_compose;
...@@ -142,12 +142,12 @@ struct fontset_info ...@@ -142,12 +142,12 @@ struct fontset_info
int height; int height;
/* Table of font name for each character set. */ /* 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 /* 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 not yet loaded, the value is -1 (FONT_NOT_OPENED). If font
loading is failed, the value is -2 (FONT_NOT_FOUND). */ 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. */ /* This data type is used for the fontset_data field of struct frame. */
......
...@@ -1582,13 +1582,13 @@ lisp_data_to_selection_data (display, obj, ...@@ -1582,13 +1582,13 @@ lisp_data_to_selection_data (display, obj,
{ {
/* Since we are now handling multilingual text, we must consider /* Since we are now handling multilingual text, we must consider
sending back compound text. */ sending back compound text. */
char charsets[MAX_CHARSET]; char charsets[MAX_CHARSET + 1];
int num; int num;
*format_ret = 8; *format_ret = 8;
*size_ret = XSTRING (obj)->size; *size_ret = XSTRING (obj)->size;
*data_ret = XSTRING (obj)->data; *data_ret = XSTRING (obj)->data;
bzero (charsets, MAX_CHARSET); bzero (charsets, MAX_CHARSET + 1);
num = ((*size_ret <= 1) /* Check the possibility of short cut. */ num = ((*size_ret <= 1) /* Check the possibility of short cut. */
? 0 ? 0
: find_charset_in_str (*data_ret, *size_ret, charsets)); : find_charset_in_str (*data_ret, *size_ret, charsets));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment