[hackers] [dwm][PATCH] drw: Maintain const-correctness for fontconfig/Xft types

From: Chris Down <chris_AT_chrisdown.name>
Date: Wed, 22 Apr 2020 15:49:31 +0100

We retrieve these from their respective functions arguments as const,
and can trivially respect that.
---
 drw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drw.c b/drw.c
index 8fd1ca4..08f7a4a 100644
--- a/drw.c
+++ b/drw.c
_AT_@ -118,7 +118,7 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
 			fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname);
 			return NULL;
 		}
-		if (!(pattern = FcNameParse((FcChar8 *) fontname))) {
+		if (!(pattern = FcNameParse((const FcChar8 *) fontname))) {
 			fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname);
 			XftFontClose(drw->dpy, xfont);
 			return NULL;
_AT_@ -404,7 +404,7 @@ drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w,
 	if (!font || !text)
 		return;
 
-	XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext);
+	XftTextExtentsUtf8(font->dpy, font->xfont, (const XftChar8 *)text, len, &ext);
 	if (w)
 		*w = ext.xOff;
 	if (h)
-- 
2.26.2
Received on Wed Apr 22 2020 - 16:49:31 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 22 2020 - 18:00:40 CEST