From b49767c0bacb714e14f988423e14832689c6faf2 Mon Sep 17 00:00:00 2001 From: Mikhail Lappo Date: Thu, 23 Mar 2017 21:44:26 +0100 Subject: Const modifiers This functions do not change class variables Would be good to mark them as const, so class variables are not changed by coincidence Change-Id: Iea34f6d26dbd1bde813035160e07ff2a681989e6 --- screen_ui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'screen_ui.cpp') diff --git a/screen_ui.cpp b/screen_ui.cpp index 706877b4d..bb2772dd8 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -98,7 +98,7 @@ GRSurface* ScreenRecoveryUI::GetCurrentText() { } } -int ScreenRecoveryUI::PixelsFromDp(int dp) { +int ScreenRecoveryUI::PixelsFromDp(int dp) const { return dp * density_; } @@ -256,12 +256,12 @@ void ScreenRecoveryUI::DrawHorizontalRule(int* y) { *y += 4; } -void ScreenRecoveryUI::DrawTextLine(int x, int* y, const char* line, bool bold) { +void ScreenRecoveryUI::DrawTextLine(int x, int* y, const char* line, bool bold) const { gr_text(gr_sys_font(), x, *y, line, bold); *y += char_height_ + 4; } -void ScreenRecoveryUI::DrawTextLines(int x, int* y, const char* const* lines) { +void ScreenRecoveryUI::DrawTextLines(int x, int* y, const char* const* lines) const { for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) { DrawTextLine(x, y, lines[i], false); } -- cgit v1.2.3