Fix some warnings generated by -Wextra

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4492 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-04-05 16:22:05 +00:00
parent 3c516a43f4
commit 3dafc4e62a
3 changed files with 13 additions and 25 deletions

View File

@ -33,7 +33,7 @@
#if defined(WZ_OS_WIN)
const static struct
static const struct
{
const char * language;
const char * name;
@ -54,7 +54,7 @@ const static struct
# endif
};
#else
const static struct
static const struct
{
const char *language;
const char *name;

View File

@ -55,7 +55,7 @@
#include "projectile.h"
static void unsetMatrix(void);
static void setMatrix(Vector3i *Position, Vector3i *Rotation, Vector3i *CameraPos, BOOL RotXYZ);
static void setMatrix(Vector3i *Position, Vector3i *Rotation, BOOL RotXYZ);
#define BLIP_ANIM_DURATION 200
#define DEFAULT_COMPONENT_TRANSLUCENCY 128
@ -128,7 +128,7 @@ void updateLightLevels(void)
}
static void setMatrix(Vector3i *Position, Vector3i *Rotation, Vector3i *CameraPos, BOOL RotXYZ)
static void setMatrix(Vector3i *Position, Vector3i *Rotation, BOOL RotXYZ)
{
pie_PerspectiveBegin();
pie_MatBegin();
@ -251,9 +251,7 @@ UDWORD getStructureStatHeight(STRUCTURE_STATS *psStat)
void displayIMDButton(iIMDShape *IMDShape, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale)
{
Vector3i TmpCamPos = {0,0,0};
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
setMatrix(Position, Rotation, RotXYZ);
pie_MatScale(scale);
pie_SetFogStatus(false);
@ -269,7 +267,6 @@ void displayStructureButton(STRUCTURE *psStructure, Vector3i *Rotation, Vector3i
iIMDShape *mountImd[STRUCT_MAXWEAPS];
iIMDShape *weaponImd[STRUCT_MAXWEAPS];
UDWORD nWeaponStat;
Vector3i TmpCamPos = {0,0,0};
int i;
/*HACK HACK HACK!
@ -281,10 +278,9 @@ void displayStructureButton(STRUCTURE *psStructure, Vector3i *Rotation, Vector3i
Position->y -= 20;
}
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
setMatrix(Position, Rotation, RotXYZ);
pie_MatScale(scale);
/* Draw the building's base first */
baseImd = psStructure->pStructureType->pBaseIMD;
if(baseImd!=NULL) {
@ -420,8 +416,6 @@ void displayStructureStatButton(STRUCTURE_STATS *Stats,UDWORD Player, Vector3i *
iIMDShape *baseImd,*strImd;//*mountImd,*weaponImd;
iIMDShape *mountImd[STRUCT_MAXWEAPS];
iIMDShape *weaponImd[STRUCT_MAXWEAPS];
Vector3i TmpCamPos = {0,0,0};
//UDWORD nWeaponStat;
UBYTE i;
/*HACK HACK HACK!
@ -433,7 +427,7 @@ void displayStructureStatButton(STRUCTURE_STATS *Stats,UDWORD Player, Vector3i *
Position->y -= 20;
}
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
setMatrix(Position, Rotation, RotXYZ);
pie_MatScale(scale);
/* Draw the building's base first */
@ -584,9 +578,8 @@ void displayComponentButton(BASE_STATS *Stat, Vector3i *Rotation, Vector3i *Posi
iIMDShape *ComponentIMD = NULL;
iIMDShape *MountIMD = NULL;
SDWORD compID;
Vector3i TmpCamPos = {0,0,0};
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
setMatrix(Position, Rotation, RotXYZ);
pie_MatScale(scale);
compID = StatIsComponent(Stat);
@ -626,11 +619,10 @@ void displayResearchButton(BASE_STATS *Stat, Vector3i *Rotation, Vector3i *Posit
{
iIMDShape *ResearchIMD = ((RESEARCH *)Stat)->pIMD;
iIMDShape *MountIMD = ((RESEARCH *)Stat)->pIMD2;
Vector3i TmpCamPos = {0,0,0};
if(ResearchIMD)
{
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
setMatrix(Position, Rotation, RotXYZ);
pie_MatScale(scale);
if(MountIMD) {
@ -654,12 +646,11 @@ void displayComponentButtonTemplate(DROID_TEMPLATE *psTemplate, Vector3i *Rotati
{
static DROID Droid; // Made static to reduce stack usage.
SDWORD difference;
Vector3i TmpCamPos = {0,0,0};
/* init to NULL */
memset( &Droid, 0, sizeof(DROID) );
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
setMatrix(Position, Rotation, RotXYZ);
pie_MatScale(scale);
// Decide how to sort it.
@ -693,9 +684,8 @@ void displayComponentButtonTemplate(DROID_TEMPLATE *psTemplate, Vector3i *Rotati
void displayComponentButtonObject(DROID *psDroid, Vector3i *Rotation, Vector3i *Position, BOOL RotXYZ, SDWORD scale)
{
SDWORD difference;
Vector3i TmpCamPos = {0,0,0};
setMatrix(Position,Rotation,&TmpCamPos,RotXYZ);
setMatrix(Position, Rotation, RotXYZ);
pie_MatScale(scale);
// Decide how to sort it.

View File

@ -4588,11 +4588,9 @@ static BOOL intAddObjectWindow(BASE_OBJECT *psObjects, BASE_OBJECT *psSelected,B
if (Droid->droidType == DROID_CONSTRUCT ||
Droid->droidType == DROID_CYBORG_CONSTRUCT)
{
ASSERT( Droid->asBits[COMP_CONSTRUCT].nStat,"intUpdateProgressBar: invalid droid type" );
ASSERT( Droid->asBits[COMP_CONSTRUCT].nStat,"intAddObjectWindow: invalid droid type" );
psStats = (BASE_STATS*)(asConstructStats + Droid->asBits[COMP_CONSTRUCT].nStat);
//sBarInit2.size = (UWORD)((CONSTRUCT_STATS*)psStats)->constructPoints; // Need to scale? YEP!
sBarInit2.size = (UWORD)constructorPoints((CONSTRUCT_STATS*)psStats,
Droid->player);
sBarInit2.size = (UWORD)constructorPoints((CONSTRUCT_STATS*)psStats, Droid->player);
if (sBarInit2.size > WBAR_SCALE)
{
sBarInit2.size = WBAR_SCALE;