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

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

[Wesnoth-cvs-commits] wesnoth/src unit.cpp serialization/parser.cpp s...


From: Philippe Plantier
Subject: [Wesnoth-cvs-commits] wesnoth/src unit.cpp serialization/parser.cpp s...
Date: Mon, 28 Mar 2005 08:31:20 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Philippe Plantier <address@hidden>      05/03/28 13:31:20

Modified files:
        src            : unit.cpp 
        src/serialization: parser.cpp tokenizer.cpp 

Log message:
        * Made the tokenizer return line number and column numbers starting 
with 1 and not 0.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/unit.cpp.diff?tr1=1.133&tr2=1.134&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/serialization/parser.cpp.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/serialization/tokenizer.cpp.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: wesnoth/src/serialization/parser.cpp
diff -u wesnoth/src/serialization/parser.cpp:1.10 
wesnoth/src/serialization/parser.cpp:1.11
--- wesnoth/src/serialization/parser.cpp:1.10   Mon Mar 28 12:29:10 2005
+++ wesnoth/src/serialization/parser.cpp        Mon Mar 28 13:31:20 2005
@@ -1,4 +1,4 @@
-/* $Id: parser.cpp,v 1.10 2005/03/28 12:29:10 gruikya Exp $ */
+/* $Id: parser.cpp,v 1.11 2005/03/28 13:31:20 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Copyright (C) 2005 by Guillaume Melquiond <address@hidden>
@@ -218,8 +218,8 @@
                                // appropriate, although a proper one should
                                // wait after string freeze.
                                error(_("Unexpected characters after variable 
name (expected , or =)"));
-                               variables.push_back("");
                        }
+                       variables.push_back("");
                        break;
                default:
                        error(_("Unexpected characters after variable name 
(expected , or =)"));
Index: wesnoth/src/serialization/tokenizer.cpp
diff -u wesnoth/src/serialization/tokenizer.cpp:1.2 
wesnoth/src/serialization/tokenizer.cpp:1.3
--- wesnoth/src/serialization/tokenizer.cpp:1.2 Mon Mar 28 12:29:10 2005
+++ wesnoth/src/serialization/tokenizer.cpp     Mon Mar 28 13:31:20 2005
@@ -1,4 +1,4 @@
-/* $Id: tokenizer.cpp,v 1.2 2005/03/28 12:29:10 gruikya Exp $ */
+/* $Id: tokenizer.cpp,v 1.3 2005/03/28 13:31:20 gruikya Exp $ */
 /*
    Copyright (C) 2004 by Philippe Plantier <address@hidden>
    Part of the Battle for Wesnoth Project http://www.wesnoth.org
@@ -32,8 +32,6 @@
 
 const token& tokenizer::next_token()
 {
-       tokenstart_lineno_ = lineno_;
-       tokenstart_colno_ = colno_;
        token_.value = "";
        token_.leading_spaces = "";
 
@@ -63,6 +61,9 @@
                }
        } 
 
+       tokenstart_lineno_ = lineno_;
+       tokenstart_colno_ = colno_;
+
        switch(current_) {
        case EOF:
                token_.type = token::END;
@@ -148,12 +149,12 @@
 
 const size_t tokenizer::get_line()
 {
-       return tokenstart_lineno_;
+       return tokenstart_lineno_ + 1;
 }
 
 const size_t tokenizer::get_column()
 {
-       return tokenstart_colno_;
+       return tokenstart_colno_ + 1;
 }
 
 std::string& tokenizer::textdomain()
Index: wesnoth/src/unit.cpp
diff -u wesnoth/src/unit.cpp:1.133 wesnoth/src/unit.cpp:1.134
--- wesnoth/src/unit.cpp:1.133  Sun Mar 27 23:06:17 2005
+++ wesnoth/src/unit.cpp        Mon Mar 28 13:31:20 2005
@@ -1,4 +1,4 @@
-/* $Id: unit.cpp,v 1.133 2005/03/27 23:06:17 gruikya Exp $ */
+/* $Id: unit.cpp,v 1.134 2005/03/28 13:31:20 gruikya Exp $ */
 /*
    Copyright (C) 2003 by David White <address@hidden>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -77,18 +77,18 @@
 //constructor for creating a new unit
 unit::unit(const unit_type* t, int side, bool use_traits, bool dummy_unit, 
unit_race::GENDER gender) :
                gender_(dummy_unit ? gender : generate_gender(*t,use_traits)),
-               type_(&t->get_gender_unit_type(gender_)), state_(STATE_NORMAL),
-                          hitpoints_(type_->hitpoints()),
-                          maxHitpoints_(type_->hitpoints()),
-               backupMaxHitpoints_(type_->hitpoints()), experience_(0),
-                          maxExperience_(type_->experience_needed()),
-                          backupMaxExperience_(type_->experience_needed()),
-               side_(side), moves_(0),
-               user_end_turn_(false), facingLeft_(side != 1),
-                          maxMovement_(type_->movement()),
-                          backupMaxMovement_(type_->movement()),
-                          recruit_(false), attacks_(type_->attacks()),
-                          backupAttacks_(type_->attacks()),
+              type_(&t->get_gender_unit_type(gender_)), state_(STATE_NORMAL),
+              hitpoints_(type_->hitpoints()),
+              maxHitpoints_(type_->hitpoints()),
+              backupMaxHitpoints_(type_->hitpoints()), experience_(0),
+              maxExperience_(type_->experience_needed()),
+              backupMaxExperience_(type_->experience_needed()),
+              side_(side), moves_(0),
+              user_end_turn_(false), facingLeft_(side != 1),
+              maxMovement_(type_->movement()),
+              backupMaxMovement_(type_->movement()),
+              recruit_(false), attacks_(type_->attacks()),
+              backupAttacks_(type_->attacks()),
                guardian_(false), upkeep_(UPKEEP_FULL_PRICE),
                unrenamable_(false)
 {




reply via email to

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