From cab5c584f1dcc125a7fd2a014785dc8adcd3c683 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 24 May 2014 10:09:22 -0700 Subject: 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 --- xgamma.c | 6 +++--- 1 file 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); -- cgit v1.2.3