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).
Post Reply
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Fixing warnings, klauss a little input please

Post by pheonixstorm »

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.
You do not have the required permissions to view the files attached to this post.
Because of YOU Arbiter, MY kids? can't get enough gas. OR NIPPLE! How does that mkae you feeeel? ~ Halo
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Fixing warnings, klauss a little input please

Post by klauss »

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
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Fixing warnings, klauss a little input please

Post by klauss »

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
pheonixstorm
Elite
Elite
Posts: 1567
Joined: Tue Jan 26, 2010 2:03 am

Re: Fixing warnings, klauss a little input please

Post by pheonixstorm »

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
Post Reply