mail[Wesnoth-commits] r24413 - in /trunk/src: formula_ai.cpp variant.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by koraq on March 08, 2008 - 17:23:
Author: mordante
Date: Sat Mar  8 17:23:53 2008
New Revision: 24413

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24413&view=rev
Log:
Silence some compiler warnings.

Sirp please check whether the warnings in variant.cpp were really false 
positives.

Modified:
    trunk/src/formula_ai.cpp
    trunk/src/variant.cpp

Modified: trunk/src/formula_ai.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/formula_ai.cpp?rev=24413&r1=24412&r2=24413&view=diff
==============================================================================
--- trunk/src/formula_ai.cpp (original)
+++ trunk/src/formula_ai.cpp Sat Mar  8 17:23:53 2008
@@ -120,13 +120,13 @@
                if(analysis->chance_to_kill > 0.0) {
                        unit_map units(units_with_moves);
                        units.erase(analysis->target);
-                       vars.push_back(variant(new position_callable(&units, 
analysis->chance_to_kill*100)));
+                       vars.push_back(variant(new position_callable(&units, 
static_cast<int>(analysis->chance_to_kill*100))));
 
                }
 
                if(analysis->chance_to_kill < 1.0) {
                        unit_map units(units_with_moves);
-                       vars.push_back(variant(new position_callable(&units, 
100 - analysis->chance_to_kill*100)));
+                       vars.push_back(variant(new position_callable(&units, 
static_cast<int>(100 - analysis->chance_to_kill*100))));
                }
 
                return variant(&vars);

Modified: trunk/src/variant.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/variant.cpp?rev=24413&r1=24412&r2=24413&view=diff
==============================================================================
--- trunk/src/variant.cpp (original)
+++ trunk/src/variant.cpp Sat Mar  8 17:23:53 2008
@@ -92,6 +92,11 @@
        case TYPE_CALLABLE:
                intrusive_ptr_add_ref(callable_);
                break;
+
+       // These are not used here, add them to silence a compiler warning.
+       case TYPE_NULL:
+       case TYPE_INT :
+               break;
        }
 }
 
@@ -110,6 +115,11 @@
                break;
        case TYPE_CALLABLE:
                intrusive_ptr_release(callable_);
+               break;
+
+       // These are not used here, add them to silence a compiler warning.
+       case TYPE_NULL:
+       case TYPE_INT :
                break;
        }
 }




Related Messages


Powered by MHonArc, Updated Sat Mar 08 18:00:57 2008