diff options
author | Eric Andersen | 2001-03-09 21:24:12 +0000 |
---|---|---|
committer | Eric Andersen | 2001-03-09 21:24:12 +0000 |
commit | 3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332 (patch) | |
tree | c9e6d3d695cbb2449132428a32fb6c309aad870f /coreutils | |
parent | dd91724aa089e344d0f05e40a338dcce481c1845 (diff) | |
download | busybox-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.zip busybox-3e6ff9017f5aa4ea41de2520a3f6d29fb20e0332.tar.gz |
A cleanup patch from Jeff Garzik to static-ify a number of
namespace polluting things that really should be static.
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/date.c | 4 | ||||
-rw-r--r-- | coreutils/head.c | 2 | ||||
-rw-r--r-- | coreutils/ls.c | 32 | ||||
-rw-r--r-- | coreutils/sort.c | 4 | ||||
-rw-r--r-- | coreutils/tail.c | 4 | ||||
-rw-r--r-- | coreutils/uuencode.c | 6 | ||||
-rw-r--r-- | coreutils/wc.c | 4 |
7 files changed, 28 insertions, 28 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index 878331f..4b2f66a 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -46,7 +46,7 @@ /* Default input handling to save suprising some people */ -struct tm *date_conv_time(struct tm *tm_time, const char *t_string) +static struct tm *date_conv_time(struct tm *tm_time, const char *t_string) { int nr; @@ -73,7 +73,7 @@ struct tm *date_conv_time(struct tm *tm_time, const char *t_string) /* The new stuff for LRP */ -struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) +static struct tm *date_conv_ftime(struct tm *tm_time, const char *t_string) { struct tm t; diff --git a/coreutils/head.c b/coreutils/head.c index fac9ec6..0c8ef3d 100644 --- a/coreutils/head.c +++ b/coreutils/head.c @@ -29,7 +29,7 @@ #include <string.h> #include "busybox.h" -int head(int len, FILE *fp) +static int head(int len, FILE *fp) { int i; char *input; diff --git a/coreutils/ls.c b/coreutils/ls.c index a8d7b18..77de93a 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -156,9 +156,9 @@ struct dnode { /* the basic node */ }; typedef struct dnode dnode_t; -struct dnode **list_dir(char *); -struct dnode **dnalloc(int); -int list_single(struct dnode *); +static struct dnode **list_dir(char *); +static struct dnode **dnalloc(int); +static int list_single(struct dnode *); static unsigned int disp_opts; static unsigned int style_fmt; @@ -186,7 +186,7 @@ static unsigned short column_width = COLUMN_WIDTH; static int status = EXIT_SUCCESS; #ifdef BB_FEATURE_HUMAN_READABLE -unsigned long ls_disp_hr = 0; +static unsigned long ls_disp_hr = 0; #endif static int my_stat(struct dnode *cur) @@ -256,7 +256,7 @@ static int is_subdir(struct dnode *dn) strcmp(dn->name, "..") != 0); } -int countdirs(struct dnode **dn, int nfiles) +static int countdirs(struct dnode **dn, int nfiles) { int i, dirs; @@ -268,7 +268,7 @@ int countdirs(struct dnode **dn, int nfiles) return(dirs); } -int countsubdirs(struct dnode **dn, int nfiles) +static int countsubdirs(struct dnode **dn, int nfiles) { int i, subdirs; @@ -280,7 +280,7 @@ int countsubdirs(struct dnode **dn, int nfiles) return subdirs; } -int countfiles(struct dnode **dnp) +static int countfiles(struct dnode **dnp) { int nfiles; struct dnode *cur; @@ -293,7 +293,7 @@ int countfiles(struct dnode **dnp) } /* get memory to hold an array of pointers */ -struct dnode **dnalloc(int num) +static struct dnode **dnalloc(int num) { struct dnode **p; @@ -303,7 +303,7 @@ struct dnode **dnalloc(int num) return(p); } -void dfree(struct dnode **dnp) +static void dfree(struct dnode **dnp) { struct dnode *cur, *next; @@ -319,7 +319,7 @@ void dfree(struct dnode **dnp) free(dnp); /* free the array holding the dnode pointers */ } -struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) +static struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) { int dncnt, i, d; struct dnode **dnp; @@ -359,7 +359,7 @@ struct dnode **splitdnarray(struct dnode **dn, int nfiles, int which) /*----------------------------------------------------------------------*/ #ifdef BB_FEATURE_LS_SORTFILES -int sortcmp(struct dnode *d1, struct dnode *d2) +static int sortcmp(struct dnode *d1, struct dnode *d2) { int cmp, dif; @@ -396,7 +396,7 @@ int sortcmp(struct dnode *d1, struct dnode *d2) } /*----------------------------------------------------------------------*/ -void shellsort(struct dnode **dn, int size) +static void shellsort(struct dnode **dn, int size) { struct dnode *temp; int gap, i, j; @@ -420,7 +420,7 @@ void shellsort(struct dnode **dn, int size) #endif /*----------------------------------------------------------------------*/ -void showfiles(struct dnode **dn, int nfiles) +static void showfiles(struct dnode **dn, int nfiles) { int i, ncols, nrows, row, nc; #ifdef BB_FEATURE_AUTOWIDTH @@ -481,7 +481,7 @@ void showfiles(struct dnode **dn, int nfiles) } /*----------------------------------------------------------------------*/ -void showdirs(struct dnode **dn, int ndirs) +static void showdirs(struct dnode **dn, int ndirs) { int i, nfiles; struct dnode **subdnp; @@ -524,7 +524,7 @@ void showdirs(struct dnode **dn, int ndirs) } /*----------------------------------------------------------------------*/ -struct dnode **list_dir(char *path) +static struct dnode **list_dir(char *path) { struct dnode *dn, *cur, **dnp; struct dirent *entry; @@ -575,7 +575,7 @@ struct dnode **list_dir(char *path) } /*----------------------------------------------------------------------*/ -int list_single(struct dnode *dn) +static int list_single(struct dnode *dn) { int i, len; char scratch[BUFSIZ + 1]; diff --git a/coreutils/sort.c b/coreutils/sort.c index 79e629c..9707efa 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -26,12 +26,12 @@ #include <stdlib.h> #include "busybox.h" -int compare_ascii(const void *x, const void *y) +static int compare_ascii(const void *x, const void *y) { return strcmp(*(char **)x, *(char **)y); } -int compare_numeric(const void *x, const void *y) +static int compare_numeric(const void *x, const void *y) { return atoi(*(char **)x) - atoi(*(char **)y); } diff --git a/coreutils/tail.c b/coreutils/tail.c index a85256c..ff77bde 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c @@ -44,14 +44,14 @@ static char *tailbuf; static int taillen; static int newline; -void tailbuf_append(char *buf, int len) +static void tailbuf_append(char *buf, int len) { tailbuf = xrealloc(tailbuf, taillen + len); memcpy(tailbuf + taillen, buf, len); taillen += len; } -void tailbuf_trunc() +static void tailbuf_trunc() { char *s; s = memchr(tailbuf, '\n', taillen); diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 41541de..35a5333 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c @@ -34,11 +34,11 @@ static void encode __P ((void)); /* Pointer to the translation table we currently use. */ -const char *trans_ptr; +static const char *trans_ptr; /* The two currently defined translation tables. The first is the standard uuencoding, the second is base64 encoding. */ -const char uu_std[64] = { +static const char uu_std[64] = { '`', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', @@ -49,7 +49,7 @@ const char uu_std[64] = { 'X', 'Y', 'Z', '[', '\\', ']', '^', '_' }; -const char uu_base64[64] = { +static const char uu_base64[64] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', diff --git a/coreutils/wc.c b/coreutils/wc.c index 5472c30..695e7e7 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c @@ -29,8 +29,8 @@ static int total_lines, total_words, total_chars, max_length; static int print_lines, print_words, print_chars, print_length; -void print_counts(int lines, int words, int chars, int length, - const char *name) +static void print_counts(int lines, int words, int chars, int length, + const char *name) { char const *space = ""; |