From fd9611ae0407c909bfccc1a5968aba4cced50365 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Fri, 8 Aug 2025 18:38:53 +0300 Subject: [PATCH] Remove compiler warnings --- Tactical/Civ Quotes.cpp | 2 +- Tactical/Items.cpp | 2 +- Tactical/LOS.cpp | 6 +++--- Tactical/Soldier Control.cpp | 6 +++--- TacticalAI/AIMain.cpp | 11 +++++------ TileEngine/Explosion Control.cpp | 4 ++-- TileEngine/SmokeEffects.cpp | 2 +- TileEngine/physics.cpp | 2 +- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Tactical/Civ Quotes.cpp b/Tactical/Civ Quotes.cpp index 589c8643..418b1443 100644 --- a/Tactical/Civ Quotes.cpp +++ b/Tactical/Civ Quotes.cpp @@ -2308,7 +2308,7 @@ BOOLEAN PlayVoiceTaunt(SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTa if ((OutFile = fopen("VoiceTauntLog.txt", "a+t")) != NULL) { fprintf(OutFile, "Soldier [%d] TauntType %d %s\n", - pCiv->ubID, + pCiv->ubID.i, iTauntType, filename); fclose(OutFile); diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index a6a0923d..b0a4ce8b 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -9316,7 +9316,7 @@ BOOLEAN DamageItemOnGround( OBJECTTYPE * pObject, INT32 sGridNo, INT8 bLevel, IN { #ifdef JA2BETAVERSION CHAR tmpMPDbgString[512]; - sprintf(tmpMPDbgString,"DamageItemOnGround ( usItem : %i , sGridNo : %i , bLevel : %i , iDamage : %i , ubOwner : %i )\n",pObject->usItem, sGridNo , bLevel , iDamage , ubOwner ); + sprintf(tmpMPDbgString,"DamageItemOnGround ( usItem : %i , sGridNo : %i , bLevel : %i , iDamage : %i , ubOwner : %i )\n",pObject->usItem, sGridNo , bLevel , iDamage , ubOwner.i ); MPDebugMsg(tmpMPDbgString); #endif diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 044e99fc..230df008 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -5639,7 +5639,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA fprintf(OutFile, "{ % 9.8f , % 9.8f , % 9.8f , % 9.8f }, //DEBUG: merc %4d fired pellet %4d of %4d using method %4d %12s with SpreadPattern %4d %s\n", ddRawHorizAngle, ddRawVerticAngle, ddHorizAngle, ddVerticAngle, - pFirer->ubID, ubLoop, ubShots, + pFirer->ubID.i, ubLoop, ubShots, gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method], ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name ); @@ -6284,7 +6284,7 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT fprintf(OutFile, "{ % 9.8f , % 9.8f , % 9.8f , % 9.8f }, //DEBUG: merc %4d fired pellet %4d of %4d using method %4d %12s with SpreadPattern %4d %s\n", ddRawHorizAngle, ddRawVerticAngle, ddHorizAngle, ddVerticAngle, - NOBODY, ubLoop, ubShots, + NOBODY.i, ubLoop, ubShots, gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method], ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name ); @@ -6834,7 +6834,7 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN fprintf( OutFile, "{ % 9.8f , % 9.8f , % 9.8f , % 9.8f }, //DEBUG: merc %4d fired pellet %4d of %4d using method %4d %12s with SpreadPattern %4d %s\n", ddRawHorizAngle, ddRawVerticAngle, ddHorizAngle, ddVerticAngle, - NOBODY, ubLoop, ubShots, + NOBODY.i, ubLoop, ubShots, gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method], ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name ); diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 5341dad7..1d7d0b6e 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -23977,13 +23977,13 @@ void DebugValidateSoldierData( ) !(pSoldier->flags.uiStatusFlags & (SOLDIER_DRIVER | SOLDIER_PASSENGER)) ) { // This is bad! - swprintf( sString, L"Soldier Data Error: Soldier %d is alive but has a zero group ID.", cnt ); + swprintf( sString, L"Soldier Data Error: Soldier %d is alive but has a zero group ID.", cnt.i ); fProblemDetected = TRUE; } else if ( (pSoldier->ubGroupID != 0) && (GetGroup( pSoldier->ubGroupID ) == NULL) ) { // This is bad! - swprintf( sString, L"Soldier Data Error: Soldier %d has an invalid group ID of %d.", cnt, pSoldier->ubGroupID ); + swprintf( sString, L"Soldier Data Error: Soldier %d has an invalid group ID of %d.", cnt.i, pSoldier->ubGroupID ); fProblemDetected = TRUE; } } @@ -24003,7 +24003,7 @@ void DebugValidateSoldierData( ) (pSoldier->sSectorY <= 0) || (pSoldier->sSectorY >= 17) || (pSoldier->bSectorZ < 0) || (pSoldier->bSectorZ > (SPY_LOCATION( pSoldier->bAssignment ) ? 13 : 3) ) ) ) { - swprintf( sString, L"Soldier Data Error: Soldier %d is located at %d/%d/%d.", cnt, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); + swprintf( sString, L"Soldier Data Error: Soldier %d is located at %d/%d/%d.", cnt.i, pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ); fProblemDetected = TRUE; } } diff --git a/TacticalAI/AIMain.cpp b/TacticalAI/AIMain.cpp index 51ea4558..c342c478 100644 --- a/TacticalAI/AIMain.cpp +++ b/TacticalAI/AIMain.cpp @@ -235,7 +235,7 @@ void DebugAI( INT8 bMsgType, SOLDIERTYPE *pSoldier, STR szOutput, INT8 bAction ) sprintf(msg, ""); - sprintf(buf, "[%d] (%d)", pSoldier->ubID, pSoldier->sGridNo); + sprintf(buf, "[%d] (%d)", pSoldier->ubID.i, pSoldier->sGridNo); strcat(msg, buf); if (pSoldier->ubProfile != NO_PROFILE) @@ -301,7 +301,7 @@ void DebugAI( INT8 bMsgType, SOLDIERTYPE *pSoldier, STR szOutput, INT8 bAction ) } // also log to individual file for selected soldier - sprintf(buf, "Logs\\AI_Decisions [%d].txt", pSoldier->ubID); + sprintf(buf, "Logs\\AI_Decisions [%d].txt", pSoldier->ubID.i); if ((DebugFile = fopen(buf, "a+t")) != NULL) { if (bMsgType == AI_MSG_START) @@ -697,19 +697,18 @@ void HandleSoldierAI( SOLDIERTYPE *pSoldier ) // FIXME - this function is named // ATE: Display message that deadlock occured... LiveMessage( "Breaking Deadlock" ); - ScreenMsg(FONT_MCOLOR_LTRED, MSG_INTERFACE, L"Aborting AI deadlock for [%d] %s %s data %d", pSoldier->ubID, pSoldier->GetName(), utf8_to_wstring(std::string(szAction[pSoldier->aiData.bAction])), pSoldier->aiData.usActionData); + ScreenMsg(FONT_MCOLOR_LTRED, MSG_INTERFACE, L"Aborting AI deadlock for [%d] %s %s data %d", pSoldier->ubID.i, pSoldier->GetName(), utf8_to_wstring(std::string(szAction[pSoldier->aiData.bAction])), pSoldier->aiData.usActionData); DebugAI(String("Aborting AI deadlock for [%d] %s data %d", pSoldier->ubID, szAction[pSoldier->aiData.bAction], pSoldier->aiData.usActionData)); #ifdef JA2TESTVERSION // display deadlock message gfUIInDeadlock = TRUE; - gUIDeadlockedSoldier = pSoldier->ubID; - DebugAI( String("DEADLOCK soldier %d action %s ABC %d", pSoldier->ubID, gzActionStr[pSoldier->aiData.bAction], gTacticalStatus.ubAttackBusyCount ) ); + DebugAI( String("DEADLOCK soldier %d action %s ABC %d", pSoldier->ubID.i, gzActionStr[pSoldier->aiData.bAction], gTacticalStatus.ubAttackBusyCount ) ); #else // If we are in beta version, also report message! #ifdef JA2BETAVERSION - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_ERROR, L"Aborting AI deadlock for %d. Please sent DEBUG.TXT file and SAVE.", pSoldier->ubID ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_ERROR, L"Aborting AI deadlock for %d. Please sent DEBUG.TXT file and SAVE.", pSoldier->ubID.i ); #endif // just abort EndAIDeadlock(); diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index d64a7526..03b88c2a 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -2168,7 +2168,7 @@ BOOLEAN ExpAffect( INT32 sBombGridNo, INT32 sGridNo, UINT32 uiDist, UINT16 usIte #ifdef JA2BETAVERSION if (is_networked) { CHAR tmpMPDbgString[512]; - sprintf(tmpMPDbgString,"ExpAffect ( sBombGridNo : %i , sGridNo : %i , uiDist : %i , usItem : %i , ubOwner : %i , sSubsequent : %i , fMercHit : %i , bLevel : %i , iSmokeEffectID : %i )\n",sBombGridNo, sGridNo , uiDist , usItem , ubOwner , sSubsequent , (int)*pfMercHit , bLevel , iSmokeEffectID ); + sprintf(tmpMPDbgString,"ExpAffect ( sBombGridNo : %i , sGridNo : %i , uiDist : %i , usItem : %i , ubOwner : %i , sSubsequent : %i , fMercHit : %i , bLevel : %i , iSmokeEffectID : %i )\n",sBombGridNo, sGridNo , uiDist , usItem , ubOwner.i , sSubsequent , (int)*pfMercHit , bLevel , iSmokeEffectID ); MPDebugMsg(tmpMPDbgString); } #endif @@ -2953,7 +2953,7 @@ void SpreadEffect( INT32 sGridNo, UINT8 ubRadius, UINT16 usItem, SoldierID ubOwn } #ifdef JA2BETAVERSION CHAR tmpMPDbgString[512]; - sprintf(tmpMPDbgString,"SpreadEffect ( sGridNo : %i , ubRadius : %i , usItem : %i , ubOwner : %i , fSubsequent : %i , bLevel : %i , iSmokeEffectID : %i , fFromRemote : %i , fNewSmoke : %i )\n",sGridNo, ubRadius , usItem , ubOwner , (int)fSubsequent , bLevel , iSmokeEffectID , fFromRemoteClient , fNewSmokeEffect ); + sprintf(tmpMPDbgString,"SpreadEffect ( sGridNo : %i , ubRadius : %i , usItem : %i , ubOwner : %i , fSubsequent : %i , bLevel : %i , iSmokeEffectID : %i , fFromRemote : %i , fNewSmoke : %i )\n",sGridNo, ubRadius , usItem , ubOwner.i , (int)fSubsequent , bLevel , iSmokeEffectID , fFromRemoteClient , fNewSmokeEffect ); MPDebugMsg(tmpMPDbgString); gfMPDebugOutputRandoms = true; #endif diff --git a/TileEngine/SmokeEffects.cpp b/TileEngine/SmokeEffects.cpp index 04bc9726..2828b22e 100644 --- a/TileEngine/SmokeEffects.cpp +++ b/TileEngine/SmokeEffects.cpp @@ -366,7 +366,7 @@ INT32 NewSmokeEffect(INT32 sGridNo, UINT16 usItem, INT8 bLevel, SoldierID ubOwne } #ifdef JA2BETAVERSION CHAR tmpMPDbgString[512]; - sprintf(tmpMPDbgString, "NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n", sGridNo, usItem, ubOwner, bLevel, iSmokeIndex); + sprintf(tmpMPDbgString, "NewSmokeEffect ( sGridNo : %i , usItem : %i , ubOwner : %i , bLevel : %i , iSmokeEffectID : %i )\n", sGridNo, usItem, ubOwner.i, bLevel, iSmokeIndex); MPDebugMsg(tmpMPDbgString); gfMPDebugOutputRandoms = true; #endif diff --git a/TileEngine/physics.cpp b/TileEngine/physics.cpp index f05398c2..b4af4896 100644 --- a/TileEngine/physics.cpp +++ b/TileEngine/physics.cpp @@ -2188,7 +2188,7 @@ BOOLEAN CalculateLaunchItemChanceToGetThrough( SOLDIERTYPE *pSoldier, OBJECTTYPE if ( pSoldier->sGridNo == sGridNo ) { - printf("Warning! Soldier #%d attempted to launch item at himself\n", pSoldier->ubID); + printf("Warning! Soldier #%d attempted to launch item at himself\n", pSoldier->ubID.i); return FALSE; } // Ge7t basic launch params...