ソースを参照

Fix Win64 type conversion warnings

bel2125 8 年 前
コミット
ec7f68a2e2
2 ファイル変更5 行追加5 行削除
  1. 1 1
      src/mod_lua.inl
  2. 4 4
      src/third_party/LuaXML_lib.c

+ 1 - 1
src/mod_lua.inl

@@ -785,7 +785,7 @@ lsp_url_decode(lua_State *L)
 		text = lua_tolstring(L, 1, &text_len);
 		is_form = (num_args == 2) ? lua_isboolean(L, 2) : 0;
 		if (text) {
-			mg_url_decode(text, text_len, dst, (int)sizeof(dst), is_form);
+			mg_url_decode(text, (int)text_len, dst, (int)sizeof(dst), is_form);
 			lua_pushstring(L, dst);
 		} else {
 			lua_pushnil(L);

+ 4 - 4
src/third_party/LuaXML_lib.c

@@ -304,11 +304,11 @@ int Xml_eval(lua_State *L) {
 
     while((token=Tokenizer_next(tok))!=0) if(token[0]==OPN) { // new tag found
         if(lua_gettop(L)) {
-            int newIndex=lua_rawlen(L,-1)+1;
-            lua_pushnumber(L,newIndex);
+            size_t newIndex=lua_rawlen(L,-1)+1;
+            lua_pushnumber(L, (lua_Number)newIndex);
             lua_newtable(L);
             lua_settable(L, -3);
-            lua_pushnumber(L,newIndex);
+            lua_pushnumber(L, (lua_Number)newIndex);
             lua_gettable(L,-2);
         }
         else {
@@ -360,7 +360,7 @@ int Xml_eval(lua_State *L) {
         else break;
     }
     else { // read elements
-        lua_pushnumber(L,lua_rawlen(L,-1)+1);
+        lua_pushnumber(L,(lua_Number)lua_rawlen(L,-1)+1);
         Xml_pushDecode(L, token, 0);
         lua_settable(L, -3);
     }