diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2016-04-17 20:30:44 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-04-18 11:36:41 -0400 |
commit | 944ea03d5be2ffe22a3f1c4c287760261c31235f (patch) | |
tree | c3f4eeaafc5a418d176a4e75d4a0f4ffc1d9eb93 | |
parent | b93be14b7d339e4e46d941729dad853452fae8c0 (diff) |
xfree86/parser: move StringToToken() definition further up
... so that we can use it without the forward declaration. Plus we're
doing to reuse it in the next commit ;-)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r-- | hw/xfree86/parser/scan.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c index 2760439b6..5c2e4ae74 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. |