summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-13 08:37:49 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-13 08:37:49 -0800
commit865c7c3da3a827cff080a763613d02729e9d4e33 (patch)
tree10accd1819c0fa641fab33e240671e15a5d7e486
parent4fa0dd48d6c9fcd54276a66c221fdafda2395c02 (diff)
Fix implicit sign conversion & integer size truncation warnings
xrefresh.c:125:14: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] arglen = strlen (arg); ~ ^~~~~~~~~~~~ xrefresh.c:126:12: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] slen = strlen (s); ~ ^~~~~~~~~~ xrefresh.c:132:26: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] if (strncmp (arg, s, slen) == 0) return (True); ~~~~~~~ ^~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xrefresh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xrefresh.c b/xrefresh.c
index ded2908..b160112 100644
--- a/xrefresh.c
+++ b/xrefresh.c
@@ -114,10 +114,10 @@ parse_boolean_option(char *option)
*/
static Bool
-isabbreviation(const char *arg, char *s, int minslen)
+isabbreviation(const 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);