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 <[email protected]>
---
setxkbmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
1.7.9.2
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel