Commit eca5f925 by Jonathan Wakely Committed by Jonathan Wakely

Avoid -Wconversion warnings when -Wsystem-headers is used

	* include/bits/stl_algobase.h (__lg): Do arithmetic on type int to
	avoid -Wconversion warnings.

From-SVN: r269876
parent 5c3703c5
2019-03-22 Jonathan Wakely <jwakely@redhat.com>
* include/bits/stl_algobase.h (__lg): Do arithmetic on type int to
avoid -Wconversion warnings.
2019-03-21 Thomas Rodgers <trodgers@redhat.com>
* include/Makefile.am (std_header): Add ${std_srcdir}/execution.
......
......@@ -1018,27 +1018,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Precondition: __n > 0.
inline _GLIBCXX_CONSTEXPR int
__lg(int __n)
{ return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
{ return (int)sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
inline _GLIBCXX_CONSTEXPR unsigned
__lg(unsigned __n)
{ return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
{ return (int)sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); }
inline _GLIBCXX_CONSTEXPR long
__lg(long __n)
{ return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
{ return (int)sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
inline _GLIBCXX_CONSTEXPR unsigned long
__lg(unsigned long __n)
{ return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
{ return (int)sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); }
inline _GLIBCXX_CONSTEXPR long long
__lg(long long __n)
{ return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
{ return (int)sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
inline _GLIBCXX_CONSTEXPR unsigned long long
__lg(unsigned long long __n)
{ return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
{ return (int)sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
_GLIBCXX_BEGIN_NAMESPACE_ALGO
......
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