From d608d97ab7915e1092be156cec22a17f71e4de40 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Tue, 9 Jun 2015 19:56:05 +0200 Subject: [PATCH] common: add new file in project and fix condition ordering --- common/build/Utilities/utilities_vs2012.vcxproj | 1 + common/build/Utilities/utilities_vs2012.vcxproj.filters | 3 +++ common/build/Utilities/utilities_vs2013.vcxproj | 1 + common/build/Utilities/utilities_vs2013.vcxproj.filters | 3 +++ common/include/Utilities/Math.h | 8 ++++---- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/common/build/Utilities/utilities_vs2012.vcxproj b/common/build/Utilities/utilities_vs2012.vcxproj index cf57db1452..d1cdcc753e 100644 --- a/common/build/Utilities/utilities_vs2012.vcxproj +++ b/common/build/Utilities/utilities_vs2012.vcxproj @@ -166,6 +166,7 @@ + diff --git a/common/build/Utilities/utilities_vs2012.vcxproj.filters b/common/build/Utilities/utilities_vs2012.vcxproj.filters index d0e937a35c..fa10f1eba0 100644 --- a/common/build/Utilities/utilities_vs2012.vcxproj.filters +++ b/common/build/Utilities/utilities_vs2012.vcxproj.filters @@ -168,6 +168,9 @@ Header Files + + Header Files + Header Files diff --git a/common/build/Utilities/utilities_vs2013.vcxproj b/common/build/Utilities/utilities_vs2013.vcxproj index f261d769e0..141fc4d745 100644 --- a/common/build/Utilities/utilities_vs2013.vcxproj +++ b/common/build/Utilities/utilities_vs2013.vcxproj @@ -166,6 +166,7 @@ + diff --git a/common/build/Utilities/utilities_vs2013.vcxproj.filters b/common/build/Utilities/utilities_vs2013.vcxproj.filters index 961b6a7d18..9dc015334a 100644 --- a/common/build/Utilities/utilities_vs2013.vcxproj.filters +++ b/common/build/Utilities/utilities_vs2013.vcxproj.filters @@ -168,6 +168,9 @@ Header Files + + Header Files + Header Files diff --git a/common/include/Utilities/Math.h b/common/include/Utilities/Math.h index e444f687fb..f9ab252922 100644 --- a/common/include/Utilities/Math.h +++ b/common/include/Utilities/Math.h @@ -21,14 +21,14 @@ // On GCC >= 4.7, this is equivalent to __builtin_clrsb(n); inline u32 count_leading_sign_bits(s32 n) { - // If BSR is used directly, it would have an undefined value for 0. - if (n == 0) - return 32; - // If the sign bit is 1, we invert the bits to 0 for count-leading-zero. if (n < 0) n = ~n; + // If BSR is used directly, it would have an undefined value for 0. + if (n == 0) + return 32; + // Perform our count leading zero. #ifdef _MSC_VER unsigned long ret;