Date: Sun, 29 Jan 2012 02:13:02 +0000 (UTC) From: Andrew Turner <andrew@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r230722 - projects/arm_eabi/contrib/libstdc++/include/std Message-ID: <201201290213.q0T2D2Rb011743@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andrew Date: Sun Jan 29 02:13:01 2012 New Revision: 230722 URL: http://svn.freebsd.org/changeset/base/230722 Log: Fix a warning where a left shift is greater than the width of an unsigned type in __glibcxx_{min,max}. The code is unused because __glibcxx_signed is false. __glibcxx_max came from libstdc++ r138078, the last GPLv2 revision. Modified: projects/arm_eabi/contrib/libstdc++/include/std/std_limits.h Modified: projects/arm_eabi/contrib/libstdc++/include/std/std_limits.h ============================================================================== --- projects/arm_eabi/contrib/libstdc++/include/std/std_limits.h Sun Jan 29 01:50:26 2012 (r230721) +++ projects/arm_eabi/contrib/libstdc++/include/std/std_limits.h Sun Jan 29 02:13:01 2012 (r230722) @@ -134,10 +134,11 @@ #define __glibcxx_signed(T) ((T)(-1) < 0) #define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) + (__glibcxx_signed (T) ? (((T)1 << (__glibcxx_digits (T) - 1)) << 1) : (T)0) #define __glibcxx_max(T) \ - (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0) + (__glibcxx_signed (T) ? \ + (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0) #define __glibcxx_digits(T) \ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201290213.q0T2D2Rb011743>