Make some functions/variables static.
authorAndre Noll <maan@systemlinux.org>
Tue, 21 Jul 2009 23:43:25 +0000 (01:43 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 21 Jul 2009 23:43:25 +0000 (01:43 +0200)
Found by sparse.

aft.c
attribute.c
audioc.c
fade.c
grab_client.c
gui.c
mm.c
mood.c
recv.c

diff --git a/aft.c b/aft.c
index a112abe766af318a876bef5fdb2c62c480e4fd63..39e94a945e0b9b8c47d29e6bb59d799491f2f9e4 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -238,7 +238,7 @@ enum audio_file_table_columns {
  *
  * \sa osl_compare_func, uint32_compare().
  */
  *
  * \sa osl_compare_func, uint32_compare().
  */
-int aft_hash_compare(const struct osl_object *obj1, const struct osl_object *obj2)
+static int aft_hash_compare(const struct osl_object *obj1, const struct osl_object *obj2)
 {
        return hash_compare((HASH_TYPE *)obj1->data, (HASH_TYPE *)obj2->data);
 }
 {
        return hash_compare((HASH_TYPE *)obj1->data, (HASH_TYPE *)obj2->data);
 }
@@ -475,7 +475,7 @@ int aft_get_row_of_path(const char *path, struct osl_row **row)
  *
  * \return Standard.
  */
  *
  * \return Standard.
  */
-int aft_get_row_of_hash(HASH_TYPE *hash, struct osl_row **row)
+static int aft_get_row_of_hash(HASH_TYPE *hash, struct osl_row **row)
 {
        const struct osl_object obj = {.data = hash, .size = HASH_SIZE};
        return osl(osl_get_row(audio_file_table, AFTCOL_HASH, &obj, row));
 {
        const struct osl_object obj = {.data = hash, .size = HASH_SIZE};
        return osl(osl_get_row(audio_file_table, AFTCOL_HASH, &obj, row));
@@ -503,7 +503,7 @@ int get_afsi_object_of_row(const struct osl_row *row, struct osl_object *obj)
  *
  * \return Positive on success, negative on errors.
  */
  *
  * \return Positive on success, negative on errors.
  */
-int get_afsi_object_of_path(const char *path, struct osl_object *obj)
+static int get_afsi_object_of_path(const char *path, struct osl_object *obj)
 {
        struct osl_row *row;
        int ret = aft_get_row_of_path(path, &row);
 {
        struct osl_row *row;
        int ret = aft_get_row_of_path(path, &row);
@@ -2435,7 +2435,7 @@ int com_cpsi(struct rc4_context *rc4c, int argc,  char * const * const argv)
        return ret;
 }
 
        return ret;
 }
 
-void afs_stat_callback(int fd, const struct osl_object *query)
+static void afs_stat_callback(int fd, const struct osl_object *query)
 {
        int *parser_friendly = query->data;
        char *buf = *parser_friendly?
 {
        int *parser_friendly = query->data;
        char *buf = *parser_friendly?
index cfb7dde0d0c1bc83160f6698bbe304d27007444b..d94589871562038a7ba96aad85c741de0db05b65 100644 (file)
@@ -565,7 +565,7 @@ err:
  *
  * \sa osl_close_table().
  */
  *
  * \sa osl_close_table().
  */
-void attribute_close(void)
+static void attribute_close(void)
 {
        osl_close_table(attribute_table, OSL_MARK_CLEAN);
        attribute_table = NULL;
 {
        osl_close_table(attribute_table, OSL_MARK_CLEAN);
        attribute_table = NULL;
index 81e5d1c53e3d349ac6182c1bb1c03a5283e445c8..fa1768b52f26eb69b6806f18c42d098a0267259e 100644 (file)
--- a/audioc.c
+++ b/audioc.c
@@ -19,8 +19,8 @@
 
 INIT_AUDIOC_ERRLISTS;
 
 
 INIT_AUDIOC_ERRLISTS;
 
-/** the gengetopt structure containing command line args */
-struct audioc_args_info conf;
+/** The gengetopt structure containing command line args. */
+static struct audioc_args_info conf;
 
 static int loglevel;
 INIT_STDERR_LOGGING(loglevel);
 
 static int loglevel;
 INIT_STDERR_LOGGING(loglevel);
diff --git a/fade.c b/fade.c
index aa7997eb94b87ee34dc8b3d334c9e7a200ddf88d..868ada4120b55c67fd3260ea93f6d81ba42b9f9d 100644 (file)
--- a/fade.c
+++ b/fade.c
@@ -25,7 +25,7 @@
 #include "error.h"
 
 INIT_FADE_ERRLISTS;
 #include "error.h"
 
 INIT_FADE_ERRLISTS;
-struct fade_args_info conf;
+static struct fade_args_info conf;
 
 __printf_2_3 void para_log(__a_unused int ll, const char *fmt, ...)
 {
 
 __printf_2_3 void para_log(__a_unused int ll, const char *fmt, ...)
 {
index 67db50570d11666b4d59041ccc354477c4b3d0fc..d1ef43f95bba34cc43881ec779976f5c3d797e50 100644 (file)
@@ -27,7 +27,7 @@
 #include "fd.h"
 
 /** Grab clients that are not yet attached to a filter node. */
 #include "fd.h"
 
 /** Grab clients that are not yet attached to a filter node. */
-struct list_head inactive_grab_client_list;
+static struct list_head inactive_grab_client_list;
 
 static int max_num_filters(void)
 {
 
 static int max_num_filters(void)
 {
diff --git a/gui.c b/gui.c
index 394b69fe5466efe19fb532a2cf43e18381409d8e..b37f8fbd5d6db608b9c3086f508809aa52500737 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -45,7 +45,7 @@ struct rb_entry {
        size_t len;
        int color;
 };
        size_t len;
        int color;
 };
-struct ringbuffer *bot_win_rb;
+static struct ringbuffer *bot_win_rb;
 #define NUM_LINES(len) (1 + (len) / bot.cols)
 
 static unsigned scroll_position;
 #define NUM_LINES(len) (1 + (len) / bot.cols)
 
 static unsigned scroll_position;
@@ -91,8 +91,8 @@ struct stat_item {
 
 static struct gui_theme theme;
 
 
 static struct gui_theme theme;
 
-int _argc;
-char **_argv;
+static int _argc;
+static char **_argv;
 
 static void com_help(void);
 static void com_reread_conf(void);
 
 static void com_help(void);
 static void com_reread_conf(void);
@@ -110,7 +110,7 @@ static void com_scroll_down(void);
 static void com_page_up(void);
 static void com_page_down(void);
 
 static void com_page_up(void);
 static void com_page_down(void);
 
-struct gui_command command_list[] = {
+static struct gui_command command_list[] = {
        {
                .key = "?",
                .name = "help",
        {
                .key = "?",
                .name = "help",
diff --git a/mm.c b/mm.c
index 885b6307d80bfc86664f1933daef52988260574b..ead20681f781427f1c1d27aec015bc64f79ff9e0 100644 (file)
--- a/mm.c
+++ b/mm.c
@@ -32,7 +32,7 @@
 enum mood_comparator_id {MOOD_COMPARATORS NUM_MOOD_COMPARATORS};
 #undef MC
 #define MC(a, b) # b,
 enum mood_comparator_id {MOOD_COMPARATORS NUM_MOOD_COMPARATORS};
 #undef MC
 #define MC(a, b) # b,
-const char const *mood_comparators[] = {MOOD_COMPARATORS};
+static const char const *mood_comparators[] = {MOOD_COMPARATORS};
 #undef MC
 
 static int parse_mood_comparator(const char *word)
 #undef MC
 
 static int parse_mood_comparator(const char *word)
diff --git a/mood.c b/mood.c
index f3ce9e0aa11a691202397039ecd275c1fd05268a..b5047d3745056703b8afab1ac85e81777cadaca7 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -35,7 +35,7 @@ struct afs_statistics {
        /** Number of admissible files */
        unsigned num;
 };
        /** Number of admissible files */
        unsigned num;
 };
-struct afs_statistics statistics;
+static struct afs_statistics statistics;
 
 /**
  * Each line of the current mood corresponds to a mood_item.
 
 /**
  * Each line of the current mood corresponds to a mood_item.
diff --git a/recv.c b/recv.c
index d01dab68847fc93912edb7e9c7a1e873cf11a1e5..9d6f028319fc6e1e8f36f7406fc64475fb3576df 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -21,8 +21,8 @@
 #include "error.h"
 #include "stdout.h"
 
 #include "error.h"
 #include "stdout.h"
 
-/** the gengetopt args info struct */
-struct recv_args_info conf;
+/** The gengetopt args info struct. */
+static struct recv_args_info conf;
 
 static int loglevel;
 /** Always log to stderr. */
 
 static int loglevel;
 /** Always log to stderr. */