Handle clang 10 warnings:

+ fix -Wtautological-bitwise-compare
+ fix -Wimplicit-int-float-conversion
+ fix -Wmisleading-indentation
+ fix -Wrange-loop-construct
+ suppress -Wdeprecated-copy of 3rd party libs
This commit is contained in:
wmayer
2020-05-25 15:34:43 +02:00
parent fe2664ec65
commit 300e887480
18 changed files with 106 additions and 23 deletions

View File

@@ -350,23 +350,25 @@ static inline bool definitelyLessThan(T a, T b)
static inline int essentiallyInteger(double a, long &l, int &i) {
double intpart;
if(std::modf(a,&intpart) == 0.0) {
if(intpart<0.0) {
if(intpart >= INT_MIN) {
i = (int)intpart;
if (std::modf(a,&intpart) == 0.0) {
if (intpart<0.0) {
if (intpart >= INT_MIN) {
i = static_cast<int>(intpart);
l = i;
return 1;
}
if(intpart >= LONG_MIN) {
l = (long)intpart;
if (intpart >= LONG_MIN) {
l = static_cast<long>(intpart);
return 2;
}
}else if(intpart <= INT_MAX) {
i = (int)intpart;
}
else if (intpart <= INT_MAX) {
i = static_cast<int>(intpart);
l = i;
return 1;
}else if(intpart <= LONG_MAX) {
l = (int)intpart;
}
else if (intpart <= static_cast<double>(LONG_MAX)) {
l = static_cast<int>(intpart);
return 2;
}
}
@@ -375,14 +377,15 @@ static inline int essentiallyInteger(double a, long &l, int &i) {
static inline bool essentiallyInteger(double a, long &l) {
double intpart;
if(std::modf(a,&intpart) == 0.0) {
if(intpart<0.0) {
if(intpart >= LONG_MIN) {
l = (long)intpart;
if (std::modf(a,&intpart) == 0.0) {
if (intpart<0.0) {
if (intpart >= LONG_MIN) {
l = static_cast<long>(intpart);
return true;
}
}else if(intpart <= LONG_MAX) {
l = (long)intpart;
}
else if (intpart <= static_cast<double>(LONG_MAX)) {
l = static_cast<long>(intpart);
return true;
}
}