mirror of
https://github.com/vxcontrol/lualibs-lrexlib.git
synced 2026-07-01 09:25:08 -04:00
Insert come casts to allow C++ compilation
This commit is contained in:
+1
-1
@@ -107,7 +107,7 @@ static void check_subject (lua_State *L, int pos, TArgExec *argE)
|
||||
if (type != LUA_TLIGHTUSERDATA)
|
||||
luaL_error (L, "subject's topointer method returned %s (expected lightuserdata)",
|
||||
lua_typename (L, type));
|
||||
argE->text = lua_touserdata (L, -1);
|
||||
argE->text = (const char*) lua_touserdata (L, -1);
|
||||
lua_pop (L, 1);
|
||||
#if LUA_VERSION_NUM == 501
|
||||
if (luaL_callmeta (L, pos, "__len")) {
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ void freelist_free (TFreeList *fl) {
|
||||
enum { ID_NUMBER, ID_STRING };
|
||||
|
||||
void buffer_init (TBuffer *buf, size_t sz, lua_State *L, TFreeList *fl) {
|
||||
buf->arr = Lmalloc(L, sz);
|
||||
buf->arr = (char*) Lmalloc(L, sz);
|
||||
if (!buf->arr) {
|
||||
freelist_free (fl);
|
||||
luaL_error (L, "malloc failed");
|
||||
|
||||
@@ -102,7 +102,7 @@ static int getcflags (lua_State *L, int pos) {
|
||||
|
||||
static int generate_error (lua_State *L, const TOnig *ud, int errcode) {
|
||||
char buf [ONIG_MAX_ERROR_MESSAGE_LEN];
|
||||
onig_error_code_to_str(buf, errcode, &ud->einfo);
|
||||
onig_error_code_to_str((unsigned char*) buf, errcode, &ud->einfo);
|
||||
return luaL_error(L, buf);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ static void checkarg_compile (lua_State *L, int pos, TArgComp *argC) {
|
||||
*/
|
||||
static int LOnig_setdefaultsyntax (lua_State *L) {
|
||||
(void)luaL_checkstring(L, 1);
|
||||
onig_set_default_syntax(getsyntax(L, 1));
|
||||
onig_set_default_syntax((OnigSyntaxType*) getsyntax(L, 1));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ static void checkarg_compile (lua_State *L, int pos, TArgComp *argC) {
|
||||
argC->locale = lua_tostring (L, pos);
|
||||
else {
|
||||
argC->tablespos = pos;
|
||||
argC->tables = *check_chartables (L, pos);
|
||||
argC->tables = (const unsigned char*) *check_chartables (L, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user