diff --git a/src/tests/kits/game/chart/ChartWindow.cpp b/src/tests/kits/game/chart/ChartWindow.cpp index 54735f40be..10ed4430ec 100644 --- a/src/tests/kits/game/chart/ChartWindow.cpp +++ b/src/tests/kits/game/chart/ChartWindow.cpp @@ -1068,7 +1068,7 @@ ChartWindow::FrameResized(float new_width, float new_height) /* loop through the window list of the application, looking for a window with a specified name. */ BWindow * -ChartWindow::GetAppWindow(char *name) +ChartWindow::GetAppWindow(const char *name) { int32 index; BWindow *window; @@ -1179,19 +1179,15 @@ ChartWindow::OpenColorPalette(BPoint here) void ChartWindow::OpenStarDensity(BPoint here) { - BRect frame; - BSlider *slider; - BWindow *window; - - window = GetAppWindow("Star density"); + BWindow *window = GetAppWindow("Star density"); if (window == NULL) { - frame.Set(here.x, here.y, here.x + STAR_DENSITY_H-1, here.y + STAR_DENSITY_V-1); + BRect frame(here.x, here.y, here.x + STAR_DENSITY_H-1, here.y + STAR_DENSITY_V-1); window = new BWindow(frame, "Star density", B_FLOATING_WINDOW_LOOK, B_FLOATING_APP_WINDOW_FEEL, B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK); frame.OffsetTo(0.0, 0.0); - slider = new BSlider(frame, "", NULL, new BMessage(STAR_DENSITY_MSG), + BSlider *slider = new BSlider(frame, "", NULL, new BMessage(STAR_DENSITY_MSG), STAR_DENSITY_MIN, STAR_DENSITY_MAX); slider->SetViewColor(background_color); slider->SetTarget(NULL, this); diff --git a/src/tests/kits/game/chart/ChartWindow.h b/src/tests/kits/game/chart/ChartWindow.h index 558dd969eb..51a430a477 100644 --- a/src/tests/kits/game/chart/ChartWindow.h +++ b/src/tests/kits/game/chart/ChartWindow.h @@ -252,7 +252,7 @@ private: BView *fTopView; /* Find a window by its name if already opened. */ -static BWindow *GetAppWindow(char *name); +static BWindow *GetAppWindow(const char *name); /* Used to set the content of PictureButton. */ BPicture *ButtonPicture(bool active, int32 button_type); /* Those function create and handle the other settings