From 9d80098e24369cefeaed17a71ae354cea979f837 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 12 Jul 2022 18:40:48 -0400 Subject: [PATCH] app_server: Add casts to appease GCC2. --- src/servers/app/decorator/DefaultDecorator.cpp | 6 +++--- src/servers/app/decorator/TabDecorator.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/servers/app/decorator/DefaultDecorator.cpp b/src/servers/app/decorator/DefaultDecorator.cpp index 78d549adf4..b8393211f7 100644 --- a/src/servers/app/decorator/DefaultDecorator.cpp +++ b/src/servers/app/decorator/DefaultDecorator.cpp @@ -207,7 +207,7 @@ DefaultDecorator::_DrawFrame(BRect rect) return; // TODO: While this works, it does not look so crisp at higher resolutions. -#define COLORS_INDEX(i, borderWidth, nominalLimit) ((float(i) / float(borderWidth)) * nominalLimit) +#define COLORS_INDEX(i, borderWidth, nominalLimit) int32((float(i) / float(borderWidth)) * nominalLimit) // Draw the border frame BRect border = BRect(fTopBorder.LeftTop(), fBottomBorder.RightBottom()); @@ -231,7 +231,7 @@ DefaultDecorator::_DrawFrame(BRect rect) if (fTitleBarRect.IsValid()) { // grey along the bottom of the tab // (overwrites "white" from frame) - const int overdraw = ceilf(fBorderWidth / 5.0f); + const int overdraw = (int)ceilf(fBorderWidth / 5.0f); for (int i = 1; i <= overdraw; i++) { fDrawingEngine->StrokeLine( BPoint(fTitleBarRect.left + 2, fTitleBarRect.bottom + i), @@ -300,7 +300,7 @@ DefaultDecorator::_DrawFrame(BRect rect) if (fTitleBarRect.IsValid() && fTopTab->look != kLeftTitledWindowLook) { // grey along the bottom of the tab // (overwrites "white" from frame) - const int overdraw = ceilf(fBorderWidth / 5.0f); + const int overdraw = (int)ceilf(fBorderWidth / 5.0f); for (int i = 1; i <= overdraw; i++) { fDrawingEngine->StrokeLine( BPoint(fTitleBarRect.left + 2, fTitleBarRect.bottom + i), diff --git a/src/servers/app/decorator/TabDecorator.cpp b/src/servers/app/decorator/TabDecorator.cpp index 21317a5b85..68160e4f1b 100644 --- a/src/servers/app/decorator/TabDecorator.cpp +++ b/src/servers/app/decorator/TabDecorator.cpp @@ -262,7 +262,7 @@ TabDecorator::_DoLayout() fBorderWidth = 0; } - fBorderWidth *= scaleFactor; + fBorderWidth = int32(fBorderWidth * scaleFactor); fResizeKnobSize = kResizeKnobSize * scaleFactor; fBorderResizeLength = kBorderResizeLength * scaleFactor;