Removed unused code. HEAD
authorTimo Sirainen <tss@iki.fi>
Tue, 24 Mar 2009 13:06:31 -0400
branchHEAD
changeset 8852ed8e33c2199e
parent 8851 1c76e82e0b36
child 8853 7a463166d607
Removed unused code.
Based on coccinelle output from Diego Liziero.
src/lib-storage/index/maildir/maildir-copy.c
src/lib/file-dotlock.c
src/lib/istream-crlf.c
     1.1 --- a/src/lib-storage/index/maildir/maildir-copy.c	Tue Mar 24 13:02:59 2009 -0400
     1.2 +++ b/src/lib-storage/index/maildir/maildir-copy.c	Tue Mar 24 13:06:31 2009 -0400
     1.3 @@ -133,7 +133,6 @@
     1.4  	struct maildir_mailbox *dest_mbox =
     1.5  		(struct maildir_mailbox *)t->ictx.ibox;
     1.6  	struct maildir_mailbox *src_mbox;
     1.7 -	struct maildir_save_context *ctx;
     1.8  	struct hardlink_ctx do_ctx;
     1.9  	const char *path, *filename = NULL;
    1.10  	uint32_t seq;
    1.11 @@ -152,7 +151,6 @@
    1.12  
    1.13  	if (t->save_ctx == NULL)
    1.14  		t->save_ctx = maildir_save_transaction_init(t);
    1.15 -	ctx = t->save_ctx;
    1.16  
    1.17  	/* don't allow caller to specify recent flag */
    1.18  	flags &= ~MAIL_RECENT;
    1.19 @@ -239,15 +237,15 @@
    1.20  #if 0
    1.21  	if (keywords == NULL || keywords->count == 0) {
    1.22  		/* hardlinked to destination, set hardlinked-flag */
    1.23 -		seq = maildir_save_add(t, do_ctx.dest_fname,
    1.24 -				       flags | MAILDIR_SAVE_FLAG_HARDLINK, NULL,
    1.25 -				       dest_mail);
    1.26 +		maildir_save_add(t, do_ctx.dest_fname,
    1.27 +				 flags | MAILDIR_SAVE_FLAG_HARDLINK, NULL,
    1.28 +				 dest_mail);
    1.29  	} else
    1.30  #endif
    1.31  {
    1.32  		/* hardlinked to tmp/, treat as normal copied mail */
    1.33 -		seq = maildir_save_add(t, do_ctx.dest_fname, flags, keywords,
    1.34 -				       dest_mail);
    1.35 +		maildir_save_add(t, do_ctx.dest_fname, flags, keywords,
    1.36 +				 dest_mail);
    1.37  	}
    1.38  	return 1;
    1.39  }
     2.1 --- a/src/lib/file-dotlock.c	Tue Mar 24 13:02:59 2009 -0400
     2.2 +++ b/src/lib/file-dotlock.c	Tue Mar 24 13:06:31 2009 -0400
     2.3 @@ -793,12 +793,10 @@
     2.4  {
     2.5  	struct dotlock *dotlock;
     2.6  	const char *lock_path;
     2.7 -	int fd;
     2.8  
     2.9  	dotlock = *dotlock_p;
    2.10  	*dotlock_p = NULL;
    2.11  
    2.12 -	fd = dotlock->fd;
    2.13  	if ((flags & DOTLOCK_REPLACE_FLAG_DONT_CLOSE_FD) != 0)
    2.14  		dotlock->fd = -1;
    2.15  
     3.1 --- a/src/lib/istream-crlf.c	Tue Mar 24 13:02:59 2009 -0400
     3.2 +++ b/src/lib/istream-crlf.c	Tue Mar 24 13:06:31 2009 -0400
     3.3 @@ -32,11 +32,10 @@
     3.4  static int i_stream_crlf_read_common(struct crlf_istream *cstream)
     3.5  {
     3.6  	struct istream_private *stream = &cstream->istream;
     3.7 -	const unsigned char *data;
     3.8  	size_t size;
     3.9  	ssize_t ret;
    3.10  
    3.11 -	data = i_stream_get_data(stream->parent, &size);
    3.12 +	(void)i_stream_get_data(stream->parent, &size);
    3.13  	if (size == 0) {
    3.14  		ret = i_stream_read(stream->parent);
    3.15  		if (ret <= 0 && (ret != -2 || stream->skip == 0)) {
    3.16 @@ -45,7 +44,7 @@
    3.17  			stream->istream.eof = stream->parent->eof;
    3.18  			return ret;
    3.19  		}
    3.20 -		data = i_stream_get_data(stream->parent, &size);
    3.21 +		(void)i_stream_get_data(stream->parent, &size);
    3.22  		i_assert(size != 0);
    3.23  	}
    3.24