From a0224bd6a2c82b8efb0003c0e5a92b3253803d40 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 17 Aug 2022 10:01:51 +0300 Subject: [PATCH] Fix build on Windows. --- src/libs/qmuparser/qmuformulabase.cpp | 2 ++ src/libs/qmuparser/qmuparser.cpp | 4 +-- src/libs/qmuparser/qmuparserbytecode.cpp | 34 +++++++++---------- src/libs/qmuparser/qmuparserbytecode.h | 1 - .../vlayout/dialogs/dialoglayoutscale.cpp | 4 +++ src/libs/vtools/dialogs/dialogtoolbox.cpp | 1 + .../drawTools/toolcurve/vabstractspline.cpp | 2 +- 7 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/libs/qmuparser/qmuformulabase.cpp b/src/libs/qmuparser/qmuformulabase.cpp index 39091a3ae..28f610ea4 100644 --- a/src/libs/qmuparser/qmuformulabase.cpp +++ b/src/libs/qmuparser/qmuformulabase.cpp @@ -30,6 +30,8 @@ #include #include +#include "qmudef.h" + namespace qmu { diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index 3ddf10a87..3b1dc9f71 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -30,11 +30,11 @@ #include #include #include +#include -#include "qmuparserdef.h" #include "qmuparsererror.h" -#include "../vmisc/vmath.h" #include "../vmisc/defglobal.h" +#include "qmudef.h" /** * @file diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index ab9aa5ee0..1123e3a9f 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -100,11 +100,11 @@ void QmuParserByteCode::AddVar(qreal *a_pVar) m_iMaxStackSize = qMax(m_iMaxStackSize, m_iStackPos); // optimization does not apply - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = cmVAR; - tok.Val.ptr = a_pVar; // NOLINT(cppcoreguidelines-pro-type-union-access) - tok.Val.data = 1; // NOLINT(cppcoreguidelines-pro-type-union-access) - tok.Val.data2 = 0; // NOLINT(cppcoreguidelines-pro-type-union-access) + tok.Val.ptr = a_pVar; + tok.Val.data = 1; + tok.Val.data2 = 0; m_vRPN.push_back(tok); } @@ -128,11 +128,11 @@ void QmuParserByteCode::AddVal(qreal a_fVal) m_iMaxStackSize = qMax(m_iMaxStackSize, m_iStackPos); // If optimization does not apply - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = cmVAL; - tok.Val.ptr = nullptr; // NOLINT(cppcoreguidelines-pro-type-union-access) - tok.Val.data = 0; // NOLINT(cppcoreguidelines-pro-type-union-access) - tok.Val.data2 = a_fVal; // NOLINT(cppcoreguidelines-pro-type-union-access) + tok.Val.ptr = nullptr; + tok.Val.data = 0; + tok.Val.data2 = a_fVal; m_vRPN.push_back(tok); } @@ -140,8 +140,8 @@ void QmuParserByteCode::AddVal(qreal a_fVal) void QmuParserByteCode::ConstantFolding(ECmdCode a_Oprt) { int sz = m_vRPN.size(); - qreal &x = m_vRPN[sz-2].Val.data2, // NOLINT(cppcoreguidelines-pro-type-union-access) - &y = m_vRPN[sz-1].Val.data2; // NOLINT(cppcoreguidelines-pro-type-union-access) + qreal &x = m_vRPN[sz-2].Val.data2, + &y = m_vRPN[sz-1].Val.data2; switch (a_Oprt) { case cmLAND: @@ -355,7 +355,7 @@ void QmuParserByteCode::AddOp(ECmdCode a_Oprt) if (not bOptimized) { --m_iStackPos; - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = a_Oprt; m_vRPN.push_back(tok); } @@ -416,7 +416,7 @@ QT_WARNING_POP //--------------------------------------------------------------------------------------------------------------------- void QmuParserByteCode::AddIfElse(ECmdCode a_Oprt) { - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = a_Oprt; m_vRPN.push_back(tok); } @@ -437,7 +437,7 @@ void QmuParserByteCode::AddAssignOp(qreal *a_pVar) { --m_iStackPos; - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = cmASSIGN; tok.Oprt.ptr = a_pVar; m_vRPN.push_back(tok); @@ -463,7 +463,7 @@ void QmuParserByteCode::AddFun(generic_fun_type a_pFun, int a_iArgc) } m_iMaxStackSize = qMax(m_iMaxStackSize, m_iStackPos); - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = cmFUNC; tok.Fun.argc = a_iArgc; tok.Fun.ptr = a_pFun; @@ -482,7 +482,7 @@ void QmuParserByteCode::AddBulkFun(generic_fun_type a_pFun, int a_iArgc) m_iStackPos = static_cast(static_cast(m_iStackPos) - a_iArgc + 1); m_iMaxStackSize = qMax(m_iMaxStackSize, m_iStackPos); - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = cmFUNC_BULK; tok.Fun.argc = a_iArgc; tok.Fun.ptr = a_pFun; @@ -501,7 +501,7 @@ void QmuParserByteCode::AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iI { m_iStackPos = static_cast(static_cast(m_iStackPos) - a_iArgc + 1); - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = cmFUNC_STR; tok.Fun.argc = a_iArgc; tok.Fun.idx = a_iIdx; @@ -519,7 +519,7 @@ void QmuParserByteCode::AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iI */ void QmuParserByteCode::Finalize() { - SToken tok{}; + SToken tok; // NOLINT tok.Cmd = cmEND; m_vRPN.push_back(tok); rpn_type(m_vRPN).swap(m_vRPN); // shrink bytecode vector to fit diff --git a/src/libs/qmuparser/qmuparserbytecode.h b/src/libs/qmuparser/qmuparserbytecode.h index 1e11c7e83..694643c42 100644 --- a/src/libs/qmuparser/qmuparserbytecode.h +++ b/src/libs/qmuparser/qmuparserbytecode.h @@ -25,7 +25,6 @@ #include #include -#include "qmudef.h" #include "qmuparserdef.h" #include "qmuparsertoken.h" diff --git a/src/libs/vlayout/dialogs/dialoglayoutscale.cpp b/src/libs/vlayout/dialogs/dialoglayoutscale.cpp index bbdc22286..ea3ee6646 100644 --- a/src/libs/vlayout/dialogs/dialoglayoutscale.cpp +++ b/src/libs/vlayout/dialogs/dialoglayoutscale.cpp @@ -34,6 +34,10 @@ #include #include +#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) +#include "../vmisc/backport/qoverload.h" +#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) + //--------------------------------------------------------------------------------------------------------------------- DialogLayoutScale::DialogLayoutScale(bool printTiled, QWidget *parent) :QDialog(parent), diff --git a/src/libs/vtools/dialogs/dialogtoolbox.cpp b/src/libs/vtools/dialogs/dialogtoolbox.cpp index b6f93f5f0..8f9650e80 100644 --- a/src/libs/vtools/dialogs/dialogtoolbox.cpp +++ b/src/libs/vtools/dialogs/dialogtoolbox.cpp @@ -42,6 +42,7 @@ #include "../vgeometry/vcubicbezierpath.h" #include "../vgeometry/vspline.h" #include "../vgeometry/vsplinepath.h" +#include "../qmuparser/qmudef.h" #include #include diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp index bf298de7e..f05d6b1e3 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vabstractspline.cpp @@ -41,9 +41,9 @@ #include #include "../ifc/exception/vexception.h" -#include "../ifc/exception/vexceptionbadid.h" #include "../ifc/xml/vabstractpattern.h" #include "../qmuparser/qmutokenparser.h" +#include "../qmuparser/qmudef.h" #include "../vgeometry/vgobject.h" #include "../vgeometry/vpointf.h" #include "../vgeometry/vspline.h"