fixed some warnings (gcc4)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27261 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2008-09-01 08:18:49 +00:00
parent 7c30291e7e
commit a61498c87d

View File

@ -482,7 +482,7 @@ ChartWindow::ChartWindow(BRect frame, const char *name)
r.Set(h, v, h+INSTANT_LOAD-1, v + (TOP_LEFT_LIMIT - 1 - 2*V_BORDER)); r.Set(h, v, h+INSTANT_LOAD-1, v + (TOP_LEFT_LIMIT - 1 - 2*V_BORDER));
fInstantLoad = new InstantView(r); fInstantLoad = new InstantView(r);
fTopView->AddChild(fInstantLoad); fTopView->AddChild(fInstantLoad);
fInstantLoad->SetViewColor(0.0, 0.0, 0.0); fInstantLoad->SetViewColor(0, 0, 0);
h += INSTANT_LOAD+H_BORDER; h += INSTANT_LOAD+H_BORDER;
@ -1209,10 +1209,10 @@ ChartWindow::OpenRefresh(BPoint here)
B_FLOATING_APP_WINDOW_FEEL, B_FLOATING_APP_WINDOW_FEEL,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK); B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK);
frame.OffsetTo(0.0, 0.0); frame.OffsetTo(0.0, 0.0);
slider = new BSlider(frame, "", NULL, new BMessage(REFRESH_RATE_MSG), 0.0, 1000.0); slider = new BSlider(frame, "", NULL, new BMessage(REFRESH_RATE_MSG), 0, 1000);
slider->SetViewColor(background_color); slider->SetViewColor(background_color);
slider->SetTarget(NULL, this); slider->SetTarget(NULL, this);
slider->SetValue(1000.0*log(fCurrentSettings.refresh_rate/REFRESH_RATE_MIN)/log(REFRESH_RATE_MAX/REFRESH_RATE_MIN)); slider->SetValue(1000*log(fCurrentSettings.refresh_rate/REFRESH_RATE_MIN)/log(REFRESH_RATE_MAX/REFRESH_RATE_MIN));
slider->SetModificationMessage(new BMessage(REFRESH_RATE_MSG)); slider->SetModificationMessage(new BMessage(REFRESH_RATE_MSG));
slider->SetLimitLabels(" 0.6 f/s (logarythmic scale)", "600.0 f/s"); slider->SetLimitLabels(" 0.6 f/s (logarythmic scale)", "600.0 f/s");
slider->ResizeToPreferred(); slider->ResizeToPreferred();
@ -1256,15 +1256,18 @@ ChartWindow::DrawInstantLoad(float frame_per_second)
colored bars. */ colored bars. */
if (level > fInstantLoadLevel) { if (level > fInstantLoadLevel) {
for (i = fInstantLoadLevel; i < level; i++) { for (i = fInstantLoadLevel; i < level; i++) {
if (i<fInstantLoad->step) fInstantLoad->SetHighColor(255.0, 90.0, 90.0); if (i < fInstantLoad->step)
else if ((i/fInstantLoad->step) & 1) fInstantLoad->SetHighColor(90.0, 255.0, 90.0); fInstantLoad->SetHighColor(255, 90, 90);
else fInstantLoad->SetHighColor(40.0, 200.0, 40.0); else if ((i / fInstantLoad->step) & 1)
fInstantLoad->SetHighColor(90, 255, 90);
else
fInstantLoad->SetHighColor(40, 200, 40);
fInstantLoad->FillRect(BRect(3 + i * 4, 2, 5 + i * 4, 19)); fInstantLoad->FillRect(BRect(3 + i * 4, 2, 5 + i * 4, 19));
} }
} }
/* the level is lower than before, we need to erase some bars. */ /* the level is lower than before, we need to erase some bars. */
else { else {
fInstantLoad->SetHighColor(0.0, 0.0, 0.0); fInstantLoad->SetHighColor(0, 0, 0);
for (i = level; i < fInstantLoadLevel; i++) for (i = level; i < fInstantLoadLevel; i++)
fInstantLoad->FillRect(BRect(3 + i * 4, 2, 5 +i * 4, 19)); fInstantLoad->FillRect(BRect(3 + i * 4, 2, 5 +i * 4, 19));
} }