git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/14] transport.c: Initialise variable to suppress msvc warning
@ 2010-12-04 19:11 Ramsay Jones
  0 siblings, 0 replies; only message in thread
From: Ramsay Jones @ 2010-12-04 19:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Sixt, GIT Mailing-list


The msvc compiler thinks that a variable could be used while
uninitialised and issues the following warning:

    ...\git\transport.c(107) : warning C4700: uninitialized local \
        variable 'cmp' used

In order to suppress the warning, we simply initialise the
variable to zero.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 transport.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/transport.c b/transport.c
index 0078660..1dca6d4 100644
--- a/transport.c
+++ b/transport.c
@@ -104,7 +104,7 @@ static void insert_packed_refs(const char *packed_refs, struct ref **list)
 		return;
 
 	for (;;) {
-		int cmp = cmp, len;
+		int cmp = 0, len;
 
 		if (!fgets(buffer, sizeof(buffer), f)) {
 			fclose(f);
-- 
1.7.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-04 21:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-04 19:11 [PATCH 13/14] transport.c: Initialise variable to suppress msvc warning Ramsay Jones

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).