Примеры ошибок, обнаруженных с помощью диагностики V563
V563. An 'else' branch may apply to the previous 'if' statement.
BCmenu
V563 It is possible that this 'else' branch must apply to the previous 'if' statement. fire bcmenu.cpp 1853
void BCMenu::InsertSpaces(void)
{
if(IsLunaMenuStyle())
if(!xp_space_accelerators)return;
else
if(!original_space_accelerators)return;
....
}
Most likely {} are missing.
Squirrel
V563 It is possible that this 'else' branch must apply to the previous 'if' statement. squirrel sqapi.cpp 756
SQRESULT sq_rawdeleteslot(HSQUIRRELVM v,
SQInteger idx,SQBool pushval)
{
....
if(pushval != 0)
if(pushval) v->GetUp(-1) = t;
else
v->Pop(1); // <=
....
}
The code "v->>Pop(1);" is never executed.
PeerBlock
V563 It is possible that this 'else' branch must apply to the previous 'if' statement. peerblock editlistproc.cpp 91
static void EditList_OnCommand(....)
{
....
if(l=dynamic_cast<StaticList*>(*list))
if(l->File!=file) {
l->File=file;
g_ret|=LISTS_NEEDRELOAD;
}
else {
delete *list;
*list=l=new StaticList;
l->File=file;
g_ret|=LISTS_NEEDRELOAD;
}
....
}
Trans-Proteomic Pipeline
V563 It is possible that this 'else' branch must apply to the previous 'if' statement. Mascot2XML mascotconverter.cxx 895
void MascotConverter::init(....) {
....
if(line_len > 8 && line[0] == 'r' && line[1] == 'e' &&
line[2] == 'l' && line[3] == 'e' && line[4] == 'a' &&
line[5] == 's' && line[6] == 'e' && line[7] == '=')
if(database_ == NULL)
database_ = strCopy(line+8);
else if(line_len > 5 && line[0] == 'F' && line[1] == 'I' &&
line[2] == 'L' && line[3] == 'E' && line[4] == '=') {
header_ = strCopy(line+5);
....
}
Because there are no parentheses, else refers to another if.
Cfront
V563 It is possible that this 'else' branch must apply to the previous 'if' statement. error.c 164
int error(int t, loc* lc, char* s ...)
{
....
if (in_error++)
if (t!='t' || 4<in_error) {
fprintf(stderr,"\nUPS!, error while handling error\n");
ext(13);
}
else if (t == 't')
t = 'i';
....
}
Open X-Ray Engine
V563 It is possible that this 'else' branch must apply to the previous 'if' statement. hit_memory_manager.cpp 368
void CHitMemoryManager::load (IReader &packet)
{
....
if (!spawn_callback || !spawn_callback->m_object_callback)
if(!g_dedicated_server)
Level().client_spawn_manager().add(
delayed_object.m_object_id,m_object->ID(),callback);
#ifdef DEBUG
else {
if (spawn_callback && spawn_callback->m_object_callback) {
VERIFY(spawn_callback->m_object_callback == callback);
}
}
#endif // DEBUG
}
Amnesia: The Dark Descent
V563 It is possible that this 'else' branch must apply to the previous 'if' statement. CharacterBody.cpp 1591
void iCharacterBody::CheckMoveCollision(....)
{
....
/////////////////////////////////////
//Forward velocity reflection
//Make sure that new velocity points in the right direction
//and that it is not too large!
if(mfMoveSpeed[eCharDir_Forward] != 0)
{
vForwardVel = ....;
float fForwardSpeed = vForwardVel.Length();
if(mfMoveSpeed[eCharDir_Forward] > 0)
if(mfMoveSpeed[eCharDir_Forward] > fForwardSpeed)
mfMoveSpeed[eCharDir_Forward] = fForwardSpeed;
else
if(mfMoveSpeed[eCharDir_Forward] < fForwardSpeed)
mfMoveSpeed[eCharDir_Forward] = -fForwardSpeed;
}
....
}