[Avida-SVN] r2691 - in development: . source/cpu source/main

baer at myxo.css.msu.edu baer at myxo.css.msu.edu
Thu Jun 26 12:51:35 PDT 2008


Author: baer
Date: 2008-06-26 15:51:35 -0400 (Thu, 26 Jun 2008)
New Revision: 2691

Modified:
   development/Avida.vcproj
   development/source/cpu/cHardwareCPU.cc
   development/source/main/cOrgMovementPredicate.h
Log:
Fixed a code that does not compile on Visual Studio 2005

Modified: development/Avida.vcproj
===================================================================
--- development/Avida.vcproj	2008-06-26 18:18:27 UTC (rev 2690)
+++ development/Avida.vcproj	2008-06-26 19:51:35 UTC (rev 2691)
@@ -653,6 +653,14 @@
 				>
 			</File>
 			<File
+				RelativePath=".\source\main\cOrgMessagePredicate.h"
+				>
+			</File>
+			<File
+				RelativePath=".\source\main\cOrgMovementPredicate.h"
+				>
+			</File>
+			<File
 				RelativePath=".\source\main\cOrgSeqMessage.h"
 				>
 			</File>

Modified: development/source/cpu/cHardwareCPU.cc
===================================================================
--- development/source/cpu/cHardwareCPU.cc	2008-06-26 18:18:27 UTC (rev 2690)
+++ development/source/cpu/cHardwareCPU.cc	2008-06-26 19:51:35 UTC (rev 2691)
@@ -5358,8 +5358,11 @@
     }
   }
 
-  GetRegister(reg_to_set) = (int)round(pher_amount);
+  // In Visual Studio 2005 round function does not exist use floor instead
+  //  GetRegister(reg_to_set) = (int)round(pher_amount);
 
+  GetRegister(reg_to_set) = (int)floor(pher_amount + 0.5);
+
   return true;
 
 } //End DoSensePheromone()

Modified: development/source/main/cOrgMovementPredicate.h
===================================================================
--- development/source/main/cOrgMovementPredicate.h	2008-06-26 18:18:27 UTC (rev 2690)
+++ development/source/main/cOrgMovementPredicate.h	2008-06-26 19:51:35 UTC (rev 2691)
@@ -194,7 +194,7 @@
           {
              // See how many times this org has gone back and forth.  If it has
              // done it enough times, it is considered successful
-             unsigned int num_backforth = (int) floor(org.GetNumTaskCellsReached()/2);
+             unsigned int num_backforth = org.GetNumTaskCellsReached()/2;
 
              if(num_backforth >= m_total_times) {
                m_successful_orgs.insert(org_id);




More information about the Avida-cvs mailing list