wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src gamestatus.cpp gamestatus.hpp seria...


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src gamestatus.cpp gamestatus.hpp seria...
Date: Tue, 05 Apr 2005 14:32:32 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/04/05 18:32:31

Modified files:
        src            : gamestatus.cpp gamestatus.hpp 
        src/serialization: string_utils.cpp string_utils.hpp 

Log message:
        Made variable_set use a get_variable_const method, which returns a const
        tstring&, to allow the code to build in MSVC6.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/gamestatus.cpp.diff?tr1=1.68&tr2=1.69&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/gamestatus.hpp.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/serialization/string_utils.cpp.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/serialization/string_utils.hpp.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: wesnoth/src/gamestatus.cpp
diff -u wesnoth/src/gamestatus.cpp:1.68 wesnoth/src/gamestatus.cpp:1.69
--- wesnoth/src/gamestatus.cpp:1.68     Sun Mar 27 23:06:16 2005
+++ wesnoth/src/gamestatus.cpp  Tue Apr  5 18:32:30 2005
@@ -1,4 +1,4 @@
-/* $Id: gamestatus.cpp,v 1.68 2005/03/27 23:06:16 gruikya Exp $ */
+/* $Id: gamestatus.cpp,v 1.69 2005/04/05 18:32:30 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -700,6 +700,11 @@
        return empty_string;
 }
 
+const t_string& game_state::get_variable_const(const std::string& key)
+{
+       return get_variable(key);
+}
+
 config& game_state::get_variable_cfg(const std::string& key)
 {
        config* res = NULL;
Index: wesnoth/src/gamestatus.hpp
diff -u wesnoth/src/gamestatus.hpp:1.42 wesnoth/src/gamestatus.hpp:1.43
--- wesnoth/src/gamestatus.hpp:1.42     Sun Mar 27 23:06:16 2005
+++ wesnoth/src/gamestatus.hpp  Tue Apr  5 18:32:30 2005
@@ -1,4 +1,4 @@
-/* $Id: gamestatus.hpp,v 1.42 2005/03/27 23:06:16 gruikya Exp $ */
+/* $Id: gamestatus.hpp,v 1.43 2005/04/05 18:32:30 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -116,7 +116,9 @@
        config variables; //variables that have been set
 
        //Variable access
-       virtual t_string& get_variable(const std::string& varname);
+       t_string& get_variable(const std::string& varname);
+       virtual const t_string& get_variable_const(const std::string& varname);
+
        config& get_variable_cfg(const std::string& varname);
        void set_variable(const std::string& varname, const t_string& value);
 
Index: wesnoth/src/serialization/string_utils.cpp
diff -u wesnoth/src/serialization/string_utils.cpp:1.14 
wesnoth/src/serialization/string_utils.cpp:1.15
--- wesnoth/src/serialization/string_utils.cpp:1.14     Sun Mar 27 23:06:17 2005
+++ wesnoth/src/serialization/string_utils.cpp  Tue Apr  5 18:32:31 2005
@@ -1,4 +1,4 @@
-/* $Id: string_utils.cpp,v 1.14 2005/03/27 23:06:17 gruikya Exp $ */
+/* $Id: string_utils.cpp,v 1.15 2005/04/05 18:32:31 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Copyright (C) 2005 by Guillaume Melquiond <address@hidden>
@@ -111,7 +111,7 @@
                //Replace = remove original, and then insert new value, if any.
                res.erase(var_begin, var_end);
 
-               res.insert(var_begin_loc, set.get_variable(var_name));
+               res.insert(var_begin_loc, set.get_variable_const(var_name));
        }
        
        //Remove any remaining '|', which are used to separate variable names,
@@ -200,7 +200,7 @@
 public:
        string_map_variable_set(const string_map& map) : map_(map) {};
        
-       virtual const t_string& get_variable(const std::string& key)
+       virtual const t_string& get_variable_const(const std::string& key)
        {
                static const t_string empty_string = "";
 
Index: wesnoth/src/serialization/string_utils.hpp
diff -u wesnoth/src/serialization/string_utils.hpp:1.9 
wesnoth/src/serialization/string_utils.hpp:1.10
--- wesnoth/src/serialization/string_utils.hpp:1.9      Sun Mar 27 23:06:17 2005
+++ wesnoth/src/serialization/string_utils.hpp  Tue Apr  5 18:32:31 2005
@@ -1,4 +1,4 @@
-/* $Id: string_utils.hpp,v 1.9 2005/03/27 23:06:17 gruikya Exp $ */
+/* $Id: string_utils.hpp,v 1.10 2005/04/05 18:32:31 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Copyright (C) 2005 by Guillaume Melquiond <address@hidden>
@@ -27,7 +27,7 @@
 public:
        virtual ~variable_set();
 
-       virtual const t_string& get_variable(const std::string& id) = 0;
+       virtual const t_string& get_variable_const(const std::string& id) = 0;
 };
 
 //the type we use to represent Unicode strings.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]