Skip to content
Snippets Groups Projects
Commit 55827a01 authored by Luigi Scarso's avatar Luigi Scarso
Browse files

zip tointeger instead of tonumber (lua 5.3) (HH) -- trunk

parent df969161
No related branches found
No related tags found
No related merge requests found
#define luatex_svn_revision 7106 #define luatex_svn_revision 7108
...@@ -29,7 +29,7 @@ static int pushresult (lua_State *L, int i, const char *filename) { ...@@ -29,7 +29,7 @@ static int pushresult (lua_State *L, int i, const char *filename) {
lua_pushfstring(L, "%s: %s", filename, zzip_strerror(zzip_errno(errno))); lua_pushfstring(L, "%s: %s", filename, zzip_strerror(zzip_errno(errno)));
else else
lua_pushfstring(L, "%s", zzip_strerror(zzip_errno(errno))); lua_pushfstring(L, "%s", zzip_strerror(zzip_errno(errno)));
lua_pushnumber(L, zzip_errno(errno)); lua_pushinteger(L, zzip_errno(errno));
return 3; return 3;
} }
} }
...@@ -150,7 +150,7 @@ static int zip_openfile (lua_State *L) { ...@@ -150,7 +150,7 @@ static int zip_openfile (lua_State *L) {
/* replaces the string by the table with the string inside */ /* replaces the string by the table with the string inside */
lua_replace(L, 2); lua_replace(L, 2);
} }
if (lua_istable(L, 2)) if (lua_istable(L, 2))
{ {
int i, m, n; int i, m, n;
...@@ -248,9 +248,9 @@ static int zip_readfile (lua_State *L) { ...@@ -248,9 +248,9 @@ static int zip_readfile (lua_State *L) {
return 0; return 0;
lua_newtable(L); lua_newtable(L);
lua_pushstring(L, "compressed_size"); lua_pushnumber(L, ent->d_csize); lua_settable(L, -3); lua_pushstring(L, "compressed_size"); lua_pushinteger(L, ent->d_csize); lua_settable(L, -3);
lua_pushstring(L, "compression_method"); lua_pushnumber(L, ent->d_compr); lua_settable(L, -3); lua_pushstring(L, "compression_method"); lua_pushinteger(L, ent->d_compr); lua_settable(L, -3);
lua_pushstring(L, "uncompressed_size"); lua_pushnumber(L, ent->st_size); lua_settable(L, -3); lua_pushstring(L, "uncompressed_size"); lua_pushinteger(L, ent->st_size); lua_settable(L, -3);
lua_pushstring(L, "filename"); lua_pushstring(L, ent->d_name); lua_settable(L, -3); lua_pushstring(L, "filename"); lua_pushstring(L, ent->d_name); lua_settable(L, -3);
return 1; return 1;
...@@ -321,7 +321,7 @@ static int zzip_fscanf (ZZIP_FILE *f, const char *format, ...) ...@@ -321,7 +321,7 @@ static int zzip_fscanf (ZZIP_FILE *f, const char *format, ...)
static int read_number (lua_State *L, ZZIP_FILE *f) { static int read_number (lua_State *L, ZZIP_FILE *f) {
lua_Number d; lua_Number d;
if (zzip_fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { if (zzip_fscanf(f, LUA_NUMBER_SCAN, &d) == 1) {
lua_pushnumber(L, d); lua_pushinteger(L, d);
return 1; return 1;
} }
else return 0; // read fails else return 0; // read fails
...@@ -459,7 +459,7 @@ static int ff_seek (lua_State *L) { ...@@ -459,7 +459,7 @@ static int ff_seek (lua_State *L) {
if (op < 0) if (op < 0)
return pushresult(L, 0, NULL); /* error */ return pushresult(L, 0, NULL); /* error */
else { else {
lua_pushnumber(L, zzip_tell(f)); lua_pushinteger(L, zzip_tell(f));
return 1; return 1;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment