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 <cmath> header for this one expression.

(cherry picked from commit 8f3c95f757)
This commit is contained in:
Scott Kostyshak 2020-03-28 12:19:11 -04:00 committed by Jean-Marc Lasgouttes
parent b7403de38c
commit 3f14be7739

View File

@ -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;