git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] avoid set-but-not-used warning
@ 2011-04-29  9:42 Jim Meyering
  2011-04-29 16:28 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Meyering @ 2011-04-29  9:42 UTC (permalink / raw)
  To: git list

I noticed this on master (also applies to next), compiling with gcc-4.6:

    diffcore-rename.c: In function 'diffcore_rename':
    diffcore-rename.c:501:18: warning: variable 'num_src' set but not used \
      [-Wunused-but-set-variable]

Here's the fix:

-- >8 --
Subject: [PATCH] avoid set-but-not-used warning

* diffcore-rename.c (diffcore_rename): Remove declaration and set.

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 diffcore-rename.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/diffcore-rename.c b/diffcore-rename.c
index f62587e..3d65bb3 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -498,7 +498,7 @@ void diffcore_rename(struct diff_options *options)
 	struct diff_queue_struct outq;
 	struct diff_score *mx;
 	int i, j, rename_count, skip_unmodified = 0;
-	int num_create, num_src, dst_cnt;
+	int num_create, dst_cnt;
 	struct progress *progress = NULL;

 	if (!minimum_score)
@@ -554,7 +554,6 @@ void diffcore_rename(struct diff_options *options)
 	 * files still remain as options for rename/copies!)
 	 */
 	num_create = (rename_dst_nr - rename_count);
-	num_src = rename_src_nr;

 	/* All done? */
 	if (!num_create)
--
1.7.5.452.gcf2d0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] avoid set-but-not-used warning
  2011-04-29  9:42 [PATCH] avoid set-but-not-used warning Jim Meyering
@ 2011-04-29 16:28 ` Junio C Hamano
  2011-04-29 16:34   ` Thiago Farina
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2011-04-29 16:28 UTC (permalink / raw)
  To: Jim Meyering; +Cc: git list

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] avoid set-but-not-used warning
  2011-04-29 16:28 ` Junio C Hamano
@ 2011-04-29 16:34   ` Thiago Farina
  2011-04-29 16:43     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Farina @ 2011-04-29 16:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jim Meyering, git list, Ingo Molnar

On Fri, Apr 29, 2011 at 1:28 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Thanks.

Ingo Molnar has posted the same fix in "diffcore-rename: Remove unused
variable 'num_src'".

> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] avoid set-but-not-used warning
  2011-04-29 16:34   ` Thiago Farina
@ 2011-04-29 16:43     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2011-04-29 16:43 UTC (permalink / raw)
  To: Thiago Farina; +Cc: Jim Meyering, git list, Ingo Molnar

Thiago Farina <tfransosi@gmail.com> writes:

> On Fri, Apr 29, 2011 at 1:28 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Thanks.
>
> Ingo Molnar has posted the same fix in "diffcore-rename: Remove unused
> variable 'num_src'".

What do you want _me_ to do about that?

If this were addressed to Jim I may kind-of understand what you were
trying to say, but you addressed me, and I am puzzled.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-29 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-29  9:42 [PATCH] avoid set-but-not-used warning Jim Meyering
2011-04-29 16:28 ` Junio C Hamano
2011-04-29 16:34   ` Thiago Farina
2011-04-29 16:43     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).