Commit 68e3ee67 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

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: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 8d8d5cfd
...@@ -176,13 +176,13 @@ TekHVC_ParseString( ...@@ -176,13 +176,13 @@ TekHVC_ParseString(
* XcmsSuccess if valid. * XcmsSuccess if valid.
*/ */
{ {
int n; size_t n;
char *pchar; char *pchar;
if ((pchar = strchr(spec, ':')) == NULL) { if ((pchar = strchr(spec, ':')) == NULL) {
return(XcmsFailure); return(XcmsFailure);
} }
n = (int)(pchar - spec); n = (size_t)(pchar - spec);
/* /*
* Check for proper prefix. * Check for proper prefix.
......
...@@ -1405,13 +1405,13 @@ XcmsLRGB_RGBi_ParseString( ...@@ -1405,13 +1405,13 @@ XcmsLRGB_RGBi_ParseString(
* 0 if failed, non-zero otherwise. * 0 if failed, non-zero otherwise.
*/ */
{ {
int n; size_t n;
char *pchar; char *pchar;
if ((pchar = strchr(spec, ':')) == NULL) { if ((pchar = strchr(spec, ':')) == NULL) {
return(XcmsFailure); return(XcmsFailure);
} }
n = (int)(pchar - spec); n = (size_t)(pchar - spec);
/* /*
* Check for proper prefix. * Check for proper prefix.
......
...@@ -120,13 +120,13 @@ CIEXYZ_ParseString( ...@@ -120,13 +120,13 @@ CIEXYZ_ParseString(
* RETURNS * RETURNS
*/ */
{ {
int n; size_t n;
char *pchar; char *pchar;
if ((pchar = strchr(spec, ':')) == NULL) { if ((pchar = strchr(spec, ':')) == NULL) {
return(XcmsFailure); return(XcmsFailure);
} }
n = (int)(pchar - spec); n = (size_t)(pchar - spec);
/* /*
* Check for proper prefix. * Check for proper prefix.
......
...@@ -126,13 +126,13 @@ _XcmsColorSpaceOfString( ...@@ -126,13 +126,13 @@ _XcmsColorSpaceOfString(
*/ */
{ {
XcmsColorSpace **papColorSpaces; XcmsColorSpace **papColorSpaces;
int n; size_t n;
char *pchar; char *pchar;
if ((pchar = strchr(color_string, ':')) == NULL) { if ((pchar = strchr(color_string, ':')) == NULL) {
return(XcmsFailure); return(XcmsFailure);
} }
n = (int)(pchar - color_string); n = (size_t)(pchar - color_string);
if (ccc == NULL) { if (ccc == NULL) {
return(NULL); return(NULL);
......
...@@ -135,13 +135,13 @@ CIEuvY_ParseString( ...@@ -135,13 +135,13 @@ CIEuvY_ParseString(
* 0 if failed, non-zero otherwise. * 0 if failed, non-zero otherwise.
*/ */
{ {
int n; size_t n;
char *pchar; char *pchar;
if ((pchar = strchr(spec, ':')) == NULL) { if ((pchar = strchr(spec, ':')) == NULL) {
return(XcmsFailure); return(XcmsFailure);
} }
n = (int)(pchar - spec); n = (size_t)(pchar - spec);
/* /*
* Check for proper prefix. * Check for proper prefix.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment