From 8f3c95f7570f84effc4601e88f13ff48c6084f0c Mon Sep 17 00:00:00 2001 From: Scott Kostyshak Date: Sat, 28 Mar 2020 12:19:11 -0400 Subject: [PATCH 1/1] Use << for raising 2 to power instead of ^ The ^ is interpretted as bitwise XOR, so 2^(20) evaluated to 22. Thanks to Riki for the << trick. This way, we do not have to use pow() and include the header for this one expression. --- src/graphics/PreviewLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index ac14fbb6a9..586ba48abc 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -727,7 +727,7 @@ void PreviewLoader::Impl::startLoading(bool wait) if (wait) { ForkedCall call(buffer_.filePath(), buffer_.layoutPos()); int ret = call.startScript(ForkedProcess::Wait, command); - static atomic_int fake((2^20) + 1); + static atomic_int fake((1 << 20) + 1); int pid = fake++; inprogress.pid = pid; inprogress.command = command; -- 2.39.2