From aef0374ed8ffd6b7e1fddfa1229f289c7c700638 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 17 Mar 2019 23:12:08 -0400 Subject: [PATCH] fix warnings and 64bit problems --- desmume/src/lua-engine.cpp | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/desmume/src/lua-engine.cpp b/desmume/src/lua-engine.cpp index e10959ecf..cd2cb6afd 100644 --- a/desmume/src/lua-engine.cpp +++ b/desmume/src/lua-engine.cpp @@ -151,7 +151,7 @@ struct LuaContextInfo { void(*onstop)(int uid, bool statusOK); }; std::map luaContextInfo; -std::map luaStateToUIDMap; +std::map luaStateToUIDMap; int g_numScriptsStarted = 0; bool g_anyScriptsHighSpeed = false; bool g_stopAllScriptsEnabled = true; @@ -505,7 +505,7 @@ static int doPopup(lua_State* L, const char* deftype, const char* deficon) static const int etypes [] = {MB_OK, MB_YESNO, MB_YESNOCANCEL, MB_OKCANCEL, MB_ABORTRETRYIGNORE}; static const int eicons [] = {MB_ICONINFORMATION, MB_ICONQUESTION, MB_ICONWARNING, MB_ICONERROR}; // DialogsOpen++; - int uid = luaStateToUIDMap[L->l_G->mainthread]; + uintptr_t uid = luaStateToUIDMap[L->l_G->mainthread]; EnableWindow(MainWindow->getHWnd(), false); // if (Full_Screen) // { @@ -1437,7 +1437,7 @@ void indicateBusy(lua_State* L, bool busy) } */ #if defined(_WIN32) - int uid = luaStateToUIDMap[L->l_G->mainthread]; + uintptr_t uid = luaStateToUIDMap[L->l_G->mainthread]; HWND hDlg = (HWND)uid; char str [1024]; GetWindowText(hDlg, str, 1000); @@ -2265,7 +2265,7 @@ public: { const NDSDisplayInfo &dispInfo = GPU->GetDisplayInfo(); char temp [256]; - sprintf(temp, " " /*"mismatch at "*/ "byte %d(0x%X at 0x%X): %d(0x%X) != %d(0x%X)\n", i, i, dst, *src,*src, *dst,*dst); + sprintf(temp, " " /*"mismatch at "*/ "byte %d(0x%X at %p): %d(0x%X) != %d(0x%X)\n", i, i, dst, *src,*src, *dst,*dst); if(ptr == dispInfo.masterNativeBuffer || ptr == dispInfo.masterCustomBuffer || ptr == GPU->GetEngineMain()->Get3DFramebufferMain()) // ignore screen-only differences since frame skipping can cause them and it's probably ok break; @@ -2485,25 +2485,25 @@ DEFINE_LUA_FUNCTION(joy_peekup, "") static const struct ColorMapping { const char* name; - int value; + s32 value; } s_colorMapping [] = { - {"white", 0xFFFFFFFF}, - {"black", 0x000000FF}, - {"clear", 0x00000000}, - {"gray", 0x7F7F7FFF}, - {"grey", 0x7F7F7FFF}, - {"red", 0xFF0000FF}, - {"orange", 0xFF7F00FF}, - {"yellow", 0xFFFF00FF}, - {"chartreuse",0x7FFF00FF}, - {"green", 0x00FF00FF}, - {"teal", 0x00FF7FFF}, - {"cyan" , 0x00FFFFFF}, - {"blue", 0x0000FFFF}, - {"purple", 0x7F00FFFF}, - {"magenta", 0xFF00FFFF}, + {"white", (s32)0xFFFFFFFF}, + {"black", (s32)0x000000FF}, + {"clear", (s32)0x00000000}, + {"gray", (s32)0x7F7F7FFF}, + {"grey", (s32)0x7F7F7FFF}, + {"red", (s32)0xFF0000FF}, + {"orange", (s32)0xFF7F00FF}, + {"yellow", (s32)0xFFFF00FF}, + {"chartreuse",(s32)0x7FFF00FF}, + {"green", (s32)0x00FF00FF}, + {"teal", (s32)0x00FF7FFF}, + {"cyan" , (s32)0x00FFFFFF}, + {"blue", (s32)0x0000FFFF}, + {"purple", (s32)0x7F00FFFF}, + {"magenta", (s32)0xFF00FFFF}, }; inline int getcolor_unmodified(lua_State *L, int idx, int defaultColor)