summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-10 20:31:56 -0800
committerPeter Hutterer <peter.hutterer@who-t.net>2013-02-12 13:27:01 +1000
commit19734cfead4b8c7a5d592fe0fe5634cb4a1ed34d (patch)
treed372b1a517ff000af3f00b17aacedd4a38709198
parent3d5ce417ba1a8973b04516b0395f15e6500c60ea (diff)
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 <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--setxkbmap.c3
1 files changed, 2 insertions, 1 deletions
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;