(BOOLEAN): incorrect/unnecessary casts
(DOUBLE): casts placed wrong
ACTIVE: never tested
ANITILE_REVERSE_LOOPING: never set
ARMY_COMPOSITION, PATROL_GROUP, GARRISON_GROUP: pointless padding
AddCharacterToDeadList(): one caller
BeginCurInteractiveTileCheck(): parameter is always INTILE_CHECK_SELECTIVE
BeginMapUIMessage(): move from tactical to strategic
BlitMineText(): code duplication
Blt8BPPDataTo16BPPBufferHalf(), Blt8BPPDataTo16BPPBufferHalfRect(): almost identical
BtnHelpScreenDontShowHelpAgainCallback(): empty
CalcInteractiveObjectAPs(): second parameter unnecessary
CalculateOverrideStatus(): szFilename yuck
CaptureTimerCallback(): complicated
CenterX(): use %
ChangeStatusOfOpenableStructInUnloadedSector(): file leak on error
CheckForAndHandleSoldierDeath(): interface complicated, return *pfMadeCorpse?
CheckForMultiTilesInTreeAndAddToUndoList(): unused (self recursion)
ChooseCreatureQuestStartDay(): empty
ConfirmActionCancel(): overkill
ContractBoxGlow(): empty
ContractListRegionBoxGlow: giContractHighLine == -1 test unnecessary
CorpseHit(): empty
Create16BPPPaletteShaded(): callers
CreateEnemyGlow16BPPPalette(), CreateEnemyGreyGlow16BPPPalette(): ?
DONT_DISPLAY_TEXT: what is this good for?
DeathTimerCallback(): complicated
DecayCreatures(), EVENT_DECAY_CREATURES: empty/unused
DecideActionBlack(): bCanAttack != TRUE && bCanAttack != FALSE strange
DisplayAllDealersCash(): MARK_DIRTY necessary?
DisplayEmploymentinformation(): code duplication
DisplayEmploymentinformation(): pointless loop
DisplayOrderGrid(): call IsMercDead() more early
DisplayPurchasedItems(): iSubTotal undefined value
DoesTownHaveRatingToTrainMilitia(): complicated
DoesVehicleHaveAnyPassengers(): complicated
DoneFadeInActionLeaveBasement(): empty
DoneFadeInWarp(): empty
DoneFadeInWarp(): pointless?
DoorToggleLockedCallback(): pointless?
DrawBreathUIBar(): overdraw
DrawTownLabels(): complicated coordinates (FindFontCenterCoordinates() necessary at all?)
ET_ENDENEMYS_TURN: unused
EndOfHelicoptersPath(): complicated
EnoughTimeOnAssignment(): complicated
EnvBeginRainStorm(), EnvEndRainStorm(): TODO
EvaluateWorld(): complicated
ExecuteGameEvent(): code duplication
FaceRegionMvtCallback(): unused
Filler, Padding, Unused, filler: remove, partially bogus
FindCacheStructDataIndex(): should return pointer instead of index
FindValidInsertionCode(): MARK_DIRTY necessary?
GetCostOfPassageForHelicopter(): callers
GetDialogueDataFilename(): checking for MANNY does nothing
GetHelpTextForItem(): complicated
GetLoadedSectorString(): gbWorldSectorZ <-> !gbWorldSectorZ
GetMLGFilename(): complicated
GetNumberOfPastMercsOnPlayersTeam(): callers
GetRootName(): complicated
GetSectorFacilitiesFlags(): complicated
GetSectorIDString(): complicated
GetSoldierAboveGuyPositions(): (twoards end of function) no decision
GetTileType(): interface complicated
GetTimeRemainingOnSoldiersContract(): callers
GetTimeRemainingOnSoldiersInsuranceContract(): callers
GetTypeSubIndexFromTileIndex(): interface complicated
GetZLevelOfItemPoolGivenStructure(): third parameter only tested for != NULL
Handle.*TextEvent(): code duplication
HandleCompatibleAmmoUI(): if (gbCompatibleAmmo[cnt]) gbCompatibleAmmo[cnt] = FALSE;
HandleDefiniteUnloadingOfWorld(): use enum
HandleFaceHilights(): LockVideoSurface() called unnecessarily often
HandleHighLightedText(): MARK_DIRTY necessary?
HandleLeftClickCursor(): if ()s without decision
HandleMinuteUpdate(): empty
HandleMinuteUpdate(): remove?
HandleMoraleEventForSoldier(): callers
HandleOpinionOfTownsAboutSoldier(): empty
HandleSummaryInput(): fallthrough SDLK_ESCAPE -> SDLK_RETURN?
HeliCharacterDialogue(): callers
IMPVideoObjects.h(): many needlessly called functions?
I_CHANGELEVEL: unused
InitializeLibrary(): invalid use of strlen()
InitializeStrategicMapSectorTownNames(): complicated?
InternalDoMercBattleSound(): Sound file selection complicated
InternalIsPerceivedDifferentThanReality(): complicated
InvPanelButtonClickCallback(): pointless
IsDoorPerceivedOpen(): sGridNo is INT16, but used as %s
IsItRaining(): complicated
IsMapScreenWorldItemVisibleInMapInventory(), IsMapScreenWorldItemInvisibleInMapInventory(): complicated
IsTownUnderCompleteControlByEnemy(): complicated
ItemHasAttachments(): complicated
KeyRingSlotInvClickCallback: one caller
L"/": pointless copy
LackOfProgressTolerance(): callers
LightIlluminateWall(): empty
LightLoad(): complicated
LightSave(): complicated
LightSetColors(): second parameter always 1
LoadAllMapChangesFromMapTempFileAndApplyThem(): Double FileClose()?
LoadAllMapChangesFromMapTempFileAndApplyThem(): file leak on error
LoadAmbientControlFile(): complicated, pointless strcpy()
LoadAnimationProfiles(): file leak on error
LoadCivQuoteFile(): string copy necessary?
LoadEnemySoldiersFromTempFile(): ubStrategicCreatures > ubNumCreatures
LoadPaletteData(): file leak on error
LoadRevealedStatusArrayFromRevealedTempFile(): file leak on error
LoadRevealedStatusArrayFromRevealedTempFile(): file leak on error
LoadSaveScreenHandle(), LoadSaveScreenInit(), LoadSaveScreenShutdown(): Investigate if the duplication can be removed
LoadSavedGameHeader(): invalid use of strlen()
LoadSavedGameWarningMessageBoxCallBack(): users
LoadShadeTablesFromTextFile(): *scanf()
LoadSummary(): filename yuck
LocationOfNearestRefuelPoint(): callers
MAPInvClickCamoCallback(): empty
MAPInvMoveCamoCallback(): empty
MERCPROFILESTRUCT: gets saved/loaded, but contains wchar_t
MERC_POPUP_PREPARE_FLAGS_TRANS_BACK: complicated
MSG_BOX_FLAG_CANCEL, MSG_BOX_FLAG_YESNOCONTRACT: never set
MaxDistanceVisible(): inline
MercDepartEquipmentBoxCallBack(): users
MergeMessageBoxCallBack(): users
MinAPsToThrow(): usInHand is INT16, but used as %s
MiscPal: unused
MoveBullet(): RemoveBullet() before BulletMissed() (twice) and CorpseHit() seems wrong
MoveGroupFromSectorToSectorButAvoidLastSector(): caller
MoveOverheadRegionCallback(): empty
MsgBoxClickCallback(): empty
NPC.h: RUSSIAN quirk
NPCQuoteInfo: weird preprocessor magic
NewOKDestination(): boolean parameter with three (four?) values
NextPersonnelFace(): callers
OBJECT_ARMED_BOMB: never gets tested
OBJECT_MODIFIED: unused
OutOfStockMessageBoxCallBack(): pointless
PLAYER_TEAM_DEAD: never set
PayMilitiaTrainingYesNoBoxCallback(): users
PersonnelDepartedTeamCallback(): x = 0; if (x == 0)
PlayerGroupInMotion(): overkill
PrevPersonnelFace(): callers
ProcessMercEditing(): code duplication
ProcessPlayerInputActivationString(): complicated
ProcessTransactionString(): complicated?
ProcessUpdateStats(): pbSoldierStatPtr write-only
QsortCompare(): complicated
ReadRLEColMapImage(), ReadRLERGBImage(): empty
RemoveAllOnRoofsOfTypeRange(): O(n^2)
RemoveAllShadows(): O(n^2)
RemoveAllShadowsOfTypeRange(): O(n^2)
RemoveAllTopmostsOfTypeRange(): O(n^2)
RemoveAmmoGUI(), RemoveEquipGUI(), RemoveKeysGUI(), RemoveMoneyGUI(): empty, remove?
RemoveGraphicFromTempFile(): file leak on error
RemoveGraphicFromTempFile(): memory leak
RemoveItemGUI(): callers
RenderFaceOverlay(): users
RenderItemDescriptionBox(): code duplication
RenderShopKeeperInterface(): MARK_DIRTY necessary?
RenderSummaryWindow(): LockVideoSurface() called unnecessarily often
RenderTalkingMenu(): code duplication
RenderTiles(): SetFontDestBuffer() + mprintf_buffer() strange
SAIMOVECODE: use enum
SAVED_GAME_HEADER: gets saved/loaded, but contains wchar_t
SHOW_AP_LEFT: never set
SLOW_ANIMATION: never set or cleared
SOLDIERCREATE_STRUCT: gets saved/loaded, but contains wchar_t
SOLDIER_GREEN_RAY: never set
SOLDIER_QUOTE_SAID_DROWNING: never set
STRUCTURE_MULTI: never set?
STRUCTURE_TREE: never set
STR_AR_MERC_RETREATING: string too long in German
SaveGame(): double close in error case (called function closes and then file gets closed again in error handler)
SaveLightEffectsToMapTempFile(): FileDelete() + FileOpen() == complicated
SaveLightEffectsToSaveGameFile(): empty
SaveSmokeEffectsToMapTempFile(): FileDelete() + FileOpen() == complicated
SaveWorld(), LoadWorld(), EvaluateWorld(): uiSoldierSize gets saved, but loaded and discarded
SectorExitBackgroundCallback(): empty
SelectPlayersOfferSlotsRegionCallBack(): [...].uiItemPrice = [...].bMoneyStatus seems wrong
SetClockResolutionPerSecond(): complicated
SetExclusive24HourTimeValue(): complicated, use swprintf()
SetInputFieldStringWithNumericStrictValue(): complicated
SetSelection(): callers
SetTilesetOneTerrainValues(): set callback to avoid explicit test
SoldierCanSeeCatchComing(): empty
SoldierCarriesTwoHandedWeapon(): complicated
StandardGunListAmmoReplacement(): declaration in .c
StrategicMap[]: definition not used in file
StrategicPythSpacesAway(): avoid sqrt()
TacticalScreenMsg(): no need for format string
TrashMapTile(), MapOptimize(): investigate if useful
TurnBasedHandleNPCAI(): lots of commented out stuff
TurnSoldierIntoCorpse(): one caller
TwoHandedItem(): complicated
UseGun(): code duplication
VIDEO_NO_CURSOR: MSYS_NO_CURSOR? strange
ValidateGameEvents(): questionable
ValidateSkillsList(), RemoveSkillFromSkillsList(): complicated
VehicleHasFuel(): inline
WaitForSelectionWindowResponse(): fallthrough SDLK_ESCAPE -> SDLK_RETURN?
WillShopKeeperRejectObjectsFromPlayer(): complicated
WrapString(): Make 1st parameter read-only
WriteSectorSummaryUpdate(): puiFilename yuck
bBuddy[5], bHated[5]: indices 3 and 4 unused
fButtonsPresent: once TRUE it never changes anymore
fPotentialForDebug: ?
fResetContractGlow: probably always TRUE
fUseDisabledAutoShade: some tests seems to be inverted
gMercPlacement: memory leak?
gOldClipRect: common variable
gOpenDoorList[], gClosedDoorList[]: users, code duplication
gSaveBufferBasicPlacement, gSaveBufferDetailedPlacement: necessarily global?
gTacticalStatus.ubEngagedInConvFromActionMercID, ENGAGED_IN_CONV: redundant?
gTacticalStatus.ubSpottersCalledForBy: once != NOBODY never gets NOBODY again
gTileTypeLogicalHeight[]: always 1 (memset)?
gTileTypeLogicalHeight[]: definition not used in file
gbSAMGraphicList[]: definition not used in file
gbSkillTraitBonus[]: definition not used in file
gfDrawPathPoints: always FALSE, debug
gfItemDescHelpTextOffset: once TRUE never gets FALSE again
gfProgBarActive: once TRUE it never changes anymore
gsRadarY: always RADAR_WINDOW_TM_Y?
gWhoThrewRock: useful?
gszCivGroupNames[]: move declaration
gszFilename: wchar_t[] -> char[]?
gubAnimSurfaceCorpseID: static if possible
gubCurrentNpcInSector[giHaveSelectedNPC]: complicated
gubWorldRoomHidden: static?
guiCacheSize: const
guiMemTotal: remove
guiPOPUPTEX: load probably unnecessary in MapScreen.c
gzFilename: wchar_t[] -> char[]?
pMapInventoryErrorString[0]: probably unused
pSoldier = pSoldier: strange
pSoldier->pShades[16 ... 31]: unused?
struct ETRLEData: reorder attributes
swprintf([^,]*,[^,]*,[^,"]*[,)]: non-fixed format string
typedef float real: remove
ubMineType: unused?
ubTravelRating: write-only
wcscat(): check for overkill
{Head,Misc,Pabts,Skin,Vest}Pal: buffer necessary? pointer instead?
{Load,Save}ShadeTable(): code duplication
{Load,Save}ShadeTable(): filename generation ugly
{Loading,Saving}Screen*(): unused?
{Lock,Unlock}{Back,Frame,Mouse}Buffer(): SDL_LockSurface()?


STRUCTS: unused attributes

BULLET
ubTilesPerUpdate: always 1

FACETYPE
uiMouthDelay: always 120

GROUP // TODO not finished
ubOriginalSector: write-only, read to write-only
ubFatigueLevel
ubRestAtFatigueLevel
ubRestToFatigueLevel
fRestAtNight
fWaypointsCancelled_UNUSED
ubCreatedSectorID: write-only
bPadding

MERCPROFILESTRUCT
uiAttnSound
uiCurseSound
uiDieSound
uiGoodSound
uiGruntSound
uiGrunt2Sound
uiOkSound
ubFaceIndex: overwritten after load from data file
bArmourAttractiveness: overwritten after load from data file
bStealRate
bVocalVolume
bScientific
uiEyeDelay
uiMouthDelay
bMinService
bResigned
bMainGunAttractiveness: overwritten after load from data file
fUseProfileInsertionInfo: overwritten after load from data file
sGridNo: overwritten after load from data file
bMercTownReputation: probably always INITIAL_TOWN_REPUTATION (0)
bPadding[4]
bRace
bNationality
bAppearance
bAppearanceCareLevel
bRefinement
bRefinementCareLevel
bHatedNationality
bHatedNationalityCareLevel
bRacist
bBaseMorale
sMedicalDepositAmount: overwritten after load from data file
usOptionalGearCost: overwritten after load from data file
sTrueSalary: write-only/read-to-init-self
ubBuffer[4]

BASIC_SOLDIERCREATE_STRUCT
PADDINGSLOTS[14]

OBJECTTYPE
ubGunUnused
bMoneyStatus: only one use, which most probably is wrong
ubMoneyUnused
ubLocationID
bKeyStatus
ubKeyUnused
ubOwnershipUnused

REAL_OBJECT
OneOverMass: always 1/60.f

SOLDIERCREATESTRUCT
fStatic: strange
fPlayerMerc: strange
fCopyProfileItemsOver: strange
MiscPal
fKillSlotIfOwnerDies
fUseGivenVehicle: strange
fHasKeys: strange

SOLDIERTYPE
fReloading: always FALSE
bScientific: just copied around a bit
sHeightAdjustment: seems to be always 0
sDesiredHeight: strange
sTempNewGridNo: strange
fPausedMove: strange
fUIdeadMerc: strange
fUICloseMerc: strange
ReloadCounter: never gets reset, probably unnecessary, see fReloading
sReloadDelay: seems to be always 0, probably unnecessary, see fReloading
fTurnInProgress: only gets printed for debug
bViewRange: always NORMAL_VIEW_RANGE
bNewOppCnt: strange
fShowLocator: maybe unnecessary
MiscPal
pThrowParams: load/save?
pLevelNode: load/save?
sBlackList: strange
bHasKeys: strange
fForceShade: pForceShade != NULL?
fDoingExternalDeath: always TRUE?
ubLastDamageReason: necessary?

TacticalStatusType
fGoingToEnterDemo_UNUSED
fNOTDOLASTDEMO_UNUSED
fMultiplayer


BUGS
KillPreBattleInterface(): EnableDisAbleMapScreenOptionsButton(TRUE) maybe tries to enable non-existent buttons

1. Create a new game
2. Hire one merc
3. Close laptop
4. Enable time compression (The game goes to tactical view)
5. Go to strategic view
6. Enter laptop
-> non-existent button access

DisplayNewMailBox(): MarkAButtonDirty(giNewMailButton[0]); sometimes accesses non-existent button


WORKLIST
