From fb27afc921300f6ea2e0852abc5f9612caf92cf2 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Fri, 1 Jan 2021 18:07:27 +0000 Subject: Greeter: add parens to DRAW_STRING & TEXT_WIDTH macros From Alan Coopersmith in xdm: Oracle Parfait static analyser points out it wasn't clear if cast or arithmetic operation in arguments at lines 410, 416, 431, & 433 was intended to be done first, so we'll make it explicit. --- greeter/Login.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/greeter/Login.c b/greeter/Login.c index 6ac1765..05a460f 100644 --- a/greeter/Login.c +++ b/greeter/Login.c @@ -223,14 +223,14 @@ static XtResource resources[] = { #define TEXT_COLOR(f) (w->login.f##color.pixel) #define TEXT_WIDTH(f, m, l) XmuXftTextWidth(XtDisplay (w), \ - w->login.f##Face, (FcChar8 *) m, l) + w->login.f##Face, (FcChar8 *) (m), l) static int XmuXftTextWidth(Display *dpy, XftFont *font, FcChar8 *string, int len); #define DRAW_STRING(f, x, y, m, l) \ /* Debug("DRAW_STRING(%s, %d, %d, %s, %d)\n", #f, x, y, m, l); */ \ XftDrawString8 (w->login.draw, &w->login.f##color, w->login.f##Face, \ - x, y, (FcChar8 *) m, l) + x, y, (FcChar8 *) (m), l) #define STRING_WIDTH(f, s) TEXT_WIDTH (f, s, strlen(s)) -- cgit v1.2.3