]> git.lyx.org Git - features.git/commitdiff
Use << for raising 2 to power instead of ^
authorScott Kostyshak <skostysh@lyx.org>
Sat, 28 Mar 2020 16:19:11 +0000 (12:19 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Sat, 28 Mar 2020 23:18:21 +0000 (19:18 -0400)
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.

src/graphics/PreviewLoader.cpp

index ac14fbb6a904591e9b8a0182bef5b230eb7ae3e6..586ba48abcf89038c68d603714a71e60a86e56e9 100644 (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;