mail[Wesnoth-commits] r20624 - /trunk/src/terrain_translation.cpp


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

Header


Content

Posted by koraq on September 20, 2007 - 19:10:
Author: mordante
Date: Thu Sep 20 19:09:44 2007
New Revision: 20624

URL: http://svn.gna.org/viewcvs/wesnoth?rev=20624&view=rev
Log:
Make sure all members are initialized in the constructor.

Modified:
    trunk/src/terrain_translation.cpp

Modified: trunk/src/terrain_translation.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/terrain_translation.cpp?rev=20624&r1=20623&r2=20624&view=diff
==============================================================================
--- trunk/src/terrain_translation.cpp (original)
+++ trunk/src/terrain_translation.cpp Thu Sep 20 19:09:44 2007
@@ -143,16 +143,23 @@
 {}
 
 t_match::t_match() :
-       has_wildcard(false), is_empty(true)
+       terrain(),
+       mask(),
+       masked_terrain(),
+       has_wildcard(false),
+       is_empty(true)
 {}
 
-t_match::t_match(const std::string& str, const t_layer filler):
-       terrain(t_translation::read_list(str, filler))
+t_match::t_match(const std::string& str, const t_layer filler) :
+       terrain(t_translation::read_list(str, filler)),
+       mask(),
+       masked_terrain(),
+       has_wildcard(t_translation::has_wildcard(terrain)),
+       is_empty(terrain.empty())
+
 {
        mask.resize(terrain.size());
        masked_terrain.resize(terrain.size());
-       has_wildcard = t_translation::has_wildcard(terrain);
-       is_empty = terrain.empty();
 
        for(size_t i = 0; i < terrain.size(); i++) {
                mask[i] = t_translation::get_mask_(terrain[i]);
@@ -161,12 +168,14 @@
 }
 
 t_match::t_match(const t_letter& letter):
-       terrain(t_list(1, letter))
+       terrain(t_list(1, letter)),
+       mask(),
+       masked_terrain(),
+       has_wildcard(t_translation::has_wildcard(terrain)),
+       is_empty(terrain.empty())
 {
        mask.resize(terrain.size());
        masked_terrain.resize(terrain.size());
-       has_wildcard = t_translation::has_wildcard(terrain);
-       is_empty = terrain.empty();
 
        for(size_t i = 0; i < terrain.size(); i++) {
                mask[i] = t_translation::get_mask_(terrain[i]);




Related Messages


Powered by MHonArc, Updated Thu Sep 20 19:40:43 2007