summaryrefslogtreecommitdiff
path: root/source/luametatex/source/luaoptional
diff options
context:
space:
mode:
Diffstat (limited to 'source/luametatex/source/luaoptional')
-rw-r--r--source/luametatex/source/luaoptional/lmtcurl.c3
-rw-r--r--source/luametatex/source/luaoptional/lmtforeign.c2
-rw-r--r--source/luametatex/source/luaoptional/lmtgraphicsmagick.c2
-rw-r--r--source/luametatex/source/luaoptional/lmthb.c3
-rw-r--r--source/luametatex/source/luaoptional/lmtlz4.c1
-rw-r--r--source/luametatex/source/luaoptional/lmtlzma.c1
-rw-r--r--source/luametatex/source/luaoptional/lmtlzo.c1
7 files changed, 9 insertions, 4 deletions
diff --git a/source/luametatex/source/luaoptional/lmtcurl.c b/source/luametatex/source/luaoptional/lmtcurl.c
index 6a54174e5..d6a5dcf26 100644
--- a/source/luametatex/source/luaoptional/lmtcurl.c
+++ b/source/luametatex/source/luaoptional/lmtcurl.c
@@ -383,6 +383,7 @@ static int curllib_fetch(lua_State * L)
if (lua_type(L,1) == LUA_TTABLE) {
curl_instance *curl = curllib_state.curl_easy_init();
if (curl) {
+ int result;
luaL_Buffer buffer;
luaL_buffinit(L, &buffer);
curllib_state.curl_easy_setopt(curl, curl_object_base + curl_option_writedata, &buffer);
@@ -422,7 +423,7 @@ static int curllib_fetch(lua_State * L)
}
lua_pop(L, 1); /* removes 'value' and keeps 'key' for next iteration */
}
- int result = curllib_state.curl_easy_perform(curl);
+ result = curllib_state.curl_easy_perform(curl);
if (result) {
lua_pushboolean(L, 0);
lua_pushstring(L, curllib_state.curl_easy_strerror(result));
diff --git a/source/luametatex/source/luaoptional/lmtforeign.c b/source/luametatex/source/luaoptional/lmtforeign.c
index da04eca12..b4cf014a8 100644
--- a/source/luametatex/source/luaoptional/lmtforeign.c
+++ b/source/luametatex/source/luaoptional/lmtforeign.c
@@ -918,7 +918,7 @@ static int foreignlib_function_call(lua_State *L)
case foreign_type_ulong : { unsigned long r; foreign_state.ffi_call(cif, function->function, &r, arguments); lua_pushinteger(L, (unsigned long) r); break; }
case foreign_type_longlong : { long long r; foreign_state.ffi_call(cif, function->function, &r, arguments); lua_pushinteger(L, (lua_Integer) r); break; }
case foreign_type_ulonglong: { unsigned long long r; foreign_state.ffi_call(cif, function->function, &r, arguments); lua_pushinteger(L, (lua_Integer) r); break; }
- case foreign_type_float : { float r; foreign_state.ffi_call(cif, function->function, &r, arguments); lua_pushnumber (L, r); break; }
+ case foreign_type_float : { float r; foreign_state.ffi_call(cif, function->function, &r, arguments); lua_pushnumber (L, (lua_Number) r); break; }
case foreign_type_double : { double r; foreign_state.ffi_call(cif, function->function, &r, arguments); lua_pushnumber (L, r); break; }
case foreign_type_size_t : { size_t r; foreign_state.ffi_call(cif, function->function, &r, arguments); lua_pushinteger(L, r); break; }
case foreign_type_string :
diff --git a/source/luametatex/source/luaoptional/lmtgraphicsmagick.c b/source/luametatex/source/luaoptional/lmtgraphicsmagick.c
index c71c68c8c..51b30a745 100644
--- a/source/luametatex/source/luaoptional/lmtgraphicsmagick.c
+++ b/source/luametatex/source/luaoptional/lmtgraphicsmagick.c
@@ -147,7 +147,7 @@ static int gmlib_execute(lua_State * L)
}
if (lua_getfield(L, -1, "noise" ) == LUA_TTABLE) {
lua_getfield(L, -1, "type");
- gmlib_state.gm_MagickAddNoiseImage(wand, lua_tointeger(L, -1));
+ gmlib_state.gm_MagickAddNoiseImage(wand, lmt_tointeger(L, -1));
lua_pop(L, 2);
} else {
lua_pop(L, 1);
diff --git a/source/luametatex/source/luaoptional/lmthb.c b/source/luametatex/source/luaoptional/lmthb.c
index d853256cf..03c4a1720 100644
--- a/source/luametatex/source/luaoptional/lmthb.c
+++ b/source/luametatex/source/luaoptional/lmthb.c
@@ -3,6 +3,7 @@
*/
# include "luametatex.h"
+# include "lmtoptional.h"
/*tex
@@ -473,9 +474,9 @@ static int hblib_load_font(lua_State * L)
hb_face_t *face = hblib_state.hb_face_create(blob, id);
unsigned int scale = hblib_state.hb_face_get_upem(face);
hb_font_t *font = hblib_state.hb_font_create(face);
+ hblib_data *data = lua_newuserdatauv(L, sizeof(data), 0);
hblib_state.hb_font_set_scale(font, scale, scale);
hblib_state.hb_ot_font_set_funcs(font);
- hblib_data *data = lua_newuserdatauv(L, sizeof(data), 0);
data->font = font;
luaL_getmetatable(L, HBLIB_METATABLE);
lua_setmetatable(L, -2);
diff --git a/source/luametatex/source/luaoptional/lmtlz4.c b/source/luametatex/source/luaoptional/lmtlz4.c
index d54442635..4d4542ac3 100644
--- a/source/luametatex/source/luaoptional/lmtlz4.c
+++ b/source/luametatex/source/luaoptional/lmtlz4.c
@@ -5,6 +5,7 @@
# include <stdlib.h>
# include "luametatex.h"
+# include "lmtoptional.h"
# define LZ4F_VERSION 100 /* used to check for an incompatible API breaking change */
diff --git a/source/luametatex/source/luaoptional/lmtlzma.c b/source/luametatex/source/luaoptional/lmtlzma.c
index 6ffe6fedf..e7b7db5b5 100644
--- a/source/luametatex/source/luaoptional/lmtlzma.c
+++ b/source/luametatex/source/luaoptional/lmtlzma.c
@@ -5,6 +5,7 @@
# include <stdlib.h>
# include "luametatex.h"
+# include "lmtoptional.h"
/*
We only need a few definitions and it's nice that they are already prepared for extensions.
diff --git a/source/luametatex/source/luaoptional/lmtlzo.c b/source/luametatex/source/luaoptional/lmtlzo.c
index 766e824ca..375a54bcb 100644
--- a/source/luametatex/source/luaoptional/lmtlzo.c
+++ b/source/luametatex/source/luaoptional/lmtlzo.c
@@ -5,6 +5,7 @@
# include <stdlib.h>
# include "luametatex.h"
+# include "lmtoptional.h"
# define lzo_output_length(n) (n + n / 16 + 64 + 64) /* we add 64 instead of 3 */