Pārlūkot izejas kodu

fix: 修正2个编译警告

Wendal Chen 5 gadi atpakaļ
vecāks
revīzija
0b9b2a8ad8
2 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 2 2
      lua/src/lstrlib.c
  2. 2 1
      luat/modules/luat_main.c

+ 2 - 2
lua/src/lstrlib.c

@@ -1926,7 +1926,7 @@ static int str_fromBase64(lua_State *L) {
   luaL_Buffer buff = {0};
   luaL_buffinitsize(L, &buff, len * 1.5 + 1);
   size_t olen = 0;
-  int re = base64_encode(buff.b, buff.size, &olen, str, len);
+  int re = base64_encode((unsigned char *)buff.b, buff.size, &olen, (const unsigned char * )str, len);
   if (re == 0) {
     luaL_pushresultsize(&buff, olen);
     return 1;
@@ -1952,7 +1952,7 @@ static int str_toBase64(lua_State *L) {
   luaL_Buffer buff = {0};
   luaL_buffinitsize(L, &buff, len + 1);
   size_t olen = 0;
-  int re = base64_decode(buff.b, buff.size, &olen, str, len);
+  int re = base64_decode((unsigned char *)buff.b, buff.size, &olen, (const unsigned char * )str, len);
   if (re == 0) {
     luaL_pushresultsize(&buff, olen);
     return 1;

+ 2 - 1
luat/modules/luat_main.c

@@ -197,7 +197,8 @@ int luat_main (void) {
   check_rollback();
 
   // 4. init Lua State
-  int status, result = 0;
+  int status = 0;
+  int result = 0;
   L = lua_newstate(luat_heap_alloc, NULL);
   if (L == NULL) {
     l_message("LUAVM", "cannot create state: not enough memory\n");