summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-24 10:09:22 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-05-24 10:09:22 -0700
commitcab5c584f1dcc125a7fd2a014785dc8adcd3c683 (patch)
tree56e356b4a9ba5922c9d8a8815e5de0c74939c3c6
parent3d05b29e9e1431f11cb2c2cb960380586c6ba494 (diff)
Fix size/sign conversion warnings in isabbreviation()
clang said: xgamma.c:85:26: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if (strncmp (arg, s, slen) == 0) return (True); ~~~~~~~ ^~~~ xgamma.c:78:14: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] arglen = strlen (arg); ~ ^~~~~~~~~~~~ xgamma.c:79:12: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] slen = strlen (s); ~ ^~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xgamma.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xgamma.c b/xgamma.c
index 6db07ef..9988575 100644
--- a/xgamma.c
+++ b/xgamma.c
@@ -67,10 +67,10 @@ Syntax(void)
*/
static Bool
-isabbreviation(char *arg, char *s, int minslen)
+isabbreviation(char *arg, char *s, size_t minslen)
{
- int arglen;
- int slen;
+ size_t arglen;
+ size_t slen;
/* exact match */
if (strcmp (arg, s) == 0) return (True);