diff --git a/Core/GameEngine/Include/Common/MapObject.h b/Core/GameEngine/Include/Common/MapObject.h index 0ef54835bbd..98add154627 100644 --- a/Core/GameEngine/Include/Common/MapObject.h +++ b/Core/GameEngine/Include/Common/MapObject.h @@ -105,6 +105,7 @@ class MapObject : public MemoryPoolObject Shadow* m_shadowObj; ///< object that renders shadow in the 3d scene. RenderObjClass* m_bridgeTowers[ BRIDGE_MAX_TOWERS ]; ///< for bridge towers Int m_runtimeFlags; + DrawableID m_treeID; ///< tree buffer id, unique per object. public: static MapObject *TheMapObjectListPtr; @@ -153,6 +154,7 @@ class MapObject : public MemoryPoolObject RenderObjClass *getRenderObj() const {return m_renderObj;} void setShadowObj(Shadow *pObj) {m_shadowObj=pObj;} Shadow *getShadowObj() const {return m_shadowObj;} + DrawableID getTreeID() const {return m_treeID;} RenderObjClass* getBridgeRenderObject( BridgeTowerType type ); void setBridgeRenderObject( BridgeTowerType type, RenderObjClass* renderObj ); diff --git a/Core/GameEngine/Include/GameClient/GameWindow.h b/Core/GameEngine/Include/GameClient/GameWindow.h index e96c94c96a0..1736f844c89 100644 --- a/Core/GameEngine/Include/GameClient/GameWindow.h +++ b/Core/GameEngine/Include/GameClient/GameWindow.h @@ -73,7 +73,7 @@ enum { WIN_COLOR_UNDEFINED = GAME_COLOR_UNDEFINED }; // WindowMsgData -------------------------------------------------------------- //----------------------------------------------------------------------------- -typedef UnsignedInt WindowMsgData; +typedef uintptr_t WindowMsgData; //----------------------------------------------------------------------------- enum WindowMsgHandledType CPP_11(: Int) { MSG_IGNORED, MSG_HANDLED }; diff --git a/Core/GameEngine/Include/GameClient/WindowVideoManager.h b/Core/GameEngine/Include/GameClient/WindowVideoManager.h index 6ad24e71002..e0f02d458d0 100644 --- a/Core/GameEngine/Include/GameClient/WindowVideoManager.h +++ b/Core/GameEngine/Include/GameClient/WindowVideoManager.h @@ -149,7 +149,7 @@ class WindowVideoManager : public SubsystemInterface size_t operator()(ConstGameWindowPtr p) const { std::hash hasher; - return hasher((UnsignedInt)p); + return hasher((UnsignedInt)(uintptr_t)p); } }; diff --git a/Core/GameEngine/Source/Common/INI/INI.cpp b/Core/GameEngine/Source/Common/INI/INI.cpp index a30d5b03cfe..4aabc102b38 100644 --- a/Core/GameEngine/Source/Common/INI/INI.cpp +++ b/Core/GameEngine/Source/Common/INI/INI.cpp @@ -654,7 +654,7 @@ void INI::parseBool( INI* ini, void * /*instance*/, void *store, const void* /*u void INI::parseBitInInt32( INI *ini, void *instance, void *store, const void* userData ) { UnsignedInt* s = (UnsignedInt*)store; - UnsignedInt mask = (UnsignedInt)userData; + UnsignedInt mask = (UnsignedInt)(uintptr_t)userData; if (INI::scanBool(ini->getNextToken())) *s |= mask; diff --git a/Core/GameEngine/Source/Common/Thing/ThingTemplate.cpp b/Core/GameEngine/Source/Common/Thing/ThingTemplate.cpp index 5369206b853..ddbe5799459 100644 --- a/Core/GameEngine/Source/Common/Thing/ThingTemplate.cpp +++ b/Core/GameEngine/Source/Common/Thing/ThingTemplate.cpp @@ -535,7 +535,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const { ThingTemplate* self = (ThingTemplate*)instance; ModuleInfo* mi = (ModuleInfo*)store; - ModuleType type = (ModuleType)(UnsignedInt)userData; + ModuleType type = (ModuleType)(UnsignedInt)(uintptr_t)userData; const char* token = ini->getNextToken(); AsciiString tokenStr = token; @@ -642,7 +642,7 @@ void ThingTemplate::parseModuleName(INI* ini, void *instance, void* store, const //------------------------------------------------------------------------------------------------- void ThingTemplate::parseIntList(INI* ini, void *instance, void* store, const void* userData) { - Int numberEntries = (Int)userData; + Int numberEntries = (Int)(intptr_t)userData; Int *intList = (Int*)store; for( Int intIndex = 0; intIndex < numberEntries; intIndex ++ ) diff --git a/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 5fb60f70a6d..16733c10ee2 100644 --- a/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -823,7 +823,7 @@ void CommandSet::parseCommandButton( INI* ini, void *instance, void *store, cons // get the index to store the command at, and the command array itself const CommandButton **buttonArray = (const CommandButton **)store; - Int buttonIndex = (Int)userData; + Int buttonIndex = (Int)(intptr_t)userData; // sanity DEBUG_ASSERTCRASH( buttonIndex < MAX_COMMANDS_PER_SET, ("parseCommandButton: button index '%d' out of range", diff --git a/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp index 8688129b035..79bdb95dda9 100644 --- a/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/Gadget/GadgetListBox.cpp @@ -1792,7 +1792,7 @@ WindowMsgHandledType GadgetListBoxSystem( GameWindow *window, UnsignedInt msg, { if( list->multiSelect ) - *(Int*)mData2 = (Int)list->selections; + *(Int**)mData2 = list->selections; else *(Int*)mData2 = list->selectPos; diff --git a/Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp b/Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp index 14758af19c1..4f44f663a18 100644 --- a/Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/IMEManager.cpp @@ -1438,7 +1438,7 @@ void IMEManager::updateCandidateList( Int candidateFlags ) for( i=0; i < m_candidateCount; i++ ) { - Char *string = (Char*) ((UnsignedInt) clist + (UnsignedInt) clist->dwOffset[i]); + Char *string = (Char*) ((UnsignedByte*) clist + clist->dwOffset[i]); if ( unicode ) { m_candidateString[i].set( (WideChar *) string); diff --git a/Core/GameEngine/Source/GameClient/Input/Keyboard.cpp b/Core/GameEngine/Source/GameClient/Input/Keyboard.cpp index 2afe7c62c17..0e0eaf4925c 100644 --- a/Core/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/Core/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -341,7 +341,7 @@ void Keyboard::initKeyNames() HKL kLayout = GetKeyboardLayout(0); - Int low = (UnsignedInt)kLayout & 0xFFFF; + Int low = (UnsignedInt)(uintptr_t)kLayout & 0xFFFF; LanguageID currentLanguage = OurLanguage; if(low == 0x040c || low == 0x080c || diff --git a/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp b/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp index d94329011eb..7dc6ff90448 100644 --- a/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp +++ b/Core/GameEngine/Source/GameNetwork/FirewallHelper.cpp @@ -689,7 +689,6 @@ Bool FirewallHelperClass::detectionBeginUpdate() { if (!found) { Int m = m_numManglers++; memcpy(&mangler_addresses[m][0], &host_info->h_addr_list[0][0], 4); - ntohl((UnsignedInt)mangler_addresses[m]); DEBUG_LOG(("Found mangler address at %d.%d.%d.%d", mangler_addresses[m][0], mangler_addresses[m][1], mangler_addresses[m][2], mangler_addresses[m][3])); } diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index 6a73ace1b46..e20f1c1a256 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -209,7 +209,7 @@ static void gameTooltip(GameWindow *window, return; } - Int gameID = (Int)GadgetListBoxGetItemData(window, row, 0); + Int gameID = (Int)(intptr_t)GadgetListBoxGetItemData(window, row, 0); GameSpyStagingRoom *room = TheGameSpyInfo->findStagingRoomByID(gameID); if (!room) { @@ -696,7 +696,7 @@ void RefreshGameListBox( GameWindow *win, Bool showMap ) GadgetListBoxGetSelected(win, &selectedIndex); if (selectedIndex != -1 ) { - selectedID = (Int)GadgetListBoxGetItemData(win, selectedIndex); + selectedID = (Int)(intptr_t)GadgetListBoxGetItemData(win, selectedIndex); } int prevPos = GadgetListBoxGetTopVisibleEntry( win ); @@ -887,7 +887,7 @@ void playerTemplateComboBoxTooltip(GameWindow *wndComboBox, WinInstanceData *ins { Int index = 0; GadgetComboBoxGetSelectedPos(wndComboBox, &index); - Int templateNum = (Int)GadgetComboBoxGetItemData(wndComboBox, index); + Int templateNum = (Int)(intptr_t)GadgetComboBoxGetItemData(wndComboBox, index); UnicodeString ustringTooltip; if (templateNum == -1) { @@ -918,7 +918,7 @@ void playerTemplateListBoxTooltip(GameWindow *wndListBox, WinInstanceData *instD if (row == -1 || col == -1) return; - Int templateNum = (Int)GadgetListBoxGetItemData(wndListBox, row, col); + Int templateNum = (Int)(intptr_t)GadgetListBoxGetItemData(wndListBox, row, col); UnicodeString ustringTooltip; if (templateNum == -1) { diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp index f35a947ae0e..4970fa77c66 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/MainMenuUtils.cpp @@ -309,7 +309,7 @@ static void queuePatch(Bool mandatory, AsciiString downloadURL) static GHTTPBool motdCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - Int run = (Int)param; + Int run = (Int)(intptr_t)param; if (run != timeThroughOnline) { DEBUG_CRASH(("Old callback being called!")); @@ -344,7 +344,7 @@ static GHTTPBool motdCallback( GHTTPRequest request, GHTTPResult result, static GHTTPBool configCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - Int run = (Int)param; + Int run = (Int)(intptr_t)param; if (run != timeThroughOnline) { DEBUG_CRASH(("Old callback being called!")); @@ -406,7 +406,7 @@ static GHTTPBool configCallback( GHTTPRequest request, GHTTPResult result, static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - Int run = (Int)param; + Int run = (Int)(intptr_t)param; if (run != timeThroughOnline) { DEBUG_CRASH(("Old callback being called!")); @@ -490,7 +490,7 @@ static GHTTPBool configHeadCallback( GHTTPRequest request, GHTTPResult result, static GHTTPBool gamePatchCheckCallback( GHTTPRequest request, GHTTPResult result, char * buffer, GHTTPByteCount bufferLen, void * param ) { - Int run = (Int)param; + Int run = (Int)(intptr_t)param; if (run != timeThroughOnline) { DEBUG_CRASH(("Old callback being called!")); diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp index fb8f1b88d08..71ee39949fa 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/Thread/BuddyThread.cpp @@ -125,7 +125,7 @@ enum CallbackType void callbackWrapper( GPConnection *con, void *arg, void *param ) { - CallbackType info = (CallbackType)(Int)param; + CallbackType info = (CallbackType)(Int)(intptr_t)param; BuddyThreadClass *thread = MESSAGE_QUEUE->getThread() ? MESSAGE_QUEUE->getThread() : nullptr /*(TheGameSpyBuddyMessageQueue)?TheGameSpyBuddyMessageQueue->getThread():nullptr*/; if (!thread) return; diff --git a/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp b/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp index a1ecfbb3238..d55fbd0ab55 100644 --- a/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp +++ b/Core/GameEngine/Source/GameNetwork/LANAPICallbacks.cpp @@ -645,7 +645,7 @@ void LANAPI::OnPlayerList( LANPlayer *playerList ) GadgetListBoxGetSelected(listboxPlayers, &selectedIndex); if (selectedIndex != -1 ) - selectedIP = (UnsignedInt) GadgetListBoxGetItemData(listboxPlayers, selectedIndex, 0); + selectedIP = (UnsignedInt)(uintptr_t)GadgetListBoxGetItemData(listboxPlayers, selectedIndex, 0); GadgetListBoxReset(listboxPlayers); diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp index 6a98dd58398..b690cf828ba 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp @@ -1233,7 +1233,7 @@ enum AnimParseType CPP_11(: Int) //------------------------------------------------------------------------------------------------- static void parseAnimation(INI* ini, void *instance, void * /*store*/, const void* userData) { - AnimParseType animType = (AnimParseType)(UnsignedInt)userData; + AnimParseType animType = (AnimParseType)(UnsignedInt)(uintptr_t)userData; AsciiString animName = ini->getNextAsciiString(); animName.toLower(); @@ -1447,7 +1447,7 @@ void W3DModelDrawModuleData::parseConditionState(INI* ini, void *instance, void ModelConditionInfo info; W3DModelDrawModuleData* self = (W3DModelDrawModuleData*)instance; - ParseCondStateType cst = (ParseCondStateType)(UnsignedInt)userData; + ParseCondStateType cst = (ParseCondStateType)(UnsignedInt)(uintptr_t)userData; switch (cst) { case PARSE_DEFAULT: diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp index 39c989c585d..6fc0e85a678 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/GUI/Gadget/W3DProgressBar.cpp @@ -76,7 +76,7 @@ void W3DGadgetProgressBarDraw( GameWindow *window, WinInstanceData *instData ) { ICoord2D origin, size, start, end; Color backColor, backBorder, barColor, barBorder; - Int progress = (Int)window->winGetUserData(); + Int progress = (Int)(intptr_t)window->winGetUserData(); // get window size and position window->winGetScreenPosition( &origin.x, &origin.y ); @@ -186,7 +186,7 @@ void W3DGadgetProgressBarImageDrawA( GameWindow *window, WinInstanceData *instDa { ICoord2D origin, size; const Image *barCenter, *barRight, *left, *right, *center; - Int progress = (Int)window->winGetUserData(); + Int progress = (Int)(intptr_t)window->winGetUserData(); Int xOffset, yOffset; Int i; // get window size and position @@ -229,7 +229,7 @@ void W3DGadgetProgressBarImageDraw( GameWindow *window, WinInstanceData *instDat ICoord2D origin, size, start, end; const Image *backLeft, *backRight, *backCenter, *barRight, *barCenter;//*backSmallCenter,*barLeft,, *barSmallCenter; - Int progress = (Int)window->winGetUserData(); + Int progress = (Int)(intptr_t)window->winGetUserData(); Int xOffset, yOffset; Int i; diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index c12e28b0db9..ffb3b648927 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -82,6 +82,7 @@ class GDIFileStream : public InputStream /* ********* MapObject class ****************************/ /*static*/ MapObject *MapObject::TheMapObjectListPtr = nullptr; /*static*/ Dict MapObject::TheWorldDict; +static Int s_nextTreeID = INVALID_DRAWABLE_ID; MapObject::MapObject(Coord3D loc, AsciiString name, Real angle, Int flags, const Dict* props, const ThingTemplate *thingTemplate ) @@ -96,6 +97,7 @@ MapObject::MapObject(Coord3D loc, AsciiString name, Real angle, Int flags, const m_renderObj = nullptr; m_shadowObj = nullptr; m_runtimeFlags = 0; + m_treeID = (DrawableID)++s_nextTreeID; // Note - do NOT set TheKey_objectSelectable on creation - allow it to follow the .ini value unless specified by user action. jba. [3/20/2003] if (props) { diff --git a/Core/Libraries/Source/Compression/EAC/huffencode.cpp b/Core/Libraries/Source/Compression/EAC/huffencode.cpp index 65513daeda7..c19568fd98e 100644 --- a/Core/Libraries/Source/Compression/EAC/huffencode.cpp +++ b/Core/Libraries/Source/Compression/EAC/huffencode.cpp @@ -1050,8 +1050,8 @@ static void HUFF_pack(struct HuffEncodeContext *EC, if (!i3) HUFF_writecode(EC,dest,i); - if (((long) bptr1- (long) EC->buffer) >= (long)(EC->plen+curpc)) - curpc = (long) bptr1 - (long) EC->buffer - EC->plen; + if ((long)(bptr1 - EC->buffer) >= (long)(EC->plen+curpc)) + curpc = (long)(bptr1 - EC->buffer) - EC->plen; } /* write EOF ([clue] 0gn [10]) */ diff --git a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp index 180e3aa03e0..bb5a8c63aeb 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/dx8webbrowser.cpp @@ -193,7 +193,7 @@ void DX8WebBrowser::CreateBrowser(const char* browsername, const char* url, int if(pBrowser) { _bstr_t brsname(browsername); - pBrowser->CreateBrowser(brsname, _bstr_t(url), reinterpret_cast(hWnd), x, y, w, h, options, gamedispatch); + pBrowser->CreateBrowser(brsname, _bstr_t(url), (long)(intptr_t)hWnd, x, y, w, h, options, gamedispatch); pBrowser->SetUpdateRate(brsname, updateticks); } } diff --git a/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp index 2de64d69a39..042a7486f31 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/surfaceclass.cpp @@ -575,7 +575,7 @@ void SurfaceClass::FindBB(Vector2i *min,Vector2i*max) for (x = min->I; x < max->I; x++) { // HY - this is not endian safe - unsigned char *alpha=(unsigned char*) ((unsigned int)lock_rect.pBits+(y-min->J)*lock_rect.Pitch+(x-min->I)*size); + unsigned char *alpha=(unsigned char*) ((uintptr_t)lock_rect.pBits+(y-min->J)*lock_rect.Pitch+(x-min->I)*size); unsigned char myalpha=alpha[size-1]; myalpha=(myalpha>>(8-alphabits)) & mask; if (myalpha) { @@ -649,7 +649,7 @@ bool SurfaceClass::Is_Transparent_Column(unsigned int column) for (y = 0; y < (int) sd.Height; y++) { // HY - this is not endian safe - unsigned char *alpha=(unsigned char*) ((unsigned int)lock_rect.pBits+y*lock_rect.Pitch); + unsigned char *alpha=(unsigned char*) ((uintptr_t)lock_rect.pBits+y*lock_rect.Pitch); unsigned char myalpha=alpha[size-1]; myalpha=(myalpha>>(8-alphabits)) & mask; if (myalpha) { diff --git a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp index db4b3447f8d..3ab15c57f94 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/Except.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/Except.cpp @@ -355,13 +355,13 @@ void Dump_Exception_Info(EXCEPTION_POINTERS *e_info) if (imagehelp != nullptr) { DebugString ("Exception Handler: Found IMAGEHLP.DLL - linking to required functions\n"); char const *function_name = nullptr; - unsigned long *fptr = (unsigned long*) &_SymCleanup; + uintptr_t *fptr = (uintptr_t*) &_SymCleanup; int count = 0; do { function_name = ImagehelpFunctionNames[count]; if (function_name) { - *fptr = (unsigned long) GetProcAddress(imagehelp, function_name); + *fptr = (uintptr_t) GetProcAddress(imagehelp, function_name); fptr++; count++; } @@ -1065,13 +1065,13 @@ void Load_Image_Helper() if (ImageHelp != nullptr) { char const *function_name = nullptr; - unsigned long *fptr = (unsigned long *) &_SymCleanup; + uintptr_t *fptr = (uintptr_t *) &_SymCleanup; int count = 0; do { function_name = ImagehelpFunctionNames[count]; if (function_name) { - *fptr = (unsigned long) GetProcAddress(ImageHelp, function_name); + *fptr = (uintptr_t) GetProcAddress(ImageHelp, function_name); fptr++; count++; } diff --git a/Core/Libraries/Source/WWVegas/WWLib/verchk.cpp b/Core/Libraries/Source/WWVegas/WWLib/verchk.cpp index b555c48bbcf..8f181028da3 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/verchk.cpp +++ b/Core/Libraries/Source/WWVegas/WWLib/verchk.cpp @@ -227,7 +227,7 @@ Get_Image_File_Header (HINSTANCE app_instance, IMAGE_FILE_HEADER *file_header) // //////////////////////////////////////////////////////////////////////// int -Compare_EXE_Version (int app_instance, const char *filename) +Compare_EXE_Version (HINSTANCE app_instance, const char *filename) { int retval = 0; @@ -236,7 +236,7 @@ Compare_EXE_Version (int app_instance, const char *filename) // IMAGE_FILE_HEADER header1 = { 0 }; IMAGE_FILE_HEADER header2 = { 0 }; - if ( ::Get_Image_File_Header ((HINSTANCE)app_instance, &header1) && + if ( ::Get_Image_File_Header (app_instance, &header1) && ::Get_Image_File_Header (filename, &header2)) { retval = int(header1.TimeDateStamp - header2.TimeDateStamp); diff --git a/Core/Libraries/Source/WWVegas/WWLib/verchk.h b/Core/Libraries/Source/WWVegas/WWLib/verchk.h index 6f5d492c434..ea21e66c2df 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/verchk.h +++ b/Core/Libraries/Source/WWVegas/WWLib/verchk.h @@ -56,4 +56,4 @@ bool GetFileCreationTime(char* filename, FILETIME* createTime); // older, 0 if they are the same, and +1 if the current process is newer. // //////////////////////////////////////////////////////////////////////// -int Compare_EXE_Version (int app_instance, const char *filename); +int Compare_EXE_Version (HINSTANCE app_instance, const char *filename); diff --git a/Core/Libraries/Source/debug/debug_stack.cpp b/Core/Libraries/Source/debug/debug_stack.cpp index ea21eba807e..44059a3b253 100644 --- a/Core/Libraries/Source/debug/debug_stack.cpp +++ b/Core/Libraries/Source/debug/debug_stack.cpp @@ -46,7 +46,7 @@ static union { #include "debug_stack.inl" }; - unsigned funcPtr[1]; + uintptr_t funcPtr[1]; } gDbg; #undef DBGHELP @@ -89,11 +89,11 @@ static void InitDbghelp() return; // Get function addresses - unsigned *funcptr=gDbg.funcPtr; + uintptr_t *funcptr=gDbg.funcPtr; unsigned k=0; for (;DebughelpFunctionNames[k];++k,++funcptr) { - *funcptr=(unsigned)GetProcAddress(g_dbghelp,DebughelpFunctionNames[k]); + *funcptr=(uintptr_t)GetProcAddress(g_dbghelp,DebughelpFunctionNames[k]); if (!*funcptr) break; } diff --git a/Core/Libraries/Source/profile/profile_funclevel.h b/Core/Libraries/Source/profile/profile_funclevel.h index a153a5f9e28..ab929705103 100644 --- a/Core/Libraries/Source/profile/profile_funclevel.h +++ b/Core/Libraries/Source/profile/profile_funclevel.h @@ -182,7 +182,7 @@ class ProfileFuncLevel */ unsigned GetId() const { - return unsigned(m_threadID); + return unsigned(uintptr_t(m_threadID)); } private: diff --git a/Core/Tools/W3DView/AssetInfo.h b/Core/Tools/W3DView/AssetInfo.h index cc6da52e35e..fefb2caaf05 100644 --- a/Core/Tools/W3DView/AssetInfo.h +++ b/Core/Tools/W3DView/AssetInfo.h @@ -59,7 +59,7 @@ class AssetInfoClass : m_AssetType (TypeUnknown), m_dwUserData (0L) { Initialize (); } - AssetInfoClass (LPCTSTR passet_name, ASSET_TYPE type, RenderObjClass *prender_obj = nullptr, DWORD user_data = 0L) + AssetInfoClass (LPCTSTR passet_name, ASSET_TYPE type, RenderObjClass *prender_obj = nullptr, uintptr_t user_data = 0L) : m_Name (passet_name), m_AssetType (type), m_dwUserData (user_data), @@ -79,14 +79,14 @@ class AssetInfoClass const CString & Get_Hierarchy_Name () const { return m_HierarchyName; } const CString & Get_Original_Name () const { return m_OriginalName; } ASSET_TYPE Get_Type () const { return m_AssetType; } - DWORD Get_User_Number () const { return m_dwUserData; } + uintptr_t Get_User_Number () const { return m_dwUserData; } const CString & Get_User_String () const { return m_UserString; } RenderObjClass * Get_Render_Obj () const { RenderObjClass *ptr = m_pRenderObj.Peek(); if (ptr) ptr->Add_Ref(); return ptr; } RenderObjClass * Peek_Render_Obj () const { return m_pRenderObj.Peek(); } void Set_Name (LPCTSTR pname) { m_Name = pname; } void Set_Hierarchy_Name (LPCTSTR pname) { m_HierarchyName = pname; } void Set_Type (ASSET_TYPE type) { m_AssetType = type; } - void Set_User_Number (DWORD user_data) { m_dwUserData = user_data; } + void Set_User_Number (uintptr_t user_data) { m_dwUserData = user_data; } void Set_User_String (LPCTSTR string) { m_UserString = string; } void Set_Render_Obj (RenderObjClass *pobj) { m_pRenderObj.Assign_Add_Ref (pobj); } @@ -115,6 +115,6 @@ class AssetInfoClass CString m_UserString; CString m_OriginalName; ASSET_TYPE m_AssetType; - DWORD m_dwUserData; + uintptr_t m_dwUserData; RefCountPtr m_pRenderObj; }; diff --git a/Core/Tools/W3DView/ColorBar.cpp b/Core/Tools/W3DView/ColorBar.cpp index e8884de5620..29030af33c9 100644 --- a/Core/Tools/W3DView/ColorBar.cpp +++ b/Core/Tools/W3DView/ColorBar.cpp @@ -229,7 +229,7 @@ fnColorBarProc { // Get the creation information from the window handle ColorBarClass *pwnd = (ColorBarClass *)::GetProp (hwnd, "CLASSPOINTER"); - BOOL created = (BOOL)::GetProp (hwnd, "CREATED"); + BOOL created = (BOOL)(uintptr_t)::GetProp (hwnd, "CREATED"); if (pwnd != nullptr) { pwnd->Detach (); @@ -1796,7 +1796,7 @@ ColorBarClass::Clear_Points () // Set_User_Data // bool -ColorBarClass::Set_User_Data (int index, DWORD data) +ColorBarClass::Set_User_Data (int index, uintptr_t data) { bool retval = false; if ((index >= 0) && (index < m_iColorPoints)) { @@ -1812,10 +1812,10 @@ ColorBarClass::Set_User_Data (int index, DWORD data) // // Get_User_Data // -DWORD +uintptr_t ColorBarClass::Get_User_Data (int index) { - DWORD data = 0; + uintptr_t data = 0; if ((index >= 0) && (index < m_iColorPoints)) { data = m_ColorPoints[index].user_data; } diff --git a/Core/Tools/W3DView/ColorBar.h b/Core/Tools/W3DView/ColorBar.h index 2c6410e7ba3..24c6a1eb35a 100644 --- a/Core/Tools/W3DView/ColorBar.h +++ b/Core/Tools/W3DView/ColorBar.h @@ -137,8 +137,8 @@ class ColorBarClass : public CWnd bool Insert_Point (int index, float position, float red, float green, float blue, DWORD flags = POINT_VISIBLE | POINT_CAN_MOVE); bool Insert_Point (CPoint point, DWORD flags = POINT_VISIBLE | POINT_CAN_MOVE); bool Modify_Point (int index, float position, float red, float green, float blue, DWORD flags = POINT_VISIBLE | POINT_CAN_MOVE); - bool Set_User_Data (int index, DWORD data); - DWORD Get_User_Data (int index); + bool Set_User_Data (int index, uintptr_t data); + uintptr_t Get_User_Data (int index); bool Set_Graph_Percent (int index, float percent); float Get_Graph_Percent (int index); bool Delete_Point (int index); @@ -186,7 +186,7 @@ class ColorBarClass : public CWnd float GreenInc; float BlueInc; - DWORD user_data; + uintptr_t user_data; int flags; } COLOR_POINT; diff --git a/Core/Tools/W3DView/ColorPicker.cpp b/Core/Tools/W3DView/ColorPicker.cpp index a3596a6b42d..0cbc4e8035a 100644 --- a/Core/Tools/W3DView/ColorPicker.cpp +++ b/Core/Tools/W3DView/ColorPicker.cpp @@ -207,7 +207,7 @@ fnColorPickerProc // Get the creation information from the window handle ColorPickerClass *pwnd = (ColorPickerClass *)::GetProp (hwnd, "CLASSPOINTER"); - BOOL created = (BOOL)::GetProp (hwnd, "CREATED"); + BOOL created = (BOOL)(uintptr_t)::GetProp (hwnd, "CREATED"); if (pwnd != nullptr) { pwnd->Detach (); diff --git a/Core/Tools/W3DView/DataTreeView.cpp b/Core/Tools/W3DView/DataTreeView.cpp index 502c892b02f..9515f330252 100644 --- a/Core/Tools/W3DView/DataTreeView.cpp +++ b/Core/Tools/W3DView/DataTreeView.cpp @@ -267,8 +267,8 @@ CDataTreeView::Load_Materials_Into_Tree () // Allocate a new asset information class to associate with this entry ptexture->Add_Ref (); - AssetInfoClass *asset_info = new AssetInfoClass (texture_name, TypeMaterial, nullptr, (DWORD)ptexture); - GetTreeCtrl ().SetItemData (tree_item, (ULONG)asset_info); + AssetInfoClass *asset_info = new AssetInfoClass (texture_name, TypeMaterial, nullptr, (uintptr_t)ptexture); + GetTreeCtrl ().SetItemData (tree_item, (uintptr_t)asset_info); } } } @@ -394,7 +394,7 @@ CDataTreeView::LoadAssetsIntoTree () // Allocate a new asset information class to associate with this entry AssetInfoClass *asset_info = new AssetInfoClass (pszItemName, assetType); - GetTreeCtrl ().SetItemData (hItem, (ULONG)asset_info); + GetTreeCtrl ().SetItemData (hItem, (uintptr_t)asset_info); } } } @@ -472,7 +472,7 @@ CDataTreeView::LoadAnimationsIntoTree () ASSERT (hAnimationNode != nullptr); // Associate the items name with its entry - GetTreeCtrl ().SetItemData (hAnimationNode, (ULONG)new AssetInfoClass (pszAnimName, TypeAnimation)); + GetTreeCtrl ().SetItemData (hAnimationNode, (uintptr_t)new AssetInfoClass (pszAnimName, TypeAnimation)); } } @@ -490,7 +490,7 @@ CDataTreeView::LoadAnimationsIntoTree () ASSERT (hAnimationNode != nullptr); // Associate the items name with its entry - GetTreeCtrl ().SetItemData (hAnimationNode, (ULONG)new AssetInfoClass (pszAnimName, TypeAnimation)); + GetTreeCtrl ().SetItemData (hAnimationNode, (uintptr_t)new AssetInfoClass (pszAnimName, TypeAnimation)); } } @@ -508,7 +508,7 @@ CDataTreeView::LoadAnimationsIntoTree () ASSERT (hAnimationNode != nullptr); // Associate the items name with its entry - GetTreeCtrl ().SetItemData (hAnimationNode, (ULONG)new AssetInfoClass (pszAnimName, TypeAnimation)); + GetTreeCtrl ().SetItemData (hAnimationNode, (uintptr_t)new AssetInfoClass (pszAnimName, TypeAnimation)); } } @@ -568,7 +568,7 @@ CDataTreeView::LoadAnimationsIntoTree (HTREEITEM hItem) ASSERT (hAnimationNode != nullptr); // Associate the items name with its entry - GetTreeCtrl ().SetItemData (hAnimationNode, (ULONG)new AssetInfoClass (pszAnimName, TypeAnimation)); + GetTreeCtrl ().SetItemData (hAnimationNode, (uintptr_t)new AssetInfoClass (pszAnimName, TypeAnimation)); } } @@ -763,7 +763,7 @@ CDataTreeView::Add_Asset_To_Tree // Associate the render object with its entry in the tree AssetInfoClass *asset_info = new AssetInfoClass (name, type); - GetTreeCtrl ().SetItemData (htree_item, (ULONG)asset_info); + GetTreeCtrl ().SetItemData (htree_item, (uintptr_t)asset_info); // Load the object's animations into the tree (if necessary) if (asset_info->Can_Asset_Have_Animations ()) { diff --git a/Core/Tools/W3DView/GraphicView.cpp b/Core/Tools/W3DView/GraphicView.cpp index 4569093cd45..d8fc99fda90 100644 --- a/Core/Tools/W3DView/GraphicView.cpp +++ b/Core/Tools/W3DView/GraphicView.cpp @@ -747,7 +747,7 @@ CGraphicView::OnLButtonUp } else { - ::SetCursor (::LoadCursor (nullptr, MAKEINTRESOURCE (IDC_ARROW))); + ::SetCursor (::LoadCursor (nullptr, IDC_ARROW)); ((CW3DViewDoc *)GetDocument())->Set_Cursor ("cursor.tga"); } @@ -1329,7 +1329,7 @@ CGraphicView::OnRButtonUp if (m_bMouseDown) { ((CW3DViewDoc *)GetDocument())->Set_Cursor ("orbit.tga"); } else { - ::SetCursor (::LoadCursor (nullptr, MAKEINTRESOURCE (IDC_ARROW))); + ::SetCursor (::LoadCursor (nullptr, IDC_ARROW)); ((CW3DViewDoc *)GetDocument())->Set_Cursor ("cursor.tga"); ReleaseCapture (); } diff --git a/Core/Tools/W3DView/SphereColorPropPage.cpp b/Core/Tools/W3DView/SphereColorPropPage.cpp index 04d364fad30..1990570eaaf 100644 --- a/Core/Tools/W3DView/SphereColorPropPage.cpp +++ b/Core/Tools/W3DView/SphereColorPropPage.cpp @@ -195,7 +195,7 @@ SphereColorPropPageClass::OnInitDialog () 128); AlphaVectorStruct *data = new AlphaVectorStruct (m_OrigVectorChannel[index].Get_Value ()); - m_VectorBar->Set_User_Data (index, (ULONG)data); + m_VectorBar->Set_User_Data (index, (uintptr_t)data); } // @@ -405,7 +405,7 @@ SphereColorPropPageClass::OnNotify // // Associate this data with the new key // - m_VectorBar->Set_User_Data (color_bar_hdr->key_index, (ULONG)new_data); + m_VectorBar->Set_User_Data (color_bar_hdr->key_index, (uintptr_t)new_data); update = true; } diff --git a/Core/Tools/W3DView/W3DView.cpp b/Core/Tools/W3DView/W3DView.cpp index b6b73e9a38d..efe25f94c5b 100644 --- a/Core/Tools/W3DView/W3DView.cpp +++ b/Core/Tools/W3DView/W3DView.cpp @@ -158,7 +158,7 @@ Do_Version_Check () // Check the version of the viewer that is out on the network // against the version we are running. // - if (Compare_EXE_Version ((int)::AfxGetInstanceHandle (), filename) < 0) { + if (Compare_EXE_Version (::AfxGetInstanceHandle (), filename) < 0) { ::MessageBox (nullptr, "There is a newer version of the W3DViewer, please run W3DUpdate to upgrade your local copy.", "Version Info", MB_ICONEXCLAMATION | MB_OK | MB_SETFOREGROUND | MB_SYSTEMMODAL); } } diff --git a/Core/Tools/W3DView/W3DViewDoc.cpp b/Core/Tools/W3DView/W3DViewDoc.cpp index da6d529a0a4..7ae72b6c527 100644 --- a/Core/Tools/W3DView/W3DViewDoc.cpp +++ b/Core/Tools/W3DView/W3DViewDoc.cpp @@ -491,7 +491,7 @@ CW3DViewDoc::LoadAssetsFromFile (LPCTSTR lpszPathName) // if (::strrchr (lpszPathName, '\\')) { CString stringTemp = lpszPathName; - stringTemp = stringTemp.Left ((long)::strrchr (lpszPathName, '\\') - (long)lpszPathName); + stringTemp = stringTemp.Left ((int)(::strrchr (lpszPathName, '\\') - lpszPathName)); ::SetCurrentDirectory (stringTemp); _TheSimpleFileFactory->Append_Sub_Directory(stringTemp); } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp index a3057616354..5a8657e1d9d 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp @@ -387,7 +387,7 @@ static void handleColorSelection(int index) GameWindow *combo = comboBoxColor[index]; Int color, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - color = (Int)GadgetComboBoxGetItemData(combo, selIndex); + color = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); LANGameInfo *myGame = TheLAN->GetMyGame(); @@ -445,7 +445,7 @@ static void handlePlayerTemplateSelection(int index) GameWindow *combo = comboBoxPlayerTemplate[index]; Int playerTemplate, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - playerTemplate = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerTemplate = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); LANGameInfo *myGame = TheLAN->GetMyGame(); if (myGame) @@ -557,7 +557,7 @@ static void handleTeamSelection(int index) GameWindow *combo = comboBoxTeam[index]; Int team, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - team = (Int)GadgetComboBoxGetItemData(combo, selIndex); + team = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); LANGameInfo *myGame = TheLAN->GetMyGame(); if (myGame) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp index 57398571638..c913d9f710d 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -343,7 +343,7 @@ static void playerTooltip(GameWindow *window, return; } - UnsignedInt playerIP = (UnsignedInt)GadgetListBoxGetItemData( window, row, col ); + UnsignedInt playerIP = (UnsignedInt)(uintptr_t)GadgetListBoxGetItemData( window, row, col ); LANPlayer *player = TheLAN->LookupPlayer(playerIP); if (!player) { diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 3e4db71f8f4..1c709e1a2d4 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -465,7 +465,7 @@ static void saveOptions() GadgetComboBoxGetSelectedPos(comboBoxLANIP, &index); if (index>=0 && TheGlobalData) { - ip = (UnsignedInt)GadgetComboBoxGetItemData(comboBoxLANIP, index); + ip = (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData(comboBoxLANIP, index); TheWritableGlobalData->m_defaultIP = ip; pref->setLANIPAddress(ip); } @@ -477,7 +477,7 @@ static void saveOptions() GadgetComboBoxGetSelectedPos(comboBoxOnlineIP, &index); if (index>=0) { - ip = (UnsignedInt)GadgetComboBoxGetItemData(comboBoxOnlineIP, index); + ip = (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData(comboBoxOnlineIP, index); pref->setOnlineIPAddress(ip); } } diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp index 87c46e82b56..c6d51de4fcd 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp @@ -475,7 +475,7 @@ WindowMsgHandledType PopupHostGameSystem( GameWindow *window, UnsignedInt msg, W { if (pos >= 0) { - Int ladderID = (Int)GadgetComboBoxGetItemData(control, pos); + Int ladderID = (Int)(intptr_t)GadgetComboBoxGetItemData(control, pos); if (ladderID < 0) { // "Choose a ladder" selected - open overlay @@ -564,7 +564,7 @@ void createGame() req.stagingRoomCreation.ladPort = 0; if (ladderSelectPos >= 0) { - ladderID = (Int)GadgetComboBoxGetItemData(comboBoxLadderName, ladderSelectPos); + ladderID = (Int)(intptr_t)GadgetComboBoxGetItemData(comboBoxLadderName, ladderSelectPos); if (ladderID != 0) { // actual ladder diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp index d1a5d1e96af..2363c9bb47c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp @@ -130,7 +130,7 @@ static void populateLadderListBox() GadgetListBoxGetSelected(listboxLadderSelect, &selIndex); if (selIndex < 0) return; - selID = (Int)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); + selID = (Int)(intptr_t)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); if (!selID) return; updateLadderDetails(selID, staticTextLadderName, listboxLadderDetails); @@ -373,7 +373,7 @@ WindowMsgHandledType PopupLadderSelectSystem( GameWindow *window, UnsignedInt ms if (selectPos < 0) break; - ladderIndex = (Int)GadgetListBoxGetItemData( listboxLadderSelect, selectPos, 0 ); + ladderIndex = (Int)(intptr_t)GadgetListBoxGetItemData( listboxLadderSelect, selectPos, 0 ); const LadderInfo *li = TheLadderList->findLadderByIndex( ladderIndex ); if (li && li->cryptedPassword.isNotEmpty()) { @@ -439,7 +439,7 @@ WindowMsgHandledType PopupLadderSelectSystem( GameWindow *window, UnsignedInt ms if (selIndex < 0) break; - selID = (Int)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); + selID = (Int)(intptr_t)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); if (!selID) break; @@ -631,7 +631,7 @@ WindowMsgHandledType RCGameDetailsMenuSystem( GameWindow *window, UnsignedInt ms { GameWindow *control = (GameWindow *)mData1; Int controlID = control->winGetWindowId(); - Int selectedID = (Int)window->winGetUserData(); + Int selectedID = (Int)(intptr_t)window->winGetUserData(); if(!selectedID) break; closeRightClickMenu(window); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index b00fa277f45..39085835354 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -326,7 +326,7 @@ void BattleHonorTooltip(GameWindow *window, return; } - Int battleHonor = (Int)GadgetListBoxGetItemData( window, row, col ); + Int battleHonor = (Int)(intptr_t)GadgetListBoxGetItemData( window, row, col ); if (battleHonor == 0) { //DEBUG_CRASH(("No Battle Honor in listbox row %d, col %d!", row, col)); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 1900c0be748..8210b8c6f03 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -522,7 +522,7 @@ WindowMsgHandledType ScoreScreenSystem( GameWindow *window, UnsignedInt msg, if( controlID == TheNameKeyGenerator->nameToKey(name)) { Bool notBuddy = TRUE; - Int playerID = (Int)GadgetButtonGetData(TheWindowManager->winGetWindowFromId(nullptr,controlID)); + Int playerID = (Int)(intptr_t)GadgetButtonGetData(TheWindowManager->winGetWindowFromId(nullptr,controlID)); // request to add a buddy BuddyInfoMap *buddies = TheGameSpyInfo->getBuddyMap(); BuddyInfoMap::iterator bIt; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp index 686e9bc7116..dabfc0aed81 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp @@ -842,7 +842,7 @@ static void handlePlayerSelection(int index) Int playerType, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); UnicodeString title = GadgetComboBoxGetText(combo); - playerType = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerType = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; if (myGame) @@ -861,7 +861,7 @@ static void handleColorSelection(int index) GameWindow *combo = comboBoxColor[index]; Int color, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - color = (Int)GadgetComboBoxGetItemData(combo, selIndex); + color = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; @@ -901,7 +901,7 @@ static void handlePlayerTemplateSelection(int index) GameWindow *combo = comboBoxPlayerTemplate[index]; Int playerTemplate, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - playerTemplate = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerTemplate = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; if (myGame) @@ -954,7 +954,7 @@ static void handleTeamSelection(int index) GameWindow *combo = comboBoxTeam[index]; Int team, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - team = (Int)GadgetComboBoxGetItemData(combo, selIndex); + team = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; if (myGame) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp index 4e94afc580b..f6673c1dd02 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp @@ -99,7 +99,7 @@ static void mapListTooltipFunc(GameWindow *window, return; } - Int imageItemData = (Int)GadgetListBoxGetItemData(window, row, 1); + Int imageItemData = (Int)(intptr_t)GadgetListBoxGetItemData(window, row, 1); UnicodeString tooltip; switch (imageItemData) { diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index 29a01321455..5f2c8811f74 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -215,8 +215,8 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, if(rc->pos < 0) break; - GPProfile profileID = (GPProfile)GadgetListBoxGetItemData(control, rc->pos, 0); - RCItemType itemType = (RCItemType)(Int)GadgetListBoxGetItemData(control, rc->pos, 1); + GPProfile profileID = (GPProfile)(intptr_t)GadgetListBoxGetItemData(control, rc->pos, 0); + RCItemType itemType = (RCItemType)(Int)(intptr_t)GadgetListBoxGetItemData(control, rc->pos, 1); UnicodeString nick = GadgetListBoxGetText(control, rc->pos); GadgetListBoxSetSelected(control, rc->pos); @@ -267,7 +267,7 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, GadgetListBoxGetSelected(buddyControls.listboxBuddies, &selected); if (selected >= 0) { - GPProfile selectedProfile = (GPProfile)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); + GPProfile selectedProfile = (GPProfile)(intptr_t)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); BuddyInfoMap *m = TheGameSpyInfo->getBuddyMap(); BuddyInfoMap::iterator recipIt = m->find(selectedProfile); if (recipIt == m->end()) @@ -393,7 +393,7 @@ void updateBuddyInfo() GadgetListBoxGetSelected(buddyControls.listboxBuddies, &selected); if (selected >= 0) - selectedProfile = (GPProfile)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); + selectedProfile = (GPProfile)(intptr_t)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); selected = -1; GadgetListBoxReset(buddyControls.listboxBuddies); @@ -883,7 +883,7 @@ WindowMsgHandledType WOLBuddyOverlaySystem( GameWindow *window, UnsignedInt msg, break; Bool isBuddy = false, isRequest = false; - GPProfile profileID = (GPProfile)GadgetListBoxGetItemData(control, rc->pos); + GPProfile profileID = (GPProfile)(intptr_t)GadgetListBoxGetItemData(control, rc->pos); UnicodeString nick = GadgetListBoxGetText(control, rc->pos); BuddyInfoMap *buddies = TheGameSpyInfo->getBuddyMap(); BuddyInfoMap::iterator bIt; diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp index e2a44cd6707..f167beeecbc 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp @@ -513,7 +513,7 @@ static void handleColorSelection(int index) GameWindow *combo = comboBoxColor[index]; Int color, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - color = (Int)GadgetComboBoxGetItemData(combo, selIndex); + color = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheGameSpyInfo->getCurrentStagingRoom(); @@ -576,7 +576,7 @@ static void handlePlayerTemplateSelection(int index) GameWindow *combo = comboBoxPlayerTemplate[index]; Int playerTemplate, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - playerTemplate = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerTemplate = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheGameSpyInfo->getCurrentStagingRoom(); if (myGame) @@ -701,7 +701,7 @@ static void handleTeamSelection(int index) GameWindow *combo = comboBoxTeam[index]; Int team, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - team = (Int)GadgetComboBoxGetItemData(combo, selIndex); + team = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheGameSpyInfo->getCurrentStagingRoom(); if (myGame) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index 3162c85179b..6d4e332d6d6 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -1465,7 +1465,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, PeerRequest req; req.peerRequestType = PeerRequest::PEERREQUEST_GETEXTENDEDSTAGINGROOMINFO; - req.stagingRoom.id = (Int)GadgetListBoxGetItemData(control, rowSelected, 0); + req.stagingRoom.id = (Int)(intptr_t)GadgetListBoxGetItemData(control, rowSelected, 0); if (lastID != req.stagingRoom.id || now > lastFrame + 60) { @@ -1543,7 +1543,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, GadgetListBoxGetSelected(GetGameListBox(), &selected); if (selected >= 0) { - Int selectedID = (Int)GadgetListBoxGetItemData(GetGameListBox(), selected); + Int selectedID = (Int)(intptr_t)GadgetListBoxGetItemData(GetGameListBox(), selected); if (selectedID > 0) { StagingRoomMap *srm = TheGameSpyInfo->getStagingRoomList(); @@ -1654,7 +1654,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, if (rowSelected >= 0) { Int groupID; - groupID = (Int)GadgetComboBoxGetItemData(comboLobbyGroupRooms, rowSelected); + groupID = (Int)(intptr_t)GadgetComboBoxGetItemData(comboLobbyGroupRooms, rowSelected); DEBUG_LOG(("ItemData was %d, current Group Room is %d", groupID, TheGameSpyInfo->getCurrentGroupRoom())); if (groupID && groupID != TheGameSpyInfo->getCurrentGroupRoom()) { @@ -1779,7 +1779,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, break; } - Int selectedID = (Int)GadgetListBoxGetItemData(control, rc->pos); + Int selectedID = (Int)(intptr_t)GadgetListBoxGetItemData(control, rc->pos); if (selectedID > 0) { StagingRoomMap *srm = TheGameSpyInfo->getStagingRoomList(); diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index 778b0637574..4c70c4c4247 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -251,7 +251,7 @@ void UpdateStartButton() Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); if (li) { @@ -491,7 +491,7 @@ static const LadderInfo * getLadderInfo() Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); return li; } @@ -570,7 +570,7 @@ static void populateQuickMatchMapSelectListbox( QuickMatchPreferences& pref ) Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); //listboxMapSelect->winEnable( li == nullptr || li->randomMaps == FALSE ); @@ -645,7 +645,7 @@ static void saveQuickMatchOptions() Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); Int numPlayers = 0; @@ -701,7 +701,7 @@ static void saveQuickMatchOptions() Int item; GadgetComboBoxGetSelectedPos(comboBoxSide, &selected); - item = (Int)GadgetComboBoxGetItemData(comboBoxSide, selected); + item = (Int)(intptr_t)GadgetComboBoxGetItemData(comboBoxSide, selected); pref.setSide(max(0, item)); GadgetComboBoxGetSelectedPos(comboBoxColor, &selected); pref.setColor(max(0, selected)); @@ -1496,7 +1496,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms if (pos >= 0) { QuickMatchPreferences pref; - Int ladderID = (Int)GadgetComboBoxGetItemData(control, pos); + Int ladderID = (Int)(intptr_t)GadgetComboBoxGetItemData(control, pos); if (ladderID == 0) { // no ladder selected - enable buttons @@ -1638,7 +1638,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms Int ladderIndex, index, selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - ladderIndex = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + ladderIndex = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *ladderInfo = nullptr; if (ladderIndex < 0) { @@ -1659,7 +1659,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms index = -1; GadgetComboBoxGetSelectedPos( comboBoxSide, &selected ); if (selected >= 0) - index = (Int)GadgetComboBoxGetItemData( comboBoxSide, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxSide, selected ); req.QM.side = index; if (ladderInfo && ladderInfo->randomFactions) { @@ -1692,7 +1692,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms index = -1; GadgetComboBoxGetSelectedPos( comboBoxColor, &selected ); if (selected >= 0) - index = (Int)GadgetComboBoxGetItemData( comboBoxColor, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxColor, selected ); req.QM.color = index; OptionPreferences natPref; diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index 2b77abfb794..f47e9afb02c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -1242,7 +1242,7 @@ Bool outOfWeaponRangePosition( State *thisState, void* userData ) */ static Bool cannotPossiblyAttackObject( State *thisState, void* userData ) { - AbleToAttackType attackType = (AbleToAttackType)(UnsignedInt)userData; + AbleToAttackType attackType = (AbleToAttackType)(UnsignedInt)(uintptr_t)userData; Object *obj = thisState->getMachineOwner(); Object *victim = thisState->getMachineGoalObject(); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 694f4b8c6b1..f26d1c2dd7f 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -5645,7 +5645,7 @@ void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) @@ -5662,7 +5662,7 @@ void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) @@ -5679,7 +5679,7 @@ void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) @@ -5696,7 +5696,7 @@ void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) diff --git a/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp b/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp index befeb2e56a6..49ab936079d 100644 --- a/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp +++ b/Generals/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp @@ -420,7 +420,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], max = GadgetComboBoxGetLength(comboColor[i]); for (idx=0; idxgetColor()) { GadgetComboBoxSetSelectedPos(comboColor[i], idx, TRUE); @@ -433,7 +433,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], max = GadgetComboBoxGetLength(comboTeam[i]); for (idx=0; idxgetTeamNumber()) { GadgetComboBoxSetSelectedPos(comboTeam[i], idx, TRUE); @@ -446,7 +446,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], max = GadgetComboBoxGetLength(comboPlayerTemplate[i]); for (idx=0; idxgetPlayerTemplate()) { GadgetComboBoxSetSelectedPos(comboPlayerTemplate[i], idx, TRUE); diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp index f2bcf516014..ca8fdd80435 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp @@ -748,7 +748,7 @@ RenderObjClass * W3DAssetManager::Create_Render_Obj( const char *mesh_name = strchr (name, '.'); if (mesh_name != nullptr) { - lstrcpyn(filename, name, ((int)mesh_name) - ((int)name) + 1); + lstrcpyn(filename, name, (int)(mesh_name - name) + 1); lstrcat(filename, ".w3d"); } else { snprintf( filename, ARRAY_SIZE(filename), "%s.w3d", name); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp index 39c481ece7a..ea0238557e4 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp @@ -795,7 +795,7 @@ RenderObjClass * WW3DAssetManager::Create_Render_Obj(const char * name) char filename [MAX_PATH]; const char *mesh_name = ::strchr (name, '.'); if (mesh_name != nullptr) { - ::lstrcpyn (filename, name, ((int)mesh_name) - ((int)name) + 1); + ::lstrcpyn (filename, name, (int)(mesh_name - name) + 1); ::lstrcat (filename, ".w3d"); } else { snprintf( filename, ARRAY_SIZE(filename), "%s.w3d", name); diff --git a/Generals/Code/Tools/GUIEdit/Source/Properties.cpp b/Generals/Code/Tools/GUIEdit/Source/Properties.cpp index 69ac8b1b4a5..4ba04591b6b 100644 --- a/Generals/Code/Tools/GUIEdit/Source/Properties.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/Properties.cpp @@ -483,7 +483,7 @@ void LoadFontCombo( HWND comboBox, GameFont *currFont ) index = SendMessage( comboBox, CB_ADDSTRING, 0, (LPARAM)buffer ); // attach pointer to font at combo index - SendMessage( comboBox, CB_SETITEMDATA, index, (DWORD)font ); + SendMessage( comboBox, CB_SETITEMDATA, index, (LPARAM)font ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp index d00f0834296..7abaa25ddde 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp @@ -394,7 +394,7 @@ static void handleColorSelection(int index) GameWindow *combo = comboBoxColor[index]; Int color, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - color = (Int)GadgetComboBoxGetItemData(combo, selIndex); + color = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); LANGameInfo *myGame = TheLAN->GetMyGame(); @@ -452,7 +452,7 @@ static void handlePlayerTemplateSelection(int index) GameWindow *combo = comboBoxPlayerTemplate[index]; Int playerTemplate, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - playerTemplate = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerTemplate = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); LANGameInfo *myGame = TheLAN->GetMyGame(); if (myGame) @@ -564,7 +564,7 @@ static void handleTeamSelection(int index) GameWindow *combo = comboBoxTeam[index]; Int team, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - team = (Int)GadgetComboBoxGetItemData(combo, selIndex); + team = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); LANGameInfo *myGame = TheLAN->GetMyGame(); if (myGame) @@ -609,7 +609,7 @@ static void handleStartingCashSelection() GadgetComboBoxGetSelectedPos(comboBoxStartingCash, &selIndex); Money startingCash; - startingCash.deposit( (UnsignedInt)GadgetComboBoxGetItemData( comboBoxStartingCash, selIndex ), FALSE, FALSE ); + startingCash.deposit( (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData( comboBoxStartingCash, selIndex ), FALSE, FALSE ); myGame->setStartingCash( startingCash ); myGame->resetAccepted(); @@ -967,7 +967,7 @@ void updateGameOptions() Int index = 0; for ( ; index < itemCount; index++ ) { - Int value = (Int)GadgetComboBoxGetItemData(comboBoxStartingCash, index); + Int value = (Int)(intptr_t)GadgetComboBoxGetItemData(comboBoxStartingCash, index); if ( value == theGame->getStartingCash().countMoney() ) { GadgetComboBoxSetSelectedPos(comboBoxStartingCash, index, TRUE); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp index cd8f01df166..0314771582a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanLobbyMenu.cpp @@ -343,7 +343,7 @@ static void playerTooltip(GameWindow *window, return; } - UnsignedInt playerIP = (UnsignedInt)GadgetListBoxGetItemData( window, row, col ); + UnsignedInt playerIP = (UnsignedInt)(uintptr_t)GadgetListBoxGetItemData( window, row, col ); LANPlayer *player = TheLAN->LookupPlayer(playerIP); if (!player) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 0c041340e4f..2632c42c26e 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -485,7 +485,7 @@ static void saveOptions() GadgetComboBoxGetSelectedPos(comboBoxLANIP, &index); if (index>=0 && TheGlobalData) { - ip = (UnsignedInt)GadgetComboBoxGetItemData(comboBoxLANIP, index); + ip = (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData(comboBoxLANIP, index); TheWritableGlobalData->m_defaultIP = ip; pref->setLANIPAddress(ip); } @@ -497,7 +497,7 @@ static void saveOptions() GadgetComboBoxGetSelectedPos(comboBoxOnlineIP, &index); if (index>=0) { - ip = (UnsignedInt)GadgetComboBoxGetItemData(comboBoxOnlineIP, index); + ip = (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData(comboBoxOnlineIP, index); pref->setOnlineIPAddress(ip); } } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp index 0d450c726c5..503bc9e2711 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupHostGame.cpp @@ -508,7 +508,7 @@ WindowMsgHandledType PopupHostGameSystem( GameWindow *window, UnsignedInt msg, W { if (pos >= 0) { - Int ladderID = (Int)GadgetComboBoxGetItemData(control, pos); + Int ladderID = (Int)(intptr_t)GadgetComboBoxGetItemData(control, pos); if (ladderID < 0) { // "Choose a ladder" selected - open overlay @@ -597,7 +597,7 @@ void createGame() req.stagingRoomCreation.ladPort = 0; if (ladderSelectPos >= 0) { - ladderID = (Int)GadgetComboBoxGetItemData(comboBoxLadderName, ladderSelectPos); + ladderID = (Int)(intptr_t)GadgetComboBoxGetItemData(comboBoxLadderName, ladderSelectPos); if (ladderID != 0) { // actual ladder diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp index 5a24d65f21b..133d25a8231 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupLadderSelect.cpp @@ -130,7 +130,7 @@ static void populateLadderListBox() GadgetListBoxGetSelected(listboxLadderSelect, &selIndex); if (selIndex < 0) return; - selID = (Int)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); + selID = (Int)(intptr_t)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); if (!selID) return; updateLadderDetails(selID, staticTextLadderName, listboxLadderDetails); @@ -373,7 +373,7 @@ WindowMsgHandledType PopupLadderSelectSystem( GameWindow *window, UnsignedInt ms if (selectPos < 0) break; - ladderIndex = (Int)GadgetListBoxGetItemData( listboxLadderSelect, selectPos, 0 ); + ladderIndex = (Int)(intptr_t)GadgetListBoxGetItemData( listboxLadderSelect, selectPos, 0 ); const LadderInfo *li = TheLadderList->findLadderByIndex( ladderIndex ); if (li && li->cryptedPassword.isNotEmpty()) { @@ -439,7 +439,7 @@ WindowMsgHandledType PopupLadderSelectSystem( GameWindow *window, UnsignedInt ms if (selIndex < 0) break; - selID = (Int)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); + selID = (Int)(intptr_t)GadgetListBoxGetItemData(listboxLadderSelect, selIndex); if (!selID) break; @@ -631,7 +631,7 @@ WindowMsgHandledType RCGameDetailsMenuSystem( GameWindow *window, UnsignedInt ms { GameWindow *control = (GameWindow *)mData1; Int controlID = control->winGetWindowId(); - Int selectedID = (Int)window->winGetUserData(); + Int selectedID = (Int)(intptr_t)window->winGetUserData(); if(!selectedID) break; closeRightClickMenu(window); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp index 5b71b4b81b4..1a51cdc45ba 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/PopupPlayerInfo.cpp @@ -308,8 +308,8 @@ void BattleHonorTooltip(GameWindow *window, return; } - Int battleHonor = (Int)GadgetListBoxGetItemData( window, row, col ); - Int extraValue = (Int)GadgetListBoxGetItemData( window, row - 1, col ); + Int battleHonor = (Int)(intptr_t)GadgetListBoxGetItemData( window, row, col ); + Int extraValue = (Int)(intptr_t)GadgetListBoxGetItemData( window, row - 1, col ); if (battleHonor == 0) { //DEBUG_CRASH(("No Battle Honor in listbox row %d, col %d!", row, col)); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp index 2f555b55381..3d115c1cc54 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp @@ -616,7 +616,7 @@ WindowMsgHandledType ScoreScreenSystem( GameWindow *window, UnsignedInt msg, if( controlID == TheNameKeyGenerator->nameToKey(name)) { Bool notBuddy = TRUE; - Int playerID = (Int)GadgetButtonGetData(TheWindowManager->winGetWindowFromId(nullptr,controlID)); + Int playerID = (Int)(intptr_t)GadgetButtonGetData(TheWindowManager->winGetWindowFromId(nullptr,controlID)); // request to add a buddy BuddyInfoMap *buddies = TheGameSpyInfo->getBuddyMap(); BuddyInfoMap::iterator bIt; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp index 46eccc8b175..d4dc6242a10 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishGameOptionsMenu.cpp @@ -854,7 +854,7 @@ static void handlePlayerSelection(int index) Int playerType, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); UnicodeString title = GadgetComboBoxGetText(combo); - playerType = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerType = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; if (myGame) @@ -873,7 +873,7 @@ static void handleColorSelection(int index) GameWindow *combo = comboBoxColor[index]; Int color, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - color = (Int)GadgetComboBoxGetItemData(combo, selIndex); + color = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; @@ -913,7 +913,7 @@ static void handlePlayerTemplateSelection(int index) GameWindow *combo = comboBoxPlayerTemplate[index]; Int playerTemplate, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - playerTemplate = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerTemplate = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; if (myGame) @@ -966,7 +966,7 @@ static void handleTeamSelection(int index) GameWindow *combo = comboBoxTeam[index]; Int team, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - team = (Int)GadgetComboBoxGetItemData(combo, selIndex); + team = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheSkirmishGameInfo; if (myGame) @@ -992,7 +992,7 @@ static void handleStartingCashSelection() GadgetComboBoxGetSelectedPos(comboBoxStartingCash, &selIndex); Money startingCash; - startingCash.deposit( (UnsignedInt)GadgetComboBoxGetItemData( comboBoxStartingCash, selIndex ), FALSE, FALSE ); + startingCash.deposit( (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData( comboBoxStartingCash, selIndex ), FALSE, FALSE ); myGame->setStartingCash( startingCash ); } } @@ -1238,7 +1238,7 @@ void updateSkirmishGameOptions() Int index = 0; for ( ; index < itemCount; index++ ) { - Int value = (Int)GadgetComboBoxGetItemData(comboBoxStartingCash, index); + Int value = (Int)(intptr_t)GadgetComboBoxGetItemData(comboBoxStartingCash, index); if ( value == TheSkirmishGameInfo->getStartingCash().countMoney() ) { GadgetComboBoxSetSelectedPos(comboBoxStartingCash, index, TRUE); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp index c58852bd572..e010311306b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/SkirmishMapSelectMenu.cpp @@ -99,7 +99,7 @@ static void mapListTooltipFunc(GameWindow *window, return; } - Int imageItemData = (Int)GadgetListBoxGetItemData(window, row, 1); + Int imageItemData = (Int)(intptr_t)GadgetListBoxGetItemData(window, row, 1); UnicodeString tooltip; switch (imageItemData) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp index aeef928e8dd..93282f9d6da 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLBuddyOverlay.cpp @@ -215,8 +215,8 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, if(rc->pos < 0) break; - GPProfile profileID = (GPProfile)GadgetListBoxGetItemData(control, rc->pos, 0); - RCItemType itemType = (RCItemType)(Int)GadgetListBoxGetItemData(control, rc->pos, 1); + GPProfile profileID = (GPProfile)(intptr_t)GadgetListBoxGetItemData(control, rc->pos, 0); + RCItemType itemType = (RCItemType)(Int)(intptr_t)GadgetListBoxGetItemData(control, rc->pos, 1); UnicodeString nick = GadgetListBoxGetText(control, rc->pos); GadgetListBoxSetSelected(control, rc->pos); @@ -267,7 +267,7 @@ WindowMsgHandledType BuddyControlSystem( GameWindow *window, UnsignedInt msg, GadgetListBoxGetSelected(buddyControls.listboxBuddies, &selected); if (selected >= 0) { - GPProfile selectedProfile = (GPProfile)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); + GPProfile selectedProfile = (GPProfile)(intptr_t)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); BuddyInfoMap *m = TheGameSpyInfo->getBuddyMap(); BuddyInfoMap::iterator recipIt = m->find(selectedProfile); if (recipIt == m->end()) @@ -393,7 +393,7 @@ void updateBuddyInfo() GadgetListBoxGetSelected(buddyControls.listboxBuddies, &selected); if (selected >= 0) - selectedProfile = (GPProfile)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); + selectedProfile = (GPProfile)(intptr_t)GadgetListBoxGetItemData(buddyControls.listboxBuddies, selected); selected = -1; GadgetListBoxReset(buddyControls.listboxBuddies); @@ -884,7 +884,7 @@ WindowMsgHandledType WOLBuddyOverlaySystem( GameWindow *window, UnsignedInt msg, break; Bool isBuddy = false, isRequest = false; - GPProfile profileID = (GPProfile)GadgetListBoxGetItemData(control, rc->pos); + GPProfile profileID = (GPProfile)(intptr_t)GadgetListBoxGetItemData(control, rc->pos); UnicodeString nick = GadgetListBoxGetText(control, rc->pos); BuddyInfoMap *buddies = TheGameSpyInfo->getBuddyMap(); BuddyInfoMap::iterator bIt; diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp index ab14869fcf5..49575779cd3 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp @@ -525,7 +525,7 @@ static void handleColorSelection(int index) GameWindow *combo = comboBoxColor[index]; Int color, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - color = (Int)GadgetComboBoxGetItemData(combo, selIndex); + color = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheGameSpyInfo->getCurrentStagingRoom(); @@ -588,7 +588,7 @@ static void handlePlayerTemplateSelection(int index) GameWindow *combo = comboBoxPlayerTemplate[index]; Int playerTemplate, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - playerTemplate = (Int)GadgetComboBoxGetItemData(combo, selIndex); + playerTemplate = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheGameSpyInfo->getCurrentStagingRoom(); if (myGame) @@ -713,7 +713,7 @@ static void handleTeamSelection(int index) GameWindow *combo = comboBoxTeam[index]; Int team, selIndex; GadgetComboBoxGetSelectedPos(combo, &selIndex); - team = (Int)GadgetComboBoxGetItemData(combo, selIndex); + team = (Int)(intptr_t)GadgetComboBoxGetItemData(combo, selIndex); GameInfo *myGame = TheGameSpyInfo->getCurrentStagingRoom(); if (myGame) @@ -759,7 +759,7 @@ static void handleStartingCashSelection() GadgetComboBoxGetSelectedPos(comboBoxStartingCash, &selIndex); Money startingCash; - startingCash.deposit( (UnsignedInt)GadgetComboBoxGetItemData( comboBoxStartingCash, selIndex ), FALSE, FALSE ); + startingCash.deposit( (UnsignedInt)(uintptr_t)GadgetComboBoxGetItemData( comboBoxStartingCash, selIndex ), FALSE, FALSE ); myGame->setStartingCash( startingCash ); myGame->resetAccepted(); @@ -1013,7 +1013,7 @@ void WOLDisplayGameOptions() Int index = 0; for ( ; index < itemCount; index++ ) { - Int value = (Int)GadgetComboBoxGetItemData(comboBoxStartingCash, index); + Int value = (Int)(intptr_t)GadgetComboBoxGetItemData(comboBoxStartingCash, index); if ( value == theGame->getStartingCash().countMoney() ) { // Note: must check if combobox is already correct to avoid infinite recursion diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp index dd463d7345d..54674faac95 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLLobbyMenu.cpp @@ -1483,7 +1483,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, PeerRequest req; req.peerRequestType = PeerRequest::PEERREQUEST_GETEXTENDEDSTAGINGROOMINFO; - req.stagingRoom.id = (Int)GadgetListBoxGetItemData(control, rowSelected, 0); + req.stagingRoom.id = (Int)(intptr_t)GadgetListBoxGetItemData(control, rowSelected, 0); if (lastID != req.stagingRoom.id || now > lastFrame + 60) { @@ -1561,7 +1561,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, GadgetListBoxGetSelected(GetGameListBox(), &selected); if (selected >= 0) { - Int selectedID = (Int)GadgetListBoxGetItemData(GetGameListBox(), selected); + Int selectedID = (Int)(intptr_t)GadgetListBoxGetItemData(GetGameListBox(), selected); if (selectedID > 0) { StagingRoomMap *srm = TheGameSpyInfo->getStagingRoomList(); @@ -1672,7 +1672,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, if (rowSelected >= 0) { Int groupID; - groupID = (Int)GadgetComboBoxGetItemData(comboLobbyGroupRooms, rowSelected); + groupID = (Int)(intptr_t)GadgetComboBoxGetItemData(comboLobbyGroupRooms, rowSelected); DEBUG_LOG(("ItemData was %d, current Group Room is %d", groupID, TheGameSpyInfo->getCurrentGroupRoom())); if (groupID && groupID != TheGameSpyInfo->getCurrentGroupRoom()) { @@ -1797,7 +1797,7 @@ WindowMsgHandledType WOLLobbyMenuSystem( GameWindow *window, UnsignedInt msg, break; } - Int selectedID = (Int)GadgetListBoxGetItemData(control, rc->pos); + Int selectedID = (Int)(intptr_t)GadgetListBoxGetItemData(control, rc->pos); if (selectedID > 0) { StagingRoomMap *srm = TheGameSpyInfo->getStagingRoomList(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp index 87d15f55c82..32d953adf5b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/WOLQuickMatchMenu.cpp @@ -237,7 +237,7 @@ void UpdateStartButton() Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); if (li) { @@ -486,7 +486,7 @@ static const LadderInfo * getLadderInfo() Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); return li; } @@ -565,7 +565,7 @@ static void populateQuickMatchMapSelectListbox( QuickMatchPreferences& pref ) Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); //listboxMapSelect->winEnable( li == nullptr || li->randomMaps == FALSE ); @@ -624,7 +624,7 @@ static void saveQuickMatchOptions() Int index; Int selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - index = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *li = TheLadderList->findLadderByIndex( index ); Int numPlayers = 0; @@ -680,7 +680,7 @@ static void saveQuickMatchOptions() Int item; GadgetComboBoxGetSelectedPos(comboBoxSide, &selected); - item = (Int)GadgetComboBoxGetItemData(comboBoxSide, selected); + item = (Int)(intptr_t)GadgetComboBoxGetItemData(comboBoxSide, selected); pref.setSide(max(0, item)); GadgetComboBoxGetSelectedPos(comboBoxColor, &selected); pref.setColor(max(0, selected)); @@ -1561,7 +1561,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms if (pos >= 0) { QuickMatchPreferences pref; - Int ladderID = (Int)GadgetComboBoxGetItemData(control, pos); + Int ladderID = (Int)(intptr_t)GadgetComboBoxGetItemData(control, pos); if (ladderID == 0) { // no ladder selected - enable buttons @@ -1687,7 +1687,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms Int ladderIndex, index, selected; GadgetComboBoxGetSelectedPos( comboBoxLadder, &selected ); - ladderIndex = (Int)GadgetComboBoxGetItemData( comboBoxLadder, selected ); + ladderIndex = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxLadder, selected ); const LadderInfo *ladderInfo = nullptr; if (ladderIndex < 0) { @@ -1708,7 +1708,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms index = -1; GadgetComboBoxGetSelectedPos( comboBoxSide, &selected ); if (selected >= 0) - index = (Int)GadgetComboBoxGetItemData( comboBoxSide, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxSide, selected ); req.QM.side = index; if (ladderInfo && ladderInfo->randomFactions) { @@ -1747,7 +1747,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms { Int numberComboBoxEntries = GadgetComboBoxGetLength(comboBoxSide); Int randomPick = GameClientRandomValue(0, numberComboBoxEntries - 1); - index = (Int)GadgetComboBoxGetItemData( comboBoxSide, randomPick ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxSide, randomPick ); req.QM.side = index; randomTries++; @@ -1757,7 +1757,7 @@ WindowMsgHandledType WOLQuickMatchMenuSystem( GameWindow *window, UnsignedInt ms index = -1; GadgetComboBoxGetSelectedPos( comboBoxColor, &selected ); if (selected >= 0) - index = (Int)GadgetComboBoxGetItemData( comboBoxColor, selected ); + index = (Int)(intptr_t)GadgetComboBoxGetItemData( comboBoxColor, selected ); req.QM.color = index; OptionPreferences natPref; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp index dbfddab2192..6afb3591d10 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp @@ -1247,7 +1247,7 @@ Bool outOfWeaponRangePosition( State *thisState, void* userData ) */ static Bool cannotPossiblyAttackObject( State *thisState, void* userData ) { - AbleToAttackType attackType = (AbleToAttackType)(UnsignedInt)userData; + AbleToAttackType attackType = (AbleToAttackType)(UnsignedInt)(uintptr_t)userData; Object *obj = thisState->getMachineOwner(); Object *victim = thisState->getMachineGoalObject(); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageInternetCenterCrateCollide.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageInternetCenterCrateCollide.cpp index 01a9ec36a99..561cb07f750 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageInternetCenterCrateCollide.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Collide/CrateCollide/SabotageInternetCenterCrateCollide.cpp @@ -118,7 +118,7 @@ Bool SabotageInternetCenterCrateCollide::isValidToExecute( const Object *other ) static void disableHacker( Object *obj, void *userData ) { - UnsignedInt frame = (UnsignedInt)userData; + UnsignedInt frame = (UnsignedInt)(uintptr_t)userData; if( obj ) { obj->setDisabledUntil( DISABLED_HACKED, frame ); @@ -129,7 +129,7 @@ static void disableInternetCenterSpyVision( Object *obj, void *userData ) { if( obj && obj->isKindOf( KINDOF_FS_INTERNET_CENTER ) ) { - UnsignedInt frame = (UnsignedInt)userData; + UnsignedInt frame = (UnsignedInt)(uintptr_t)userData; //Loop through all it's SpyVisionUpdates() and wake them all up so they can be shut down. This is weird because //it's one of the few update modules that is actually properly sleepified. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp index 269a75f986f..3b2813ec2f5 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/PartitionManager.cpp @@ -5687,7 +5687,7 @@ void hLineAddLooker(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) @@ -5704,7 +5704,7 @@ void hLineRemoveLooker(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) @@ -5721,7 +5721,7 @@ void hLineAddShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) @@ -5738,7 +5738,7 @@ void hLineRemoveShrouder(Int x1, Int x2, Int y, void *playerIndexVoid) if (y < 0 || y >= ThePartitionManager->m_cellCountY || x1 >= ThePartitionManager->m_cellCountX || x2 < 0) return; - Int playerIndex = (Int)(playerIndexVoid); + Int playerIndex = (Int)(intptr_t)(playerIndexVoid); PartitionCell* cell = &ThePartitionManager->m_cells[y * ThePartitionManager->m_cellCountX + x1]; // yes, this could be invalid. we'll skip the bad ones. for (Int x = x1; x <= x2; ++x, ++cell) diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp index b62a6937e4a..20dfd438640 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GUIUtil.cpp @@ -473,7 +473,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], max = GadgetComboBoxGetLength(comboColor[i]); for (idx=0; idxgetColor()) { GadgetComboBoxSetSelectedPos(comboColor[i], idx, TRUE); @@ -486,7 +486,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], max = GadgetComboBoxGetLength(comboTeam[i]); for (idx=0; idxgetTeamNumber()) { GadgetComboBoxSetSelectedPos(comboTeam[i], idx, TRUE); @@ -499,7 +499,7 @@ void UpdateSlotList( GameInfo *myGame, GameWindow *comboPlayer[], max = GadgetComboBoxGetLength(comboPlayerTemplate[i]); for (idx=0; idxgetPlayerTemplate()) { GadgetComboBoxSetSelectedPos(comboPlayerTemplate[i], idx, TRUE); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp index 597b5e505f9..8a31bfee6e8 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DAssetManager.cpp @@ -778,7 +778,7 @@ RenderObjClass * W3DAssetManager::Create_Render_Obj( const char *mesh_name = strchr (name, '.'); if (mesh_name != nullptr) { - lstrcpyn(filename, name, ((int)mesh_name) - ((int)name) + 1); + lstrcpyn(filename, name, (int)(mesh_name - name) + 1); lstrcat(filename, ".w3d"); } else { snprintf( filename, ARRAY_SIZE(filename), "%s.w3d", name); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp index 7147761f385..ffbe1f77de7 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/assetmgr.cpp @@ -800,7 +800,7 @@ RenderObjClass * WW3DAssetManager::Create_Render_Obj(const char * name) char filename [MAX_PATH]; const char *mesh_name = ::strchr (name, '.'); if (mesh_name != nullptr) { - ::lstrcpyn (filename, name, ((int)mesh_name) - ((int)name) + 1); + ::lstrcpyn (filename, name, (int)(mesh_name - name) + 1); ::lstrcat (filename, ".w3d"); } else { snprintf( filename, ARRAY_SIZE(filename), "%s.w3d", name); diff --git a/GeneralsMD/Code/Tools/GUIEdit/Include/HierarchyView.h b/GeneralsMD/Code/Tools/GUIEdit/Include/HierarchyView.h index 9aa5f24dd4a..a801c7f270f 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Include/HierarchyView.h +++ b/GeneralsMD/Code/Tools/GUIEdit/Include/HierarchyView.h @@ -145,7 +145,7 @@ class HierarchyView size_t operator()(ConstGameWindowPtr p) const { std::hash hasher; - return hasher((UnsignedInt)p); + return hasher((UnsignedInt)(uintptr_t)p); } }; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp index c1473cfc0ab..4456263d3cc 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/Properties.cpp @@ -483,7 +483,7 @@ void LoadFontCombo( HWND comboBox, GameFont *currFont ) index = SendMessage( comboBox, CB_ADDSTRING, 0, (LPARAM)buffer ); // attach pointer to font at combo index - SendMessage( comboBox, CB_SETITEMDATA, index, (DWORD)font ); + SendMessage( comboBox, CB_SETITEMDATA, index, (LPARAM)font ); } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp index ec9e402270c..bafede12b4f 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/wbview3d.cpp @@ -1030,7 +1030,7 @@ void WbView3d::updateTrees() Coord3D pos = *pMapObj->getLocation(); if (m_heightMapRenderObj) { pos.z += m_heightMapRenderObj->getHeightMapHeight(pos.x, pos.y, nullptr); - TheTerrainRenderObject->addTree((DrawableID)(Int)pMapObj, pos, scale, pMapObj->getAngle(), + TheTerrainRenderObject->addTree(pMapObj->getTreeID(), pos, scale, pMapObj->getAngle(), 0.0f /*no random scaling*/, md); } } @@ -1403,7 +1403,7 @@ void WbView3d::invalObjectInView(MapObject *pMapObjIn) const ThingTemplate *tTemplate = pMapObj->getThingTemplate(); if (tTemplate && tTemplate->isKindOf(KINDOF_OPTIMIZED_TREE)) { - if (!m_heightMapRenderObj->updateTreePosition((DrawableID)(Int)pMapObj, loc, pMapObj->getAngle())) { + if (!m_heightMapRenderObj->updateTreePosition(pMapObj->getTreeID(), loc, pMapObj->getAngle())) { // Couldn't find it, so update them all. [5/27/2003] updateAllTrees = true; } diff --git a/GeneralsMD/Code/Tools/wdump/wdtview.cpp b/GeneralsMD/Code/Tools/wdump/wdtview.cpp index f825177632e..d407f048e04 100644 --- a/GeneralsMD/Code/Tools/wdump/wdtview.cpp +++ b/GeneralsMD/Code/Tools/wdump/wdtview.cpp @@ -127,7 +127,7 @@ void CWDumpTreeView::InsertItem(ChunkItem * item, HTREEITEM Parent) CTreeCtrl &tree = GetTreeCtrl(); HTREEITEM tree_item = tree.InsertItem(name, Parent); - tree.SetItem(tree_item, TVIF_PARAM,nullptr,0,0,0,0, (long) item); + tree.SetItem(tree_item, TVIF_PARAM,nullptr,0,0,0,0, (LPARAM) item); POSITION p = item->Chunks.GetHeadPosition(); while(p != nullptr) { @@ -282,7 +282,7 @@ void CWDumpTreeView::SelectTreeItem (HTREEITEM treeitem, ChunkItem *chunkitem) HTREEITEM subtreeitem; - if (tree.GetItemData (treeitem) == (DWORD) chunkitem) { + if (tree.GetItemData (treeitem) == (uintptr_t) chunkitem) { tree.SelectItem (treeitem); } subtreeitem = tree.GetChildItem (treeitem);