From 0e8980ea133052faef212528d14ffe4a3af22114 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Wed, 30 Oct 2024 19:05:49 +0100 Subject: [PATCH] 2dlib: Fix set but not used compiler warning in font.cpp This fixes a set but not used compiler warning in Release builds in 2dlib/font.cpp. --- 2dlib/font.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/2dlib/font.cpp b/2dlib/font.cpp index adaa36f8..2dfd9cc9 100644 --- a/2dlib/font.cpp +++ b/2dlib/font.cpp @@ -631,7 +631,7 @@ int grFont::draw_char(grSurface *sf, int x, int y, int ch, tCharProperties *chpr int grFont::draw_char(grSurface *sf, int x, int y, int ch, int sx, int sy, int sw, int sh, tCharProperties *chprop) { gr_font_record *ft; - int next_x = 0, width, index; + int next_x = 0, index; ASSERT(m_FontHandle > -1); if ((ch < min_ascii()) || (ch > max_ascii())) @@ -643,6 +643,7 @@ int grFont::draw_char(grSurface *sf, int x, int y, int ch, int sx, int sy, int s index = ch - ft->font.min_ascii; // draw either a color bitmap or mono font. + [[maybe_unused]] int width; if (ft->font.flags & FT_PROPORTIONAL) { width = (int)ft->font.char_widths[index]; } else {