[Aptitude-svn-commit] r3577 - in branches/aptitude-0.3/aptitude: . src/generic

Daniel Burrows dburrows@costa.debian.org
Sun Jul 3 02:23:34 UTC 2005


Author: dburrows
Date: Sun Jul  3 02:23:32 2005
New Revision: 3577

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/aptitude_resolver.h
Log:
Fix a place where the compiler can't prove that a variable is
initialized before being used.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sun Jul  3 02:23:32 2005
@@ -1,5 +1,10 @@
 2005-07-02  Daniel Burrows  <dburrows@debian.org>
 
+	* src/generic/aptitude_resolver.h:
+
+	  Add some safety code to make sure that the resolver compiles
+	  even when the compiler is being ultra-strict.
+
 	* po/POTFILES.in:
 
 	  Remove another reference to strhash.h.

Modified: branches/aptitude-0.3/aptitude/src/generic/aptitude_resolver.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/aptitude_resolver.h	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/aptitude_resolver.h	Sun Jul  3 02:23:32 2005
@@ -160,7 +160,7 @@
 	// Version, apt will give them the same VerStr.  Detect and
 	// compensate for this.
 	int count=0;
-	int idx;
+	int idx=-1;
 
 	for(pkgCache::VerIterator i=pkg.VersionList(); !i.end(); ++i)
 	  {
@@ -173,6 +173,10 @@
 	      ++count;
 	  }
 
+	// if not, we have a "version" of this package that's not in
+	// its list of versions!
+	assert(idx>0);
+
 	if(count>1)
 	  {
 	    std::ostringstream s;




More information about the Aptitude-svn-commit mailing list