[Avida-SVN] r3162 - in development/source: cpu main tools

brysonda at myxo.css.msu.edu brysonda at myxo.css.msu.edu
Wed Feb 25 10:38:53 PST 2009


Author: brysonda
Date: 2009-02-25 13:38:53 -0500 (Wed, 25 Feb 2009)
New Revision: 3162

Modified:
   development/source/cpu/cHardwareExperimental.h
   development/source/main/cPhenPlastGenotype.cc
   development/source/main/cTaskLib.cc
   development/source/tools/cFlexVar.h
   development/source/tools/cString.cc
   development/source/tools/cStringList.cc
Log:
More adjustments to quell warnings.

Modified: development/source/cpu/cHardwareExperimental.h
===================================================================
--- development/source/cpu/cHardwareExperimental.h	2009-02-25 18:20:29 UTC (rev 3161)
+++ development/source/cpu/cHardwareExperimental.h	2009-02-25 18:38:53 UTC (rev 3162)
@@ -107,6 +107,7 @@
     unsigned int oldest_component:15;
     unsigned int env_component:1;
     
+    inline sInternalValue() { ; }
     inline void Clear() { value = 0; originated = 0; from_env = 0, oldest_component = 0; env_component = 0; }
     inline sInternalValue& operator=(const sInternalValue& i);
   };

Modified: development/source/main/cPhenPlastGenotype.cc
===================================================================
--- development/source/main/cPhenPlastGenotype.cc	2009-02-25 18:20:29 UTC (rev 3161)
+++ development/source/main/cPhenPlastGenotype.cc	2009-02-25 18:38:53 UTC (rev 3162)
@@ -105,7 +105,7 @@
 {
   assert(num >= 0 && num < (int) m_unique.size() && m_unique.size() > 0);
   UniquePhenotypes::const_iterator it = m_unique.begin();
-  for (int k = 0; k < num; k++, it++);
+  for (int k = 0; k < num; k++, it++) ;
   return static_cast<cPlasticPhenotype*>(*it);
 }
 

Modified: development/source/main/cTaskLib.cc
===================================================================
--- development/source/main/cTaskLib.cc	2009-02-25 18:20:29 UTC (rev 3161)
+++ development/source/main/cTaskLib.cc	2009-02-25 18:38:53 UTC (rev 3162)
@@ -2078,7 +2078,7 @@
     for (int i = 0; i < stored; i++) {
       if (valmap.HasEntry(output[i])) {
         int t_start = i;
-        while (++i < stored && valmap.HasEntry(output[i]));
+        while (++i < stored && valmap.HasEntry(output[i])) ;
         if (span_start == -1 || (i - t_start) > (span_end - span_start)) {
           span_start = t_start;
           span_end = i;
@@ -2090,7 +2090,7 @@
     if (span_start == -1) return 0.0;    
   } else { // Scattered
     // search for first valid entry
-    while (++span_start < stored && valmap.HasEntry(output[span_start]));
+    while (++span_start < stored && valmap.HasEntry(output[span_start])) ;
     
     // scanned past the end of the output, nothing to validate
     if (span_start >= stored) return 0.0;

Modified: development/source/tools/cFlexVar.h
===================================================================
--- development/source/tools/cFlexVar.h	2009-02-25 18:20:29 UTC (rev 3161)
+++ development/source/tools/cFlexVar.h	2009-02-25 18:38:53 UTC (rev 3162)
@@ -246,11 +246,11 @@
     else if (in_var.GetType() == TYPE_STRING) m_var = new cFlexVar_String( in_var.AsString() );
     return *this;
   }
-  cFlexVar & operator=(int in_value)             { delete m_var; m_var = new cFlexVar_Int(in_value);    return *this; }
-  cFlexVar & operator=(char in_value)            { delete m_var; m_var = new cFlexVar_Char(in_value);   return *this; }
-  cFlexVar & operator=(double in_value)          { delete m_var; m_var = new cFlexVar_Double(in_value); return *this; }
-  cFlexVar & operator=(const cString & in_value) { delete m_var; m_var = new cFlexVar_String(in_value); return *this; }
-  cFlexVar & operator=(char * in_value)          { delete m_var; m_var = new cFlexVar_String(in_value); return *this; }
+  cFlexVar& operator=(int in_value)             { delete m_var; m_var = new cFlexVar_Int(in_value);    return *this; }
+  cFlexVar& operator=(char in_value)            { delete m_var; m_var = new cFlexVar_Char(in_value);   return *this; }
+  cFlexVar& operator=(double in_value)          { delete m_var; m_var = new cFlexVar_Double(in_value); return *this; }
+  cFlexVar& operator=(const cString & in_value) { delete m_var; m_var = new cFlexVar_String(in_value); return *this; }
+  cFlexVar& operator=(const char * in_value)          { delete m_var; m_var = new cFlexVar_String(in_value); return *this; }
 
   // The following macro will forward all of the commands with the associated operator to the internal class.
 #define FORWARD_FLEX_VAR_OP(OP, RETURN_TYPE)                                               \

Modified: development/source/tools/cString.cc
===================================================================
--- development/source/tools/cString.cc	2009-02-25 18:20:29 UTC (rev 3161)
+++ development/source/tools/cString.cc	2009-02-25 18:38:53 UTC (rev 3162)
@@ -65,13 +65,13 @@
 
 // -- Comparisons --
 
-bool cString::operator== (const cString & in) const {
+bool cString::operator==(const cString& in) const {
   // Compares sizes first since we have that info anyway
-  int i=-1;
-  if( GetSize() == in.GetSize() ){
-    for( i=0; i<GetSize() && (*this)[i]==in[i]; ++i );
+  int i = -1;
+  if (GetSize() == in.GetSize()) {
+    for (i = 0; i<GetSize() && (*this)[i] == in[i]; ++i) ;
   }
-  return ( i == GetSize() );  // i == GetSize if all chars matched
+  return (i == GetSize());  // i == GetSize if all chars matched
 }
 
 

Modified: development/source/tools/cStringList.cc
===================================================================
--- development/source/tools/cStringList.cc	2009-02-25 18:20:29 UTC (rev 3161)
+++ development/source/tools/cStringList.cc	2009-02-25 18:38:53 UTC (rev 3162)
@@ -91,7 +91,7 @@
 {
   tListIterator<cString> string_it(string_list);
   string_it.Next();
-  for (int k = 0; k < line_num && string_it.Next(); k++);
+  for (int k = 0; k < line_num && string_it.Next(); k++) ;
   return ReturnString(string_list.Remove(string_it));
 }
 




More information about the Avida-cvs mailing list