From 494301a5aa9fb6356e6f229c18905b3a10905aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 14 Jun 2005 13:27:26 +0000 Subject: [PATCH] Minor cleanup, fixed warnings. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13115 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/finddir.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/bin/finddir.c b/src/bin/finddir.c index 79d4942424..9642181e73 100644 --- a/src/bin/finddir.c +++ b/src/bin/finddir.c @@ -10,8 +10,12 @@ #include #include -typedef struct -{ + +#define NO_ERRORS 0 +#define ARGUMENT_MISSING 1 +#define WRONG_DIR_TYPE 2 + +typedef struct { const char *key; directory_which value; } directoryType; @@ -78,7 +82,9 @@ directoryType directoryTypes[] = { {NULL,B_USER_DESKBAR_DIRECTORY} }; -void listDirectoryWhich(void) + +static void +listDirectoryWhich(void) { int i; @@ -87,25 +93,27 @@ void listDirectoryWhich(void) } } -bool retrieveDirValue(directoryType *list, const char *key, directory_which *value_out) + +static bool +retrieveDirValue(directoryType *list, const char *key, directory_which *value_out) { unsigned i = 0; - while (list[i].key != NULL) - { - if (strcmp(list[i].key, key) == 0) - { + while (list[i].key != NULL) { + if (strcmp(list[i].key, key) == 0) { *value_out = list[i].value; return true; } - + i++; } - + return false; } -void usageMsg() + +static void +usageMsg() { printf("usage: /bin/finddir -l | [ -v volume ] directory_which\n"); printf("\t-l\t list valid which constants to use\n"); @@ -117,11 +125,9 @@ void usageMsg() printf(" see the find_directory(...) documentation in the Be Book.\n"); } -#define NO_ERRORS 0 -#define ARGUMENT_MISSING 1 -#define WRONG_DIR_TYPE 2 -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { int directoryArgNr; int status;