summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lua
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2008-04-28 08:45:24 +0000
committerTaco Hoekwater <taco@elvenkind.com>2008-04-28 08:45:24 +0000
commit5b93d006ed6fa1c5990c7079d92d3b7d195068b0 (patch)
treed2ddf0f582719f4e67e618f99a47fa32db728c27 /Build/source/texk/web2c/luatexdir/lua
parent6b4bb4d5747a2819cb015fcfe7e6a7521580adbb (diff)
Aix compilation fixes a from Vladimir Volovich
git-svn-id: svn://tug.org/texlive/trunk@7695 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/lua')
-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
4 files changed, 15 insertions, 9 deletions
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);