Skip to content

Commit aea5415

Browse files
committed
Warning fixes
1 parent f8466e2 commit aea5415

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

CFGScript.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ GNU General Public License for more details.
2424

2525
const char *cvartypes[] = { NULL, "BOOL" , "NUMBER", "LIST", "STRING" };
2626

27-
typedef struct parserstate_s
27+
struct parserstate_t
2828
{
29+
parserstate_t() : buf( NULL ), token( "" ), filename( NULL ) {}
2930
char *buf;
3031
char token[MAX_STRING];
3132
const char *filename;
32-
} parserstate_t;
33+
};
3334

3435
/*
3536
===================
@@ -262,7 +263,7 @@ scrvardef_t *CSCR_LoadDefaultCVars( const char *scriptfilename, int *count )
262263
{
263264
int length = 0;
264265
char *start;
265-
parserstate_t state = { 0 };
266+
parserstate_t state;
266267
bool success = false;
267268
scrvardef_t *list = 0, *last;
268269

@@ -291,7 +292,7 @@ scrvardef_t *CSCR_LoadDefaultCVars( const char *scriptfilename, int *count )
291292

292293
while( !CSCR_ExpectString( &state, "}", false, false ) )
293294
{
294-
scrvardef_t var = { 0 };
295+
scrvardef_t var;
295296

296297
// Create a new object
297298
if( CSCR_ParseSingleCvar( &state, &var ) )

CFGScript.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,12 @@ typedef struct
4949
float fMax;
5050
} scrvarnumber_t;
5151

52-
typedef struct scrvardef_s
52+
struct scrvardef_t
5353
{
54+
scrvardef_t() :
55+
flags(0), name(""), value(""), desc(""),
56+
type(T_NONE), next(0) {}
57+
5458
int flags;
5559
char name[MAX_STRING];
5660
char value[MAX_STRING];
@@ -61,8 +65,8 @@ typedef struct scrvardef_s
6165
scrvarlist_t list;
6266
};
6367
cvartype_t type;
64-
struct scrvardef_s *next;
65-
} scrvardef_t;
68+
struct scrvardef_t *next;
69+
};
6670

6771
scrvardef_t *CSCR_LoadDefaultCVars( const char *scriptfilename, int *count );
6872
void CSCR_FreeList( scrvardef_t *list );

controls/PicButton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ int CMenuPicButton::transition_initial_time;
333333
CMenuPicButton* CMenuPicButton::temp = NULL;
334334
HIMAGE CMenuPicButton::s_hCurrentTransPic = 0;
335335
wrect_t CMenuPicButton::s_pCurrentTransRect = { 0, 0, 0, 0 };
336-
CMenuPicButton::Quad CMenuPicButton::s_CurrentLerpQuads[2] = { {0} };
336+
CMenuPicButton::Quad CMenuPicButton::s_CurrentLerpQuads[2];
337337

338338
float CMenuPicButton::GetTitleTransFraction( void )
339339
{

controls/PicButton.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,11 @@ class CMenuPicButton : public CMenuBaseItem
5858
static void RootChanged( bool isForward );
5959
private:
6060
enum animState_e { AS_TO_TITLE = 0, AS_TO_BUTTON };
61-
struct Quad { float x, y, lx, ly; };
61+
struct Quad
62+
{
63+
Quad(): x(0), y(0), lx(0), ly(0) {}
64+
float x, y, lx, ly;
65+
};
6266

6367
static void SetTitleAnim( int state );
6468
void TACheckMenuDepth( void );

0 commit comments

Comments
 (0)