Hi,
attached patch marks some more functions as static.
Please consider applying.
Regards,
Stefan
Index: src/display.c
===================================================================
--- src/display.c (revision 351)
+++ src/display.c (working copy)
@@ -434,19 +434,19 @@
}
-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 @@
//}
-BOOL OverRadarAndNotDragging(void)
+static BOOL OverRadarAndNotDragging(void)
{
-BOOL OverRadar = mouseOverRadar;
+ BOOL OverRadar = mouseOverRadar;
if(getHQExists(selectedPlayer)==FALSE)
{
@@ -757,7 +757,7 @@
}
-void CheckFinishedDrag(void)
+static void CheckFinishedDrag(void)
{
if(driveModeActive()) {
return;
@@ -801,7 +801,7 @@
}
}
-void CheckStartWallDrag(void)
+static void CheckStartWallDrag(void)
{
if(driveModeActive()) {
return;
@@ -835,7 +835,7 @@
//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 @@
}
-void HandleDrag(void)
+static void HandleDrag(void)
{
BOOL OverRadar = mouseOverRadar;
UDWORD dragX,dragY;
@@ -1649,7 +1649,7 @@
}
-void mouseSetMXMY(void)
+static void mouseSetMXMY(void)
{
mX = mouseX();
mY = mouseY();
@@ -1900,7 +1900,7 @@
// 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 FeedbackOrderGiven(void)
+static void FeedbackOrderGiven(void)
{
static UDWORD LastFrame = 0;
UDWORD ThisFrame = frameGetFrameNumber();
@@ -2017,7 +2017,7 @@
}
-void FeedbackClickedOn(void)
+static void FeedbackClickedOn(void)
{
FeedbackOrderGiven();
}
Index: src/action.c
===================================================================
--- src/action.c (revision 351)
+++ src/action.c (working copy)
@@ -709,7 +709,7 @@
return FALSE;
}
-void actionAddVtolAttackRun( DROID *psDroid )
+static void actionAddVtolAttackRun( DROID *psDroid )
{
FRACT_D fA;
SDWORD iVNx, iVNy, iA, iX, iY;
@@ -773,7 +773,7 @@
//psDroid->sMove.iAttackRuns++;
}
-void actionUpdateVtolAttack( DROID *psDroid )
+static void actionUpdateVtolAttack( DROID *psDroid )
{
WEAPON_STATS *psWeapStats = NULL;
@@ -811,7 +811,7 @@
}
}
-void actionUpdateTransporter( DROID *psDroid )
+static void actionUpdateTransporter( DROID *psDroid )
{
//check if transporter has arrived
if (updateTransporter(psDroid))
@@ -869,7 +869,7 @@
// 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 @@
// 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;
Index: src/droid.c
===================================================================
--- src/droid.c (revision 351)
+++ src/droid.c (working copy)
@@ -635,7 +635,7 @@
UDWORD droidRemoveKills=0;
//
-------------------------------------------------------------------------------
*/
-void removeDroidFX(DROID *psDel)
+static void removeDroidFX(DROID *psDel)
{
iVector pos;
@@ -1153,7 +1153,7 @@
static DROID *CurrentNaybors = NULL;
static UDWORD nayborTime = 0;
-void droidResetNaybors(void)
+static void droidResetNaybors(void)
{
CurrentNaybors = NULL;
}
@@ -1281,7 +1281,7 @@
/* Display the neigbours of a droid */
-void displayNaybors(void)
+static void displayNaybors(void)
{
UDWORD count, y;
STRING *pType = NULL;
@@ -1657,7 +1657,7 @@
-BOOL
+static BOOL
droidCheckBuildStillInProgress( AUDIO_SAMPLE *psSample )
{
DROID *psDroid;
@@ -4589,7 +4589,7 @@
// 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 @@
}
/* 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 @@
/* 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 @@
// ////////////////////////////////////////////////////////////////////////////
// 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 halfPAT(UDWORD x, UDWORD y)
+static BOOL halfPAT(UDWORD x, UDWORD y)
{
if(sensiblePlace(x,y) AND oneDroid(x,y))
{
@@ -6272,7 +6272,7 @@
// 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)
{
}
Index: src/component.c
===================================================================
--- src/component.c (revision 351)
+++ src/component.c (working copy)
@@ -239,7 +239,7 @@
return (size);
}
-UDWORD getStructureRadius(STRUCTURE *psStructure)
+static UDWORD getStructureRadius(STRUCTURE *psStructure)
{
iIMDShape *baseImd;
SDWORD Radius = GetRadius(psStructure->sDisplay.imd);
@@ -268,7 +268,7 @@
return (size);
}
-UDWORD getStructureStatRadius(STRUCTURE_STATS *Stats,UDWORD Player)
+static UDWORD getStructureStatRadius(STRUCTURE_STATS *Stats,UDWORD Player)
{
iIMDShape *baseImd;
SDWORD Radius = GetRadius(Stats->pIMD);
Index: src/design.c
===================================================================
--- src/design.c (revision 351)
+++ src/design.c (working copy)
@@ -425,7 +425,7 @@
/* 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 @@
- 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 @@
}
/* 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 @@
* 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 @@
#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 )
{
}
Index: src/cluster.c
===================================================================
--- src/cluster.c (revision 351)
+++ src/cluster.c (working copy)
@@ -86,7 +86,7 @@
// check the cluster usage
-void clustValidateUsage(void)
+static void clustValidateUsage(void)
{
SDWORD cluster, player, droidUsage, structUsage;
STRUCTURE *psStruct;
@@ -217,7 +217,7 @@
// 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)
+static void clustAddDroid(DROID *psDroid, SDWORD cluster)
{
_clustAddDroid(psDroid,cluster);
}
@@ -283,7 +283,7 @@
// 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)
+static void clustAddStruct(STRUCTURE *psStruct, SDWORD cluster)
{
_clustAddStruct(psStruct,cluster);
}
@@ -349,7 +349,7 @@
// find an unused cluster number for a droid
-SDWORD clustFindUnused(void)
+static SDWORD clustFindUnused(void)
{
SDWORD cluster;
Index: src/console.c
===================================================================
--- src/console.c (revision 351)
+++ src/console.c (working copy)
@@ -746,7 +746,7 @@
return(bConsoleDisplayEnabled);
}
-void conShowReplayWav( void )
+static void conShowReplayWav( void )
{
Index: src/cmddroid.c
===================================================================
--- src/cmddroid.c (revision 351)
+++ src/cmddroid.c (working copy)
@@ -254,7 +254,7 @@
}
// 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" );
Index: src/ai.c
===================================================================
--- src/ai.c (revision 351)
+++ src/ai.c (working copy)
@@ -183,7 +183,7 @@
// 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 @@
// see if an object is a wall
-BOOL aiObjIsWall(BASE_OBJECT *psObj)
+static BOOL aiObjIsWall(BASE_OBJECT *psObj)
{
if (psObj->type != OBJ_STRUCTURE)
{
Index: src/astar.c
===================================================================
--- src/astar.c (revision 351)
+++ src/astar.c (working copy)
@@ -107,13 +107,13 @@
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 @@
* 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 @@
}
// 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 @@
// 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 @@
// 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 @@
}
// 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 @@
// Reset the hash tables
-void fpathHashReset(void)
+static void fpathHashReset(void)
{
SDWORD i;
FP_NODE *psNext;
@@ -372,7 +372,7 @@
// 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 @@
// make a 50/50 random choice
static UWORD seed = 1234;
-BOOL fpathRandChoice(void)
+static BOOL fpathRandChoice(void)
{
UDWORD val;
@@ -417,7 +417,7 @@
#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 @@
}
// 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 @@
}
// 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 @@
#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 @@
// Get the nearest entry in the open list
-FP_NODE *fpathOpenGet(void)
+static FP_NODE *fpathOpenGet(void)
{
FP_NODE *psNode;
@@ -652,14 +652,14 @@
#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 @@
#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 @@
// 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 @@
// 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 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 @@
// Optimise the route
-void fpathOptimise(FP_NODE *psRoute)
+static void fpathOptimise(FP_NODE *psRoute)
{
FP_NODE *psCurr, *psSearch, *psTest;
BOOL los;
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev