mail[Wesnoth-commits] r43355 - /trunk/src/serialization/preprocessor.cpp


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

Header


Content

Posted by koraq on June 12, 2010 - 18:03:
Author: mordante
Date: Sat Jun 12 18:03:53 2010
New Revision: 43355

URL: http://svn.gna.org/viewcvs/wesnoth?rev=43355&view=rev
Log:
Make Wesnoth more compatible with C++0x (g++-4.5).

Prevent narrowing when using an initializer list to initialize
token_desc.

Modified:
    trunk/src/serialization/preprocessor.cpp

Modified: trunk/src/serialization/preprocessor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.cpp?rev=43355&r1=43354&r2=43355&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.cpp (original)
+++ trunk/src/serialization/preprocessor.cpp Sat Jun 12 18:03:53 2010
@@ -349,6 +349,12 @@
        /** Description of a preprocessing chunk. */
        struct token_desc
        {
+               token_desc(const char type, const int stack_pos, const int 
linenum)
+                       : type(type)
+                       , stack_pos(stack_pos)
+                       , linenum(linenum)
+               {
+               }
                /** @todo FIXME: add enum for token type. */
                /**
                 * Preprocessor state.
@@ -493,7 +499,7 @@
 
 void preprocessor_data::push_token(char t)
 {
-       token_desc token = { t, strings_.size(), linenum_ };
+       token_desc token(t, strings_.size(), linenum_);
        tokens_.push_back(token);
        std::ostringstream s;
        if (!skipping_ && slowpath_) {




Related Messages


Powered by MHonArc, Updated Sat Jun 12 18:20:18 2010