diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2022-09-28 19:28:13 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-28 19:28:13 +0100 |
| commit | 31cb4c49d9f977d4cb0876cf1124bf9e86a60669 (patch) | |
| tree | 2bd8c4f182167b587fa243f37dd3760fabdc9ec7 /src/Compositor.cpp | |
| parent | ec5ffe8839c9c993fed4c23d72077969615dd298 (diff) | |
| parent | 11ee78f88bb811a8998b2dc7499c003289a24b1f (diff) | |
Merge pull request #743 from Dickby/use_double_literals
Use double literals, don't cast integer or float literals to double.
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index de80d797..f670a643 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1102,7 +1102,7 @@ CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { switch (dir) { case 'l': if (STICKS(POSA.x, POSB.x + SIZEB.x)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectWindow = w.get(); @@ -1111,7 +1111,7 @@ CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { break; case 'r': if (STICKS(POSA.x + SIZEA.x, POSB.x)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectWindow = w.get(); @@ -1121,7 +1121,7 @@ CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { case 't': case 'u': if (STICKS(POSA.y, POSB.y + SIZEB.y)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectWindow = w.get(); @@ -1131,7 +1131,7 @@ CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { case 'b': case 'd': if (STICKS(POSA.y + SIZEA.y, POSB.y)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectWindow = w.get(); @@ -1277,7 +1277,7 @@ CMonitor* CCompositor::getMonitorInDirection(const char& dir) { switch (dir) { case 'l': if (STICKS(POSA.x, POSB.x + SIZEB.x)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectMonitor = m.get(); @@ -1286,7 +1286,7 @@ CMonitor* CCompositor::getMonitorInDirection(const char& dir) { break; case 'r': if (STICKS(POSA.x + SIZEA.x, POSB.x)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.y + SIZEA.y, POSB.y + SIZEB.y) - std::max(POSA.y, POSB.y)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectMonitor = m.get(); @@ -1296,7 +1296,7 @@ CMonitor* CCompositor::getMonitorInDirection(const char& dir) { case 't': case 'u': if (STICKS(POSA.y, POSB.y + SIZEB.y)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectMonitor = m.get(); @@ -1306,7 +1306,7 @@ CMonitor* CCompositor::getMonitorInDirection(const char& dir) { case 'b': case 'd': if (STICKS(POSA.y + SIZEA.y, POSB.y)) { - const auto INTERSECTLEN = std::max((double)0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); + const auto INTERSECTLEN = std::max(0.0, std::min(POSA.x + SIZEA.x, POSB.x + SIZEB.x) - std::max(POSA.x, POSB.x)); if (INTERSECTLEN > longestIntersect) { longestIntersect = INTERSECTLEN; longestIntersectMonitor = m.get(); |
