Fix: various compile warnings

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8872 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2020-07-24 19:27:34 +00:00
parent 5036772e1b
commit 8e4961f021
14 changed files with 35 additions and 47 deletions
+1 -1
View File
@@ -2687,7 +2687,7 @@ void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, B
void LuaHandleInteractiveActionResult( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ,
INT32 sGridNo, UINT8 bLevel, UINT8 ubId,
UINT8 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill )
UINT16 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill )
{
const char* filename = "scripts\\Overhead.lua";
+1 -1
View File
@@ -62,7 +62,7 @@ extern BOOLEAN LuaHandleQuestCodeOnSector( INT16 sSectorX, INT16 sSectorY, INT8
void LuaHandleSectorLiberation( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fFirstTime );
void LuaHandleInteractiveActionResult( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ,
INT32 sGridNo, UINT8 bLevel, UINT8 ubId,
UINT8 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill );
UINT16 usActionType, INT32 sLuaactionid, INT32 difficulty, UINT16 skill );
void LuaRecruitRPCAdditionalHandling( UINT8 usProfile );
void LuaHandleSectorTacticalEntry( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, BOOLEAN fHasEverBeenPlayerControlled );
+1 -1
View File
@@ -291,7 +291,7 @@ void HandlePossibleArmsDealerIntelRefresh( BOOLEAN aForceReread )
pDealerInv[cnt].uiIndex = cnt;
pDealerInv[cnt].sItemIndex = data.usItem;
pDealerInv[cnt].ubOptimalNumber = data.sOptimalNumber;
pDealerInv[cnt].ubOptimalNumber = (UINT8)data.sOptimalNumber;
++cnt;
}
+2 -2
View File
@@ -821,7 +821,7 @@ INT8 GetDealersMaxItemAmount( UINT8 ubDealerID, UINT16 usItemIndex )
}
}
DEALER_POSSIBLE_INV *GetPointerToDealersPossibleInventory( UINT8 ubArmsDealerID )
DEALER_POSSIBLE_INV *GetPointerToDealersPossibleInventory( UINT16 ubArmsDealerID )
{
switch( ubArmsDealerID )
{
@@ -921,7 +921,7 @@ DEALER_POSSIBLE_INV *GetPointerToDealersPossibleInventory( UINT8 ubArmsDealerID
{
if ( ubArmsDealerID < NUM_ARMS_DEALERS )
{
UINT8 additionaldealernumber = ubArmsDealerID - ARMS_DEALER_ADDITIONAL_1;
UINT16 additionaldealernumber = ubArmsDealerID - ARMS_DEALER_ADDITIONAL_1;
return( gArmsDealerAdditional[additionaldealernumber] );
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ typedef struct
INT8 GetDealersMaxItemAmount( UINT8 ubDealerID, UINT16 usItemIndex );
DEALER_POSSIBLE_INV *GetPointerToDealersPossibleInventory( UINT8 ubArmsDealerID );
DEALER_POSSIBLE_INV *GetPointerToDealersPossibleInventory( UINT16 ubArmsDealerID );
UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex );
UINT8 ChanceOfItemTransaction( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEAN fDealerSelling, BOOLEAN fUsed );
+6 -8
View File
@@ -777,8 +777,7 @@ void HandleDynamicOpinionSpeechEvents( )
// award any opinion events that have happened...
// these better not start dialogues themselves, or we might cause a loop here
UINT16 opinioneentscollectedsize = gOpionionEventsDuringDialogue.size( );
for ( UINT16 i = 0; i < opinioneentscollectedsize; ++i )
for ( size_t i = 0, opinioneentscollectedsize = gOpionionEventsDuringDialogue.size(); i < opinioneentscollectedsize; ++i )
{
OpinionEvent event = gOpionionEventsDuringDialogue[i];
@@ -1080,8 +1079,7 @@ INT8 GetSidePosition( UINT8 aDostPosition )
{
INT8 bestpos = -1;
UINT8 size = gDynamicOpinionSpeechInCurrentDialogue.size( );
for ( UINT8 i = 0; i < size; ++i )
for ( size_t i = 0, size = gDynamicOpinionSpeechInCurrentDialogue.size(); i < size; ++i )
{
if ( gDynamicOpinionSpeechInCurrentDialogue[i].usSide == aDostPosition )
{
@@ -1779,7 +1777,7 @@ void HandleDynamicOpinionBattleFinished( BOOLEAN fBattleWon )
UINT32 enemysidesize = 0;
// pick the 'leader' who gets all the praise (or blame, depending on how this went)
UINT8 leaderid = GetBestMercLeaderInSector( SECTORX( gCurrentIncident.usSector ), SECTORY( gCurrentIncident.usSector ), (INT8)gCurrentIncident.usLevel );
UINT16 leaderid = GetBestMercLeaderInSector( SECTORX( gCurrentIncident.usSector ), SECTORY( gCurrentIncident.usSector ), (INT8)gCurrentIncident.usLevel );
if ( leaderid != NOBODY )
{
@@ -1825,7 +1823,7 @@ void HandleDynamicOpinionRetreat( )
{
// This was a disaster (Ignoring of how high the enemies losses were to create drama :-) )! Let's blame the player -> blame an IMP!
std::vector<UINT8> aTaboo;
UINT8 impid = GetBestMercLeaderInSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
UINT16 impid = GetBestMercLeaderInSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
// we've found someone competent. Let's all blame him for this disaster!
if ( impid != NOBODY )
@@ -1936,10 +1934,10 @@ UINT32 GetSoldierLeaderRating( SOLDIERTYPE* pSoldier )
}
UINT8 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ )
UINT16 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ )
{
UINT32 highestrating = 0;
UINT8 bestid = NOBODY;
UINT16 bestid = NOBODY;
SOLDIERTYPE* pSoldier = NULL;
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
+1 -1
View File
@@ -480,7 +480,7 @@ void HandleDynamicOpinionTeaching( SOLDIERTYPE* pSoldier, UINT8 ubStat );
// some events require a 'leader' - merc the team will regard as the one being in charge, and subsequently being praised or damned for the way things develop
UINT32 GetSoldierLeaderRating( SOLDIERTYPE* pSoldier );
UINT8 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ );
UINT16 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ );
// get id of a random merc in a sector, provided one exists
UINT8 GetRandomMercInSectorNotInList( INT16 sX, INT16 sY, INT8 sZ, std::vector<UINT8> aTaboo, BOOLEAN fImpOnly );
+3 -6
View File
@@ -7679,8 +7679,7 @@ BOOLEAN RemoveFortification( INT32 sGridNo, SOLDIERTYPE *pSoldier, OBJECTTYPE *p
// We only want to do this on the earth piles, of course - flattening crates via a shovel would be odd :-)
UINT8 numbertofind = (UINT8)(pStruct->pDBStructureRef->pDBStructure->usStructureNumber);
UINT8 size = gStructureDeconstruct[i].tilevector.size();
for ( UINT8 j = 0; j < size; ++j)
for ( size_t j = 0, size = gStructureDeconstruct[i].tilevector.size(); j < size; ++j)
{
if ( gStructureDeconstruct[i].tilevector[j] == numbertofind )
{
@@ -7988,8 +7987,7 @@ BOOLEAN CanRemoveFortification( INT32 sGridNo, INT8 sLevel, UINT32 usStructureco
// We only want to do this on the earth piles, of course - flattening crates via a shovel would be odd :-)
UINT8 numbertofind = (UINT8)(pStruct->pDBStructureRef->pDBStructure->usStructureNumber);
UINT8 size = gStructureDeconstruct[usStructureconstructindex].tilevector.size( );
for ( UINT8 j = 0; j < size; ++j )
for ( size_t j = 0, size = gStructureDeconstruct[usStructureconstructindex].tilevector.size(); j < size; ++j )
{
if ( gStructureDeconstruct[usStructureconstructindex].tilevector[j] == numbertofind )
{
@@ -8187,8 +8185,7 @@ BOOLEAN RemoveFortification( INT32 sGridNo, INT8 sLevel, UINT32 usStructureconst
// We only want to do this on the earth piles, of course - flattening crates via a shovel would be odd :-)
UINT8 numbertofind = (UINT8)(pStruct->pDBStructureRef->pDBStructure->usStructureNumber);
UINT8 size = gStructureDeconstruct[usStructureconstructindex].tilevector.size( );
for ( UINT8 j = 0; j < size; ++j )
for ( size_t j = 0, size = gStructureDeconstruct[usStructureconstructindex].tilevector.size(); j < size; ++j )
{
if ( gStructureDeconstruct[usStructureconstructindex].tilevector[j] == numbertofind )
{
+8 -12
View File
@@ -162,8 +162,7 @@ bool DestroyLBEIfEmpty(OBJECTTYPE* pObj, int stackIndex)
LBENODE* pLBE = pObj->GetLBEPointer(stackIndex);
if (pLBE)
{
UINT16 plbesize = pLBE->inv.size();
for (UINT16 x = 0; x < plbesize; ++x)
for ( size_t x = 0, plbesize = pLBE->inv.size(); x < plbesize; ++x)
{
if (pLBE->inv[x].exists() == true)
return false;
@@ -189,8 +188,7 @@ void DestroyLBE(OBJECTTYPE* pObj, int stackIndex)
LBENODE* pLBE = pObj->GetLBEPointer(stackIndex);
if(pLBE)
{
UINT16 plbesize = pLBE->inv.size();
for(UINT16 x = 0; x < plbesize; ++x)
for(size_t x = 0, plbesize = pLBE->inv.size(); x < plbesize; ++x)
{
if(pLBE->inv[x].exists() == true)
{
@@ -217,16 +215,15 @@ void DestroyLBE(OBJECTTYPE* pObj, int stackIndex)
void MoveItemsInSlotsToLBE( SOLDIERTYPE *pSoldier, std::vector<INT8>& LBESlots, LBENODE* pLBE, OBJECTTYPE* pObj)
{
UINT16 plbesize = pLBE->inv.size();
UINT16 lbesize = LBESlots.size();
for(UINT16 i=0; i<lbesize; ++i) // Go through default pockets one by one
size_t plbesize = pLBE->inv.size();
for( size_t i=0, lbesize = LBESlots.size(); i<lbesize; ++i) // Go through default pockets one by one
{
if(pSoldier->inv[LBESlots[i]].exists() == false) // No item in this pocket
continue;
// Found an item in a default pocket so get it's ItemSize
UINT16 dSize = CalculateItemSize(&pSoldier->inv[LBESlots[i]]);
for(unsigned int j=0; j<plbesize; ++j) // Search through LBE and see if item fits anywhere
for( size_t j=0; j<plbesize; ++j) // Search through LBE and see if item fits anywhere
{
if(pLBE->inv[j].exists() == true) // Item already stored in LBENODE pocket
continue;
@@ -464,13 +461,12 @@ BOOLEAN MoveItemFromLBEItem( SOLDIERTYPE *pSoldier, UINT32 uiHandPos, OBJECTTYPE
//we should have copied all the items from the LBE to the soldier
//which means the LBE should be empty and destroyed. However, if it's not empty, we need to force place
//some items so that we can empty the LBE without losing anything.
UINT16 invsize = pSoldier->inv.size();
UINT16 lbesize = LBESlots.size();
for(UINT16 i = 0; i < lbesize; ++i)
size_t invsize = pSoldier->inv.size();
for(size_t i = 0, lbesize = LBESlots.size(); i < lbesize; ++i)
{
if(pLBE->inv[i].exists() == true)
{
for(UINT16 j = BIGPOCKSTART; j < invsize; ++j)
for( size_t j = BIGPOCKSTART; j < invsize; ++j)
{
if(pSoldier->inv[j].exists() == false)
{
+5 -7
View File
@@ -2874,8 +2874,8 @@ UINT16 CalculateItemSize( OBJECTTYPE *pObject )
UINT16 pIndex, testSize, maxSize;
UINT8 pocketCapacity, numberOfSizeIncrements;
FLOAT currentPocketPercent, currentPocketPartOfTotal;
UINT16 invsize = pLBE->inv.size();
for(UINT16 x = 0; x < invsize; ++x)
size_t invsize = pLBE->inv.size();
for( size_t x = 0; x < invsize; ++x)
{
if(LoadBearingEquipment[Item[pObject->usItem].ubClassIndex].lbePocketIndex[x] != 0)
{
@@ -2884,7 +2884,7 @@ UINT16 CalculateItemSize( OBJECTTYPE *pObject )
}
}
//Now, look through each active pocket
for(UINT16 x = 0; x < invsize; ++x)
for( size_t x = 0; x < invsize; ++x)
{
if ( pLBE->inv[x].exists() )
{
@@ -3044,8 +3044,7 @@ UINT16 OBJECTTYPE::GetWeightOfObjectInStack(unsigned int index)
LBENODE* pLBE = GetLBEPointer( index );
if ( pLBE )
{
UINT16 invsize = pLBE->inv.size();
for ( UINT16 subObjects = 0; subObjects < invsize; ++subObjects )
for ( size_t subObjects = 0, invsize = pLBE->inv.size(); subObjects < invsize; ++subObjects )
{
if ( pLBE->inv[subObjects].exists() == true )
{
@@ -8723,8 +8722,7 @@ BOOLEAN RemoveObjectFromSoldierProfile( UINT8 ubProfile, UINT16 usItem )
return( TRUE );
}
MERCPROFILESTRUCT* pProfile = &gMercProfiles[ ubProfile ];
UINT8 invsize = pProfile->inv.size();
for (UINT8 bLoop = 0; bLoop < invsize; ++bLoop)
for (size_t bLoop = 0, invsize = pProfile->inv.size(); bLoop < invsize; ++bLoop)
{
if ( pProfile->inv[ bLoop ] == usItem )
{
+1 -2
View File
@@ -6678,8 +6678,7 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
ddHorizAngle, ddVerticAngle,
NOBODY, ubLoop, ubShots,
gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method],
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name,
NULL
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name
);
fclose( OutFile );
}
+3 -3
View File
@@ -1468,8 +1468,8 @@ void HandleSnitchesReports( std::vector<SnitchEvent>& aVec )
SOLDIERTYPE *pSnitch;
BOOLEAN fSleepingSnitch = FALSE;
UINT16 size = aVec.size( );
for ( UINT16 bCounter = 0; bCounter < size; ++bCounter )
size_t size = aVec.size( );
for ( size_t bCounter = 0; bCounter < size; ++bCounter )
{
SnitchEvent& event = aVec[bCounter];
@@ -1497,7 +1497,7 @@ void HandleSnitchesReports( std::vector<SnitchEvent>& aVec )
SnitchTacticalCharacterDialogue( pSnitch, 0, SNITCH_INTRODUCTION, NO_PROFILE, NO_PROFILE );
// process all reports by the same snitch in row
for ( UINT16 bCounter2 = bCounter; bCounter2 < size; ++bCounter2 )
for ( size_t bCounter2 = bCounter; bCounter2 < size; ++bCounter2 )
{
SnitchEvent& event2 = aVec[bCounter2];
+1 -1
View File
@@ -4161,7 +4161,7 @@ INT16 GetAPsForMultiTurnAction( SOLDIERTYPE *pSoldier, UINT8 usActionType )
return sAPCost;
}
INT16 GetAPsForInteractiveAction( SOLDIERTYPE *pSoldier, UINT8 usActionType )
INT16 GetAPsForInteractiveAction( SOLDIERTYPE *pSoldier, UINT16 usActionType )
{
INT16 sAPCost = 0;
+1 -1
View File
@@ -356,7 +356,7 @@ INT16 GetAPsToApplyItem( SOLDIERTYPE *pSoldier, INT32 usMapPos ); // added by Fl
INT16 GetAPsToFillBloodbag( SOLDIERTYPE *pSoldier, INT32 usMapPos ); // added by Flugente
INT16 GetAPsForMultiTurnAction( SOLDIERTYPE *pSoldier, UINT8 usActionType ); // added by Flugente
INT16 GetAPsForInteractiveAction( SOLDIERTYPE *pSoldier, UINT8 usActionType ); // added by Flugente
INT16 GetAPsForInteractiveAction( SOLDIERTYPE *pSoldier, UINT16 usActionType ); // added by Flugente
INT16 GetAPsToJumpOver( SOLDIERTYPE *pSoldier );