Hi All,

I get a few warnings when building fgfs (gcc-3.4.6), all to do with int 
conversion:


FGInitialCondition.cpp:806: warning: converting to `int' from `double'
806: n = document->FindElementValueAsNumber("running");
fix:
n = (int)document->FindElementValueAsNumber("running");


FGInput.cpp:209: warning: converting to `unsigned int' from `double'
209: port = element->GetAttributeValueAsNumber("port");
fix:
port = (unsigned int)element->GetAttributeValueAsNumber("port");


renderer.cxx:1021: warning: converting to `unsigned int' from `double'
1021: y = viewport->height() - y;
fix:
y = (int)viewport->height() - y;


AIMultiplayer.cxx:280: warning: converting to `int' from `double'
                ival = (int) (1-tau)*((double) (*prevPropIt)->int_value) +
280:        tau*((double) (*nextPropIt)->int_value);
fix - the whole line needs to cast to int so enclose in ( ):
                ival = (int) ((1-tau)*((double) (*prevPropIt)->int_value) +
                tau*((double) (*nextPropIt)->int_value));


The last one needs looking at closely - it seems the original code cast (int) 
(1-tau) only.  I think....


One I cannot work out, as I don't know what the code does here:

Rotor.cpp: In member function `void yasim::Rotor::setParameter(char*, float)':
Rotor.cpp:600: warning: converting to `int' from `float'
Rotor.cpp:601: warning: converting to `int' from `float'

600:        p(number_of_segments,1)
601:        p(number_of_parts,1)


I haven't done a proper diff patch, as these all need looking at by somebody 
that knows what they are doing ;-)

Nick

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to