[Aptitude-devel] r2937 - in branches/aptitude-0.3/aptitude: . src/generic/problemresolver

Daniel Burrows dburrows@costa.debian.org
Thu, 07 Apr 2005 23:26:30 +0000


Author: dburrows
Date: Thu Apr  7 23:26:27 2005
New Revision: 2937

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h
Log:
Actually decrement the max_steps counter; make it signed.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Thu Apr  7 23:26:27 2005
@@ -1,11 +1,18 @@
 2005-04-07  Daniel Burrows  <dburrows@debian.org>
 
+	* src/generic/problemresolver/problemresolver.h:
+
+	  Actually decrement the max_steps counter, and make it
+	  signed to avoid accidents with -1==INT_MAX.
+
 	* src/generic/problemresolver/problemresolver.h, src/generic/problemresolver/test.cc:
+
 	  Finish writing the final method of the resolver, and
 	  make the changes (in both files) necessary to hook it
 	  up to the toy package system and get it to run.
 
 	* src/generic/problemresolver/problemresolver.h, src/generic/problemresolver/test.cc:
+
 	  Complete and compile the resolver ...... theoretically.
 	  Now it's time to watch it run reallllly sloowwwly
 	  and produce stoopid answers.

Modified: branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h	Thu Apr  7 23:26:27 2005
@@ -637,7 +637,7 @@
    *  \todo when throwing NoMoreSolutions or NoMoreTime, maybe we
    *        should include the "least broken" solution seen.
    */
-  solution find_next_solution(unsigned int max_steps)
+  solution find_next_solution(int max_steps)
   {
     // If the open queue is empty, then we're between searches and
     // should enqueue a new root node.
@@ -664,6 +664,8 @@
 	// Nope, let's go enqueue successor nodes.
 	else
 	  process_solution(s);
+
+	--max_steps;
       }
 
     // Oh no, we either ran out of solutions or ran out of steps.