From 623e980083dbe0088087b9b7b506c31327029ab5 Mon Sep 17 00:00:00 2001 From: avolkov Date: Tue, 28 Mar 2006 04:10:25 +0000 Subject: [PATCH] Removed initializers from static globals that do not need them (for clarity); fixed others that do need to be reinited; bug #870 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2298 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/comm/melnorm/melnorm.c | 8 +++----- sc2/src/sc2code/comm/mycon/myconc.c | 4 +++- sc2/src/sc2code/comm/slyland/slyland.c | 10 +++++----- sc2/src/sc2code/comm/starbas/starbas.c | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sc2/src/sc2code/comm/melnorm/melnorm.c b/sc2/src/sc2code/comm/melnorm/melnorm.c index faf6e7806..570f35805 100644 --- a/sc2/src/sc2code/comm/melnorm/melnorm.c +++ b/sc2/src/sc2code/comm/melnorm/melnorm.c @@ -230,10 +230,7 @@ ShipWorth (void) return (worth); } -static COUNT rescue_fuel = 0; - -/* We're relying on this large, #define-dependent-size structure to be - automatically initialized to 0 across the board here. */ +static COUNT rescue_fuel; static SIS_STATE SIS_copy; static BOOLEAN @@ -394,7 +391,8 @@ StripShip (COUNT fuel_required) else { NPCPhrase (RESCUE_OFFER); - if ((rescue_fuel = fuel_required) == capacity) + rescue_fuel = fuel_required; + if (rescue_fuel == capacity) NPCPhrase (RESCUE_TANKS); else NPCPhrase (RESCUE_HOME); diff --git a/sc2/src/sc2code/comm/mycon/myconc.c b/sc2/src/sc2code/comm/mycon/myconc.c index a05917c0f..fac917f8d 100644 --- a/sc2/src/sc2code/comm/mycon/myconc.c +++ b/sc2/src/sc2code/comm/mycon/myconc.c @@ -102,7 +102,7 @@ static LOCDATA mycon_desc = { {0, 0}, 0, 0, 0, 0 }, /* AlienTextTemplate - starts blank */ }; -static BYTE MadeChoice = 0; +static BYTE MadeChoice; static void DoRamble (RESPONSE_REF R) @@ -623,6 +623,8 @@ init_mycon_comm (void) mycon_desc.AlienTextTemplate.align = ALIGN_CENTER; mycon_desc.AlienTextWidth = SIS_TEXT_WIDTH - 16; + MadeChoice = 0; + if (LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE) { SET_GAME_STATE (BATTLE_SEGUE, 1); diff --git a/sc2/src/sc2code/comm/slyland/slyland.c b/sc2/src/sc2code/comm/slyland/slyland.c index 3385d2555..84b986b50 100644 --- a/sc2/src/sc2code/comm/slyland/slyland.c +++ b/sc2/src/sc2code/comm/slyland/slyland.c @@ -111,11 +111,11 @@ static LOCDATA slylandro_desc = { {0, 0}, 0, 0, 0, 0 }, /* AlienTextTemplate - starts blank */ }; -static RESPONSE_REF threat = 0, - something_wrong = 0, - we_are_us = 0, - why_attack = 0, - bye = 0; +static RESPONSE_REF threat, + something_wrong, + we_are_us, + why_attack, + bye; static void CombatIsInevitable (RESPONSE_REF R) diff --git a/sc2/src/sc2code/comm/starbas/starbas.c b/sc2/src/sc2code/comm/starbas/starbas.c index 6a85b65b2..f5c261476 100644 --- a/sc2/src/sc2code/comm/starbas/starbas.c +++ b/sc2/src/sc2code/comm/starbas/starbas.c @@ -233,10 +233,10 @@ static void NeedInfo (RESPONSE_REF R); static void TellHistory (RESPONSE_REF R); static void AlienRaces (RESPONSE_REF R); -static BYTE stack0 = 0, - stack1 = 0, - stack2 = 0, - stack3 = 0; +static BYTE stack0, + stack1, + stack2, + stack3; static void AllianceInfo (RESPONSE_REF R)