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

From: Chris Down <chris_AT_chrisdown.name>
Date: Sun, 21 Aug 2022 23:08:53 +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 ced7d37..b9fa818 100644
--- a/drw.c
+++ b/drw.c
_AT_@ -119,7 +119,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_@ -433,7 +433,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.37.2
Received on Mon Aug 22 2022 - 00:08:53 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 22 2022 - 00:24:36 CEST