mail[Wesnoth-commits] r20130 - /trunk/src/unit.cpp


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

Header


Content

Posted by koraq on September 05, 2007 - 19:07:
Author: mordante
Date: Wed Sep  5 19:06:38 2007
New Revision: 20130

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20130&view=rev
Log:
C-style cast cleanup. 

Modified:
    trunk/src/unit.cpp

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=20130&r1=20129&r2=20130&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Wed Sep  5 19:06:38 2007
@@ -919,8 +919,7 @@
                }
        }
 
-       if(side.empty() == false && this->side() != 
(unsigned)atoi(side.c_str()))
-         {
+       if(side.empty() == false && this->side() != 
lexical_cast_default<unsigned>(side)) {
                if(std::find(side.begin(),side.end(),',') != side.end()) {
                        const std::vector<std::string>& vals = 
utils::split(side);
 
@@ -1752,7 +1751,7 @@
        } else {
                //! @todo TODO this, the is_attack_anim param and the return 
value are ugly hacks
                // that need to be taken care of eventually
-               anim_ = new attack_animation(*(const 
attack_animation*)animation);
+               anim_ = new attack_animation(*(static_cast<const 
attack_animation*>(animation)));
        }
        anim_->start_animation(anim_->get_begin_time(), false, 
disp.turbo_speed());
        frame_begin_time_ = anim_->get_begin_time() -1;
@@ -1763,7 +1762,7 @@
                next_idling_ = INT_MAX;
        }
        if(is_attack_anim) {
-               return &((attack_animation*)anim_)->get_missile_anim();
+               return 
&(static_cast<attack_animation*>(anim_))->get_missile_anim();
        } else {
                return NULL;
        }




Related Messages


Powered by MHonArc, Updated Wed Sep 05 20:40:21 2007