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.
This commit is contained in:
Scott Kostyshak 2020-03-28 12:19:11 -04:00
parent 104fdcc9be
commit 8f3c95f757

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;