[PATCH xserver 2/4] xfree86/parser: move StringToToken() definition further up
Emil Velikov
emil.l.velikov at gmail.com
Sun Apr 17 19:30:44 UTC 2016
... so that we can use it without the forward declaration. Plus we're
doing to reuse it in the next commit ;-)
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
hw/xfree86/parser/scan.c | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c
index 2760439..5c2e4ae 100644
--- a/hw/xfree86/parser/scan.c
+++ b/hw/xfree86/parser/scan.c
@@ -87,8 +87,6 @@
#define CONFIG_BUF_LEN 1024
#define CONFIG_MAX_FILES 64
-static int StringToToken(const char *, const xf86ConfigSymTabRec *);
-
static struct {
FILE *file;
char *path;
@@ -241,6 +239,18 @@ xf86getNextLine(void)
return ret;
}
+static int
+StringToToken(const char *str, const xf86ConfigSymTabRec * tab)
+{
+ int i;
+
+ for (i = 0; tab[i].token != -1; i++) {
+ if (!xf86nameCompare(tab[i].name, str))
+ return tab[i].token;
+ }
+ return ERROR_TOKEN;
+}
+
/*
* xf86getToken --
* Read next Token from the config file. Handle the global variable
@@ -1028,18 +1038,6 @@ xf86getStringToken(const xf86ConfigSymTabRec * tab)
return StringToToken(xf86_lex_val.str, tab);
}
-static int
-StringToToken(const char *str, const xf86ConfigSymTabRec * tab)
-{
- int i;
-
- for (i = 0; tab[i].token != -1; i++) {
- if (!xf86nameCompare(tab[i].name, str))
- return tab[i].token;
- }
- return ERROR_TOKEN;
-}
-
/*
* Compare two names. The characters '_', ' ', and '\t' are ignored
* in the comparison.
--
2.8.0
More information about the xorg-devel
mailing list