added finddead target, removed dead code and made some functions
authorAndrew Tridgell <tridge@samba.org>
Wed, 9 Sep 1998 05:57:34 +0000 (05:57 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 9 Sep 1998 05:57:34 +0000 (05:57 +0000)
static

Makefile.in
authenticate.c
flist.c
io.c
main.c
md4.c
token.c
util.c

index fb9956b..9575e74 100644 (file)
@@ -60,3 +60,11 @@ proto:
 clean:
        rm -f *~ $(OBJS) rsync config.cache config.log config.status
 
+
+# this target is really just for my use. It only works on a limited
+# range of machines and is used to produce a list of potentially
+# dead (ie. unused) functions in the code. (tridge)
+finddead:
+       nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
+       nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
+       comm -13 nmused.txt nmfns.txt 
index 0ff318b..5ecce15 100644 (file)
@@ -112,7 +112,7 @@ static int get_secret(int module, char *user, char *secret, int len)
 }
 
 /* generate a 16 byte hash from a password and challenge */
-void generate_hash(char *in, char *challenge, char *out)
+static void generate_hash(char *in, char *challenge, char *out)
 {
        char buf[16];
 
diff --git a/flist.c b/flist.c
index 406a5f4..693e900 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -94,7 +94,7 @@ static void send_directory(int f,struct file_list *flist,char *dir);
 static char *flist_dir;
 
 
-void send_file_entry(struct file_struct *file,int f,unsigned base_flags)
+static void send_file_entry(struct file_struct *file,int f,unsigned base_flags)
 {
        unsigned char flags;
        static time_t last_time;
diff --git a/io.c b/io.c
index 0f8ab91..5122a2a 100644 (file)
--- a/io.c
+++ b/io.c
@@ -484,7 +484,7 @@ void write_buf(int f,char *buf,int len)
 }
 
 /* write a string to the connection */
-void write_sbuf(int f,char *buf)
+static void write_sbuf(int f,char *buf)
 {
        write_buf(f, buf, strlen(buf));
 }
diff --git a/main.c b/main.c
index a2df930..c87dd7b 100644 (file)
--- a/main.c
+++ b/main.c
@@ -544,7 +544,7 @@ static int start_client(int argc, char *argv[])
 }
 
 
-RETSIGTYPE sigusr1_handler(int val) {
+static RETSIGTYPE sigusr1_handler(int val) {
        exit_cleanup(1);
 }
 
diff --git a/md4.c b/md4.c
index a12a5de..0ab2501 100644 (file)
--- a/md4.c
+++ b/md4.c
  ** Assumes X is an array of 16 ints.
  ** The macro revx reverses the byte-ordering of the next word of X.
  */
- void MDreverse(X)
+static void MDreverse(X)
  unsigned int32 *X;
  { register unsigned int32 t;
    register unsigned int i;
diff --git a/token.c b/token.c
index 8295cc5..1244b2d 100644 (file)
--- a/token.c
+++ b/token.c
@@ -366,8 +366,7 @@ recv_deflated_token(int f, char **data)
  * put the data corresponding to a token that we've just returned
  * from recv_deflated_token into the decompressor's history buffer.
  */
-void
-see_deflate_token(char *buf, int len)
+static void see_deflate_token(char *buf, int len)
 {
        int r, blklen;
        unsigned char hdr[5];
diff --git a/util.c b/util.c
index 70743a6..8b36474 100644 (file)
--- a/util.c
+++ b/util.c
@@ -253,7 +253,7 @@ static int full_write(int desc, char *ptr, int len)
    for an error.  
 
    derived from GNU C's cccp.c. */
-int safe_read(int desc, char *ptr, int len)
+static int safe_read(int desc, char *ptr, int len)
 {
        int n_chars;
  
@@ -410,14 +410,6 @@ int name_to_gid(char *name, gid_t *gid)
 }
 
 
-/****************************************************************************
-check if a process exists. 
-****************************************************************************/
-int process_exists(int pid)
-{
-       return(kill(pid,0) == 0 || errno != ESRCH);
-}
-
 /* lock a byte range in a open file */
 int lock_range(int fd, int offset, int len)
 {