From 08008f8c6b8c4b71ba8106ad88ca20c01a5ad468 Mon Sep 17 00:00:00 2001 From: Manuel Menal Date: Thu, 13 Apr 2006 11:06:02 +0000 Subject: Cleanup patch by Ben Asselstine (remove unused variables, make some functions static) (Manuel) --- lib.c | 3 --- options.c | 16 ++++++++-------- ulfs.c | 10 +++++----- ulfs.h | 3 --- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/lib.c b/lib.c index 0423c1b..049b5e5 100644 --- a/lib.c +++ b/lib.c @@ -174,9 +174,6 @@ for_each_subdir (char *path, error_t (*func) (char *, char *)) for (dirent = dirent_list; (! err) && (*dirent); dirent++) { - char *name; - struct stat filestat; - if ((!strcmp ((*dirent)->d_name, ".")) || (!strcmp ((*dirent)->d_name, ".."))) continue; diff --git a/options.c b/options.c index c3a872d..ef29a02 100644 --- a/options.c +++ b/options.c @@ -38,10 +38,10 @@ startup options. Whenever the argument parser is later called to modify the underlying filesystems of the root node, the root node is initialized accordingly directly by the parser. */ -int parsing_startup_options_finished; +static int parsing_startup_options_finished; /* Argp options common to the runtime and startup parser. */ -const struct argp_option argp_common_options[] = +static const struct argp_option argp_common_options[] = { { OPT_LONG_UNDERLYING, OPT_UNDERLYING, 0, 0, "add the underlying node to the unionfs" }, @@ -66,13 +66,13 @@ const struct argp_option argp_common_options[] = }; /* Argp options only meaningful for startup parsing. */ -const struct argp_option argp_startup_options[] = +static const struct argp_option argp_startup_options[] = { { 0 } }; /* Argp parser function for the common options. */ -error_t +static error_t argp_parse_common_options (int key, char *arg, struct argp_state *state) { static int ulfs_flags = 0, ulfs_mode = 0, ulfs_modified = 0, @@ -169,7 +169,7 @@ argp_parse_common_options (int key, char *arg, struct argp_state *state) } /* Argp parser function for the startup oprtions. */ -error_t +static error_t argp_parse_startup_options (int key, char *arg, struct argp_state *state) { error_t err = 0; @@ -185,15 +185,15 @@ argp_parse_startup_options (int key, char *arg, struct argp_state *state) } /* Argp parser for only the common options. */ -const struct argp argp_parser_common_options = +static const struct argp argp_parser_common_options = { argp_common_options, argp_parse_common_options, 0, 0, 0 }; /* Argp parser for only the startup options. */ -struct argp argp_parser_startup_options = +static struct argp argp_parser_startup_options = { argp_startup_options, argp_parse_startup_options, 0, 0, 0 }; /* The children parser for runtime arguments. */ -const struct argp_child argp_children_runtime[] = +static const struct argp_child argp_children_runtime[] = { { &argp_parser_common_options }, { &netfs_std_runtime_argp }, diff --git a/ulfs.c b/ulfs.c index d924b0c..3c565a5 100644 --- a/ulfs.c +++ b/ulfs.c @@ -46,7 +46,7 @@ unsigned int ulfs_num; struct mutex ulfs_lock = MUTEX_INITIALIZER; /* Create a new ulfs element. */ -error_t +static error_t ulfs_create (char *path, ulfs_t **ulfs) { ulfs_t *ulfs_new = malloc (sizeof (ulfs_t)); @@ -76,7 +76,7 @@ ulfs_create (char *path, ulfs_t **ulfs) } /* Destroy an ulfs element. */ -void +static void ulfs_destroy (ulfs_t *ulfs) { free (ulfs->path); @@ -85,7 +85,7 @@ ulfs_destroy (ulfs_t *ulfs) /* Install ULFS into the linked list of registered filesystems in * priority order. */ -void +static void ulfs_install (ulfs_t *ulfs) { ulfs_t *u = ulfs_chain_start; @@ -134,7 +134,7 @@ ulfs_install (ulfs_t *ulfs) } /* Remove ULFS from the linked list of registered filesystems. */ -void +static void ulfs_uninstall (ulfs_t *ulfs) { if (ulfs == ulfs_chain_start) @@ -168,7 +168,7 @@ ulfs_get_num (int num, ulfs_t **ulfs) } /* Get an ulfs element by the associated path. */ -error_t +static error_t ulfs_get_path (char *path, ulfs_t **ulfs) { error_t err = ENOENT; diff --git a/ulfs.h b/ulfs.h index 186718c..532e3c7 100644 --- a/ulfs.h +++ b/ulfs.h @@ -58,9 +58,6 @@ error_t ulfs_unregister (char *path); /* Get an ULFS element by it's index. */ error_t ulfs_get_num (int num, ulfs_t **ulfs); -/* Get an ulfs element by the associated path. */ -error_t ulfs_get_path (char *path, ulfs_t **ulfs); - /* Removes invalid ulfs entries. */ void ulfs_check (void); -- cgit v1.2.3