From 1b8bf0b5477c1f6ad38a7d57cd9ef354409472d1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 6 Sep 2013 00:15:23 -0700 Subject: Explicitly cast tolower() return value to char before storing in a char For ancient historical compatibility, the C standards define the functions as taking & returning ints, but limiting them to the subset of values that fit in a char. Silences clang warning: xkill.c:244:12: warning: implicit conversion loses integer precision: 'int' to 'char' [-Wconversion] *cp = _tolower (*cp); ~ ^~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith --- xkill.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xkill.c b/xkill.c index 9bbde1c..2270dcd 100644 --- a/xkill.c +++ b/xkill.c @@ -241,9 +241,9 @@ parse_button(char *s, int *buttonp) for (cp = s; *cp; cp++) { if (isascii (*cp) && isupper (*cp)) { #ifdef _tolower - *cp = _tolower (*cp); + *cp = (char) _tolower (*cp); #else - *cp = tolower (*cp); + *cp = (char) tolower (*cp); #endif /* _tolower */ } } -- cgit v1.2.3