From 19734cfead4b8c7a5d592fe0fe5634cb4a1ed34d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 10 Feb 2013 20:31:56 -0800 Subject: Make len a size_t instead of converting back & forth to an int Gets rid of a number of clang warnings: setxkbmap.c:689:28: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] len = strlen(orig) + 1; ~ ~~~~~~~~~~~~~^~~ setxkbmap.c:701:39: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] orig = (char *) realloc(orig, len); ~~~~~~~ ^~~ setxkbmap.c:707:32: warning: implicit conversion changes signedness: 'int' to 'size_t' (aka 'unsigned long') [-Wsign-conversion] orig = (char *) calloc(len, 1); ~~~~~~ ^~~ Signed-off-by: Alan Coopersmith Signed-off-by: Peter Hutterer --- setxkbmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'setxkbmap.c') diff --git a/setxkbmap.c b/setxkbmap.c index b573b14..e50ad16 100644 --- a/setxkbmap.c +++ b/setxkbmap.c @@ -683,7 +683,8 @@ addStringToOptions(char *opt_str, list_t *opts) char * stringFromOptions(char *orig, list_t *newOpts) { - int len, i, nOut; + size_t len; + int i, nOut; if (orig) len = strlen(orig) + 1; -- cgit v1.2.3