Fixing warnings, klauss a little input please

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).

Fixing warnings, klauss a little input please

Postby pheonixstorm » Tue Feb 08, 2011 3:30 pm

first,

Code: Select all
..\..\vegastrike\src\gfx\nav\navpath.cpp(462) : warning C4101: 'i' : unreferenced local variable
..\..\vegastrike\src\gfx\nav\navpath.cpp(463) : warning C4101: 'system' : unreferenced local variable

Can both of these be removed? They are part of:
Code: Select all
void NavPath::addNewPath()
{
    NavigationSystem::CachedSystemIterator &systemIter = _Universe->AccessCockpit()->AccessNavSystem()->systemIter;

    int i;
    unsigned system;
    //Inscribe new path
    //*************************

    list< unsigned >::iterator aux;
    for (list< unsigned >::iterator iter = path.begin(); iter != path.end(); ++iter) {
        if ( (*iter) != path.front() )
            pathNeighbors[(*iter)].first = ( *--(aux = iter) );
        if ( (*iter) != path.back() )
            pathNeighbors[(*iter)].second = ( *++(aux = iter) );
        systemIter[*iter].part_of_path = true;
        systemIter[*iter].paths.insert( this );
    }
}
It loos like it can be removed but want a second opinion

Next warning... class/struct mixups fixed. There are several warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
that I don't know how to fix (never come across it so unsure why that wanring is coming up) and several more unreferenced locals. I am attached the build log to see if we can get the rest of these warnings worked out. I used /w3 for this run.
Attachments
BuildLog.zip
Windows build log, r13031
(15.06 KiB) Downloaded 104 times
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
User avatar
pheonixstorm
Elite
Elite
 
Posts: 1567
Topics: 113
Joined: Mon Jan 25, 2010 7:03 pm

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Fixing warnings, klauss a little input please

Postby klauss » Tue Feb 08, 2011 3:34 pm

pheonixstorm wrote:first,

Code: Select all
..\..\vegastrike\src\gfx\nav\navpath.cpp(462) : warning C4101: 'i' : unreferenced local variable
..\..\vegastrike\src\gfx\nav\navpath.cpp(463) : warning C4101: 'system' : unreferenced local variable

Can both of these be removed?


I believe so too.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Fixing warnings, klauss a little input please

Postby klauss » Tue Feb 08, 2011 3:40 pm

pheonixstorm wrote:Next warning... class/struct mixups fixed. There are several warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)


It's telling you a boolean value (ie, any numeric value) is being cast into a "bool" variable, which requires, per C spec, the equivalent of (expression != 0) ? 1 : 0. It's "slow".

I wouldn't pay much attention, the way around the warning is to explicitly do the casting.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Re: Fixing warnings, klauss a little input please

Postby pheonixstorm » Tue Feb 08, 2011 3:50 pm

Thats fine. The svn project file runs with w1 so none of these warnings show up. Im mostly trying to fix any that conflict such as declaring struct something then in another file declaring the same struct as a class and things that might eventually go boom or just got missed on some cleanup such as unreferenced variables.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
User avatar
pheonixstorm
Elite
Elite
 
Posts: 1567
Topics: 113
Joined: Mon Jan 25, 2010 7:03 pm


Return to Compiling Problems [paste config.log]

Who is online

Users browsing this forum: No registered users and 2 guests

cron