summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-09-05 05:07:05 +0000
committerAndrew Tridgell <tridge@samba.org>1998-09-05 05:07:05 +0000
commite9ea36e4d2270bd7d32da12ef6d6e2299641582d (patch)
tree34905bbfb6adde96be7234d122562e678aa6efd8 /source3/utils
parent766aa4ff5c6007669010d8c284de20111e633b25 (diff)
downloadsamba-e9ea36e4d2270bd7d32da12ef6d6e2299641582d.tar.gz
samba-e9ea36e4d2270bd7d32da12ef6d6e2299641582d.tar.bz2
samba-e9ea36e4d2270bd7d32da12ef6d6e2299641582d.zip
tridge the destroyer returns!
prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static? (This used to be commit 2204475c87f3024ea8fd1fbd7385b2def617a46f)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/make_printerdef.c18
-rw-r--r--source3/utils/make_smbcodepage.c16
-rw-r--r--source3/utils/testparm.c3
-rw-r--r--source3/utils/torture.c2
4 files changed, 19 insertions, 20 deletions
diff --git a/source3/utils/make_printerdef.c b/source3/utils/make_printerdef.c
index 4745127175..76545b9903 100644
--- a/source3/utils/make_printerdef.c
+++ b/source3/utils/make_printerdef.c
@@ -32,12 +32,12 @@ char buffer[50][sizeof(pstring)];
char sbuffer[50][sizeof(pstring)];
char sub_dir[50][2][sizeof(pstring)];
-void usage(char *name)
+static void usage(char *name)
{
fprintf(stderr,"%s: printer.def \"Printer Name\"\n", name);
}
-char *myfgets(char *s, int n, FILE *stream)
+static char *myfgets(char *s, int n, FILE *stream)
{
char *LString1;
char *LString2;
@@ -76,7 +76,7 @@ char *myfgets(char *s, int n, FILE *stream)
on both side of the equal sign
"entry=value"
*/
-char *scan(char *chaine,char **entry)
+static char *scan(char *chaine,char **entry)
{
char *value;
char *temp;
@@ -94,7 +94,7 @@ char *scan(char *chaine,char **entry)
return (value);
}
-void build_subdir(void)
+static void build_subdir(void)
{
int i=0;
char *entry;
@@ -126,7 +126,7 @@ void build_subdir(void)
Return all the lines between the entry and the next one or the end of file
An entry is something between braces.
*/
-void lookup_strings(FILE *fichier)
+static void lookup_strings(FILE *fichier)
{
int found=0,pointeur=0,i=0;
char *temp,*temp2;
@@ -176,7 +176,7 @@ void lookup_strings(FILE *fichier)
Return all the lines between the entry and the next one or the end of file
An entry is something between braces.
*/
-void lookup_entry(FILE *fichier,char *chaine)
+static void lookup_entry(FILE *fichier,char *chaine)
{
int found=0,pointeur=0,i=0;
char *temp,*temp2;
@@ -222,7 +222,7 @@ void lookup_entry(FILE *fichier,char *chaine)
#endif
}
-char *find_desc(FILE *fichier,char *text)
+static char *find_desc(FILE *fichier,char *text)
{
char *chaine;
char *long_desc;
@@ -271,7 +271,7 @@ char *find_desc(FILE *fichier,char *text)
return(short_desc);
}
-void scan_copyfiles(FILE *fichier, char *chaine)
+static void scan_copyfiles(FILE *fichier, char *chaine)
{
char *part;
char *mpart;
@@ -354,7 +354,7 @@ void scan_copyfiles(FILE *fichier, char *chaine)
}
-void scan_short_desc(FILE *fichier, char *short_desc)
+static void scan_short_desc(FILE *fichier, char *short_desc)
{
int i=0;
char *chaine;
diff --git a/source3/utils/make_smbcodepage.c b/source3/utils/make_smbcodepage.c
index 67cd3d4f6f..0653fd31f1 100644
--- a/source3/utils/make_smbcodepage.c
+++ b/source3/utils/make_smbcodepage.c
@@ -28,7 +28,7 @@ static char *prog_name = NULL;
* Print program usage and die.
*/
-void codepage_usage(char *progname)
+static void codepage_usage(char *progname)
{
fprintf(stderr, "Usage is : %s [c|d] <codepage> <inputfile> <outputfile>\n",
progname);
@@ -40,7 +40,7 @@ void codepage_usage(char *progname)
* terminated.
*/
-void read_line( char **buf, char *line_buf, int size)
+static void read_line( char **buf, char *line_buf, int size)
{
char *p = *buf;
int num = 0;
@@ -62,7 +62,7 @@ void read_line( char **buf, char *line_buf, int size)
* Returns the number of lines copied.
*/
-int clean_data( char **buf, uint32 *size)
+static int clean_data( char **buf, uint32 *size)
{
pstring linebuf;
char *p = *buf;
@@ -108,7 +108,7 @@ int clean_data( char **buf, uint32 *size)
* Parse a byte from a codepage file.
*/
-BOOL parse_byte(char *buf, unsigned char *bp)
+static BOOL parse_byte(char *buf, unsigned char *bp)
{
unsigned int b;
char *endptr = NULL;
@@ -125,7 +125,7 @@ BOOL parse_byte(char *buf, unsigned char *bp)
* Parse a bool from a codepage file.
*/
-BOOL parse_bool(char *buf, unsigned char *bp)
+static BOOL parse_bool(char *buf, unsigned char *bp)
{
if(isdigit((int)*buf))
{
@@ -151,7 +151,7 @@ BOOL parse_bool(char *buf, unsigned char *bp)
* Print a parse error and exit.
*/
-void parse_error(char *buf, char *msg)
+static void parse_error(char *buf, char *msg)
{
fprintf(stderr, "%s: %s whilst parsing line \n%s\n", prog_name,
msg, buf);
@@ -162,7 +162,7 @@ void parse_error(char *buf, char *msg)
* Create a compiled codepage file from a codepage definition file.
*/
-int do_compile(int codepage, char *input_file, char *output_file)
+static int do_compile(int codepage, char *input_file, char *output_file)
{
FILE *fp = NULL;
uint32 size = 0;
@@ -307,7 +307,7 @@ definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, nu
* Placeholder for now.
*/
-int do_decompile( int codepage, char *input_file, char *output_file)
+static int do_decompile( int codepage, char *input_file, char *output_file)
{
uint32 size = 0;
SMB_STRUCT_STAT st;
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index d41e8b9f66..6697dc7fd9 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -44,8 +44,7 @@ extern pstring myhostname;
Here we do a set of 'hard coded' checks for bad
configuration settings.
************************************************/
-
-void do_global_checks(void)
+static void do_global_checks(void)
{
SMB_STRUCT_STAT st;
if (lp_security() > SEC_SHARE && lp_revalidate(-1)) {
diff --git a/source3/utils/torture.c b/source3/utils/torture.c
index 164bc4f743..2bee5f3769 100644
--- a/source3/utils/torture.c
+++ b/source3/utils/torture.c
@@ -608,7 +608,7 @@ static void run_unlinktest(void)
}
/* generate a random buffer */
-void rand_buf(char *buf, int len)
+static void rand_buf(char *buf, int len)
{
while (len--) {
*buf = random();