bug-freedink
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Make variables const


From: Håvard F . Aasen
Subject: [PATCH] Make variables const
Date: Wed, 20 Jul 2022 19:52:49 +0200

Both of these functions, TTF_FontFaceStyleName() and
TTF_FontFaceFamilyName() return 'const char *'. Update variables to
match expected returned type.

Bug-Debian: http://bugs.debian.org/1015106
---
 src/gfx_fonts.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gfx_fonts.cpp b/src/gfx_fonts.cpp
index b00816e..2cedd8a 100644
--- a/src/gfx_fonts.cpp
+++ b/src/gfx_fonts.cpp
@@ -293,10 +293,10 @@ void set_font_color(int no, int r, int g, int b)
  */
 void setup_font(TTF_Font *font)
 {
-  char *familyname = TTF_FontFaceFamilyName(font);
+  const char *familyname = TTF_FontFaceFamilyName(font);
   if(familyname)
     log_info("The family name of the face in the font is: %s", familyname);
-  char *stylename = TTF_FontFaceStyleName(font);
+  const char *stylename = TTF_FontFaceStyleName(font);
   if(stylename)
     log_info("The name of the face in the font is: %s", stylename);
   log_info("The font max height is: %d", TTF_FontHeight(font));
-- 
2.35.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]