cppcheck/cppcheck-1.74-test.patch
2016-08-02 21:51:00 +02:00

39 lines
1.2 KiB
Diff

Index: lib/checkcondition.cpp
===================================================================
--- lib/checkcondition.cpp (revision a5cfa2b12c034e59b5805ac51b53e893c8bc2d1b)
+++ lib/checkcondition.cpp (revision 9bda97975aeec2c18198946e72524f13b4308d8e)
@@ -569,14 +569,6 @@
// 5 => return value that is larger than both value1 and value2
switch (test) {
- case 1: {
- const T ret = std::min(value1, value2);
- if ((ret - (T)1) < ret)
- return ret - (T)1;
- else if ((ret / (T)2) < ret)
- return ret / (T)2;
- else if ((ret * (T)2) < ret)
- return ret * (T)2;
- return ret;
- }
+ case 1:
+ return std::numeric_limits<T>::lowest();
case 2:
return value1;
@@ -585,14 +577,6 @@
case 4:
return value2;
- case 5: {
- const T ret = std::max(value1, value2);
- if ((ret + (T)1) > ret)
- return ret + (T)1;
- else if ((ret / (T)2) > ret)
- return ret / (T)2;
- else if ((ret * (T)2) > ret)
- return ret * (T)2;
- return ret;
- }
+ case 5:
+ return std::numeric_limits<T>::max();
};
return 0;