Patch by Stefan Huehner: "code cleanup: static 2"

Mark some more function as static.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@711 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2006-09-14 13:15:40 +00:00
parent 3fdc9539b9
commit 0ebbf5f1db
10 changed files with 67 additions and 67 deletions

View File

@ -709,7 +709,7 @@ BOOL actionVisibleTarget(DROID *psDroid, BASE_OBJECT *psTarget)
return FALSE;
}
void actionAddVtolAttackRun( DROID *psDroid )
static void actionAddVtolAttackRun( DROID *psDroid )
{
FRACT_D fA;
SDWORD iVNx, iVNy, iA, iX, iY;
@ -773,7 +773,7 @@ void actionAddVtolAttackRun( DROID *psDroid )
//psDroid->sMove.iAttackRuns++;
}
void actionUpdateVtolAttack( DROID *psDroid )
static void actionUpdateVtolAttack( DROID *psDroid )
{
WEAPON_STATS *psWeapStats = NULL;
@ -811,7 +811,7 @@ void actionUpdateVtolAttack( DROID *psDroid )
}
}
void actionUpdateTransporter( DROID *psDroid )
static void actionUpdateTransporter( DROID *psDroid )
{
//check if transporter has arrived
if (updateTransporter(psDroid))
@ -869,7 +869,7 @@ void actionUpdateTransporter( DROID *psDroid )
// calculate a position for units to pull back to if they
// need to increase the range between them and a target
void actionCalcPullBackPoint(BASE_OBJECT *psObj, BASE_OBJECT *psTarget, SDWORD *px, SDWORD *py)
static void actionCalcPullBackPoint(BASE_OBJECT *psObj, BASE_OBJECT *psTarget, SDWORD *px, SDWORD *py)
{
SDWORD xdiff,ydiff, len;
@ -2920,7 +2920,7 @@ void moveToRearm(DROID *psDroid)
// whether a tile is suitable for a vtol to land on
BOOL vtolLandingTile(SDWORD x, SDWORD y)
static BOOL vtolLandingTile(SDWORD x, SDWORD y)
{
MAPTILE *psTile;

View File

@ -183,7 +183,7 @@ BOOL aiNearestTarget(DROID *psDroid, BASE_OBJECT **ppsObj)
// see if a structure has the range to fire on a target
BOOL aiStructHasRange(STRUCTURE *psStruct, BASE_OBJECT *psTarget)
static BOOL aiStructHasRange(STRUCTURE *psStruct, BASE_OBJECT *psTarget)
{
WEAPON_STATS *psWStats;
SDWORD xdiff,ydiff, longRange;
@ -211,7 +211,7 @@ BOOL aiStructHasRange(STRUCTURE *psStruct, BASE_OBJECT *psTarget)
// see if an object is a wall
BOOL aiObjIsWall(BASE_OBJECT *psObj)
static BOOL aiObjIsWall(BASE_OBJECT *psObj)
{
if (psObj->type != OBJ_STRUCTURE)
{

View File

@ -107,13 +107,13 @@ void astarResetCounters(void)
astarOuter = 0;
astarRemove = 0;
}
void ClearAstarNodes(void)
static void ClearAstarNodes(void)
{
assert(apsNodes);
memset(apsNodes, 0, sizeof(FP_NODE *) * FPATH_TABLESIZE);
}
UDWORD GetApsNodesSize(void)
static UDWORD GetApsNodesSize(void)
{
return(sizeof(FP_NODE *) * FPATH_TABLESIZE);
}
@ -199,7 +199,7 @@ void fpathShutDown(void)
* Hack to use coordinates instead of a string by John.
*/
/***************************************************************************/
SDWORD fpathHashFunc(SDWORD x, SDWORD y)
static SDWORD fpathHashFunc(SDWORD x, SDWORD y)
{
UINT iHashValue, i;
CHAR *c;
@ -229,7 +229,7 @@ SDWORD fpathHashFunc(SDWORD x, SDWORD y)
}
// Add a node to the hash table
void fpathHashAdd(FP_NODE *apsTable[], FP_NODE *psNode)
static void fpathHashAdd(FP_NODE *apsTable[], FP_NODE *psNode)
{
SDWORD index;
@ -241,7 +241,7 @@ void fpathHashAdd(FP_NODE *apsTable[], FP_NODE *psNode)
// See if a node is in the hash table
FP_NODE *fpathHashPresent(FP_NODE *apsTable[], SDWORD x, SDWORD y)
static FP_NODE *fpathHashPresent(FP_NODE *apsTable[], SDWORD x, SDWORD y)
{
SDWORD index;
FP_NODE *psFound;
@ -265,7 +265,7 @@ FP_NODE *fpathHashPresent(FP_NODE *apsTable[], SDWORD x, SDWORD y)
// Remove a node from the hash table
FP_NODE *fpathHashRemove(FP_NODE *apsTable[], SDWORD x, SDWORD y)
static FP_NODE *fpathHashRemove(FP_NODE *apsTable[], SDWORD x, SDWORD y)
{
SDWORD index;
FP_NODE *psPrev, *psFound;
@ -298,7 +298,7 @@ FP_NODE *fpathHashRemove(FP_NODE *apsTable[], SDWORD x, SDWORD y)
}
// Remove a node from the hash table
FP_NODE *fpathHashCondRemove(FP_NODE *apsTable[], SDWORD x, SDWORD y, SDWORD dist)
static FP_NODE *fpathHashCondRemove(FP_NODE *apsTable[], SDWORD x, SDWORD y, SDWORD dist)
{
SDWORD index;
FP_NODE *psPrev, *psFound;
@ -337,7 +337,7 @@ FP_NODE *fpathHashCondRemove(FP_NODE *apsTable[], SDWORD x, SDWORD y, SDWORD dis
// Reset the hash tables
void fpathHashReset(void)
static void fpathHashReset(void)
{
SDWORD i;
FP_NODE *psNext;
@ -372,7 +372,7 @@ void fpathHashReset(void)
// Compare two nodes
__inline SDWORD fpathCompare(FP_NODE *psFirst, FP_NODE *psSecond)
static __inline SDWORD fpathCompare(FP_NODE *psFirst, FP_NODE *psSecond)
{
SDWORD first,second;
@ -404,7 +404,7 @@ __inline SDWORD fpathCompare(FP_NODE *psFirst, FP_NODE *psSecond)
// make a 50/50 random choice
static UWORD seed = 1234;
BOOL fpathRandChoice(void)
static BOOL fpathRandChoice(void)
{
UDWORD val;
@ -417,7 +417,7 @@ BOOL fpathRandChoice(void)
#if OPEN_LIST == 0
// Add a node to the open list
void fpathOpenAdd(FP_NODE *psNode)
static void fpathOpenAdd(FP_NODE *psNode)
{
FP_NODE *psCurr, *psPrev;
SDWORD comp;
@ -461,7 +461,7 @@ void fpathOpenAdd(FP_NODE *psNode)
}
// Remove a node from the open list
void fpathOpenRemove(FP_NODE *psNode)
static void fpathOpenRemove(FP_NODE *psNode)
{
FP_NODE *psCurr, *psParent, *psSubParent, *psInsert;
SDWORD comp;
@ -546,7 +546,7 @@ void fpathOpenRemove(FP_NODE *psNode)
}
// Get the nearest entry in the open list
FP_NODE *fpathOpenGet(void)
static FP_NODE *fpathOpenGet(void)
{
FP_NODE *psNode, *psPrev;
@ -610,7 +610,7 @@ BOOL fpathValidateTree(FP_NODE *psNode)
#elif OPEN_LIST == 1
// Add a node to the open list
void fpathOpenAdd(FP_NODE *psNode)
static void fpathOpenAdd(FP_NODE *psNode)
{
FP_NODE *psCurr,*psPrev;
@ -639,7 +639,7 @@ void fpathOpenAdd(FP_NODE *psNode)
// Get the nearest entry in the open list
FP_NODE *fpathOpenGet(void)
static FP_NODE *fpathOpenGet(void)
{
FP_NODE *psNode;
@ -652,14 +652,14 @@ FP_NODE *fpathOpenGet(void)
#elif OPEN_LIST == 2
// Add a node to the open list
void fpathOpenAdd(FP_NODE *psNode)
static void fpathOpenAdd(FP_NODE *psNode)
{
psNode->psOpen = psOpen;
psOpen = psNode;
}
// Get the nearest entry in the open list
FP_NODE *fpathOpenGet(void)
static FP_NODE *fpathOpenGet(void)
{
FP_NODE *psNode, *psCurr, *psPrev, *psParent = NULL;
SDWORD comp;
@ -701,7 +701,7 @@ FP_NODE *fpathOpenGet(void)
#if OPEN_LIST == 1 || OPEN_LIST == 2
// Remove a node from the open list
void fpathOpenRemove(FP_NODE *psNode)
static void fpathOpenRemove(FP_NODE *psNode)
{
FP_NODE *psCurr,*psPrev;
@ -740,7 +740,7 @@ void fpathOpenRemove(FP_NODE *psNode)
// estimate the distance to the target point
SDWORD fpathEstimate(SDWORD x, SDWORD y, SDWORD fx, SDWORD fy)
static SDWORD fpathEstimate(SDWORD x, SDWORD y, SDWORD fx, SDWORD fy)
{
SDWORD xdiff, ydiff;
@ -755,7 +755,7 @@ SDWORD fpathEstimate(SDWORD x, SDWORD y, SDWORD fx, SDWORD fy)
// Generate a new node
FP_NODE *fpathNewNode(SDWORD x, SDWORD y, SDWORD dist, FP_NODE *psRoute)
static FP_NODE *fpathNewNode(SDWORD x, SDWORD y, SDWORD dist, FP_NODE *psRoute)
{
FP_NODE *psNode;
@ -813,7 +813,7 @@ static SDWORD finalX,finalY, vectorX,vectorY;
static BOOL obstruction;
// The visibility ray callback
BOOL fpathVisCallback(SDWORD x, SDWORD y, SDWORD dist)
static BOOL fpathVisCallback(SDWORD x, SDWORD y, SDWORD dist)
{
SDWORD vx,vy;
@ -862,7 +862,7 @@ BOOL fpathTileLOS(SDWORD x1,SDWORD y1, SDWORD x2,SDWORD y2)
// Optimise the route
void fpathOptimise(FP_NODE *psRoute)
static void fpathOptimise(FP_NODE *psRoute)
{
FP_NODE *psCurr, *psSearch, *psTest;
BOOL los;

View File

@ -86,7 +86,7 @@ void clustInitialise(void)
// check the cluster usage
void clustValidateUsage(void)
static void clustValidateUsage(void)
{
SDWORD cluster, player, droidUsage, structUsage;
STRUCTURE *psStruct;
@ -217,7 +217,7 @@ void clustRemoveObject(BASE_OBJECT *psObj)
// tell a droid to join a cluster
void _clustAddDroid(DROID *psDroid, SDWORD cluster)
static void _clustAddDroid(DROID *psDroid, SDWORD cluster)
{
DROID *psCurr;
SDWORD xdiff, ydiff;
@ -252,7 +252,7 @@ void _clustAddDroid(DROID *psDroid, SDWORD cluster)
}
void clustAddDroid(DROID *psDroid, SDWORD cluster)
static void clustAddDroid(DROID *psDroid, SDWORD cluster)
{
_clustAddDroid(psDroid,cluster);
}
@ -283,7 +283,7 @@ void clustNewDroid(DROID *psDroid)
// tell a structure to join a cluster
void _clustAddStruct(STRUCTURE *psStruct, SDWORD cluster)
static void _clustAddStruct(STRUCTURE *psStruct, SDWORD cluster)
{
STRUCTURE *psCurr;
SDWORD xdiff, ydiff;
@ -317,7 +317,7 @@ void _clustAddStruct(STRUCTURE *psStruct, SDWORD cluster)
}
}
void clustAddStruct(STRUCTURE *psStruct, SDWORD cluster)
static void clustAddStruct(STRUCTURE *psStruct, SDWORD cluster)
{
_clustAddStruct(psStruct,cluster);
}
@ -349,7 +349,7 @@ void clustNewStruct(STRUCTURE *psStruct)
// find an unused cluster number for a droid
SDWORD clustFindUnused(void)
static SDWORD clustFindUnused(void)
{
SDWORD cluster;

View File

@ -254,7 +254,7 @@ DROID *psCurr;
}
// set the number of command droids for a player
void cmdDroidSetAvailable(SDWORD player, SDWORD num)
static void cmdDroidSetAvailable(SDWORD player, SDWORD num)
{
ASSERT( (player >= 0) && (player < MAX_PLAYERS),
"cmdUnitSetAvailable: invalid player number" );

View File

@ -239,7 +239,7 @@ UDWORD getStructureSize(STRUCTURE *psStructure)
return (size);
}
UDWORD getStructureRadius(STRUCTURE *psStructure)
static UDWORD getStructureRadius(STRUCTURE *psStructure)
{
iIMDShape *baseImd;
SDWORD Radius = GetRadius(psStructure->sDisplay.imd);
@ -268,7 +268,7 @@ UDWORD getStructureStatSize(STRUCTURE_STATS *Stats)
return (size);
}
UDWORD getStructureStatRadius(STRUCTURE_STATS *Stats,UDWORD Player)
static UDWORD getStructureStatRadius(STRUCTURE_STATS *Stats,UDWORD Player)
{
iIMDShape *baseImd;
SDWORD Radius = GetRadius(Stats->pIMD);

View File

@ -746,7 +746,7 @@ BOOL getConsoleDisplayStatus( void )
return(bConsoleDisplayEnabled);
}
void conShowReplayWav( void )
static void conShowReplayWav( void )
{

View File

@ -425,7 +425,7 @@ extern BOOL bRender3DOnly;
/* Add the design widgets to the widget screen */
BOOL _intAddDesign( BOOL bShowCentreScreen )
static BOOL _intAddDesign( BOOL bShowCentreScreen )
{
W_FORMINIT sFormInit;
W_LABINIT sLabInit;
@ -1387,7 +1387,7 @@ intChooseSystemStats( DROID_TEMPLATE *psTemplate )
- This is used for generating cyborg names
*/
DROID_TEMPLATE *MatchTemplate(DROID_TEMPLATE *SourceTemplate,UDWORD player)
static DROID_TEMPLATE *MatchTemplate(DROID_TEMPLATE *SourceTemplate,UDWORD player)
{
DROID_TEMPLATE *pDroidDesign;
@ -3993,7 +3993,7 @@ void intRemoveDesign(void)
}
/* set flashing flag for button */
void intSetButtonFlash( UDWORD id, BOOL bFlash )
static void intSetButtonFlash( UDWORD id, BOOL bFlash )
{
#ifdef FLASH_BUTTONS
WIDGET *psWidget = widgGetFromID( psWScreen, id );
@ -4018,7 +4018,7 @@ void intSetButtonFlash( UDWORD id, BOOL bFlash )
* Checks whether user has customised template name : template not
* customised if not complete or if generated name same as current.
*/
BOOL desTemplateNameCustomised( DROID_TEMPLATE *psTemplate )
static BOOL desTemplateNameCustomised( DROID_TEMPLATE *psTemplate )
{
if ( (psTemplate->droidType == DROID_DEFAULT) ||
(strcmp( getTemplateName(psTemplate),
@ -4034,7 +4034,7 @@ BOOL desTemplateNameCustomised( DROID_TEMPLATE *psTemplate )
#endif
/* checks whether to update name or has user already changed it */
void desUpdateDesignName( DROID_TEMPLATE *psTemplate, STRING *szCurrName )
static void desUpdateDesignName( DROID_TEMPLATE *psTemplate, STRING *szCurrName )
{
}

View File

@ -434,19 +434,19 @@ BOOL dispModeChange(void)
}
BOOL GetMouseOverRadar(void)
static BOOL GetMouseOverRadar(void)
{
return mouseOverRadar;
}
void ClearMouseOverRadar(void)
static void ClearMouseOverRadar(void)
{
mouseOverRadar = FALSE;
}
void SetMouseOverRadar(void)
static void SetMouseOverRadar(void)
{
mouseOverRadar = TRUE;
}
@ -740,9 +740,9 @@ void processInput(void)
//}
BOOL OverRadarAndNotDragging(void)
static BOOL OverRadarAndNotDragging(void)
{
BOOL OverRadar = mouseOverRadar;
BOOL OverRadar = mouseOverRadar;
if(getHQExists(selectedPlayer)==FALSE)
{
@ -757,7 +757,7 @@ BOOL OverRadar = mouseOverRadar;
}
void CheckFinishedDrag(void)
static void CheckFinishedDrag(void)
{
if(driveModeActive()) {
return;
@ -801,7 +801,7 @@ void CheckFinishedDrag(void)
}
}
void CheckStartWallDrag(void)
static void CheckStartWallDrag(void)
{
if(driveModeActive()) {
return;
@ -835,7 +835,7 @@ void CheckStartWallDrag(void)
//BOOL CheckFinishedWallDrag(void) - misleading name - sorry Paul!
//this function is called when a location has been chosen to place a structure or a DP
BOOL CheckFinishedFindPosition(void)
static BOOL CheckFinishedFindPosition(void)
{
BOOL OverRadar = OverRadarAndNotDragging();
@ -883,7 +883,7 @@ BOOL CheckFinishedFindPosition(void)
}
void HandleDrag(void)
static void HandleDrag(void)
{
BOOL OverRadar = mouseOverRadar;
UDWORD dragX,dragY;
@ -1649,7 +1649,7 @@ void displayWorld(void)
}
void mouseSetMXMY(void)
static void mouseSetMXMY(void)
{
mX = mouseX();
mY = mouseY();
@ -1900,7 +1900,7 @@ void CancelDeliveryRepos(void)
// check whether a clicked on droid is in a command group or assigned to a sensor
BOOL droidHasLeader(DROID *psDroid)
static BOOL droidHasLeader(DROID *psDroid)
{
BASE_OBJECT *psLeader;
@ -2004,7 +2004,7 @@ void dealWithDroidSelect(DROID *psDroid, BOOL bDragBox)
}
void FeedbackOrderGiven(void)
static void FeedbackOrderGiven(void)
{
static UDWORD LastFrame = 0;
UDWORD ThisFrame = frameGetFrameNumber();
@ -2017,7 +2017,7 @@ void FeedbackOrderGiven(void)
}
void FeedbackClickedOn(void)
static void FeedbackClickedOn(void)
{
FeedbackOrderGiven();
}

View File

@ -635,7 +635,7 @@ UDWORD lastDroidRemove=0;
UDWORD droidRemoveKills=0;
// -------------------------------------------------------------------------------
*/
void removeDroidFX(DROID *psDel)
static void removeDroidFX(DROID *psDel)
{
iVector pos;
@ -1153,7 +1153,7 @@ static void addNaybor(BASE_OBJECT *psObj, UDWORD distSqr)
static DROID *CurrentNaybors = NULL;
static UDWORD nayborTime = 0;
void droidResetNaybors(void)
static void droidResetNaybors(void)
{
CurrentNaybors = NULL;
}
@ -1281,7 +1281,7 @@ void droidGetNaybors(DROID *psDroid)
/* Display the neigbours of a droid */
void displayNaybors(void)
static void displayNaybors(void)
{
UDWORD count, y;
STRING *pType = NULL;
@ -1657,7 +1657,7 @@ BOOL droidStartFoundation(DROID *psDroid)
BOOL
static BOOL
droidCheckBuildStillInProgress( AUDIO_SAMPLE *psSample )
{
DROID *psDroid;
@ -4589,7 +4589,7 @@ void droidSetBits(DROID_TEMPLATE *pTemplate,DROID *psDroid)
// Sets the parts array in a template given a droid.
void templateSetParts(DROID *psDroid,DROID_TEMPLATE *psTemplate)
static void templateSetParts(DROID *psDroid,DROID_TEMPLATE *psTemplate)
{
// UDWORD inc;
@ -5543,7 +5543,7 @@ UDWORD getBound(UDWORD level)
}
/* Calculate the system points used by a template - NOT USED AT PRESENT*/
UDWORD calcTemplateSystemPoints(DROID_TEMPLATE *psTemplate)
static UDWORD calcTemplateSystemPoints(DROID_TEMPLATE *psTemplate)
{
UDWORD system, i;
@ -5577,7 +5577,7 @@ UDWORD calcTemplateSystemPoints(DROID_TEMPLATE *psTemplate)
/* Calculate the system points used by a droid - NOT USED AT PRESENT*/
UDWORD calcDroidSystemPoints(DROID *psDroid)
static UDWORD calcDroidSystemPoints(DROID *psDroid)
{
UDWORD system;//, i;
@ -5679,7 +5679,7 @@ BOOL noDroid(UDWORD x, UDWORD y)
// ////////////////////////////////////////////////////////////////////////////
// returns true when one droid on x,y square.
BOOL oneDroid(UDWORD x, UDWORD y)
static BOOL oneDroid(UDWORD x, UDWORD y)
{
UDWORD i;
BOOL bFound = FALSE;
@ -5781,7 +5781,7 @@ BOOL zonedPAT(UDWORD x, UDWORD y)
}
}
// ------------------------------------------------------------------------------------
BOOL halfPAT(UDWORD x, UDWORD y)
static BOOL halfPAT(UDWORD x, UDWORD y)
{
if(sensiblePlace(x,y) AND oneDroid(x,y))
{
@ -6272,7 +6272,7 @@ void setUpBuildModule(DROID *psDroid)
// not written yet - needs merging with code in Dr Jones' Design.c
void BuildNameFromDroid(DROID *psDroid, STRING *ConstructedName)
static void BuildNameFromDroid(DROID *psDroid, STRING *ConstructedName)
{
}