summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/lua/limglib.c
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/limglib.c
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/limglib.c')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/limglib.c15
1 files changed, 10 insertions, 5 deletions
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);