Skip to content

Commit

Permalink
Fixed: More compiler warnings
Browse files Browse the repository at this point in the history
Mostly potentially uninitialized variables.
  • Loading branch information
skyjake committed Mar 15, 2013
1 parent 81eab9b commit 70123eb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 29 deletions.
6 changes: 3 additions & 3 deletions doomsday/client/src/audio/sys_audiod_sdlmixer.cpp
Expand Up @@ -84,13 +84,13 @@ int DS_SDLMixer_Music_PlayFile(const char* fileName, int looped);

boolean sdlInitOk = false;

DENG_EXTERN_C audiodriver_t audiod_sdlmixer = {
audiodriver_t audiod_sdlmixer = {
DS_SDLMixerInit,
DS_SDLMixerShutdown,
DS_SDLMixerEvent
};

DENG_EXTERN_C audiointerface_sfx_t audiod_sdlmixer_sfx = { {
audiointerface_sfx_t audiod_sdlmixer_sfx = { {
DS_SDLMixer_SFX_Init,
DS_SDLMixer_SFX_CreateBuffer,
DS_SDLMixer_SFX_DestroyBuffer,
Expand All @@ -105,7 +105,7 @@ DENG_EXTERN_C audiointerface_sfx_t audiod_sdlmixer_sfx = { {
DS_SDLMixer_SFX_Listenerv
} };

DENG_EXTERN_C audiointerface_music_t audiod_sdlmixer_music = { {
audiointerface_music_t audiod_sdlmixer_music = { {
DS_SDLMixer_Music_Init,
NULL,
DS_SDLMixer_Music_Update,
Expand Down
3 changes: 1 addition & 2 deletions doomsday/client/src/client/cl_main.cpp
Expand Up @@ -68,7 +68,6 @@ void Cl_InitID(void)
{
int i;
FILE* file;
size_t result;

if((i = CommandLine_CheckWith("-id", 1)) != 0)
{
Expand All @@ -81,7 +80,7 @@ void Cl_InitID(void)
srand(time(NULL));
if((file = fopen("client.id", "rb")) != NULL)
{
result = fread(&clientID, sizeof(clientID), 1, file); // return value ignored
DENG_UNUSED(fread(&clientID, sizeof(clientID), 1, file)); // return value ignored
clientID = ULONG(clientID);
fclose(file);
return;
Expand Down
3 changes: 2 additions & 1 deletion doomsday/client/src/dd_main.cpp
Expand Up @@ -2096,7 +2096,8 @@ static int DD_StartupWorker(void* /*parm*/)
RLF_DEFAULT, DD_ResourceClassById(RC_PACKAGE));
foundPath = App_BasePath() / foundPath; // Ensure the path is absolute.
de::File1 *loadedFile = tryLoadFile(de::Uri(foundPath, RC_NULL));
DENG2_ASSERT(loadedFile);
DENG2_ASSERT(loadedFile != 0);
DENG2_UNUSED(loadedFile);

/*
* No more lumps/packages will be loaded in startup mode after this point.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/m_misc.cpp
Expand Up @@ -156,7 +156,7 @@ int M_BoxOnLineSide(const AABoxd* box, double const linePoint[], double const li

int M_BoxOnLineSide_FixedPrecision(const fixed_t box[], const fixed_t linePoint[], const fixed_t lineDirection[])
{
int a, b;
int a = 0, b = 0;

switch(M_SlopeTypeXY_FixedPrecision(lineDirection[0], lineDirection[1]))
{
Expand Down
23 changes: 2 additions & 21 deletions doomsday/client/src/network/net_event.cpp
Expand Up @@ -226,14 +226,14 @@ void N_NETicker(timespan_t time)
*/
void N_Update(void)
{
#ifdef __SERVER__
netevent_t nevent;

// Are there any events to process?
while(N_NEGet(&nevent))
{
switch(nevent.type)
{
#ifdef __SERVER__
case NE_CLIENT_ENTRY: {
// Assign a console to the new player.
Sv_PlayerArrives(nevent.id, App_ServerSystem().user(nevent.id).name().toUtf8());
Expand All @@ -249,31 +249,12 @@ void N_Update(void)
masterHeartbeat = MASTER_UPDATETIME;
break;

/*case NE_TERMINATE_NODE:
// The server receives this event when a client's connection is broken.
App_ServerSystem().terminateNode(nevent.id);
break;*/
#endif // __SERVER__

#ifdef __CLIENT__
/*case NE_END_CONNECTION:
// A client receives this event when the connection is
// terminated.
if(netGame)
{
// We're still in a netGame, which means we didn't disconnect
// voluntarily.
Con_Message("N_Update: Connection was terminated.");
N_Disconnect();
}
break;*/
#endif

default:
Con_Error("N_Update: Invalid value, nevent.type = %i.", (int) nevent.type);
break;
}
}
#endif // __SERVER__
}

/**
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/b_command.cpp
Expand Up @@ -383,7 +383,7 @@ void B_SubstituteInCommand(const char* command, ddevent_t* event, evbinding_t* e
boolean B_TryCommandBinding(evbinding_t* eb, ddevent_t* event, struct bcontext_s* eventClass)
{
int i;
inputdev_t* dev;
inputdev_t* dev = 0;
ddstring_t command;

if(eb->device != event->device || eb->type != event->type)
Expand Down

0 comments on commit 70123eb

Please sign in to comment.