Author: mordante
Date: Tue Oct 25 21:31:42 2011
New Revision: 51638
URL: http://svn.gna.org/viewcvs/wesnoth?rev=51638&view=rev
Log:
Fix compilation with clang 2.9 / boost 1.47.
This applies a slightly modified version of the patch linked in
bug #18399. The changes are coding-style related.
The patch was intended to fix compilation with boost 1.47, but that
boost version is not yet in Debian so didn't test that part. Since it
does fix compilation with clang 2.9 Iapplied it, without waiting for
boost 1.47 to hit Debian.
Modified:
trunk/changelog
trunk/src/gui/widgets/tree_view_node.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=51638&r1=51637&r2=51638&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Oct 25 21:31:42 2011
@@ -84,6 +84,8 @@
image lists
* Evaluate key length even if intervening WML children don't exist (bug
#18701)
* Fix gold carryover if loading a save created in linger mode (bug #16111)
+ * Fixed: Compilation with boost 1.47 (bug #18399's patch).
+ * Fixed: Compilation with the clang 2.9 compiler (bug #18399's patch).
Version 1.9.9:
* AI:
Modified: trunk/src/gui/widgets/tree_view_node.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/tree_view_node.cpp?rev=51638&r1=51637&r2=51638&view=diff
==============================================================================
--- trunk/src/gui/widgets/tree_view_node.cpp (original)
+++ trunk/src/gui/widgets/tree_view_node.cpp Tue Oct 25 21:31:42 2011
@@ -233,6 +233,25 @@
struct ttree_view_node_implementation
{
+private:
+
+ template<class W, class It>
+ static W* find_at_aux(
+ It begin
+ , It end
+ , const tpoint& coordinate
+ , const bool must_be_active)
+ {
+ for(It it = begin; it != end; ++it) {
+ if(W* widget = it->find_at(coordinate, must_be_active))
{
+ return widget;
+ }
+ }
+ return NULL;
+ }
+
+public:
+
template<class W>
static W* find_at(
typename tconst_duplicator<W, ttree_view_node>::type&
@@ -250,13 +269,9 @@
}
typedef typename tconst_duplicator<W, ttree_view_node>::type
thack;
- foreach(thack& node, tree_view_node.children_) {
- if(W* widget = node.find_at(coordinate,
must_be_active)) {
- return widget;
- }
- }
-
- return NULL;
+ return find_at_aux<W>(tree_view_node.children_.begin(),
+ tree_view_node.children_.end(),
+ coordinate, must_be_active);
}
};
@@ -308,7 +323,10 @@
return size;
}
- foreach(const ttree_view_node& node, children_) {
+ for(boost::ptr_vector<ttree_view_node>::const_iterator itor =
+ children_.begin (); itor != children_.end (); ++itor) {
+
+ const ttree_view_node& node = *itor;
if(node.grid_.get_visible() == twidget::INVISIBLE) {
continue;
@@ -339,7 +357,10 @@
size.x += (get_indention_level() - 1) *
tree_view().indention_step_size_;
}
- foreach(const ttree_view_node& node, children_) {
+ for(boost::ptr_vector<ttree_view_node>::const_iterator itor =
+ children_.begin (); itor != children_.end (); ++itor) {
+
+ const ttree_view_node& node = *itor;
if(node.grid_.get_visible() == twidget::INVISIBLE) {
continue;
@@ -373,7 +394,10 @@
DBG_GUI_L << LOG_HEADER << " own grid best size " << best_size << ".\n";
- foreach(const ttree_view_node& node, children_) {
+ for(boost::ptr_vector<ttree_view_node>::const_iterator itor =
+ children_.begin (); itor != children_.end (); ++itor) {
+
+ const ttree_view_node& node = *itor;
if(node.grid_.get_visible() == twidget::INVISIBLE) {
continue;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits