1
0
Fork 0

Change occurrences of fabsf to fabs - part of tracking down an osg/Math issue on Mac with XCode4

This commit is contained in:
James Turner 2011-05-21 13:41:43 +01:00
parent 87647b40cb
commit 59fe23dcb3
4 changed files with 6 additions and 6 deletions

View file

@ -89,7 +89,7 @@ void HUD::Label::draw(void)
l = _center_x - pw;
r = _center_x + pw;
bool draw_parallel = fabsf(_pointer_width - _w) > 2.0; // draw lines left and right of arrow?
bool draw_parallel = fabs(_pointer_width - _w) > 2.0; // draw lines left and right of arrow?
if (option_bottom()) {
if (draw_parallel) {
@ -115,7 +115,7 @@ void HUD::Label::draw(void)
l = _center_y - pw;
r = _center_y + pw;
draw_parallel = fabsf(_pointer_width - _h) > 2.0;
draw_parallel = fabs(_pointer_width - _h) > 2.0;
if (option_left()) {
if (draw_parallel) {

View file

@ -48,7 +48,7 @@ HUD::Ladder::Ladder(HUD *hud, const SGPropertyNode *n, float x, float y) :
_roll(n->getNode("roll-input", false)),
_width_units(int(n->getFloatValue("display-span"))),
_div_units(int(fabs(n->getFloatValue("divisions")))),
_scr_hole(fabsf(n->getFloatValue("screen-hole")) * 0.5f),
_scr_hole(fabs(n->getFloatValue("screen-hole")) * 0.5f),
_zero_bar_overlength(n->getFloatValue("zero-bar-overlength", 10)),
_dive_bar_angle(n->getBoolValue("enable-dive-bar-angle")),
_tick_length(n->getFloatValue("tick-length")),

View file

@ -534,7 +534,7 @@ void HUD::Tape::draw_horizontal(float value)
char *HUD::Tape::format_value(float v)
{
if (fabsf(v) < 1e-8) // avoid -0.0
if (fabs(v) < 1e-8) // avoid -0.0
v = 0.0f;
if (_label_fmt == INT)

View file

@ -129,12 +129,12 @@ void HUD::TurnBankIndicator::draw_scale()
int dir = bank > 0 ? 1 : -1;
if (fabsf(bank) > 25) {
if (fabs(bank) > 25) {
draw_tick(45, r, minor, dir);
draw_tick(60, r, major, dir);
}
if (fabsf(bank) > 55) {
if (fabs(bank) > 55) {
draw_tick(90, r, major, dir);
draw_tick(135, r, major, dir);
}