| 475 | } |
| 476 | |
| 477 | static std::pair<bool, char const*> consistentNumberProperty(char const* lhs, |
| 478 | char const* rhs, |
| 479 | CompatibleType t) |
| 480 | { |
| 481 | char* pEnd; |
| 482 | |
| 483 | long lnum = strtol(lhs, &pEnd, 0); |
| 484 | if (pEnd == lhs || *pEnd != '\0' || errno == ERANGE) { |
| 485 | return { false, nullptr }; |
| 486 | } |
| 487 | |
| 488 | long rnum = strtol(rhs, &pEnd, 0); |
| 489 | if (pEnd == rhs || *pEnd != '\0' || errno == ERANGE) { |
| 490 | return { false, nullptr }; |
| 491 | } |
| 492 | |
| 493 | if (t == NumberMaxType) { |
| 494 | return { true, std::max(lnum, rnum) == lnum ? lhs : rhs }; |
| 495 | } |
| 496 | |
| 497 | return { true, std::min(lnum, rnum) == lnum ? lhs : rhs }; |
| 498 | } |
| 499 | |
| 500 | template <> |
| 501 | std::pair<bool, char const*> consistentProperty(char const* lhs, |
no test coverage detected
searching dependent graphs…