From c65f554a8d6d7498af9544befaa6ba6713772975 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 2 Oct 2015 08:37:31 +0300 Subject: [PATCH] Fixed GCC warnings. --HG-- branch : develop --- src/libs/vdxf/dxflib/dl_creationinterface.h | 2 +- src/libs/vdxf/dxflib/dl_dxf.h | 2 +- src/libs/vdxf/dxflib/dl_entities.h | 13 +++-- src/libs/vdxf/dxflib/dl_exception.h | 58 --------------------- src/libs/vdxf/dxflib/dl_writer_ascii.cpp | 8 --- src/libs/vdxf/vdxf.pri | 51 +++++++++--------- src/libs/vdxf/vdxfengine.cpp | 10 +++- 7 files changed, 43 insertions(+), 101 deletions(-) delete mode 100644 src/libs/vdxf/dxflib/dl_exception.h diff --git a/src/libs/vdxf/dxflib/dl_creationinterface.h b/src/libs/vdxf/dxflib/dl_creationinterface.h index 7683d76c6..317986063 100644 --- a/src/libs/vdxf/dxflib/dl_creationinterface.h +++ b/src/libs/vdxf/dxflib/dl_creationinterface.h @@ -365,7 +365,7 @@ public: } private: - Q_DISABLE_COPY(DL_CreationInterface); + Q_DISABLE_COPY(DL_CreationInterface) protected: DL_Extrusion *extrusion; diff --git a/src/libs/vdxf/dxflib/dl_dxf.h b/src/libs/vdxf/dxflib/dl_dxf.h index 80dba39ef..1cb77c5ea 100644 --- a/src/libs/vdxf/dxflib/dl_dxf.h +++ b/src/libs/vdxf/dxflib/dl_dxf.h @@ -457,7 +457,7 @@ public: } private: - Q_DISABLE_COPY(DL_Dxf); + Q_DISABLE_COPY(DL_Dxf) DL_Codes::version version; std::string polylineLayer; diff --git a/src/libs/vdxf/dxflib/dl_entities.h b/src/libs/vdxf/dxflib/dl_entities.h index e9e871be0..3c99e5177 100644 --- a/src/libs/vdxf/dxflib/dl_entities.h +++ b/src/libs/vdxf/dxflib/dl_entities.h @@ -30,6 +30,7 @@ #include #include +#include /** * Layer Data. @@ -65,7 +66,7 @@ struct DXFLIB_EXPORT DL_BlockData DL_BlockData(const std::string& bName, int bFlags, double bbpx, double bbpy, double bbpz) : name(bName), flags(bFlags), bpx(bbpx), bpy(bbpy), bpz(bbpz) - { + { } /** Block name. */ @@ -125,7 +126,7 @@ struct DXFLIB_EXPORT DL_LinetypeData double* pattern; private: - Q_DISABLE_COPY(DL_LinetypeData); + Q_DISABLE_COPY(DL_LinetypeData) }; @@ -331,7 +332,7 @@ struct DXFLIB_EXPORT DL_ArcData double aRadius, double aAngle1, double aAngle2) : cx(acx), cy(acy), cz(acz), radius(aRadius), angle1(aAngle1), angle2(aAngle2) - { + { } /*! X Coordinate of center point. */ @@ -839,6 +840,8 @@ struct DXFLIB_EXPORT DL_TextData { } + virtual ~DL_TextData(){} + /*! X Coordinate of insertion point. */ double ipx; /*! Y Coordinate of insertion point. */ @@ -1043,7 +1046,7 @@ struct DXFLIB_EXPORT DL_DimAlignedData double depx2, double depy2, double depz2) : epx1(depx1), epy1(depy1), epz1(depz1), epx2(depx2), epy2(depy2), epz2(depz2) - { + { } /*! X Coordinate of Extension point 1. */ @@ -1704,7 +1707,7 @@ struct DXFLIB_EXPORT DL_ImageDefData DL_ImageDefData(const std::string& iref, const std::string& ifile) : ref(iref), file(ifile) - { + { } /*! Reference to the image file diff --git a/src/libs/vdxf/dxflib/dl_exception.h b/src/libs/vdxf/dxflib/dl_exception.h deleted file mode 100644 index 506e194c8..000000000 --- a/src/libs/vdxf/dxflib/dl_exception.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** Copyright (C) 2001-2013 RibbonSoft, GmbH. All rights reserved. -** Copyright (C) 2001 Robert J. Campbell Jr. -** -** This file is part of the dxflib project. -** -** This file is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** Licensees holding valid dxflib Professional Edition licenses may use -** this file in accordance with the dxflib Commercial License -** Agreement provided with the Software. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.ribbonsoft.com for further details. -** -** Contact info@ribbonsoft.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#ifndef DL_EXCEPTION_H -#define DL_EXCEPTION_H - -#include "dl_global.h" - -#if defined(Q_CC_MSVC) - #if (_MSC_VER > 1000) - #pragma once - #endif // _MSC_VER > 1000 -#endif // Q_CC_MSVC - -/** - * Used for exception handling. - */ -class DXFLIB_EXPORT DL_Exception {} -; - -/** - * Used for exception handling. - */ -class DXFLIB_EXPORT DL_NullStrExc : public DL_Exception {} -; - -/** - * Used for exception handling. - */ -class DXFLIB_EXPORT DL_GroupCodeExc : public DL_Exception -{ - DL_GroupCodeExc(int gc=0) : groupCode(gc) {} - int groupCode; -}; -#endif - diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp index f52596e80..147d8b9de 100644 --- a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp +++ b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp @@ -33,8 +33,6 @@ #include #include "dl_writer_ascii.h" -#include "dl_exception.h" - /** * Closes the output file. @@ -133,12 +131,6 @@ void DL_WriterA::dxfHex(int gc, int value) const */ void DL_WriterA::dxfString(int gc, const char* value) const { - if (value==NULL) - { -#ifndef __GCC2x__ - //throw DL_NullStrExc(); -#endif - } m_ofile << (gc<10 ? " " : (gc<100 ? " " : "")) << gc << "\n" << value << "\n"; } diff --git a/src/libs/vdxf/vdxf.pri b/src/libs/vdxf/vdxf.pri index a92d4303a..fcec10ec2 100644 --- a/src/libs/vdxf/vdxf.pri +++ b/src/libs/vdxf/vdxf.pri @@ -1,26 +1,25 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -SOURCES += \ - $$PWD/stable.cpp \ - $$PWD/dxflib/dl_dxf.cpp \ - $$PWD/dxflib/dl_writer_ascii.cpp \ - $$PWD/vdxfengine.cpp \ - $$PWD/vdxfpaintdevice.cpp - -HEADERS += \ - $$PWD/stable.h \ - $$PWD/dxflib/dl_attributes.h \ - $$PWD/dxflib/dl_codes.h \ - $$PWD/dxflib/dl_creationadapter.h \ - $$PWD/dxflib/dl_creationinterface.h \ - $$PWD/dxflib/dl_dxf.h \ - $$PWD/dxflib/dl_entities.h \ - $$PWD/dxflib/dl_exception.h \ - $$PWD/dxflib/dl_extrusion.h \ - $$PWD/dxflib/dl_global.h \ - $$PWD/dxflib/dl_writer.h \ - $$PWD/dxflib/dl_writer_ascii.h \ - $$PWD/vdxfengine.h \ - $$PWD/vdxfpaintdevice.h \ - $$PWD/dxfdef.h +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/stable.cpp \ + $$PWD/dxflib/dl_dxf.cpp \ + $$PWD/dxflib/dl_writer_ascii.cpp \ + $$PWD/vdxfengine.cpp \ + $$PWD/vdxfpaintdevice.cpp + +HEADERS += \ + $$PWD/stable.h \ + $$PWD/dxflib/dl_attributes.h \ + $$PWD/dxflib/dl_codes.h \ + $$PWD/dxflib/dl_creationadapter.h \ + $$PWD/dxflib/dl_creationinterface.h \ + $$PWD/dxflib/dl_dxf.h \ + $$PWD/dxflib/dl_entities.h \ + $$PWD/dxflib/dl_extrusion.h \ + $$PWD/dxflib/dl_global.h \ + $$PWD/dxflib/dl_writer.h \ + $$PWD/dxflib/dl_writer_ascii.h \ + $$PWD/vdxfengine.h \ + $$PWD/vdxfpaintdevice.h \ + $$PWD/dxfdef.h diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index e4701a115..a7de339f0 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -54,8 +54,14 @@ static inline QPaintEngine::PaintEngineFeatures svgEngineFeatures() //--------------------------------------------------------------------------------------------------------------------- VDxfEngine::VDxfEngine() :QPaintEngine(svgEngineFeatures()), - size(), resolution(PrintDPI), fileName(), matrix(), dxf(nullptr), dw(nullptr), - varMeasurement(VarMeasurement::Metric), varInsunits(VarInsunits::Centimeters) + size(), + resolution(static_cast(PrintDPI)), + fileName(), + matrix(), + dxf(nullptr), + dw(nullptr), + varMeasurement(VarMeasurement::Metric), + varInsunits(VarInsunits::Centimeters) { }