From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QVJvq-00009A-RJ for garchives@archives.gentoo.org; Sat, 11 Jun 2011 08:52:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0C4641C01C; Sat, 11 Jun 2011 08:52:16 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id BF47F1C01B for ; Sat, 11 Jun 2011 08:52:16 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4B4C11B402D for ; Sat, 11 Jun 2011 08:52:15 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 28ECF80040 for ; Sat, 11 Jun 2011 08:52:14 +0000 (UTC) From: "Petteri Räty" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Petteri Räty" Message-ID: Subject: [gentoo-commits] proj/libbash:master commit in: src/core/ X-VCS-Repository: proj/libbash X-VCS-Files: src/core/interpreter.cpp src/core/interpreter.h X-VCS-Directories: src/core/ X-VCS-Committer: betelgeuse X-VCS-Committer-Name: Petteri Räty X-VCS-Revision: a10aa4fcd41b4b636a36e42ddbf60650108c20d8 Date: Sat, 11 Jun 2011 08:52:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 19e037a62218e61e95a35a91e2455b1e commit: a10aa4fcd41b4b636a36e42ddbf60650108c20d8 Author: Mu Qiao gentoo org> AuthorDate: Fri Jun 10 03:42:47 2011 +0000 Commit: Petteri R=C3=A4ty gentoo org> CommitDate: Fri Jun 10 08:25:09 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/libbash.git;a= =3Dcommit;h=3Da10aa4fc Core: declared some methods to be const Some methods should have been declared to be const. Now this is fixed. --- src/core/interpreter.cpp | 4 ++-- src/core/interpreter.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/interpreter.cpp b/src/core/interpreter.cpp index d1eb411..fedbee4 100644 --- a/src/core/interpreter.cpp +++ b/src/core/interpreter.cpp @@ -236,7 +236,7 @@ void interpreter::get_all_elements_IFS_joined(const s= td::string& name, result); } =20 -void interpreter::split_word(const std::string& word, std::vector& output) +void interpreter::split_word(const std::string& word, std::vector& output) const { const std::string& delimeter =3D resolve("IFS"); std::string trimmed(word); @@ -313,7 +313,7 @@ void interpreter::trim_trailing_eols(std::string& val= ue) boost::trim_right_if(value, boost::is_any_of("\n")); } =20 -void interpreter::get_all_function_names(std::vector& funct= ion_names) +void interpreter::get_all_function_names(std::vector& funct= ion_names) const { boost::copy(functions | boost::adaptors::map_keys, back_inserter(funct= ion_names)); } diff --git a/src/core/interpreter.h b/src/core/interpreter.h index 38b4c94..937edd8 100644 --- a/src/core/interpreter.h +++ b/src/core/interpreter.h @@ -245,7 +245,7 @@ public: /// \brief get the return status of the last command /// \param the value of the return status template - T get_status(void) + T get_status(void) const { return resolve("?"); } @@ -322,12 +322,12 @@ public: /// \brief check if we have 'name' defined as a function /// \param function name /// \return whether 'name' is a function - bool has_function(const std::string& name) + bool has_function(const std::string& name) const { return functions.find(name) !=3D functions.end(); } =20 - void get_all_function_names(std::vector& function_names); + void get_all_function_names(std::vector& function_names) = const; =20 /// \brief execute builtin /// \param builtin name @@ -430,7 +430,7 @@ public: /// \brief implementation of word splitting /// \param the value of the word //. \param[out] the splitted result will be appended to output - void split_word(const std::string& word, std::vector& out= put); + void split_word(const std::string& word, std::vector& out= put) const; =20 /// \brief get the status of shell optional behavior /// \param the option name