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


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

Header


Content

Posted by patrick_X99 on September 09, 2007 - 20:16:
Author: sapient
Date: Sun Sep  9 20:15:56 2007
New Revision: 20239

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20239&view=rev
Log:
* 'd' : redefinition; multiple initialization
Please read the Coding Standards section 4.1, "Respect for loop scoping of 
different platforms"
http://www.wesnoth.org/wiki/CodingStandards#Respect_for_loop_scoping_of_different_platforms

Modified:
    trunk/src/unit.cpp

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=20239&r1=20238&r2=20239&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Sun Sep  9 20:15:56 2007
@@ -1323,7 +1323,8 @@
                        const config::child_list& levelout_anims = 
cfg_.get_children("levelout_anim");
                        const config::child_list& healed_anims = 
cfg_.get_children("healed_anim");
                        const config::child_list& poison_anims = 
cfg_.get_children("poison_anim");
-                       for(config::child_list::const_iterator d = 
animations.begin(); d != animations.end(); ++d) {
+                       config::child_list::const_iterator d;
+                       for(d = animations.begin(); d != animations.end(); 
++d) {
                                animations_.push_back(unit_animation(**d));
                        }
                        for(config::child_list::const_iterator leading_anim = 
leading_anims.begin(); leading_anim != leading_anims.end(); ++leading_anim) {
@@ -1410,7 +1411,7 @@
                        
animations_.push_back(unit_animation(0,unit_frame(absolute_image(),150),"movement",unit_animation::DEFAULT_ANIM));
                        // Always have a movement animation
                        bool found_attack = false;
-                       for(config::child_list::const_iterator d = 
attack_anim.begin(); d != attack_anim.end(); ++d) {
+                       for(d = attack_anim.begin(); d != attack_anim.end(); 
++d) {
                                animations_.push_back(unit_animation(**d));
                                found_attack = true;
                                //lg::wml_error<<"attack animations  are 
deprecate, support will be removed in 1.3.8 (in unit "<<id_<<")\n";
@@ -2758,7 +2759,8 @@
                                        const config::child_list& 
levelout_anims = (**i.first).get_children("levelout_anim");
                                        const config::child_list& 
healed_anims = (**i.first).get_children("healed_anim");
                                        const config::child_list& 
poison_anims = (**i.first).get_children("poison_anim");
-                                       
for(config::child_list::const_iterator d = animations.begin(); d != 
animations.end(); ++d) {
+                                       config::child_list::const_iterator d;
+                                       for(d = animations.begin(); d != 
animations.end(); ++d) {
                                                
animations_.push_back(unit_animation(**d));
                                        }
                                        
for(config::child_list::const_iterator leading_anim = leading_anims.begin(); 
leading_anim != leading_anims.end(); ++leading_anim) {
@@ -2826,7 +2828,7 @@
                                                //lg::wml_error<<"movement 
animations  are deprecate, support will be removed in 1.3.8 (in unit 
"<<id_<<")\n";
                                                //lg::wml_error<<"please put 
it with an [animation] tag and apply_to=movement flag\n";
                                        }
-                                       
for(config::child_list::const_iterator d = attack_anim.begin(); d != 
attack_anim.end(); ++d) {
+                                       for(d = attack_anim.begin(); d != 
attack_anim.end(); ++d) {
                                                (**d)["apply_to"]="attack";
                                                
animations_.push_back(unit_animation(**d));
                                                //lg::wml_error<<"attack 
animations  are deprecate, support will be removed in 1.3.8 (in unit 
"<<id_<<")\n";




Related Messages


Powered by MHonArc, Updated Sun Sep 09 21:20:28 2007