Commit d962e073 by Paolo Carlini Committed by Paolo Carlini

hash_map: Trivial formatting fixes.

2004-06-14  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/hash_map: Trivial formatting fixes.
	* include/ext/hash_set: Likewise.
	* include/ext/memory: Likewise.
	* include/ext/numeric: Likewise.

From-SVN: r83131
parent f51d8522
2004-06-14 Paolo Carlini <pcarlini@suse.de>
* include/ext/hash_map: Trivial formatting fixes.
* include/ext/hash_set: Likewise.
* include/ext/memory: Likewise.
* include/ext/numeric: Likewise.
2004-06-14 Benjamin Kosnik <bkoz@redhat.com> 2004-06-14 Benjamin Kosnik <bkoz@redhat.com>
* Makefile.in: Regenerate with automake 1.8.5. * Makefile.in: Regenerate with automake 1.8.5.
......
// Memory extensions -*- C++ -*- // Memory extensions -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc. // Copyright (C) 2002, 2004 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -82,7 +82,7 @@ namespace __gnu_cxx ...@@ -82,7 +82,7 @@ namespace __gnu_cxx
_ForwardIter __cur = __result; _ForwardIter __cur = __result;
try try
{ {
for ( ; __count > 0 ; --__count, ++__first, ++__cur) for (; __count > 0 ; --__count, ++__first, ++__cur)
std::_Construct(&*__cur, *__first); std::_Construct(&*__cur, *__first);
return pair<_InputIter, _ForwardIter>(__first, __cur); return pair<_InputIter, _ForwardIter>(__first, __cur);
} }
...@@ -100,19 +100,16 @@ namespace __gnu_cxx ...@@ -100,19 +100,16 @@ namespace __gnu_cxx
std::random_access_iterator_tag) std::random_access_iterator_tag)
{ {
_RandomAccessIter __last = __first + __count; _RandomAccessIter __last = __first + __count;
return pair<_RandomAccessIter, _ForwardIter>( return (pair<_RandomAccessIter, _ForwardIter>
__last, (__last, std::uninitialized_copy(__first, __last, __result)));
std::uninitialized_copy(__first, __last, __result));
} }
template<typename _InputIter, typename _Size, typename _ForwardIter> template<typename _InputIter, typename _Size, typename _ForwardIter>
inline pair<_InputIter, _ForwardIter> inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count, __uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) _ForwardIter __result)
{ { return __uninitialized_copy_n(__first, __count, __result,
return __uninitialized_copy_n(__first, __count, __result, __iterator_category(__first)); }
__iterator_category(__first));
}
/** /**
* @brief Copies the range [first,last) into result. * @brief Copies the range [first,last) into result.
...@@ -128,11 +125,8 @@ namespace __gnu_cxx ...@@ -128,11 +125,8 @@ namespace __gnu_cxx
inline pair<_InputIter, _ForwardIter> inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count, uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) _ForwardIter __result)
{ { return __uninitialized_copy_n(__first, __count, __result,
return __uninitialized_copy_n(__first, __count, __result, __iterator_category(__first)); }
__iterator_category(__first));
}
/** /**
* This class provides similar behavior and semantics of the standard * This class provides similar behavior and semantics of the standard
...@@ -155,16 +149,16 @@ namespace __gnu_cxx ...@@ -155,16 +149,16 @@ namespace __gnu_cxx
* @ingroup SGIextensions * @ingroup SGIextensions
*/ */
template <class _ForwardIterator, class _Tp template <class _ForwardIterator, class _Tp
= typename std::iterator_traits<_ForwardIterator>::value_type > = typename std::iterator_traits<_ForwardIterator>::value_type >
struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp> struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
{ {
/// Requests storage large enough to hold a copy of [first,last). /// Requests storage large enough to hold a copy of [first,last).
temporary_buffer(_ForwardIterator __first, _ForwardIterator __last) temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
: _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) { } : _Temporary_buffer<_ForwardIterator, _Tp>(__first, __last) { }
/// Destroys objects and frees storage. /// Destroys objects and frees storage.
~temporary_buffer() { } ~temporary_buffer() { }
}; };
} // namespace __gnu_cxx } // namespace __gnu_cxx
#endif #endif
......
// Numeric extensions -*- C++ -*- // Numeric extensions -*- C++ -*-
// Copyright (C) 2002 Free Software Foundation, Inc. // Copyright (C) 2002, 2004 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -79,22 +79,25 @@ namespace __gnu_cxx ...@@ -79,22 +79,25 @@ namespace __gnu_cxx
{ {
if (__n == 0) if (__n == 0)
return identity_element(__monoid_op); return identity_element(__monoid_op);
else { else
while ((__n & 1) == 0) { {
while ((__n & 1) == 0)
{
__n >>= 1;
__x = __monoid_op(__x, __x);
}
_Tp __result = __x;
__n >>= 1; __n >>= 1;
__x = __monoid_op(__x, __x); while (__n != 0)
{
__x = __monoid_op(__x, __x);
if ((__n & 1) != 0)
__result = __monoid_op(__result, __x);
__n >>= 1;
}
return __result;
} }
_Tp __result = __x;
__n >>= 1;
while (__n != 0) {
__x = __monoid_op(__x, __x);
if ((__n & 1) != 0)
__result = __monoid_op(__result, __x);
__n >>= 1;
}
return __result;
}
} }
template<typename _Tp, typename _Integer> template<typename _Tp, typename _Integer>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment