This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[Patch] Fix adjacent_difference in parallel-mode
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Cc: Johannes Singler <singler at ira dot uka dot de>
- Date: Fri, 09 Oct 2009 16:40:26 +0200
- Subject: [Patch] Fix adjacent_difference in parallel-mode
Hi all, hi Johannes,
today I run again after some time check-parallel and one or more (don't
remember now, sorry) adjacent_difference tests failed, because of typos
introduce by the uglification, as far as I can see. I would ask you,
however, to go again through for_each_selectors.h, because the mix of
first vs _M_first and second vs _M_second (see, for example
__transform1_selector vs __transform2_selector) makes me a little
nervous... Consider any further simple fixes in this area pre-approved,
of course.
Thanks,
Paolo.
////////////////////
2009-10-09 Paolo Carlini <paolo.carlini@oracle.com>
* include/parallel/numeric (__adjacent_difference_switch): Fix typo.
* include/parallel/for_each_selectors.h
(__adjacent_difference_selector): Likewise.
Index: include/parallel/numeric
===================================================================
--- include/parallel/numeric (revision 152584)
+++ include/parallel/numeric (working copy)
@@ -435,7 +435,7 @@
__for_each_template_random_access_ed(
__begin_pair, __end_pair, __bin_op, __functionality,
__gnu_parallel::_DummyReduct(), __dummy, __dummy, -1);
- return __functionality.finish_iterator;
+ return __functionality._M_finish_iterator;
}
else
return adjacent_difference(__begin, __end, __result, __bin_op,
Index: include/parallel/for_each_selectors.h
===================================================================
--- include/parallel/for_each_selectors.h (revision 152584)
+++ include/parallel/for_each_selectors.h (working copy)
@@ -277,7 +277,7 @@
{
typename _It::first_type __go_back_one = __i.first;
--__go_back_one;
- *__i.__second = __o(*__i.__first, *__go_back_one);
+ *__i.second = __o(*__i.first, *__go_back_one);
return true;
}
};