summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshmuz <shmuz>2010-01-19 08:58:25 +0000
committershmuz <shmuz>2010-01-19 08:58:25 +0000
commit9983df8800cead2b4dc05563f4ab7d5087691df5 (patch)
treef4aba6b4d21338e50b202e18b27ae2cbb6a1b622 /src
parent83bbc169065a85e179d5419f31dfdba3dcf6c581 (diff)
downloadlrexlib-9983df8800cead2b4dc05563f4ab7d5087691df5.tar.gz
several files: luaL_typerror renamed to luaL_typeerror (as in Lua 5.2).
common.h: added a macro for handling luaL_typeerror and luaL_typerror.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/algo.h9
-rwxr-xr-xsrc/common.h4
-rwxr-xr-xsrc/oniguruma/lonig.c3
-rwxr-xr-xsrc/pcre/lpcre.c3
4 files changed, 10 insertions, 9 deletions
diff --git a/src/algo.h b/src/algo.h
index f36168a..fb8b479 100755
--- a/src/algo.h
+++ b/src/algo.h
@@ -66,7 +66,7 @@ static int OptLimit (lua_State *L, int pos) {
int a = lua_tointeger (L, pos);
return a < 0 ? 0 : a;
}
- return luaL_typerror (L, pos, "number or function");
+ return luaL_typeerror (L, pos, "number or function");
}
@@ -99,7 +99,7 @@ static TUserdata* test_ud (lua_State *L, int pos)
static TUserdata* check_ud (lua_State *L)
{
TUserdata *ud = test_ud(L, 1);
- if (ud == NULL) luaL_typerror(L, 1, REX_TYPENAME);
+ if (ud == NULL) luaL_typeerror(L, 1, REX_TYPENAME);
return ud;
}
@@ -111,7 +111,7 @@ static void check_pattern (lua_State *L, int pos, TArgComp *argC)
argC->ud = NULL;
}
else if ((argC->ud = test_ud (L, pos)) == NULL)
- luaL_typerror(L, pos, "string or "REX_TYPENAME);
+ luaL_typeerror(L, pos, "string or "REX_TYPENAME);
}
static void checkarg_new (lua_State *L, TArgComp *argC) {
@@ -130,7 +130,7 @@ static void checkarg_gsub (lua_State *L, TArgComp *argC, TArgExec *argE) {
argE->reptype = lua_type (L, 3);
if (argE->reptype != LUA_TSTRING && argE->reptype != LUA_TTABLE &&
argE->reptype != LUA_TFUNCTION) {
- luaL_typerror (L, 3, "string, table or function");
+ luaL_typeerror (L, 3, "string, table or function");
}
argE->funcpos = 3;
argE->funcpos2 = 4;
@@ -704,4 +704,3 @@ found:
lua_pushinteger (L, from - text + patlen);
return 2;
}
-
diff --git a/src/common.h b/src/common.h
index 06d9856..f492af8 100755
--- a/src/common.h
+++ b/src/common.h
@@ -6,6 +6,10 @@
#include "lua.h"
+#if LUA_VERSION_NUM < 502
+#define luaL_typeerror luaL_typerror
+#endif
+
/* REX_API can be overridden from the command line or Makefile */
#ifndef REX_API
# define REX_API LUALIB_API
diff --git a/src/oniguruma/lonig.c b/src/oniguruma/lonig.c
index 62123a4..d80c46a 100755
--- a/src/oniguruma/lonig.c
+++ b/src/oniguruma/lonig.c
@@ -98,7 +98,7 @@ static int getcflags (lua_State *L, int pos) {
return res;
}
default:
- return luaL_typerror (L, pos, "number or string");
+ return luaL_typeerror (L, pos, "number or string");
}
}
@@ -365,4 +365,3 @@ REX_API int REX_OPENLIB (lua_State *L) {
return 1;
}
-
diff --git a/src/pcre/lpcre.c b/src/pcre/lpcre.c
index 1f3ff50..c2162f6 100755
--- a/src/pcre/lpcre.c
+++ b/src/pcre/lpcre.c
@@ -113,7 +113,7 @@ static int getcflags (lua_State *L, int pos) {
return res;
}
default:
- return luaL_typerror (L, pos, "number or string");
+ return luaL_typeerror (L, pos, "number or string");
}
}
@@ -436,4 +436,3 @@ REX_API int REX_OPENLIB (lua_State *L) {
return 1;
}
-