summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/libs/lua51/liolib.c3
-rw-r--r--Build/source/libs/luafilesystem/src/lfs.c3
-rw-r--r--Build/source/libs/luafontforge/Makefile6
-rw-r--r--Build/source/libs/luafontforge/fontforge/Unicode/Makefile6
-rw-r--r--Build/source/libs/luafontforge/fontforge/fontforge/Makefile6
-rw-r--r--Build/source/libs/luafontforge/fontforge/fontforge/namelist.c2
-rw-r--r--Build/source/libs/luafontforge/fontforge/inc/basics.h6
-rw-r--r--Build/source/libs/luazlib/lzlib.c10
-rw-r--r--Build/source/texk/web2c/luatexdir/font/luafont.c13
-rw-r--r--Build/source/texk/web2c/luatexdir/image/image.h4
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writeimg.c16
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writepng.c17
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/hyphen.c38
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/texlang.c7
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c3
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/limglib.c15
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/loslibext.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatoken.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/postlinebreak.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.c3
20 files changed, 97 insertions, 71 deletions
diff --git a/Build/source/libs/lua51/liolib.c b/Build/source/libs/lua51/liolib.c
index c009946079e..f86e436ff2a 100644
--- a/Build/source/libs/lua51/liolib.c
+++ b/Build/source/libs/lua51/liolib.c
@@ -157,9 +157,10 @@ static int io_open (lua_State *L) {
static int io_open_ro (lua_State *L) {
const char *filename = luaL_checkstring(L, 1);
const char *mode = luaL_optstring(L, 2, "r");
+ FILE **pf;
if ((strcmp(mode,"r")!= 0)&&(strcmp(mode,"rb")!=0))
return pushresult(L, 0, filename);
- FILE **pf = newfile(L);
+ pf = newfile(L);
*pf = fopen(filename, mode);
return (*pf == NULL) ? pushresult(L, 0, filename) : 1;
}
diff --git a/Build/source/libs/luafilesystem/src/lfs.c b/Build/source/libs/luafilesystem/src/lfs.c
index ee2920412d1..eea8bfaca83 100644
--- a/Build/source/libs/luafilesystem/src/lfs.c
+++ b/Build/source/libs/luafilesystem/src/lfs.c
@@ -256,6 +256,8 @@ static int remove_dir (lua_State *L) {
static int dir_iter (lua_State *L) {
#ifdef _WIN32
struct _finddata_t c_file;
+#else
+ struct dirent *entry;
#endif
dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1));
luaL_argcheck (L, !d->closed, 1, "closed directory");
@@ -281,7 +283,6 @@ static int dir_iter (lua_State *L) {
}
}
#else
- struct dirent *entry;
if ((entry = readdir (d->dir)) != NULL) {
lua_pushstring (L, entry->d_name);
return 1;
diff --git a/Build/source/libs/luafontforge/Makefile b/Build/source/libs/luafontforge/Makefile
index 84564f19ad2..a160ab19650 100644
--- a/Build/source/libs/luafontforge/Makefile
+++ b/Build/source/libs/luafontforge/Makefile
@@ -4,8 +4,8 @@ srcdir=../../../libs/luafontforge
FF_LIB=ffdummies.o luafflib.o
-_CFLAGS=-Wall -DFONTFORGE_CONFIG_NO_WINDOWING_UI=1 -DLUA_FF_LIB=1 $(XCFLAGS)
-CFLAGS = -g -O2
+_CFLAGS=-DFONTFORGE_CONFIG_NO_WINDOWING_UI=1 -DLUA_FF_LIB=1 $(XCFLAGS)
+#CFLAGS = -g -O2
.PHONY: newfile
@@ -17,7 +17,7 @@ fontforge: $(FF_LIB) newfile
ranlib libff.a
%.o: $(srcdir)/src/%.c
- gcc $(_CFLAGS) $(CFLAGS) -I$(srcdir)/../lua51 -I$(srcdir)/fontforge/inc -I$(srcdir)/fontforge/fontforge -c $< -o $@
+ $(CC) $(_CFLAGS) $(CFLAGS) -I$(srcdir)/../lua51 -I$(srcdir)/fontforge/inc -I$(srcdir)/fontforge/fontforge -c $< -o $@
clean:
rm -f libff.a $(FF_LIB)
diff --git a/Build/source/libs/luafontforge/fontforge/Unicode/Makefile b/Build/source/libs/luafontforge/fontforge/Unicode/Makefile
index 8e215835910..7538627cb5d 100644
--- a/Build/source/libs/luafontforge/fontforge/Unicode/Makefile
+++ b/Build/source/libs/luafontforge/fontforge/Unicode/Makefile
@@ -2,12 +2,12 @@
top_srcdir = ../../../../libs/luafontforge/fontforge
srcdir = $(top_srcdir)/Unicode
-CC = gcc
+#CC = gcc
OBJECTS = alphabet.o char.o memory.o cjk.o ustring.o gwwiconv.o
-_CFLAGS = -I$(top_srcdir)/inc -Wall -DLUA_FF_LIB=1 $(XCFLAGS)
-CFLAGS = -g -O2
+_CFLAGS = -I$(top_srcdir)/inc -DLUA_FF_LIB=1 $(XCFLAGS)
+#CFLAGS = -g -O2
all: $(OBJECTS)
diff --git a/Build/source/libs/luafontforge/fontforge/fontforge/Makefile b/Build/source/libs/luafontforge/fontforge/fontforge/Makefile
index d0e7b983446..3113228c30a 100644
--- a/Build/source/libs/luafontforge/fontforge/fontforge/Makefile
+++ b/Build/source/libs/luafontforge/fontforge/fontforge/Makefile
@@ -2,7 +2,7 @@
top_srcdir = ../../../../libs/luafontforge/fontforge
srcdir = $(top_srcdir)/fontforge
-CC = gcc
+#CC = gcc
AR = ar cru
RANLIB = ranlib
@@ -14,7 +14,7 @@ OBJECTS =autohint.o charview.o fontinfo.o \
stemdb.o lookups.o featurefile.o \
tottf.o tottfgpos.o tottfvar.o splinesave.o
-_CFLAGS = -I$(top_srcdir)/inc -I$(srcdir) -I. -Wall $(XCFLAGS) \
+_CFLAGS = -I$(top_srcdir)/inc -I$(srcdir) -I. $(XCFLAGS) \
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 \
-DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -D_NO_PYTHON=1 -DHAVE_LANGINFO_H=1 \
@@ -22,7 +22,7 @@ _CFLAGS = -I$(top_srcdir)/inc -I$(srcdir) -I. -Wall $(XCFLAGS) \
-DNODYNAMIC=1 -D_NO_FREETYPE=1 -D_NO_LIBUNINAMESLIST=1 \
-DFONTFORGE_CONFIG_NO_WINDOWING_UI=1 -DLUA_FF_LIB=1 -UHAVE_LIBINTL_H
-CFLAGS = -g -O2
+#CFLAGS = -g -O2
all: $(OBJECTS)
diff --git a/Build/source/libs/luafontforge/fontforge/fontforge/namelist.c b/Build/source/libs/luafontforge/fontforge/fontforge/namelist.c
index ebc1fc8e4cf..c290afaa8ab 100644
--- a/Build/source/libs/luafontforge/fontforge/fontforge/namelist.c
+++ b/Build/source/libs/luafontforge/fontforge/fontforge/namelist.c
@@ -43,7 +43,7 @@ static struct psaltnames {
char *name;
int unicode;
int provenance; /* 1=> Adobe PUA, 2=>AMS PUA, 3=>TeX */
-} psaltnames[];
+} psaltnames[5487];
static NameList agl_sans, agl, adobepua, greeksc, tex, ams;
NameList *namelist_for_new_fonts = &agl;
diff --git a/Build/source/libs/luafontforge/fontforge/inc/basics.h b/Build/source/libs/luafontforge/fontforge/inc/basics.h
index 04c2fcf54a2..eb3781df017 100644
--- a/Build/source/libs/luafontforge/fontforge/inc/basics.h
+++ b/Build/source/libs/luafontforge/fontforge/inc/basics.h
@@ -45,11 +45,11 @@
#define forever for (;;)
-typedef int32_t int32;
+/* typedef int32_t int32; */
typedef uint32_t uint32;
-typedef int16_t int16;
+/* typedef int16_t int16; */
typedef uint16_t uint16;
-typedef int8_t int8;
+/* typedef int8_t int8; */
typedef uint8_t uint8;
/* An integral type which can hold a pointer */
diff --git a/Build/source/libs/luazlib/lzlib.c b/Build/source/libs/luazlib/lzlib.c
index ebc72d97664..74c9dd21a64 100644
--- a/Build/source/libs/luazlib/lzlib.c
+++ b/Build/source/libs/luazlib/lzlib.c
@@ -199,9 +199,9 @@ static int lzstream_decompress(lua_State *L)
s->avail_in = lua_strlen(L, 2);
{
+ int r;
luaL_Buffer b;
luaL_buffinit(L, &b);
- int r;
do {
s->next_out = luaL_prepbuffer(&b);
@@ -235,9 +235,9 @@ static int lzstream_compress(lua_State *L)
s->avail_in = lua_strlen(L, 2);
{
+ int r;
luaL_Buffer b;
luaL_buffinit(L, &b);
- int r;
do {
s->next_out = luaL_prepbuffer(&b);
@@ -388,11 +388,10 @@ static int lzlib_compress(lua_State *L)
int strategy = luaL_optint(L, 6, Z_DEFAULT_STRATEGY);
int ret;
+ z_stream zs;
luaL_Buffer b;
luaL_buffinit(L, &b);
- z_stream zs;
-
zs.zalloc = Z_NULL;
zs.zfree = Z_NULL;
@@ -450,11 +449,10 @@ static int lzlib_decompress(lua_State *L)
int windowBits = luaL_optint(L, 2, 15);
int ret;
+ z_stream zs;
luaL_Buffer b;
luaL_buffinit(L, &b);
- z_stream zs;
-
zs.zalloc = Z_NULL;
zs.zfree = Z_NULL;
diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.c b/Build/source/texk/web2c/luatexdir/font/luafont.c
index be32e39de9f..7bc888c6b67 100644
--- a/Build/source/texk/web2c/luatexdir/font/luafont.c
+++ b/Build/source/texk/web2c/luatexdir/font/luafont.c
@@ -1355,6 +1355,7 @@ handle_lig_word(halfword cur) {
/* if a{bx}{}{y} and a+b=>B convert to {Bx}{}{ay} */
halfword pre = vlink_pre_break(fwd);
halfword nob = vlink_no_break(fwd);
+ halfword next, tail;
liginfo lig;
assert_disc(fwd);
/* Check on: a{b?}{?}{?} and a+b=>B : {B?}{?}{a?}*/
@@ -1373,7 +1374,7 @@ handle_lig_word(halfword cur) {
cur = prev;
}
/* Check on: a{?}{?}{}b and a+b=>B : {a?}{?b}{B}*/
- halfword next = vlink(fwd);
+ next = vlink(fwd);
if (nob==null && next != null && type(next)==glyph_node
&& test_ligature(&lig,cur,next)) {
/* move cur from before disc to no_break part */
@@ -1386,7 +1387,7 @@ handle_lig_word(halfword cur) {
/* now copy cur the pre_break */
nesting_prepend(pre_break(fwd),copy_node(cur));
/* move next from after disc to no_break part */
- halfword tail = vlink(next);
+ tail = vlink(next);
uncouple_node(next);
try_couple_nodes(fwd,tail);
couple_nodes(cur,next); /* we _know_ this works */
@@ -1428,7 +1429,8 @@ handle_lig_word(halfword cur) {
while (1) {
if ((fwd = vlink(cur))==null) return cur;
if ( type(fwd)==glyph_node) {
- for (i=0; i<max_depth; i++) {
+ halfword next;
+ for (i=0; i<max_depth; i++) {
liginfo lig;
halfword tail = tlink(lists[i]);
if ( tail!=null && test_ligature(&lig,tail,fwd))
@@ -1444,7 +1446,7 @@ add_glyph_to_all:
if (tail==null) continue; /* first character - never a ligature */
handle_lig_nest(lists[i],tail);
}
- halfword next = vlink(fwd);
+ next = vlink(fwd);
uncouple_node(fwd);
try_couple_nodes(cur,next);
flush_node(fwd);
@@ -1458,6 +1460,7 @@ add_glyph_to_all:
for (i=0; i<m; i++) {
halfword copy = copy_node(fwd);
halfword tail = tlink(lists[i]);
+ halfword next;
if (tail!=null) {
halfword prev = alink(tail);
assert(alink(tail)!=null);
@@ -1477,7 +1480,7 @@ add_glyph_to_all:
lists[max_depth++] = handle_lig_nest(no_break(copy),vlink_no_break(copy));
lists[i] = handle_lig_nest(post_break(copy),vlink_post_break(copy));
}
- halfword next = vlink(fwd);
+ next = vlink(fwd);
uncouple_node(fwd);
try_couple_nodes(cur,next);
flush_node(fwd);
diff --git a/Build/source/texk/web2c/luatexdir/image/image.h b/Build/source/texk/web2c/luatexdir/image/image.h
index e239e617f37..33f09274433 100644
--- a/Build/source/texk/web2c/luatexdir/image/image.h
+++ b/Build/source/texk/web2c/luatexdir/image/image.h
@@ -52,8 +52,10 @@ typedef struct {
JPG_UINT32 length; /* length of file/data */
} jpg_img_struct;
+#if 0
typedef struct { /* currently unused */
} jb2_img_struct;
+#endif
typedef enum { DICT_NEW, /* fresh dictionary */
DICT_FILESCANNED, /* image file scanned */
@@ -101,7 +103,7 @@ typedef struct {
union {
png_img_struct *png;
jpg_img_struct *jpg;
- jb2_img_struct *jb2;
+ /* jb2_img_struct *jb2; */
} img_struct;
} image_dict;
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.c b/Build/source/texk/web2c/luatexdir/image/writeimg.c
index c49ef9a28d9..79c3445945d 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.c
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.c
@@ -328,8 +328,9 @@ void scale_img(image * img)
integer x, y, xr, yr; /* size and resolution of image */
scaled w, h; /* indeed size corresponds to image resolution */
integer default_res;
+ image_dict *idict;
assert(img != NULL);
- image_dict *idict = img_dict(img);
+ idict = img_dict(img);
assert(idict != NULL);
x = img_xsize(idict); /* dimensions, resolutions from image file */
y = img_ysize(idict);
@@ -414,12 +415,14 @@ void out_img(image * img, scaled hpos, scaled vpos)
float a[6]; /* transformation matrix */
float xoff, yoff, tmp;
int r; /* number of digits after the decimal point */
+ image_dict *idict;
+ scaled wd, ht, dp;
assert(img != 0);
- image_dict *idict = img_dict(img);
+ idict = img_dict(img);
assert(idict != 0);
- scaled wd = img_width(img);
- scaled ht = img_height(img);
- scaled dp = img_depth(img);
+ wd = img_width(img);
+ ht = img_height(img);
+ dp = img_depth(img);
if ((img_transform(img) & 1) == 1) { /* 90 deg. or 270 deg. rotated */
if (ht == -dp)
pdftex_fail("image transform: division by zero (height == -depth)");
@@ -571,8 +574,9 @@ integer read_image(integer objnum, integer index, strnumber filename,
{
integer ref;
image *a = new_image();
+ image_dict *idict;
ref = img_to_array(a);
- image_dict *idict = img_dict(a) = new_image_dict();
+ idict = img_dict(a) = new_image_dict();
assert(idict != NULL);
img_objnum(idict) = objnum;
img_index(idict) = index;
diff --git a/Build/source/texk/web2c/luatexdir/image/writepng.c b/Build/source/texk/web2c/luatexdir/image/writepng.c
index 7f1269d9943..d431b3b7ed1 100644
--- a/Build/source/texk/web2c/luatexdir/image/writepng.c
+++ b/Build/source/texk/web2c/luatexdir/image/writepng.c
@@ -433,13 +433,16 @@ static int spng_getint(FILE * fp)
void copy_png(image_dict * idict)
{
- assert(idict != NULL);
- png_structp png_p = img_png_png_ptr(idict);
- png_infop info_p = img_png_info_ptr(idict);
- FILE *fp = (FILE *) png_p->io_ptr;
+ png_structp png_p;
+ png_infop info_p;
+ FILE *fp;
int i, len, type, streamlength = 0;
boolean endflag = false;
int idat = 0; /* flag to check continuous IDAT chunks sequence */
+ assert(idict != NULL);
+ png_p = img_png_png_ptr(idict);
+ info_p = img_png_info_ptr(idict);
+ fp = (FILE *) png_p->io_ptr;
/* 1st pass to find overall stream /Length */
if (fseek(fp, 8, SEEK_SET) != 0)
pdftex_fail("writepng: fseek in PNG file failed");
@@ -518,12 +521,14 @@ void write_png(image_dict * idict)
double gamma, checked_gamma;
int i;
integer palette_objnum = 0;
+ png_structp png_p;
+ png_infop info_p;
assert(idict != NULL);
if (img_file(idict) == NULL)
reopen_png(idict);
assert(img_png_ptr(idict) != NULL);
- png_structp png_p = img_png_png_ptr(idict);
- png_infop info_p = img_png_info_ptr(idict);
+ png_p = img_png_png_ptr(idict);
+ info_p = img_png_info_ptr(idict);
if (fixed_pdf_minor_version < 5)
fixed_image_hicolor = 0;
pdf_puts("/Type /XObject\n/Subtype /Image\n");
diff --git a/Build/source/texk/web2c/luatexdir/lang/hyphen.c b/Build/source/texk/web2c/luatexdir/lang/hyphen.c
index 1f75b352bca..049210d3d71 100644
--- a/Build/source/texk/web2c/luatexdir/lang/hyphen.c
+++ b/Build/source/texk/web2c/luatexdir/lang/hyphen.c
@@ -418,9 +418,9 @@ static const unsigned char* next_pattern(
size_t* length,
const unsigned char **buf
) {
- const unsigned char *rover = *buf;
+ const unsigned char *rover = *buf, *here;
while (*rover && isspace(*rover)) rover++;
- const unsigned char *here = rover;
+ here = rover;
while (*rover) {
if (isspace(*rover)) {
*length = rover-here;
@@ -437,8 +437,8 @@ static const unsigned char* next_pattern(
static void init_hash(
HashTab**h
) {
- if (*h) return;
int i;
+ if (*h) return;
*h = hnj_malloc(sizeof(HashTab));
for (i = 0; i < HASH_SIZE; i++) (*h)->entries[i] = NULL;
}
@@ -447,8 +447,8 @@ static void init_hash(
static void clear_state_hash(
HashTab**h
) {
- if (*h==NULL) return;
int i;
+ if (*h==NULL) return;
for (i = 0; i < HASH_SIZE; i++) {
HashEntry *e, *next;
for (e = (*h)->entries[i]; e; e = next) {
@@ -465,8 +465,8 @@ static void clear_state_hash(
static void clear_hyppat_hash(
HashTab**h
) {
- if (*h==NULL) return;
int i;
+ if (*h==NULL) return;
for (i = 0; i < HASH_SIZE; i++) {
HashEntry *e, *next;
for (e = (*h)->entries[i]; e; e = next) {
@@ -600,6 +600,8 @@ void hnj_hyphen_load(
const unsigned char* begin = f;
while((format = next_pattern(&l,&f))!=NULL) {
int i,j,e;
+ unsigned char *pat;
+ char *org;
/*
printf("%s\n",format);
char* repl = strnchr(format, '/',l);
@@ -629,9 +631,9 @@ void hnj_hyphen_load(
}
/* l-e => number of _characters_ not _bytes_*/
/* l-e-j => number of pattern characters*/
- unsigned char *pat = (unsigned char*) malloc(1+l-j);
- char *org = ( char*) malloc(2+l-e-j);
- /* remove hyphenation encoders (digits) from pat*/
+ pat = (unsigned char*) malloc(1+l-j);
+ org = ( char*) malloc(2+l-e-j);
+ /* remove hyphenation encoders (digits) from pat*/
org[0] = '0';
for (i=0,j=0,e=0; (unsigned)i<l; i++) {
unsigned char c = format[i];
@@ -658,16 +660,17 @@ void hnj_hyphen_load(
if (is_utf8_follow(word[l])) continue; /* Do not clip an utf8 sequence*/
for (j=1; j<=l; j++) {
int i = l-j;
- if (is_utf8_follow(word[i])) continue; /* Do not start halfway an utf8 sequence*/
char *subpat_pat;
+ if (is_utf8_follow(word[i])) continue; /* Do not start halfway an utf8 sequence*/
if ((subpat_pat = hyppat_lookup(dict->patterns,word+i,j))!=NULL) {
char* newpat_pat;
if ((newpat_pat = hyppat_lookup(dict->merged,word,l))==NULL) {
unsigned char *newword=(unsigned char*)malloc(l+1);
- strncpy((char*)newword, (char*)word,l); newword[l]=0;
int e=0;
+ char *neworg;
+ strncpy((char*)newword, (char*)word,l); newword[l]=0;
for (i=0; i<l; i++) if (is_utf8_follow(newword[i])) e++;
- char *neworg = malloc(l+2-e);
+ neworg = malloc(l+2-e);
sprintf(neworg,"%0*d",l+1-e,0); /* fill with right amount of '0'*/
hyppat_insert(dict->merged,newword,combine(neworg,subpat_pat));
} else {
@@ -697,10 +700,10 @@ void hnj_hyphen_load(
last_state = state_num;
ch = word[j];
if (ch>=0x80) {
- int i=1;
+ int i=1, m;
while (is_utf8_follow(word[j-i])) i++;
ch = word[j-i] & mask[i];
- int m = j-i;
+ m = j-i;
while (i--) {
ch = (ch<<6)+(0x3F & word[j-i]);
}
@@ -759,13 +762,15 @@ void hnj_hyphen_hyphenate(
int hyphen_len = ext_word_len+1;
/*char *hyphens = hnj_malloc((hyphen_len*2)+1); */ /* LATER */
char *hyphens = hnj_malloc(hyphen_len+1);
+ int char_num;
+ int state = 0;
+ halfword here;
/* Add a '.' to beginning and end to facilitate matching*/
set_vlink(begin_point,first);
set_vlink(end_point,get_vlink(last));
set_vlink(last,end_point);
- int char_num;
for (char_num = 0; char_num < hyphen_len; char_num++) {
/* hyphens[char_num*2] = '0'; */ /* LATER */
/* hyphens[char_num*2+1] = '0'; */ /* LATER */
@@ -775,8 +780,6 @@ void hnj_hyphen_hyphenate(
hyphens[hyphen_len] = 0;
/* now, run the finite state machine */
- int state = 0;
- halfword here;
for (char_num=0, here=begin_point; here!=end_point; here=get_vlink(here)) {
int ch = get_lc_code(get_character(here));
@@ -787,9 +790,10 @@ void hnj_hyphen_hyphenate(
int k;
for (k = 0; k < hstate->num_trans; k++) {
if (hstate->trans[k].uni_ch == ch) {
+ char *match;
state = hstate->trans[k].new_state;
/* printf(" state %d\n",state);*/
- char *match = dict->states[state].match;
+ match = dict->states[state].match;
if (match) {
/* +2 because:
* 1 string length is one bigger than offset
diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.c b/Build/source/texk/web2c/luatexdir/lang/texlang.c
index 0504805a55e..1f847f5c643 100644
--- a/Build/source/texk/web2c/luatexdir/lang/texlang.c
+++ b/Build/source/texk/web2c/luatexdir/lang/texlang.c
@@ -650,11 +650,12 @@ hnj_hyphenation (halfword head, halfword tail) {
couple_nodes(tail, s);
while (r!=null) { /* could be while(1), but let's be paranoid */
+ int clang, lhmin, rhmin;
wordstart = r;
assert (is_simple_character(wordstart));
- int clang = char_lang(wordstart);
- int lhmin = char_lhmin(wordstart);
- int rhmin = char_rhmin(wordstart);
+ clang = char_lang(wordstart);
+ lhmin = char_lhmin(wordstart);
+ rhmin = char_rhmin(wordstart);
langdata.pre_hyphen_char = get_pre_hyphen_char(clang);
langdata.post_hyphen_char = get_post_hyphen_char(clang);
while (r!=null &&
diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
index fa207420dfb..09e94fda2e9 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c
@@ -282,13 +282,14 @@ do_run_callback (int special, char *values, va_list vl) {
}
nres = -nres;
while (*values) {
+ int b;
switch (*values++) {
case CALLBACK_BOOLEAN:
if (!lua_isboolean(L,nres)) {
fprintf(stderr,"Expected a boolean, not: %s\n", lua_typename(L,lua_type(L,nres)));
goto EXIT;
}
- int b = lua_toboolean(L,nres);
+ b = lua_toboolean(L,nres);
*va_arg(vl, boolean *) = (boolean)b;
break;
case CALLBACK_INTEGER:
diff --git a/Build/source/texk/web2c/luatexdir/lua/limglib.c b/Build/source/texk/web2c/luatexdir/lua/limglib.c
index fd75e49799a..8f3f70ec718 100644
--- a/Build/source/texk/web2c/luatexdir/lua/limglib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/limglib.c
@@ -392,6 +392,7 @@ void copy_image(lua_State * L, lua_Number scale)
static int l_new_image(lua_State * L)
{
image *a, **aa;
+ image_dict **add;
if (lua_gettop(L) > 1)
luaL_error(L, "img.new() needs maximum 1 argument");
if (lua_gettop(L) == 1 && !lua_istable(L, 1))
@@ -400,7 +401,7 @@ static int l_new_image(lua_State * L)
luaL_getmetatable(L, TYPE_IMG); /* m i (t) */
lua_setmetatable(L, -2); /* i (t) */
a = *aa = new_image();
- image_dict **add = (image_dict **) lua_newuserdata(L, sizeof(image_dict *)); /* ad i (t) */
+ add = (image_dict **) lua_newuserdata(L, sizeof(image_dict *)); /* ad i (t) */
luaL_getmetatable(L, TYPE_IMG_DICT); /* m ad i (t) */
lua_setmetatable(L, -2); /* ad i (t) */
img_dict(a) = *add = new_image_dict();
@@ -431,13 +432,14 @@ static int l_copy_image(lua_State * L)
static int l_scan_image(lua_State * L)
{
image *a, **aa;
+ image_dict *ad;
if (lua_gettop(L) != 1)
luaL_error(L, "img.scan() needs exactly 1 argument");
if (lua_istable(L, 1))
l_new_image(L); /* image --- if everything worked well */
aa = (image **) luaL_checkudata(L, 1, TYPE_IMG); /* image */
a = *aa;
- image_dict *ad = img_dict(a);
+ ad = img_dict(a);
if (img_state(ad) == DICT_NEW) {
read_img(ad, get_pdf_minor_version(), get_pdf_inclusion_errorlevel());
img_unset_scaled(a);
@@ -454,9 +456,10 @@ static int l_scan_image(lua_State * L)
static halfword img_to_node(image * a, integer ref)
{
image_dict *ad = img_dict(a);
+ halfword n;
assert(ad != NULL);
assert(img_objnum(ad) != 0);
- halfword n = new_node(whatsit_node, pdf_refximage_node);
+ n = new_node(whatsit_node, pdf_refximage_node);
pdf_ximage_ref(n) = ref;
pdf_width(n) = img_width(a);
pdf_height(n) = img_height(a);
@@ -473,14 +476,16 @@ extern void lua_nodelib_push_fast(lua_State * L, halfword n);
static void write_image_or_node(lua_State * L, wrtype_e writetype)
{
image *a, **aa;
+ image_dict *ad;
halfword n;
+ integer ref;
if (lua_gettop(L) != 1)
luaL_error(L, "%s needs exactly 1 argument", wrtype_s[writetype]);
if (lua_istable(L, 1))
l_new_image(L); /* image --- if everything worked well */
aa = (image **) luaL_checkudata(L, 1, TYPE_IMG); /* image */
a = *aa;
- image_dict *ad = img_dict(a);
+ ad = img_dict(a);
assert(ad != NULL);
if (img_state(ad) == DICT_NEW) {
read_img(ad, get_pdf_minor_version(), get_pdf_inclusion_errorlevel());
@@ -489,7 +494,7 @@ static void write_image_or_node(lua_State * L, wrtype_e writetype)
fix_image_size(L, a);
check_pdfoutput(maketexstring(wrtype_s[writetype]), true);
flush_str(last_tex_string);
- integer ref = img_to_array(a);
+ ref = img_to_array(a);
if (img_objnum(ad) == 0) { /* not strictly needed here, could be delayed until out_image() */
pdf_ximage_count++;
pdf_create_obj(obj_type_ximage, pdf_ximage_count);
diff --git a/Build/source/texk/web2c/luatexdir/lua/loslibext.c b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
index 003b031f627..05a96688441 100644
--- a/Build/source/texk/web2c/luatexdir/lua/loslibext.c
+++ b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
@@ -410,7 +410,7 @@ static int os_setenv (lua_State *L) {
return luaL_error(L, "unable to change environment");
}
} else {
-#if defined(WIN32) || defined(__sun__)
+#if defined(WIN32) || defined(__sun__) || defined(_AIX)
value = xmalloc(strlen(key)+2);
sprintf(value,"%s=",key);
if (putenv(value)) {
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatoken.c b/Build/source/texk/web2c/luatexdir/lua/luatoken.c
index bf434b286bb..5f823104d56 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatoken.c
+++ b/Build/source/texk/web2c/luatexdir/lua/luatoken.c
@@ -161,9 +161,9 @@ int get_command_id (char *s) {
static int
get_cur_cmd (lua_State *L) {
- int r = 0;
+ int r = 0, len;
cur_cs = 0;
- int len = lua_objlen(L,-1);
+ len = lua_objlen(L,-1);
if (len==3 || len==2) {
r = 1;
lua_rawgeti(L,-1,1);
diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c
index 21451602f8b..5a7ea253be8 100644
--- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c
+++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.c
@@ -192,9 +192,9 @@ void ext_post_line_break(boolean d,
assert(vlink(r) == q);
/* |r| refers to the node after which the dir nodes should be closed */
} else if (type(r) == disc_node) {
- halfword a = alink(r);
+ halfword a = alink(r), v;
assert(a != null);
- halfword v = vlink(r);
+ v = vlink(r);
if (v == null) { /* nested disc, let's unfold */
fprintf(stderr, "Nested disc [%d]<-[%d]->null\n", (int) a,
(int) r);
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.c b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
index bb477e54ffb..2ba5488952f 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
@@ -569,12 +569,13 @@ static void do_free_error(halfword p)
"but could also point to a bug in the executable. It should be safe to continue.",
NULL
};
+ halfword r;
check_node_mem();
if (free_error_seen)
return;
- halfword r = null;
+ r = null;
free_error_seen = 1;
if (type(p) == glyph_node) {
snprintf(errstr, 255,