diff --git a/sc2/src/sc2code/comm/starbas/starbas.c b/sc2/src/sc2code/comm/starbas/starbas.c index d9f56cb0d..80239242c 100644 --- a/sc2/src/sc2code/comm/starbas/starbas.c +++ b/sc2/src/sc2code/comm/starbas/starbas.c @@ -36,6 +36,10 @@ void DrawCargoStrings (BYTE OldElement, BYTE NewElement); //End Added by Chris +static void TellMission (RESPONSE_REF R); +static void SellMinerals (RESPONSE_REF R); + + static LOCDATA commander_desc = { NULL_PTR, /* init_encounter_func */ @@ -565,7 +569,6 @@ DefeatUrquan (RESPONSE_REF R) #define HOW_ALLY_AGAINST_URQUAN (1 << 2) #define HOW_STRONG_AGAINST_URQUAN (1 << 3) static BYTE DefeatMask = 0; - static void TellMission (RESPONSE_REF R); if (PLAYER_SAID (R, how_defeat)) { @@ -1720,11 +1723,7 @@ NormalStarbase (RESPONSE_REF R) } if (GLOBAL_SIS (TotalElementMass)) - { - static void SellMinerals (RESPONSE_REF R); - Response (have_minerals, SellMinerals); - } if (DiscussDevices (FALSE)) Response (new_devices, NormalStarbase); if (CurBulletinMask) diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 17cde1d43..c9121f234 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -44,9 +44,13 @@ #define MAX_NAME_CHARS 15 #define SAVES_PER_PAGE 5 +static BOOLEAN DoSettings (PMENU_STATE pMS); +static BOOLEAN DoNaming (PMENU_STATE pMS); + static PMENU_STATE pLocMenuState; static BYTE prev_save; //keeps track of the last slot that was saved or loaded + void ConfirmSaveLoad (STAMP *MsgStamp) { @@ -175,7 +179,8 @@ FeedbackSetting (BYTE which_setting) DrawStatusMessage (buf); UnlockMutex (GraphicsLock); } -static void + +static void FeedbackQuit (BYTE which_setting) { UNICODE buf[20]; @@ -195,8 +200,6 @@ FeedbackQuit (BYTE which_setting) UnlockMutex (GraphicsLock); } -static BOOLEAN DoSettings (PMENU_STATE pMS); - static BOOLEAN DrawDescriptionString (PMENU_STATE pMS, COUNT which_string, SIZE state) { @@ -205,7 +208,6 @@ DrawDescriptionString (PMENU_STATE pMS, COUNT which_string, SIZE state) TEXT lf; COLOR BackGround, ForeGround; FONT Font; - static BOOLEAN DoNaming (PMENU_STATE pMS); LockMutex (GraphicsLock); diff --git a/sc2/src/sc2code/libs/resource/loadres.c b/sc2/src/sc2code/libs/resource/loadres.c index 8e0ca38a4..55ddc85f0 100644 --- a/sc2/src/sc2code/libs/resource/loadres.c +++ b/sc2/src/sc2code/libs/resource/loadres.c @@ -62,7 +62,7 @@ GetResourceData (uio_Stream *fp, DWORD length, MEM_FLAGS mem_flags) if ((int)(ReadResFile (RDPtr, 1, num_read, fp)) != (int)num_read) break; } - ((BYTE *) RDPtr) += num_read; + RDPtr = (RESOURCE_DATAPTR) ((BYTE *) RDPtr + num_read); } while (length -= num_read); UnlockResourceData (RData); diff --git a/sc2/src/sc2code/libs/strings/strings.c b/sc2/src/sc2code/libs/strings/strings.c index 7edb19ea5..179f0e4da 100644 --- a/sc2/src/sc2code/libs/strings/strings.c +++ b/sc2/src/sc2code/libs/strings/strings.c @@ -45,7 +45,8 @@ ReleaseStringTable (STRING String) { STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) != 0) + StringTable = GetStringTable (String); + if (StringTable != 0) UnlockStringTable (StringTable); return (StringTable); @@ -63,7 +64,8 @@ GetStringTableCount (STRING String) COUNT StringCount; STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) == 0) + StringTable = GetStringTable (String); + if (StringTable == 0) StringCount = 0; else { @@ -88,7 +90,8 @@ SetAbsStringTableIndex (STRING String, COUNT StringTableIndex) { STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) == 0) + StringTable = GetStringTable (String); + if (StringTable == 0) String = 0; else { @@ -109,7 +112,8 @@ SetRelStringTableIndex (STRING String, SIZE StringTableOffs) { STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) == 0) + StringTable = GetStringTable (String); + if (StringTable == 0) String = 0; else { @@ -135,7 +139,8 @@ GetStringLength (STRING String) COUNT StringLength; STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) == 0) + StringTable = GetStringTable (String); + if (StringTable == 0) StringLength = 0; else { @@ -173,7 +178,8 @@ GetStringSoundClip (STRING String) STRINGPTR StringAddr; STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) == 0) + StringTable = GetStringTable (String); + if (StringTable == 0) StringAddr = 0; else { @@ -189,8 +195,8 @@ GetStringSoundClip (STRING String) StringAddr = 0; else { - StringAddr = (STRINGPTR)StringTablePtr; - ((BYTE *) StringAddr) += StringTablePtr->StringOffsets[StringIndex]; + StringAddr = (STRINGPTR) ((BYTE *) StringTablePtr + + StringTablePtr->StringOffsets[StringIndex]); } UnlockStringTable (StringTable); } @@ -204,7 +210,8 @@ GetStringTimeStamp (STRING String) STRINGPTR StringAddr; STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) == 0) + StringTable = GetStringTable (String); + if (StringTable == 0) StringAddr = 0; else { @@ -222,8 +229,8 @@ GetStringTimeStamp (STRING String) StringAddr = 0; else { - StringAddr = (STRINGPTR)StringTablePtr; - ((BYTE *) StringAddr) += StringTablePtr->StringOffsets[StringIndex]; + StringAddr = (STRINGPTR) ((BYTE *) StringTablePtr + + StringTablePtr->StringOffsets[StringIndex]); } UnlockStringTable (StringTable); } @@ -237,7 +244,8 @@ GetStringAddress (STRING String) STRINGPTR StringAddr; STRING_TABLE StringTable; - if ((StringTable = GetStringTable (String)) == 0) + StringTable = GetStringTable (String); + if (StringTable == 0) StringAddr = 0; else { @@ -246,8 +254,8 @@ GetStringAddress (STRING String) StringIndex = STRING_INDEX (String); LockStringTable (StringTable, &StringTablePtr); - StringAddr = (STRINGPTR)StringTablePtr; - ((BYTE *) StringAddr) += StringTablePtr->StringOffsets[StringIndex]; + StringAddr = (STRINGPTR) ((BYTE *) StringTablePtr + + StringTablePtr->StringOffsets[StringIndex]); UnlockStringTable (StringTable); } diff --git a/sc2/src/sc2code/melee.c b/sc2/src/sc2code/melee.c index bd2a93292..be5f692fc 100644 --- a/sc2/src/sc2code/melee.c +++ b/sc2/src/sc2code/melee.c @@ -51,6 +51,7 @@ void ConfirmSaveLoad (STAMP *MsgStamp); //End Added by Chris +static void DrawMeleeShipStrings (PMELEE_STATE pMS, BYTE NewStarShip); static int flash_selection_func (void *data); @@ -244,8 +245,6 @@ DrawPickFrame (PMELEE_STATE pMS) { FRAME F; RECT r, r0, r1, ship_r; - static void DrawMeleeShipStrings (PMELEE_STATE pMS, BYTE - NewStarShip); GetShipBox (&r0, 0, 0, 0), GetShipBox (&r1, 1, NUM_MELEE_ROWS - 1, NUM_MELEE_COLUMNS - 1),