aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/cmd_lua.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/cmd_lua.c')
-rw-r--r--cmd/cmd_lua.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/cmd/cmd_lua.c b/cmd/cmd_lua.c
index 820620f..2c850be 100644
--- a/cmd/cmd_lua.c
+++ b/cmd/cmd_lua.c
@@ -127,28 +127,27 @@ int lua_excute(const char *fname, rpc_call_request *req, rpc_call_response **res
{
int t;
int top = lua_gettop(L);
- int len = lua_rawlen(L,1);
+ //int len = lua_rawlen(L,1);
if (top == 1)
{
t = lua_type(L,1);
if (t == LUA_TTABLE)
{
- int j;
-
- const char *r_result;
- const char *r_error;
+
+ char *r_result; //this care unchangable stupid C dont know what is const
+ char *r_error; //this unchangable stupid C dont know what is const
int r_id;
size_t sz;
- check_table_key_string(L, "result", &r_result, &sz);
+ check_table_key_string(L, "result", (const char **)&r_result, &sz);
//printf("RESULT:%s\n", r_result);
check_table_key_integer(L, "id", &r_id);
//printf("ID:%d\n", r_id);
- check_table_key_string(L, "error", &r_error, &sz);
+ check_table_key_string(L, "error", (const char **)&r_error, &sz);
//printf("ERROR:%s\n", r_error);
@@ -176,12 +175,10 @@ void *cmd_lua(void *data)
char *ret = NULL;
char *req_data = NULL;
int fret;
- int rc;
- int i;
int count;
sds params = sdsempty();
- sds out_result = sdsempty(), out_lua = sdsempty();
+ sds out_result = sdsempty();
sds *tokens;
rpc_call_request *req = NULL;
@@ -202,7 +199,7 @@ void *cmd_lua(void *data)
//prepare request
nb_req = malloc(sizeof(netbyte_store));
nb_init(nb_req);
- nb_load(nb_req, req_data);
+ nb_load(nb_req, (unsigned char *)req_data);
if (nb_req == NULL)
{