- Fix: UB cannot be compiled

- Fixed a few compiler warnings

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8176 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-04-24 19:59:25 +00:00
parent 38814f5ee3
commit bd59b2fcba
16 changed files with 31 additions and 45 deletions
-1
View File
@@ -498,7 +498,6 @@ UINT16 DetermineCivQuoteEntry( SOLDIERTYPE *pCiv, UINT16 *pubCivHintToUse, BOOLE
BOOLEAN bCivHighLoyalty = FALSE;
BOOLEAN bMiners = FALSE;
UINT16 iCounter2;
UINT16 FileEDTQUoteID;
(*pubCivHintToUse) = 0;
+5 -6
View File
@@ -4361,7 +4361,6 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
void INVRenderSteeringWheel( UINT32 uiBuffer, UINT32 uiSteeringWheelIndex, SOLDIERTYPE *pSoldier, INT16 sX, INT16 sY, INT16 sWidth, INT16 sHeight, UINT8 fDirtyLevel )
{
SOLDIERTYPE *pVehicle = NULL;
UINT32 usHeight, usWidth;
INT16 sNewY, sNewX;
static CHAR16 pStr[ 100 ], pStr2[ 100 ];
@@ -7585,16 +7584,16 @@ void RenderItemDescriptionBox( )
{
if ( !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto )
{
UINT8 ubComparedAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL );
if( ubComparedAttackAPs > ubAttackAPs )
INT16 sComparedAttackAPs = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL );
if ( sComparedAttackAPs > ubAttackAPs )
{
SetFontForeground( ITEMDESC_FONTNEGATIVE );
swprintf( pStr, L"+%2d", ubComparedAttackAPs - ubAttackAPs );
swprintf( pStr, L"+%2d", sComparedAttackAPs - ubAttackAPs );
}
else if( ubComparedAttackAPs < ubAttackAPs )
else if ( sComparedAttackAPs < ubAttackAPs )
{
SetFontForeground( ITEMDESC_FONTPOSITIVE );
swprintf( pStr, L"%2d", ubComparedAttackAPs - ubAttackAPs );
swprintf( pStr, L"%2d", sComparedAttackAPs - ubAttackAPs );
}
else
swprintf( pStr, L"=");
+1 -1
View File
@@ -1026,7 +1026,7 @@ void HandleFirstHeliDropOfGame( )
CharacterDialogueWithSpecialEvent( 0, 0, 0, DIALOGUE_TACTICAL_UI , FALSE , FALSE , DIALOGUE_SPECIAL_EVENT_ENABLE_AI ,0, 0 );
}
UINT16 SpawnAirDropElite( INT32 sGridNo )
UINT8 SpawnAirDropElite( INT32 sGridNo )
{
SOLDIERTYPE *pSoldier;
+1 -1
View File
@@ -150,7 +150,7 @@ TraitSelection::Setup( UINT32 aVal )
INT16 sX, sY;
// sevenfm: changed TraitsMenu position from soldier to mouse
//GetSoldierScreenPos( pSoldier, &sX, &sY );
GetGridNoScreenPos( sTraitsMenuTargetGridNo, gsInterfaceLevel, &sX, &sY );
GetGridNoScreenPos( sTraitsMenuTargetGridNo, (UINT8)gsInterfaceLevel, &sX, &sY );
if( sX < 0 ) sX = 0;
if( sY < 0 ) sY = 0;
+1 -1
View File
@@ -22844,7 +22844,7 @@ void HandleVolunteerRecruitment( SOLDIERTYPE* pRecruiter, SOLDIERTYPE* pTarget )
// bonus for assertive characters
if ( DoesMercHavePersonality( pRecruiter, CHAR_TRAIT_ASSERTIVE ) )
leadershipfactor *= 1.05;
leadershipfactor *= 1.05f;
FLOAT recruitmodifier = (100 + pRecruiter->GetBackgroundValue( BG_PERC_APPROACH_RECRUIT )) / 100.0f;
-6
View File
@@ -4161,12 +4161,6 @@ UINT8 GetLocationModifier( UINT8 ubSoldierClass )
{
UINT8 ubLocationModifier = 0;
INT16 sSectorX, sSectorY, sSectorZ;
#ifdef JA2UB
#else
//INT8 bTownId;
//UINT8 ubPalaceDistance;
#endif
BOOLEAN fSuccess;
// Flugente: why do we always crash the game if something does not work?
// where is all this taking place?
+2 -2
View File
@@ -3093,7 +3093,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
GetMouseMapPos( &sGridNo );
// a node to add a structure
AddFortificationPlanNode( sGridNo, gsInterfaceLevel, gCurrentFortificationStructure, gCurrentFortificationTileLibraryIndex, TRUE );
AddFortificationPlanNode( sGridNo, (INT8)gsInterfaceLevel, gCurrentFortificationStructure, gCurrentFortificationTileLibraryIndex, TRUE );
}
else if ( fAlt )
{
@@ -3145,7 +3145,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
GetMouseMapPos( &sGridNo );
// a node to delete a structure
AddFortificationPlanNode( sGridNo, gsInterfaceLevel, gCurrentFortificationStructure, gCurrentFortificationTileLibraryIndex, FALSE );
AddFortificationPlanNode( sGridNo, (INT8)gsInterfaceLevel, gCurrentFortificationStructure, gCurrentFortificationTileLibraryIndex, FALSE );
}
else
{
+1 -1
View File
@@ -132,7 +132,7 @@ VehicleSelection::Setup( UINT32 aVal )
// grab soldier's x,y screen position
INT16 sX, sY;
GetGridNoScreenPos( sVehicleMenuTargetGridNo, gsInterfaceLevel, &sX, &sY );
GetGridNoScreenPos( sVehicleMenuTargetGridNo, (UINT8)gsInterfaceLevel, &sX, &sY );
if( sX < 0 ) sX = 0;
if( sY < 0 ) sY = 0;
+1 -1
View File
@@ -154,7 +154,7 @@ diseaseEndElementHandle( void *userData, const XML_Char *name )
else if ( strcmp( name, "uiIndex" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curItem.uiIndex = (UINT16)atol( pData->szCharData );
pData->curItem.uiIndex = (UINT8)atol( pData->szCharData );
}
else if ( strcmp( name, "szName" ) == 0 )
{
+1 -1
View File
@@ -14,7 +14,7 @@ void StartHelicopterRun();
void HandleHeliDrop( BOOLEAN fPlayer = TRUE );
UINT16 SpawnAirDropElite( INT32 sGridNo );
UINT8 SpawnAirDropElite( INT32 sGridNo );
void InitiateEnemyAirDropSoldiers( INT32 sGridNo );
void HandleEnemyAirdrop( );