From 1cf4e97b7ddf3bd3cf8329685162fd03ae08a965 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 10 May 2017 14:58:17 +0300 Subject: [PATCH] Clang warnings. --- src/libs/vdxf/dxflib/dl_writer_ascii.h | 8 +++++--- src/libs/vdxf/dxflib/strlcpy.h | 7 +++++++ src/libs/vwidgets/fancytabbar/fancytabbar.cpp | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.h b/src/libs/vdxf/dxflib/dl_writer_ascii.h index 9d7084e9f..9d1f2d9b1 100644 --- a/src/libs/vdxf/dxflib/dl_writer_ascii.h +++ b/src/libs/vdxf/dxflib/dl_writer_ascii.h @@ -48,15 +48,17 @@ * Implements functions defined in DL_Writer for writing low * level DXF constructs to an ASCII format DXF file. * - * @para fname File name of the file to be created. - * @para version DXF version. Defaults to DL_VERSION_2002. - * * @todo What if \c fname is NULL? Or \c fname can't be opened for * another reason? */ class DXFLIB_EXPORT DL_WriterA : public DL_Writer { public: + /** + * @brief DL_WriterA contructor + * @param fname File name of the file to be created. + * @param version DXF version. Defaults to DL_VERSION_2002. + */ explicit DL_WriterA(const char* fname, DL_Codes::version version=DL_VERSION_2000) : DL_Writer(version), m_ofile(fname) {} virtual ~DL_WriterA() {} diff --git a/src/libs/vdxf/dxflib/strlcpy.h b/src/libs/vdxf/dxflib/strlcpy.h index f56914445..95bf9e9d1 100644 --- a/src/libs/vdxf/dxflib/strlcpy.h +++ b/src/libs/vdxf/dxflib/strlcpy.h @@ -62,6 +62,11 @@ #include #include +#include "../vmisc/diagnostic.h" + +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wsign-conversion") + /* * Copy src to string dst of size siz. At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). @@ -139,5 +144,7 @@ inline size_t strlcat(char *dst, const char *src, size_t siz) return(dlen + (s - src)); /* count does not include NUL */ } +QT_WARNING_POP + #endif /* ! __*BSD__ */ #endif // VALENTINA_STRLCPY_H diff --git a/src/libs/vwidgets/fancytabbar/fancytabbar.cpp b/src/libs/vwidgets/fancytabbar/fancytabbar.cpp index 871daaace..38927fb6d 100644 --- a/src/libs/vwidgets/fancytabbar/fancytabbar.cpp +++ b/src/libs/vwidgets/fancytabbar/fancytabbar.cpp @@ -162,7 +162,7 @@ QPoint FancyTabBar::GetCorner(const QRect& rect, const Corner corner) const break; } - Q_ASSERT("that's impossible!"); + qFatal("that's impossible!"); return QPoint(); } @@ -193,7 +193,7 @@ QRect FancyTabBar::AdjustRect(const QRect& rect, const qint8 offsetOutside, cons break; } - Q_ASSERT("that's impossible!"); + qFatal("that's impossible!"); return QRect(); } @@ -216,7 +216,7 @@ QPoint FancyTabBar::AdjustPoint(const QPoint& point, const qint8 offsetInsideOut break; } - Q_ASSERT("that's impossible!"); + qFatal("that's impossible!"); return QPoint(); }