Minor cleanup, fixed warnings.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13115 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-06-14 13:27:26 +00:00
parent 43ed6aa0db
commit 494301a5aa
1 changed files with 21 additions and 15 deletions

View File

@ -10,8 +10,12 @@
#include <stdio.h>
#include <string.h>
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;