From: Timo Kokkonen Date: Tue, 27 Mar 2012 16:42:00 +0000 (+0300) Subject: main.c: Remove forward declaration for token() X-Git-Url: http://git.itanic.dy.fi/?p=glucose;a=commitdiff_plain;h=f24584d2a8d55e48fe24d76dbd168d4dea687c22 main.c: Remove forward declaration for token() The forward declaration can be avoided by moving the function before any call sites. As an added bonus, the function is marked as static as it is not used in any other C file. Signed-off-by: Timo Kokkonen --- diff --git a/main.c b/main.c index d1b586c..aa1c0e2 100644 --- a/main.c +++ b/main.c @@ -32,7 +32,18 @@ #include "options.h" #include "contour-protocol.h" -char *token(char **str, char sep); +static char *token(char **str, char sep) +{ + char *start = *str; + char *cur; + + for (cur = start; *cur && (*cur != sep); ++cur); + + *cur = 0; + *str = cur+1; + + return start; +} int main(int argc, char *argv[]) { @@ -118,13 +129,3 @@ int main(int argc, char *argv[]) return 0; } - -char *token(char **str, char sep) -{ - char *start = *str; - char *cur; - for ( cur = start; *cur && (*cur != sep); ++cur ) ; - *cur = 0; - *str = cur+1; - return start; -}