| 198 | } |
| 199 | |
| 200 | static std::vector<int> compare(const Interval& lhs, |
| 201 | const Interval& rhs, |
| 202 | std::vector<const ValueFlow::Value*>* ref = nullptr) |
| 203 | { |
| 204 | Interval diff = lhs - rhs; |
| 205 | if (diff.isGreaterThan(0, ref)) |
| 206 | return {1}; |
| 207 | if (diff.isLessThan(0, ref)) |
| 208 | return {-1}; |
| 209 | std::vector<int> eq = Interval::equal(lhs, rhs, ref); |
| 210 | if (!eq.empty()) { |
| 211 | if (eq.front() == 0) |
| 212 | return {1, -1}; |
| 213 | return {0}; |
| 214 | } |
| 215 | if (diff.isGreaterThan(-1, ref)) |
| 216 | return {0, 1}; |
| 217 | if (diff.isLessThan(1, ref)) |
| 218 | return {0, -1}; |
| 219 | return {}; |
| 220 | } |
| 221 | |
| 222 | static std::vector<bool> compare(const std::string& op, |
| 223 | const Interval& lhs, |
nothing calls this directly
no test coverage detected