Insert come casts to allow C++ compilation

This commit is contained in:
Shmuel Zeigerman
2015-06-21 15:44:44 +03:00
parent b12cf4e2c7
commit 0a49849394
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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
View File
@@ -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");
+2 -2
View File
@@ -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
View File
@@ -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);
}
}
}