All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH QGit] Fix compiler warning due to ambiguous 'else'
@ 2009-06-12 12:07 Markus Heidelberg
  0 siblings, 0 replies; only message in thread
From: Markus Heidelberg @ 2009-06-12 12:07 UTC (permalink / raw)
  To: Marco Costalba; +Cc: git, Markus Heidelberg

g++ 4.3.2 produced the following warning:

treeview.cpp: In member function ‘void TreeView::updateTree()’:
treeview.cpp:221: warning: suggest explicit braces to avoid ambiguous ‘else’

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 src/treeview.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/treeview.cpp b/src/treeview.cpp
index 346c577..d391a32 100644
--- a/src/treeview.cpp
+++ b/src/treeview.cpp
@@ -222,7 +222,7 @@ void TreeView::updateTree() {
 	    && treeIsValid
 	    && root
 	    && st->sha() != QGit::ZERO_SHA
-	    && root->treeSha != QGit::ZERO_SHA)
+	    && root->treeSha != QGit::ZERO_SHA) {
 		// root->treeSha could reference a different sha from current
 		// one in case the tree is the same, i.e. has the same files.
 		// so we prefer to use the previous state sha to call isSameFiles()
@@ -233,6 +233,7 @@ void TreeView::updateTree() {
 			newTree = !git->isSameFiles(st->sha(false), st->sha(true));
 		else
 			newTree = !git->isSameFiles(root->treeSha, st->sha(true));
+	}
 
 	if (newTree) // ok, we really need to update the tree
 		setTree(st->sha());
-- 
1.6.3.2.236.ge505d

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

only message in thread, other threads:[~2009-06-12 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12 12:07 [PATCH QGit] Fix compiler warning due to ambiguous 'else' Markus Heidelberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.