Commit cb4bae714e32ba9ec6ec8bfec91cbac0117b1ef5

Ran Benita 2014-06-30T14:52:30

parser: don't shadow "str" It's a name of a function in scanner-utils.h and also of some parameters. https://bugs.freedesktop.org/show_bug.cgi?id=79898 Reported-by: Bryce Harrington <b.harrington@samsung.com> Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/src/xkbcomp/parser-priv.h b/src/xkbcomp/parser-priv.h
index 0675e55..76b5047 100644
--- a/src/xkbcomp/parser-priv.h
+++ b/src/xkbcomp/parser-priv.h
@@ -28,8 +28,8 @@
 #define XKBCOMP_PARSER_PRIV_H
 
 struct parser_param;
+struct scanner;
 
-#include "scanner-utils.h"
 #include "parser.h"
 
 int
diff --git a/src/xkbcomp/parser.y b/src/xkbcomp/parser.y
index 521168d..ad1a27b 100644
--- a/src/xkbcomp/parser.y
+++ b/src/xkbcomp/parser.y
@@ -34,6 +34,7 @@
 #include "xkbcomp-priv.h"
 #include "ast-build.h"
 #include "parser-priv.h"
+#include "scanner-utils.h"
 
 struct parser_param {
     struct xkb_context *ctx;
@@ -55,21 +56,21 @@ _xkbcommon_error(struct parser_param *param, const char *msg)
 }
 
 static bool
-resolve_keysym(const char *str, xkb_keysym_t *sym_rtrn)
+resolve_keysym(const char *name, xkb_keysym_t *sym_rtrn)
 {
     xkb_keysym_t sym;
 
-    if (!str || istreq(str, "any") || istreq(str, "nosymbol")) {
+    if (!name || istreq(name, "any") || istreq(name, "nosymbol")) {
         *sym_rtrn = XKB_KEY_NoSymbol;
         return true;
     }
 
-    if (istreq(str, "none") || istreq(str, "voidsymbol")) {
+    if (istreq(name, "none") || istreq(name, "voidsymbol")) {
         *sym_rtrn = XKB_KEY_VoidSymbol;
         return true;
     }
 
-    sym = xkb_keysym_from_name(str, XKB_KEYSYM_NO_FLAGS);
+    sym = xkb_keysym_from_name(name, XKB_KEYSYM_NO_FLAGS);
     if (sym != XKB_KEY_NoSymbol) {
         *sym_rtrn = sym;
         return true;
diff --git a/src/xkbcomp/scanner.c b/src/xkbcomp/scanner.c
index 9f200bb..06eb653 100644
--- a/src/xkbcomp/scanner.c
+++ b/src/xkbcomp/scanner.c
@@ -23,6 +23,7 @@
 
 #include "xkbcomp-priv.h"
 #include "parser-priv.h"
+#include "scanner-utils.h"
 
 static bool
 number(struct scanner *s, int64_t *out, int *out_tok)