From 8d8d5cfd8c4f3d25c85d6ed60298f3aa917651eb Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 6 Feb 2016 13:32:44 -0800 Subject: xcms: use unsigned indexes when looping through unsigned values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clears many gcc warnings of the form: uvY.c: In function ‘XcmsCIEuvYToCIEXYZ’: uvY.c:263:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (i = 0; i < nColors; i++, pColor++) { ^ Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/uvY.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/lib/X11/uvY.c') diff --git a/nx-X11/lib/X11/uvY.c b/nx-X11/lib/X11/uvY.c index 60603a950..0788b7542 100644 --- a/nx-X11/lib/X11/uvY.c +++ b/nx-X11/lib/X11/uvY.c @@ -243,7 +243,7 @@ XcmsCIEuvYToCIEXYZ( { XcmsCIEXYZ XYZ_return; XcmsColor whitePt; - int i; + unsigned int i; XcmsColor *pColor = pColors_in_out; XcmsFloat div, x, y, z, Y; @@ -358,7 +358,7 @@ XcmsCIEXYZToCIEuvY( { XcmsCIEuvY uvY_return; XcmsColor whitePt; - int i; + unsigned int i; XcmsColor *pColor = pColors_in_out; XcmsFloat div; -- cgit v1.2.3 From 68e3ee67c07282c11cd144fbdb767b41a6dacc4e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 6 Feb 2016 14:18:32 -0800 Subject: xcms: use size_t for pointer offsets passed to strncmp instead of converting to int and back Fixes clang warnings of the form: HVC.c:190:43: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] if (strncmp(spec, _XcmsTekHVC_prefix, n) != 0) { ~~~~~~~ Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/uvY.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/lib/X11/uvY.c') diff --git a/nx-X11/lib/X11/uvY.c b/nx-X11/lib/X11/uvY.c index 0788b7542..19e6c5232 100644 --- a/nx-X11/lib/X11/uvY.c +++ b/nx-X11/lib/X11/uvY.c @@ -135,13 +135,13 @@ CIEuvY_ParseString( * 0 if failed, non-zero otherwise. */ { - int n; + size_t n; char *pchar; if ((pchar = strchr(spec, ':')) == NULL) { return(XcmsFailure); } - n = (int)(pchar - spec); + n = (size_t)(pchar - spec); /* * Check for proper prefix. -- cgit v1.2.3