[LyX/master] Use << for raising 2 to power instead of ^

Scott Kostyshak skostysh at lyx.org
Sat Mar 28 22:59:56 UTC 2020


commit 8f3c95f7570f84effc4601e88f13ff48c6084f0c
Author: Scott Kostyshak <skostysh at lyx.org>
Date:   Sat Mar 28 12:19:11 2020 -0400

    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.
---
 src/graphics/PreviewLoader.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index ac14fbb..586ba48 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;


More information about the lyx-cvs mailing list