summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lang/texlang.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lang/texlang.c')
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/texlang.c21
1 files changed, 12 insertions, 9 deletions
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);