diff options
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lang')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lang/hyphen.c | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lang/texlang.c | 21 |
2 files changed, 15 insertions, 12 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lang/hyphen.c b/Build/source/texk/web2c/luatexdir/lang/hyphen.c index 140cde8d768..1f75b352bca 100644 --- a/Build/source/texk/web2c/luatexdir/lang/hyphen.c +++ b/Build/source/texk/web2c/luatexdir/lang/hyphen.c @@ -623,7 +623,7 @@ void hnj_hyphen_load( repl = hnj_strdup(repl + 1); } */ - for (i=0,j=0,e=0; i<l; i++) { + for (i=0,j=0,e=0; (unsigned)i<l; i++) { if (format[i]>='0'&&format[i]<='9') j++; if (is_utf8_follow(format[i])) e++; } @@ -633,7 +633,7 @@ void hnj_hyphen_load( char *org = ( char*) malloc(2+l-e-j); /* remove hyphenation encoders (digits) from pat*/ org[0] = '0'; - for (i=0,j=0,e=0; i<l; i++) { + for (i=0,j=0,e=0; (unsigned)i<l; i++) { unsigned char c = format[i]; if (is_utf8_follow(c)) { pat[j+e++] = c; @@ -779,7 +779,7 @@ void hnj_hyphen_hyphenate( halfword here; for (char_num=0, here=begin_point; here!=end_point; here=get_vlink(here)) { - int ch = get_character(here); + int ch = get_lc_code(get_character(here)); while (state!=-1) { /* printf("%*s%s%c",char_num-strlen(get_state_str(state)),"",get_state_str(state),(char)ch);*/ diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.c b/Build/source/texk/web2c/luatexdir/lang/texlang.c index 12390ae2fcf..0504805a55e 100644 --- a/Build/source/texk/web2c/luatexdir/lang/texlang.c +++ b/Build/source/texk/web2c/luatexdir/lang/texlang.c @@ -60,7 +60,7 @@ new_language (void) { struct tex_language * get_language (int n) { - if (n>=0 && n<=MAX_TEX_LANGUAGES ) { + if (n>=0 && n<MAX_TEX_LANGUAGES ) { if (tex_languages[n]!=NULL) { return tex_languages[n]; } else { @@ -74,24 +74,28 @@ get_language (int n) { void set_pre_hyphen_char (integer n, integer v) { struct tex_language *l = get_language((int)n); - l->pre_hyphen_char = (int)v; + if (l!=NULL) + l->pre_hyphen_char = (int)v; } void set_post_hyphen_char (integer n, integer v) { struct tex_language *l = get_language((int)n); - l->post_hyphen_char = (int)v; + if (l!=NULL) + l->post_hyphen_char = (int)v; } integer get_pre_hyphen_char (integer n) { struct tex_language *l = get_language((int)n); + if (l==NULL) return -1; return (integer)l->pre_hyphen_char; } integer get_post_hyphen_char (integer n) { struct tex_language *l = get_language((int)n); + if (l==NULL) return -1; return (integer)l->post_hyphen_char; } @@ -352,7 +356,7 @@ char *hyphenation_exception(int exceptions, char *w) { char *exception_strings(struct tex_language *lang) { char *value; - int size = 0, current =0; + size_t size = 0, current =0; size_t l =0; char *ret = NULL; lua_State *L = Luas[0]; @@ -382,7 +386,7 @@ char *exception_strings(struct tex_language *lang) { /* the sequence from |wordstart| to |r| can contain only normal characters */ /* it could be faster to modify a halfword pointer and return an integer */ -halfword find_exception_part(int *j, int *uword, int len) { +halfword find_exception_part(unsigned int *j, int *uword, int len) { halfword g = null, gg = null; register int i = *j; i++; /* this puts uword[i] on the '{' */ @@ -401,7 +405,7 @@ halfword find_exception_part(int *j, int *uword, int len) { return gg; } -int count_exception_part(int *j, int *uword, int len) { +int count_exception_part(unsigned int *j, int *uword, int len) { int ret=0; register int i = *j; i++; /* this puts uword[i] on the '{' */ @@ -420,7 +424,7 @@ static char *PAT_ERROR[] = { NULL }; void do_exception (halfword wordstart, halfword r, char *replacement) { - int i; + unsigned i; halfword t; unsigned len; int clang; @@ -812,8 +816,7 @@ void undump_one_language (int i) { } void undump_language_data (void) { - int i; - unsigned x, numlangs; + unsigned i, x, numlangs; undump_int(numlangs); for (i=0;i<numlangs;i++) { undump_int(x); |