From a4797b349c0596ce1f89e00c50269964adfaba78 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 15 Jan 2008 02:06:31 +0000 Subject: [PATCH] list_partition.h: Formatting fixes, inline tweaks. 2008-01-14 Paolo Carlini * include/parallel/list_partition.h: Formatting fixes, inline tweaks. * include/parallel/numeric: Likewise. * include/parallel/balanced_quicksort.h: Likewise. * include/parallel/unique_copy.h: Likewise. * include/parallel/algobase.h: Likewise. * include/parallel/algo.h: Likewise. From-SVN: r131542 --- libstdc++-v3/ChangeLog | 9 +++++++++ libstdc++-v3/include/parallel/algo.h | 11 +++++------ libstdc++-v3/include/parallel/algobase.h | 6 +++--- libstdc++-v3/include/parallel/balanced_quicksort.h | 11 ++++++----- libstdc++-v3/include/parallel/list_partition.h | 2 +- libstdc++-v3/include/parallel/numeric | 9 ++++----- libstdc++-v3/include/parallel/unique_copy.h | 3 ++- 7 files changed, 30 insertions(+), 21 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 46eea7aba59e..94388f513733 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2008-01-14 Paolo Carlini + + * include/parallel/list_partition.h: Formatting fixes, inline tweaks. + * include/parallel/numeric: Likewise. + * include/parallel/balanced_quicksort.h: Likewise. + * include/parallel/unique_copy.h: Likewise. + * include/parallel/algobase.h: Likewise. + * include/parallel/algo.h: Likewise. + 2008-01-14 Seongbae Park * crossconfig.m4: Add missing header checks, C99 TR1 check, diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h index 47f305dca32f..f1c403234132 100644 --- a/libstdc++-v3/include/parallel/algo.h +++ b/libstdc++-v3/include/parallel/algo.h @@ -1585,7 +1585,7 @@ namespace __parallel // Parallel algorithm for random access iterators. template - RandomAccessIterator + inline RandomAccessIterator generate_n_switch(RandomAccessIterator begin, Size n, Generator gen, random_access_iterator_tag, __gnu_parallel::parallelism parallelism_tag @@ -1940,10 +1940,10 @@ namespace __parallel // Sequential fallback template - void - partial_sort(RandomAccessIterator begin, RandomAccessIterator middle, - RandomAccessIterator end, __gnu_parallel::sequential_tag) - { _GLIBCXX_STD_P::partial_sort(begin, middle, end); } + inline void + partial_sort(RandomAccessIterator begin, RandomAccessIterator middle, + RandomAccessIterator end, __gnu_parallel::sequential_tag) + { _GLIBCXX_STD_P::partial_sort(begin, middle, end); } // Public interface, parallel algorithm for random access iterators template @@ -2155,4 +2155,3 @@ namespace __parallel } // end namespace #endif /* _GLIBCXX_ALGORITHM_H */ - diff --git a/libstdc++-v3/include/parallel/algobase.h b/libstdc++-v3/include/parallel/algobase.h index 4b3e6eba5595..821985d49b17 100644 --- a/libstdc++-v3/include/parallel/algobase.h +++ b/libstdc++-v3/include/parallel/algobase.h @@ -58,7 +58,7 @@ namespace __parallel // Sequential fallback template inline pair - mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, + mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, __gnu_parallel::sequential_tag) { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2); } @@ -66,7 +66,7 @@ namespace __parallel template inline pair - mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, + mismatch(InputIterator1 begin1, InputIterator1 end1, InputIterator2 begin2, Predicate pred, __gnu_parallel::sequential_tag) { return _GLIBCXX_STD_P::mismatch(begin1, end1, begin2, pred); } @@ -83,7 +83,7 @@ namespace __parallel template pair - mismatch_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1, + mismatch_switch(RandomAccessIterator1 begin1, RandomAccessIterator1 end1, RandomAccessIterator2 begin2, Predicate pred, random_access_iterator_tag, random_access_iterator_tag) { diff --git a/libstdc++-v3/include/parallel/balanced_quicksort.h b/libstdc++-v3/include/parallel/balanced_quicksort.h index 70d811526fdf..182c82df6021 100644 --- a/libstdc++-v3/include/parallel/balanced_quicksort.h +++ b/libstdc++-v3/include/parallel/balanced_quicksort.h @@ -307,10 +307,10 @@ template // Very unequal split, one part smaller than one 128th // elements not strictly larger than the pivot. __gnu_parallel::unary_negate<__gnu_parallel::binder1st - , value_type> - pred(__gnu_parallel::binder1st - (comp, - *pivot_pos)); + , value_type> + pred(__gnu_parallel::binder1st + (comp, + *pivot_pos)); // Find other end of pivot-equal range. split_pos2 = __gnu_sequential::partition(split_pos1 + 1, @@ -330,7 +330,8 @@ template { // Right side larger. if ((split_pos2) != end) - tl.leftover_parts.push_front(std::make_pair(split_pos2, end)); + tl.leftover_parts.push_front(std::make_pair(split_pos2, + end)); //current.first = begin; //already set anyway current.second = split_pos1; diff --git a/libstdc++-v3/include/parallel/list_partition.h b/libstdc++-v3/include/parallel/list_partition.h index 0fcc6285c715..5adc5c9280de 100644 --- a/libstdc++-v3/include/parallel/list_partition.h +++ b/libstdc++-v3/include/parallel/list_partition.h @@ -109,7 +109,7 @@ namespace __gnu_parallel { bool make_twice = false; - // According to the oversampling factor, the resizing algorithm is chosen. + // The resizing algorithm is chosen according to the oversampling factor. if (oversampling == 0) { make_twice = true; diff --git a/libstdc++-v3/include/parallel/numeric b/libstdc++-v3/include/parallel/numeric index ccbdeee12c43..27bad63d3e59 100644 --- a/libstdc++-v3/include/parallel/numeric +++ b/libstdc++-v3/include/parallel/numeric @@ -78,7 +78,7 @@ namespace __parallel template - T + inline T accumulate_switch(InputIterator begin, InputIterator end, T init, BinaryOperation binary_op, IteratorTag) { return accumulate(begin, end, init, binary_op, @@ -345,10 +345,9 @@ namespace __parallel OutputIterator result, BinaryOperation bin_op, random_access_iterator_tag, random_access_iterator_tag) { - if (_GLIBCXX_PARALLEL_CONDITION(static_cast<__gnu_parallel:: - sequence_index_t>(end - begin) - >= __gnu_parallel::Settings:: - partial_sum_minimal_n)) + if (_GLIBCXX_PARALLEL_CONDITION( + static_cast<__gnu_parallel::sequence_index_t>(end - begin) + >= __gnu_parallel::Settings::partial_sum_minimal_n)) return __gnu_parallel::parallel_partial_sum(begin, end, result, bin_op); else diff --git a/libstdc++-v3/include/parallel/unique_copy.h b/libstdc++-v3/include/parallel/unique_copy.h index 01bd1077c1b5..7f51e2603fde 100644 --- a/libstdc++-v3/include/parallel/unique_copy.h +++ b/libstdc++-v3/include/parallel/unique_copy.h @@ -187,7 +187,8 @@ template parallel_unique_copy(InputIterator first, InputIterator last, OutputIterator result) { - typedef typename std::iterator_traits::value_type value_type; + typedef typename std::iterator_traits::value_type + value_type; return parallel_unique_copy(first, last, result, std::equal_to()); } -- 2.47.2