Hi,
attached patch marks several more functions as static.
Regards,
Stefan
Index: src/formation.c
===================================================================
--- src/formation.c (revision 353)
+++ src/formation.c (working copy)
@@ -200,7 +200,7 @@
}
// find formation speed (currently speed of slowest unit)
-void formationUpdateSpeed( FORMATION *psFormation, BASE_OBJECT *psNew )
+static void formationUpdateSpeed( FORMATION *psFormation, BASE_OBJECT *psNew )
{
DROID *psDroid;
SDWORD iUnit;
@@ -364,7 +364,7 @@
}
// calculate the coordinates of a position on a line
-void formationCalcPos(FORMATION *psFormation, SDWORD line, SDWORD dist,
+static void formationCalcPos(FORMATION *psFormation, SDWORD line, SDWORD dist,
SDWORD *pX, SDWORD *pY)
{
SDWORD dir, xoffset,yoffset, rank;
@@ -389,7 +389,7 @@
// assign a unit to a free spot in the formation
-void formationFindFree(FORMATION *psFormation, BASE_OBJECT *psObj,
+static void formationFindFree(FORMATION *psFormation, BASE_OBJECT *psObj,
SDWORD *pX, SDWORD *pY)
{
SDWORD line, unit, objRadius, radius;
Index: src/gatewaysup.c
===================================================================
--- src/gatewaysup.c (revision 353)
+++ src/gatewaysup.c (working copy)
@@ -90,7 +90,7 @@
* with the same pixel value to the new pixel value nv.
* A 4-connected neighbor is a pixel above, below, left, or right of a pixel.
*/
-void gwSeedFill(SDWORD x, SDWORD y, SDWORD nv)
+static void gwSeedFill(SDWORD x, SDWORD y, SDWORD nv)
{
#ifdef ENABLEFILL
int l, x1, x2, dy;
@@ -157,7 +157,7 @@
// set the tiles a gateway covers to a zone
-void gwSetGatewayZone(GATEWAY *psGate, SDWORD zone)
+static void gwSetGatewayZone(GATEWAY *psGate, SDWORD zone)
{
SDWORD pos;
@@ -179,7 +179,7 @@
// find the first zone on a line
-SDWORD gwFindFirstZone(SDWORD y)
+static SDWORD gwFindFirstZone(SDWORD y)
{
SDWORD x, zone;
@@ -538,7 +538,7 @@
// Decompress a line of the zone map
// pBuffer should point to a buffer of gwMapWidth() bytes
-void gwDecompressLine(SDWORD line, UBYTE *pBuffer)
+static void gwDecompressLine(SDWORD line, UBYTE *pBuffer)
{
SDWORD rlePos, bufPos, count,zone, store;
@@ -563,7 +563,7 @@
// Compress a line of the zone map
// pBuffer should point to a buffer of gwMapWidth() bytes
-void gwCompressLine(SDWORD line, UBYTE *pBuffer)
+static void gwCompressLine(SDWORD line, UBYTE *pBuffer)
{
SDWORD rlePos, bufPos, count,zone;
Index: src/fpath.c
===================================================================
--- src/fpath.c (revision 353)
+++ src/fpath.c (working copy)
@@ -318,7 +318,7 @@
#endif
// Calculate the distance to a tile from a point
-SDWORD fpathDistToTile(SDWORD tileX,SDWORD tileY, SDWORD pointX, SDWORD pointY)
+static SDWORD fpathDistToTile(SDWORD tileX,SDWORD tileY, SDWORD pointX, SDWORD
pointY)
{
SDWORD xdiff,ydiff, dist;
SDWORD tx,ty;
@@ -438,7 +438,7 @@
// append an astar route onto a move-control route
-void fpathAppendRoute( MOVE_CONTROL *psMoveCntl, ASTAR_ROUTE *psAStarRoute )
+static void fpathAppendRoute( MOVE_CONTROL *psMoveCntl, ASTAR_ROUTE
*psAStarRoute )
{
SDWORD mi, ai;
@@ -534,7 +534,7 @@
// check whether a WORLD coordinate point is within a gateway's tiles
-BOOL fpathPointInGateway(SDWORD x, SDWORD y, GATEWAY *psGate)
+static BOOL fpathPointInGateway(SDWORD x, SDWORD y, GATEWAY *psGate)
{
x = x >> TILE_SHIFT;
y = y >> TILE_SHIFT;
@@ -550,7 +550,7 @@
// set blocking flags for all gateways around a zone
-void fpathSetGatewayBlock(SDWORD zone, GATEWAY *psLast, GATEWAY *psNext)
+static void fpathSetGatewayBlock(SDWORD zone, GATEWAY *psLast, GATEWAY *psNext)
{
GATEWAY *psCurr;
SDWORD pos, tx,ty, blockZone;
@@ -624,7 +624,7 @@
// clear blocking flags for all gateways around a zone
-void fpathClearGatewayBlock(SDWORD zone, GATEWAY *psLast, GATEWAY *psNext)
+static void fpathClearGatewayBlock(SDWORD zone, GATEWAY *psLast, GATEWAY
*psNext)
{
GATEWAY *psCurr;
SDWORD pos, tx,ty, blockZone;
@@ -690,7 +690,7 @@
// clear the routing ignore flags for the gateways
-void fpathClearIgnore(void)
+static void fpathClearIgnore(void)
{
GATEWAY *psCurr;
SDWORD link, numLinks;
@@ -707,7 +707,7 @@
}
// find a clear tile on a gateway to route to
-void fpathGatewayCoords(GATEWAY *psGate, SDWORD *px, SDWORD *py)
+static void fpathGatewayCoords(GATEWAY *psGate, SDWORD *px, SDWORD *py)
{
SDWORD x = 0, y = 0, dist, mx, my, pos;
@@ -952,7 +952,7 @@
// check if the route to a gateway has already been generated
-BOOL fpathCheckRouteMatch(MOVE_CONTROL *psMoveCntl, SDWORD *pPos, SDWORD
gwx,SDWORD gwy)
+static BOOL fpathCheckRouteMatch(MOVE_CONTROL *psMoveCntl, SDWORD *pPos,
SDWORD gwx,SDWORD gwy)
{
SDWORD pos = *pPos;
@@ -970,7 +970,7 @@
return FALSE;
}
-void fpathBlockGatewayLink(GATEWAY *psLast, GATEWAY *psCurr)
+static void fpathBlockGatewayLink(GATEWAY *psLast, GATEWAY *psCurr)
{
SDWORD link, numLinks;
@@ -1014,7 +1014,7 @@
// check if a new route is closer to the target than the one stored in
// the droid
-BOOL fpathRouteCloser(MOVE_CONTROL *psMoveCntl, ASTAR_ROUTE *psAStarRoute,
SDWORD tx,SDWORD ty)
+static BOOL fpathRouteCloser(MOVE_CONTROL *psMoveCntl, ASTAR_ROUTE
*psAStarRoute, SDWORD tx,SDWORD ty)
{
SDWORD xdiff,ydiff, prevDist, nextDist;
@@ -1048,7 +1048,7 @@
}
// create a final route from a gateway route
-SDWORD fpathGatewayRoute(BASE_OBJECT *psObj, SDWORD routeMode, SDWORD
GWTerrain,
+static SDWORD fpathGatewayRoute(BASE_OBJECT *psObj, SDWORD routeMode, SDWORD
GWTerrain,
SDWORD sx, SDWORD sy, SDWORD
fx, SDWORD fy,
MOVE_CONTROL *psMoveCntl)
{
@@ -1605,7 +1605,7 @@
// find the first point on the route which has both droids on the same side of
it
-BOOL fpathFindFirstRoutePoint(MOVE_CONTROL *psMove, SDWORD *pIndex, SDWORD
x1,SDWORD y1, SDWORD x2,SDWORD y2)
+static BOOL fpathFindFirstRoutePoint(MOVE_CONTROL *psMove, SDWORD *pIndex,
SDWORD x1,SDWORD y1, SDWORD x2,SDWORD y2)
{
SDWORD vx1,vy1, vx2,vy2;
Index: src/gatewayroute.c
===================================================================
--- src/gatewayroute.c (revision 353)
+++ src/gatewayroute.c (working copy)
@@ -21,7 +21,7 @@
static GATEWAY *psOpenList;
// estimate the distance to the target from a gateway
-SDWORD gwrEstimate(GATEWAY *psGate, SDWORD x, SDWORD y)
+static SDWORD gwrEstimate(GATEWAY *psGate, SDWORD x, SDWORD y)
{
SDWORD gwx,gwy, dx,dy;
@@ -39,7 +39,7 @@
// add a gateway to the open list
-void gwrOpenAdd(GATEWAY *psGate)
+static void gwrOpenAdd(GATEWAY *psGate)
{
psGate->flags &= ~GWR_CLOSED;
psGate->flags |= GWR_OPEN;
@@ -49,7 +49,7 @@
// get the next gateway from the open list
-GATEWAY *gwrOpenGet(void)
+static GATEWAY *gwrOpenGet(void)
{
SDWORD minDist, dist;
GATEWAY *psCurr, *psPrev, *psParent = NULL, *psFound = NULL;
@@ -91,7 +91,7 @@
// check whether a gateway should be considered for routing
// (i.e. whether it is inside the current scroll limits)
-BOOL gwrConsiderGateway(GATEWAY *psGate)
+static BOOL gwrConsiderGateway(GATEWAY *psGate)
{
return (psGate->x1 >= scrollMinX) && (psGate->x1 <= scrollMaxX) &&
(psGate->x2 >= scrollMinX) && (psGate->x2 <= scrollMaxX) &&
@@ -102,7 +102,7 @@
// check whether all the tiles on a gateway are blocked
-BOOL gwrBlockedGateway(GATEWAY *psGate, SDWORD player, UDWORD terrain)
+static BOOL gwrBlockedGateway(GATEWAY *psGate, SDWORD player, UDWORD terrain)
{
// SDWORD pos;
BOOL blocked;
Index: src/init.c
===================================================================
--- src/init.c (revision 353)
+++ src/init.c (working copy)
@@ -725,7 +725,7 @@
}
-BOOL loadLevFile(const char* filename, int datadir) {
+static BOOL loadLevFile(const char* filename, int datadir) {
char *pBuffer;
UDWORD size;
@@ -1152,7 +1152,7 @@
/***************************************************************************/
-BOOL
+static BOOL
init_ObjectDead( void * psObj )
{
BASE_OBJECT *psBaseObj = (BASE_OBJECT *) psObj;
@@ -1772,7 +1772,7 @@
/*****************************************************************************/
/* Initialise after all data is loaded */
-void SetAllTilesVisible(void)
+static void SetAllTilesVisible(void)
{
// Make all the tiles visible
MAPTILE *psTile = psMapTiles;
@@ -1791,7 +1791,7 @@
- this is for the playstation, so that at the end of each level
everything is set to visible
- this means that we don't have to save the visibilty area in the save
game (this is good)
*/
-void SetScrollLimitsTilesVisible(void)
+static void SetScrollLimitsTilesVisible(void)
{
MAPTILE *psTile;
UWORD MapX,MapY;
Index: src/frontend.c
===================================================================
--- src/frontend.c (revision 353)
+++ src/frontend.c (working copy)
@@ -496,14 +496,14 @@
addMultiBut(psWScreen,FRONTEND_BOTFORM,FRONTEND_QUIT,10,10,30,29,
STR_FE_RETURN,IMAGE_RETURN,IMAGE_RETURN_HI,TRUE);
}
-void endSinglePlayerMenu( void )
+static void endSinglePlayerMenu( void )
{
removeTopForm();
removeBottomForm();
removeBackdrop();
}
-void frontEndNewGame( void )
+static void frontEndNewGame( void )
{
switch(StartWithGame) {
case 1:
Index: src/feature.c
===================================================================
--- src/feature.c (revision 353)
+++ src/feature.c (working copy)
@@ -68,7 +68,7 @@
oilResFeature = 0;
}
-void featureType(FEATURE_STATS* psFeature, char *pType)
+static void featureType(FEATURE_STATS* psFeature, char *pType)
{
if (!strcmp(pType,"HOVER WRECK"))
{
Index: src/gateway.c
===================================================================
--- src/gateway.c (revision 353)
+++ src/gateway.c (working copy)
@@ -259,7 +259,7 @@
#ifndef EDITORWORLD
-BOOL gwBlockingTile(SDWORD x,SDWORD y)
+static BOOL gwBlockingTile(SDWORD x,SDWORD y)
{
MAPTILE *psTile;
@@ -580,7 +580,7 @@
// find a route between two gateways and return
// its length
-SDWORD gwRouteLength(GATEWAY *psStart, GATEWAY *psEnd)
+static SDWORD gwRouteLength(GATEWAY *psStart, GATEWAY *psEnd)
{
#ifndef EDITORWORLD
SDWORD ret, sx,sy, ex,ey, xdiff,ydiff, i;
@@ -650,7 +650,7 @@
// check that the initial flood fill tiles are not on a blocking tile
-BOOL gwCheckFloodTiles(GATEWAY *psGate)
+static BOOL gwCheckFloodTiles(GATEWAY *psGate)
{
SDWORD floodX,floodY;
Index: src/geometry.c
===================================================================
--- src/geometry.c (revision 353)
+++ src/geometry.c (working copy)
@@ -471,7 +471,7 @@
return(retVal);
}
-void getObjectsOnTile(MAPTILE *psTile)
+static void getObjectsOnTile(MAPTILE *psTile)
{
/*UDWORD i;
FEATURE *psFeature;
Index: lib/ivis_opengl/piematrix.c
===================================================================
--- lib/ivis_opengl/piematrix.c (revision 353)
+++ lib/ivis_opengl/piematrix.c (working copy)
@@ -129,7 +129,7 @@
//*
//******
-void pie_MatReset(void)
+static void pie_MatReset(void)
{
// printf("pie_MatReset\n");
@@ -382,7 +382,7 @@
return pie_RotateProject(v3d->x, v3d->y, v3d->z, &(v2d->x), &(v2d->y));
}
-int32 pie_Transform(iVector *v3d, iPoint *v2d)
+static int32 pie_Transform(iVector *v3d, iPoint *v2d)
{
v2d->x = v3d->x;
v2d->y = v3d->y;
Index: lib/ivis_opengl/textdraw.c
===================================================================
--- lib/ivis_opengl/textdraw.c (revision 353)
+++ lib/ivis_opengl/textdraw.c (working copy)
@@ -194,7 +194,7 @@
}
-BOOL iV_GetTextDetails(unsigned char Char, UWORD *Width, UWORD *Height, SWORD
*YOffset, UBYTE *U, UBYTE *V, UWORD *TpageID)
+static BOOL iV_GetTextDetails(unsigned char Char, UWORD *Width, UWORD *Height,
SWORD *YOffset, UBYTE *U, UBYTE *V, UWORD *TpageID)
{
@@ -309,13 +309,13 @@
UBYTE ExtentsMode=EXTENTS_USEMAXWIDTH;
-void SetExtentsMode_USELAST(void)
+static void SetExtentsMode_USELAST(void)
{
ExtentsMode=EXTENTS_USELASTX;
}
-void SetExtentsMode_USEMAX(void)
+static void SetExtentsMode_USEMAX(void)
{
ExtentsMode=EXTENTS_USEMAXWIDTH;
}
Index: lib/ivis_opengl/piestate.c
===================================================================
--- lib/ivis_opengl/piestate.c (revision 353)
+++ lib/ivis_opengl/piestate.c (working copy)
@@ -141,7 +141,7 @@
}
/***************************************************************************/
-void pie_SetColourCombine(COLOUR_MODE colCombMode)
+static void pie_SetColourCombine(COLOUR_MODE colCombMode)
{
#ifndef PIETOOL //ffs
Index: lib/ivis_opengl/piemode.c
===================================================================
--- lib/ivis_opengl/piemode.c (revision 353)
+++ lib/ivis_opengl/piemode.c (working copy)
@@ -162,5 +162,5 @@
}
-void pie_RenderSetup(void) {
+static void pie_RenderSetup(void) {
}
Index: lib/ivis_opengl/piedraw.c
===================================================================
--- lib/ivis_opengl/piedraw.c (revision 353)
+++ lib/ivis_opengl/piedraw.c (working copy)
@@ -278,33 +278,33 @@
float z;
} fVector;
-void fVector_Set(fVector* v, float x, float y, float z) {
+static void fVector_Set(fVector* v, float x, float y, float z) {
v->x = x;
v->y = y;
v->z = z;
}
-void fVector_Sub(fVector* dest, fVector* op1, fVector* op2) {
+static void fVector_Sub(fVector* dest, fVector* op1, fVector* op2) {
dest->x = op1->x - op2->x;
dest->y = op1->y - op2->y;
dest->z = op1->z - op2->z;
}
-float fVector_SP(fVector* op1, fVector* op2) {
+static float fVector_SP(fVector* op1, fVector* op2) {
return op1->x * op2->x + op1->y * op2->y + op1->z * op2->z;
}
-void fVector_CP(fVector* dest, fVector* op1, fVector* op2) {
+static void fVector_CP(fVector* dest, fVector* op1, fVector* op2) {
dest->x = op1->y * op2->z - op1->z * op2->y;
dest->y = op1->z * op2->x - op1->x * op2->z;
dest->z = op1->x * op2->y - op1->y * op2->x;
}
-float fVector_Length2(fVector* v) {
+static float fVector_Length2(fVector* v) {
return v->x*v->x + v->y*v->y + v->z*v->z;
}
-void
+static void
pie_Polygon(SDWORD numVerts, PIEVERTEX* pVrts, FRACT texture_offset, BOOL
light)
{
SDWORD i;
@@ -393,7 +393,7 @@
static unsigned int tshapes_size = 0;
static unsigned int nb_tshapes = 0;
-void pie_Draw3DShape2(iIMDShape *shape, int frame, PIELIGHT colour, PIELIGHT
specular,
+static void pie_Draw3DShape2(iIMDShape *shape, int frame, PIELIGHT colour,
PIELIGHT specular,
int pieFlag, int pieFlagData) {
int32 tempY;
int i, n;
@@ -504,7 +504,7 @@
}
}
-void pie_DrawShadow(iIMDShape *shape, int flag, int flag_data, fVector* light)
{
+static void pie_DrawShadow(iIMDShape *shape, int flag, int flag_data, fVector*
light) {
int32 tempY;
int i, n;
iVector *pVertices;
@@ -679,7 +679,7 @@
}
}
-void inverse_matrix(float* src, float * dst) {
+static void inverse_matrix(float* src, float * dst) {
float det =
src[0]*src[5]*src[10]+src[4]*src[9]*src[2]+src[8]*src[1]*src[6]
-src[2]*src[5]*src[8]-src[6]*src[9]*src[0]-src[10]*src[1]*src[4];
float invdet = 1.0/det;
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev