Skip to content

Commit

Permalink
Fixed: Warnings given by new version of clang
Browse files Browse the repository at this point in the history
Some possible use of uninitialized variables.
  • Loading branch information
skyjake committed Mar 8, 2013
1 parent 3deaa57 commit f359350
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/src/con_main.cpp
Expand Up @@ -1149,7 +1149,7 @@ static int completeWord(int mode)
char unambiguous[256];
const knownword_t* completeWord = NULL;
const knownword_t** matches = NULL;
uint numMatches;
uint numMatches = 0;

if(mode == 1)
cp = (int)complPos - 1;
Expand Down
8 changes: 6 additions & 2 deletions doomsday/client/src/map/p_ticker.cpp
Expand Up @@ -53,6 +53,8 @@ int P_MobjTicker(thinker_t* th, void* context)
{
DENG_UNUSED(context);

#ifdef __CLIENT__

uint i;
mobj_t* mo = (mobj_t*) th;

Expand All @@ -61,7 +63,6 @@ int P_MobjTicker(thinker_t* th, void* context)
int f;
byte* haloFactor = &mo->haloFactors[i];

#ifdef __CLIENT__
// Set the high bit of halofactor if the light is clipped. This will
// make P_Ticker diminish the factor to zero. Take the first step here
// and now, though.
Expand Down Expand Up @@ -105,9 +106,12 @@ int P_MobjTicker(thinker_t* th, void* context)

*haloFactor &= ~0x7f;
*haloFactor |= f;
#endif
}

#else
DENG_UNUSED(th);
#endif

return false; // Continue iteration.
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/resource/image.cpp
Expand Up @@ -330,7 +330,7 @@ uint8_t *Image_LoadFromFile(image_t *img, filehandle_s *_file)
#else
// Server does not load image files.
DENG2_UNUSED2(img, _file);
return false;
return NULL;
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/dd_input.cpp
Expand Up @@ -1244,7 +1244,7 @@ void DD_ReadKeyboard(void)
{
uint i, k;
ddevent_t ev;
size_t n, numkeyevs;
size_t n, numkeyevs = 0;
keyevent_t keyevs[KBDQUESIZE];

// Check the repeaters.
Expand Down
2 changes: 0 additions & 2 deletions doomsday/libdeng2/include/de/scriptsys/parser.h
Expand Up @@ -153,8 +153,6 @@ class Parser : public IParser
// Range of the current statement. Can be a subrange of the full
// set of tokens.
TokenRange _statementRange;

duint _currentIndent;
};

Q_DECLARE_OPERATORS_FOR_FLAGS(de::Parser::CompoundFlags)
Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/common/src/m_ctrl.c
Expand Up @@ -470,8 +470,8 @@ static void iterateBindings(const mndata_bindings_t* binds, const char* bindings

if(*k == '@')
{
for(begin = k - 1; begin > bindings && isdigit(*(begin - 1)); --begin);
bid = strtol(begin, NULL, 10);
for(begin = k - 1; begin > bindings && isdigit(*(begin - 1)); --begin) {}
bid = strtol(begin, NULL, 10);
}
else
{
Expand Down

0 comments on commit f359350

Please sign in to comment.