From c161df4fee61819a28089682963cc2e721ca22c8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 10 Aug 2013 23:51:08 -0700 Subject: Remove even more casts of return values from Xmalloc/Xrealloc Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/IdOfPr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11/IdOfPr.c') diff --git a/nx-X11/lib/X11/IdOfPr.c b/nx-X11/lib/X11/IdOfPr.c index 3a92e0a11..e15f34fec 100644 --- a/nx-X11/lib/X11/IdOfPr.c +++ b/nx-X11/lib/X11/IdOfPr.c @@ -67,7 +67,7 @@ XcmsFormatOfPrefix(char *prefix) * While copying prefix to string_lowered, convert to lowercase */ if ((len = strlen(prefix)) >= sizeof(string_buf)) { - string_lowered = (char *) Xmalloc(len+1); + string_lowered = Xmalloc(len+1); } else { string_lowered = string_buf; } -- cgit v1.2.3 From 327d2cc6047683abb36cab25a90633c7b8d9b036 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 6 Feb 2016 13:01:25 -0800 Subject: xcms: use size_t for strlen/sizeof values instead of converting to int & back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes gcc warnings of the form: IdOfPr.c: In function ‘XcmsFormatOfPrefix’: IdOfPr.c:69:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if ((len = strlen(prefix)) >= sizeof(string_buf)) { ^ IdOfPr.c:83:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (len >= sizeof(string_buf)) Xfree(string_lowered); ^ IdOfPr.c:97:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (len >= sizeof(string_buf)) Xfree(string_lowered); ^ IdOfPr.c:104:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (len >= sizeof(string_buf)) Xfree(string_lowered); ^ Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/IdOfPr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11/IdOfPr.c') diff --git a/nx-X11/lib/X11/IdOfPr.c b/nx-X11/lib/X11/IdOfPr.c index e15f34fec..9f43dd387 100644 --- a/nx-X11/lib/X11/IdOfPr.c +++ b/nx-X11/lib/X11/IdOfPr.c @@ -61,7 +61,7 @@ XcmsFormatOfPrefix(char *prefix) XcmsColorSpace **papColorSpaces; char string_buf[64]; char *string_lowered; - int len; + size_t len; /* * While copying prefix to string_lowered, convert to lowercase -- cgit v1.2.3