From b877c49f61f8b08260c866d36d06e047d5fb3b46 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Wed, 21 Oct 2015 16:17:05 +0300 Subject: [PATCH 1/4] Fixed MSVC build (access the not operator) --HG-- branch : feature --- src/libs/ifc/ifcdef.h | 1 + src/libs/vdxf/dxfdef.h | 1 + src/libs/vlayout/vlayoutdef.h | 2 ++ src/libs/vmisc/def.h | 1 + 4 files changed, 5 insertions(+) diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 4dceb4b48..9f72d92da 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -31,6 +31,7 @@ #include #include "../vmisc/def.h" +#include //for msvc extern const QString CustomMSign; extern const QString CustomIncrSign; diff --git a/src/libs/vdxf/dxfdef.h b/src/libs/vdxf/dxfdef.h index 6d70eada1..6e5da7729 100644 --- a/src/libs/vdxf/dxfdef.h +++ b/src/libs/vdxf/dxfdef.h @@ -30,6 +30,7 @@ #define DXFDEF_H #include +#include //for msvc enum class VarMeasurement : unsigned char { English=0, Metric=1 }; diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index 3c58dbdde..a5e86c87d 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -29,6 +29,8 @@ #ifndef VLAYOUTDEF_H #define VLAYOUTDEF_H +#include //for msvc + enum class EquidistantType : char { OpenEquidistant, CloseEquidistant }; enum class LayoutErrors : char diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 6aca40422..14bc77b8f 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -37,6 +37,7 @@ #endif /* Q_OS_WIN */ #include "debugbreak.h" +#include //for msvc class QComboBox; From 38541c78c9e9c85039524a27231a0be2af56183d Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Wed, 21 Oct 2015 17:13:16 +0300 Subject: [PATCH 2/4] Fixed MSVC build (C2143, missing ';' before 'type') --HG-- branch : feature --- src/libs/vobj/delaunay.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libs/vobj/delaunay.c b/src/libs/vobj/delaunay.c index 37cd77cc4..46c9e040a 100644 --- a/src/libs/vobj/delaunay.c +++ b/src/libs/vobj/delaunay.c @@ -1024,17 +1024,17 @@ delaunay2d_t* delaunay2d_from(del_point2d_t *points, unsigned int num_points) { qsort(del.points, num_points, sizeof(point2d_t*), cmp_points); if( num_points >= 3 ) { - del_divide_and_conquer( &del, 0, num_points - 1 ); + unsigned int fbuff_size = 0; + unsigned int j = 0; + del_divide_and_conquer( &del, 0, num_points - 1 ); del_build_faces( &del ); - unsigned int fbuff_size = 0; for( i = 0; i < del.num_faces; i++ ) fbuff_size += del.faces[i].num_verts + 1; faces = (unsigned int*)malloc(sizeof(unsigned int) * fbuff_size); - unsigned int j = 0; for( i = 0; i < del.num_faces; i++ ) { halfedge_t *curr; From 36f0e1dc441a2f013b589f532d924656b81c2d82 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Thu, 22 Oct 2015 12:28:17 +0300 Subject: [PATCH 3/4] Fixed MSVC build --HG-- branch : feature --- src/libs/vmisc/vabstractapplication.cpp | 56 ++++++++++++++++++++++++ src/libs/vmisc/vabstractapplication.h | 57 +------------------------ src/libs/vpatterndb/vcontainer.h | 3 +- 3 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 5be987414..300319907 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -74,6 +74,62 @@ VAbstractApplication::VAbstractApplication(int &argc, char **argv) VAbstractApplication::~VAbstractApplication() {} +//--------------------------------------------------------------------------------------------------------------------- +MeasurementsType VAbstractApplication::patternType() const +{ + return _patternType; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractApplication::setPatternType(const MeasurementsType &patternType) +{ + _patternType = patternType; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractApplication::setCurrentDocument(VAbstractPattern *doc) +{ + this->doc = doc; +} + +//--------------------------------------------------------------------------------------------------------------------- +VAbstractPattern *VAbstractApplication::getCurrentDocument() const +{ + SCASSERT(doc != nullptr) + return doc; +} + +//--------------------------------------------------------------------------------------------------------------------- +bool VAbstractApplication::getOpeningPattern() const +{ + return openingPattern; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractApplication::setOpeningPattern() +{ + openingPattern = !openingPattern; +} + +//--------------------------------------------------------------------------------------------------------------------- +QWidget *VAbstractApplication::getMainWindow() const +{ + return mainWindow; +} + +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractApplication::setMainWindow(QWidget *value) +{ + SCASSERT(value != nullptr) + mainWindow = value; +} + +//--------------------------------------------------------------------------------------------------------------------- +QUndoStack *VAbstractApplication::getUndoStack() const +{ + return undoStack; +} + //--------------------------------------------------------------------------------------------------------------------- Unit VAbstractApplication::patternUnit() const { diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index 2a1e9361e..a02916d4c 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -36,9 +36,9 @@ #include "def.h" #include "vsettings.h" #include "vlockguard.h" +#include "../vpatterndb/vtranslatevars.h" class VAbstractApplication;// use in define -class VTranslateVars; class VAbstractPattern; class VMainGraphicsView; class QUndoStack; @@ -137,17 +137,6 @@ private: void ClearTranslation(); }; -//--------------------------------------------------------------------------------------------------------------------- -inline MeasurementsType VAbstractApplication::patternType() const -{ - return _patternType; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline void VAbstractApplication::setPatternType(const MeasurementsType &patternType) -{ - _patternType = patternType; -} //--------------------------------------------------------------------------------------------------------------------- template @@ -158,48 +147,4 @@ inline QString VAbstractApplication::LocaleToString(const T &value) return loc.toString(value); } -//--------------------------------------------------------------------------------------------------------------------- -inline void VAbstractApplication::setCurrentDocument(VAbstractPattern *doc) -{ - this->doc = doc; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline VAbstractPattern *VAbstractApplication::getCurrentDocument() const -{ - SCASSERT(doc != nullptr) - return doc; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline bool VAbstractApplication::getOpeningPattern() const -{ - return openingPattern; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline void VAbstractApplication::setOpeningPattern() -{ - openingPattern = !openingPattern; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline QWidget *VAbstractApplication::getMainWindow() const -{ - return mainWindow; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline void VAbstractApplication::setMainWindow(QWidget *value) -{ - SCASSERT(value != nullptr) - mainWindow = value; -} - -//--------------------------------------------------------------------------------------------------------------------- -inline QUndoStack *VAbstractApplication::getUndoStack() const -{ - return undoStack; -} - #endif // VABSTRACTAPPLICATION_H diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index ec13d2dfa..21becd502 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -34,14 +34,13 @@ #include "../vgeometry/vgobject.h" #include "../ifc/exception/vexceptionbadid.h" #include "../vgeometry/vabstractcurve.h" +#include "vtranslatevars.h" #include #include #include #include -class VTranslateVars; - #if defined(Q_CC_INTEL) #pragma warning( push ) #pragma warning( disable: 2021 ) From dd9fecb89f3374953e14a72539c0f4bf7442467f Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Thu, 22 Oct 2015 15:16:15 +0300 Subject: [PATCH 4/4] Added Q_CC_MSVC --HG-- branch : feature --- src/libs/ifc/ifcdef.h | 1 - src/libs/vdxf/dxfdef.h | 5 ++++- src/libs/vlayout/vlayoutdef.h | 4 +++- src/libs/vmisc/def.h | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 9f72d92da..4dceb4b48 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -31,7 +31,6 @@ #include #include "../vmisc/def.h" -#include //for msvc extern const QString CustomMSign; extern const QString CustomIncrSign; diff --git a/src/libs/vdxf/dxfdef.h b/src/libs/vdxf/dxfdef.h index 6e5da7729..234db98d8 100644 --- a/src/libs/vdxf/dxfdef.h +++ b/src/libs/vdxf/dxfdef.h @@ -30,7 +30,10 @@ #define DXFDEF_H #include -#include //for msvc + +#ifdef Q_CC_MSVC + #include +#endif /* Q_CC_MSVC */ enum class VarMeasurement : unsigned char { English=0, Metric=1 }; diff --git a/src/libs/vlayout/vlayoutdef.h b/src/libs/vlayout/vlayoutdef.h index a5e86c87d..19fbcc297 100644 --- a/src/libs/vlayout/vlayoutdef.h +++ b/src/libs/vlayout/vlayoutdef.h @@ -29,7 +29,9 @@ #ifndef VLAYOUTDEF_H #define VLAYOUTDEF_H -#include //for msvc +#ifdef Q_CC_MSVC + #include +#endif /* Q_CC_MSVC */ enum class EquidistantType : char { OpenEquidistant, CloseEquidistant }; diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 14bc77b8f..585a0fea7 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -37,7 +37,10 @@ #endif /* Q_OS_WIN */ #include "debugbreak.h" -#include //for msvc + +#ifdef Q_CC_MSVC + #include +#endif /* Q_CC_MSVC */ class QComboBox;