diff --git a/Valentina.pri b/Valentina.pri index 5dc56db0c..eb3a98d03 100644 --- a/Valentina.pri +++ b/Valentina.pri @@ -39,3 +39,414 @@ defineTest(copyToDestdir) { export(QMAKE_POST_LINK) } + + +GCC_CXXFLAGS += \ + -O0 \ + -Wall \ + -Wextra \ + -pedantic \ + -Weffc++ \ + -Woverloaded-virtual \ + -Wctor-dtor-privacy \ + -Wnon-virtual-dtor \ + -Wold-style-cast \ + -Wconversion \ + -Winit-self \ + -Wstack-protector \ + -Wunreachable-code \ + -Wcast-align \ + -Wcast-qual \ + -Wdisabled-optimization \ + -Wfloat-equal \ + -Wformat=2 \ + -Wimport \ + -Wmissing-include-dirs \ + -Wpacked \ + -Wredundant-decls \ + -Winline \ + -Winvalid-pch \ + -Wunsafe-loop-optimizations \ + -Wlong-long \ + -Wmissing-format-attribute \ + -Wswitch-default \ + -Wuninitialized \ + -Wvariadic-macros \ + -Wlogical-op \ + -Wnoexcept \ + -Wmissing-noreturn \ + -Wpointer-arith \ + -Wstrict-null-sentinel \ + -Wstrict-overflow=5 \ + -Wundef \ + -Wno-unused \ + -gdwarf-3 \ + -ftrapv + +CLANG_CXXFLAGS += \ + -O0 \ + -fparse-all-comments \ + -Wabi \ + -Wabstract-final-class \ + -Wabstract-vbase-init \ + -Waddress \ + -Waddress-of-array-temporary \ + -Waddress-of-temporary \ + -Waggregate-return \ + -Wall \ + -Wambiguous-macro \ + -Wambiguous-member-template \ + -Wanalyzer-incompatible-plugin \ + -Wanonymous-pack-parens \ + -Warc \ + -Warc-abi \ + -Warc-bridge-casts-disallowed-in-nonarc \ + -Warc-maybe-repeated-use-of-weak \ + -Warc-non-pod-memaccess \ + -Warc-performSelector-leaks \ + -Warc-repeated-use-of-weak \ + -Warc-retain-cycles \ + -Warc-unsafe-retained-assign \ + -Warray-bounds \ + -Warray-bounds-pointer-arithmetic \ + -Wasm \ + -Wasm-operand-widths \ + -Wassign-enum \ + -Watomic-properties \ + -Watomic-property-with-user-defined-accessor \ + -Wattributes \ + -Wauto-import \ + -Wauto-storage-class \ + -Wauto-var-id \ + -Wavailability \ + -Wbackslash-newline-escape \ + -Wbad-array-new-length \ + -Wbad-function-cast \ + -Wbind-to-temporary-copy \ + -Wbitfield-constant-conversion \ + -Wbitwise-op-parentheses \ + -Wbool-conversion \ + -Wbool-conversions \ + -Wbuiltin-macro-redefined \ + -Wbuiltin-requires-header \ + -Wc++-compat \ + -Wc++0x-compat \ + -Wc++0x-extensions \ + -Wc++0x-narrowing \ + -Wc++11-compat \ + -Wc++11-compat-pedantic \ + -Wc++11-compat-reserved-user-defined-literal \ + -Wc++11-extensions \ + -Wc++11-extra-semi \ + -Wc++11-long-long \ + -Wc++11-narrowing \ + -Wc11-extensions \ + -Wcast-align \ + -Wcast-of-sel-type \ + -Wcast-qual \ + -WCFString-literal \ + -Wchar-align \ + -Wchar-subscripts \ + -Wcomment \ + -Wcomments \ + -Wcompare-distinct-pointer-types \ + -Wcomplex-component-init \ + -Wconditional-type-mismatch \ + -Wconditional-uninitialized \ + -Wconfig-macros \ + -Wconstant-conversion \ + -Wconstant-logical-operand \ + -Wconstexpr-not-const \ + -Wconversion \ + -Wconversion-null \ + -Wno-covered-switch-default \ + -Wctor-dtor-privacy \ + -Wcustom-atomic-properties \ + -Wdangling-else \ + -Wdangling-field \ + -Wdangling-initializer-list \ + -Wdeclaration-after-statement \ + -Wdelegating-ctor-cycles \ + -Wdelete-incomplete \ + -Wdelete-non-virtual-dtor \ + -Wdeprecated \ + -Wdeprecated-declarations \ + -Wdeprecated-implementations \ + -Wdeprecated-objc-isa-usage \ + -Wdeprecated-objc-pointer-introspection \ + -Wdeprecated-objc-pointer-introspection-performSelector \ + -Wdeprecated-register \ + -Wdeprecated-writable-strings \ + -Wdirect-ivar-access \ + -Wdisabled-macro-expansion \ + -Wdisabled-optimization \ + -Wdiscard-qual \ + -Wdistributed-object-modifiers \ + -Wdiv-by-zero \ + -Wdivision-by-zero \ + -Wdocumentation \ + -Wdocumentation-deprecated-sync \ + -Wdocumentation-html \ + -Wdollar-in-identifier-extension \ + -Wduplicate-decl-specifier \ + -Wduplicate-enum \ + -Wduplicate-method-arg \ + -Wduplicate-method-match \ + -Wdynamic-class-memaccess \ + -Weffc++ \ + -Wembedded-directive \ + -Wempty-body \ + -Wempty-translation-unit \ + -Wendif-labels \ + -Wenum-compare \ + -Wenum-conversion \ + -Wexplicit-ownership-type \ + -Wextended-offsetof \ + -Wextern-initializer \ + -Wextra \ + -Wextra-semi \ + -Wextra-tokens \ + -Wflexible-array-extensions \ + -Wfloat-equal \ + -Wformat \ + -Wformat-extra-args \ + -Wformat-invalid-specifier \ + -Wformat-non-iso \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-y2k \ + -Wformat-zero-length \ + -Wformat=2 \ + -Wfour-char-constants \ + -Wgcc-compat \ + -Wgnu \ + -Wgnu-array-member-paren-init \ + -Wgnu-designator \ + -Wgnu-static-float-init \ + -Wheader-guard \ + -Wheader-hygiene \ + -Widiomatic-parentheses \ + -Wignored-attributes \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-atomic-properties \ + -Wimplicit-conversion-floating-point-to-bool \ + -Wimplicit-exception-spec-mismatch \ + -Wimplicit-fallthrough \ + -Wimplicit-fallthrough-per-function \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Wimplicit-retain-self \ + -Wimport \ + -Wimport-preprocessor-directive-pedantic \ + -Wincompatible-library-redeclaration \ + -Wincompatible-pointer-types \ + -Wincompatible-pointer-types-discards-qualifiers \ + -Wincomplete-implementation \ + -Wincomplete-module \ + -Wincomplete-umbrella \ + -Winherited-variadic-ctor \ + -Winit-self \ + -Winitializer-overrides \ + -Winline \ + -Wint-conversion \ + -Wint-conversions \ + -Wint-to-pointer-cast \ + -Wint-to-void-pointer-cast \ + -Winteger-overflow \ + -Winvalid-constexpr \ + -Winvalid-iboutlet \ + -Winvalid-noreturn \ + -Winvalid-offsetof \ + -Winvalid-pch \ + -Winvalid-pp-token \ + -Winvalid-source-encoding \ + -Winvalid-token-paste \ + -Wknr-promoted-parameter \ + -Wlanguage-extension-token \ + -Wlarge-by-value-copy \ + -Wliteral-conversion \ + -Wliteral-range \ + -Wlocal-type-template-args \ + -Wlogical-not-parentheses \ + -Wlogical-op-parentheses \ + -Wlong-long \ + -Wloop-analysis \ + -Wmain \ + -Wmain-return-type \ + -Wmalformed-warning-check \ + -Wmethod-signatures \ + -Wmicrosoft \ + -Wmicrosoft-exists \ + -Wmismatched-parameter-types \ + -Wmismatched-return-types \ + -Wmismatched-tags \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-format-attribute \ + -Wmissing-include-dirs \ + -Wmissing-method-return-type \ + -Wmissing-noreturn \ + -Wmissing-prototypes \ + -Wmissing-selector-name \ + -Wmissing-sysroot \ + -Wmissing-variable-declarations \ + -Wmodule-conflict \ + -Wmost \ + -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnewline-eof \ + -Wnon-gcc \ + -Wnon-literal-null-conversion \ + -Wnon-pod-varargs \ + -Wnon-virtual-dtor \ + -Wnonnull \ + -Wnonportable-cfstrings \ + -WNSObject-attribute \ + -Wnull-arithmetic \ + -Wnull-character \ + -Wnull-conversion \ + -Wnull-dereference \ + -Wodr \ + -Wold-style-cast \ + -Wold-style-definition \ + -Wout-of-line-declaration \ + -Wover-aligned \ + -Woverflow \ + -Woverlength-strings \ + -Woverloaded-shift-op-parentheses \ + -Woverloaded-virtual \ + -Woverriding-method-mismatch \ + -Wpacked \ + -Wparentheses \ + -Wparentheses-equality \ + -Wpedantic \ + -Wpointer-arith \ + -Wpointer-sign \ + -Wpointer-to-int-cast \ + -Wpointer-type-mismatch \ + -Wpredefined-identifier-outside-function \ + -Wprivate-extern \ + -Wprotocol \ + -Wprotocol-property-synthesis-ambiguity \ + -Wreadonly-iboutlet-property \ + -Wreceiver-expr \ + -Wreceiver-forward-class \ + -Wreceiver-is-weak \ + -Wredundant-decls \ + -Wreinterpret-base-class \ + -Wreorder \ + -Wrequires-super-attribute \ + -Wreserved-user-defined-literal \ + -Wreturn-stack-address \ + -Wreturn-type \ + -Wreturn-type-c-linkage \ + -Wsection \ + -Wselector \ + -Wselector-type-mismatch \ + -Wself-assign \ + -Wself-assign-field \ + -Wsemicolon-before-method-body \ + -Wsentinel \ + -Wsequence-point \ + -Wserialized-diagnostics \ + -Wshadow-ivar \ + -Wshift-count-negative \ + -Wshift-count-overflow \ + -Wshift-op-parentheses \ + -Wshift-overflow \ + -Wshift-sign-overflow \ + -Wshorten-64-to-32 \ + -Wsign-compare \ + -Wsign-conversion \ + -Wsign-promo \ + -Wsizeof-array-argument \ + -Wsizeof-array-decay \ + -Wsizeof-pointer-memaccess \ + -Wsometimes-uninitialized \ + -Wsource-uses-openmp \ + -Wstack-protector \ + -Wstatic-float-init \ + -Wstatic-in-inline \ + -Wstatic-local-in-inline \ + -Wstatic-self-init \ + -Wstrict-aliasing \ + -Wstrict-aliasing=0 \ + -Wstrict-aliasing=1 \ + -Wstrict-aliasing=2 \ + -Wstrict-overflow \ + -Wstrict-overflow=0 \ + -Wstrict-overflow=1 \ + -Wstrict-overflow=2 \ + -Wstrict-overflow=3 \ + -Wstrict-overflow=4 \ + -Wstrict-overflow=5 \ + -Wstrict-prototypes \ + -Wstrict-selector-match \ + -Wstring-compare \ + -Wstring-conversion \ + -Wstring-plus-int \ + -Wstrlcpy-strlcat-size \ + -Wstrncat-size \ + -Wsuper-class-method-mismatch \ + -Wswitch \ + -Wswitch-default \ + -Wsynth \ + -Wtautological-compare \ + -Wtautological-constant-out-of-range-compare \ + -Wtentative-definition-incomplete-type \ + -Wthread-safety \ + -Wthread-safety-analysis \ + -Wthread-safety-attributes \ + -Wthread-safety-beta \ + -Wthread-safety-precise \ + -Wtrigraphs \ + -Wtype-limits \ + -Wtype-safety \ + -Wtypedef-redefinition \ + -Wtypename-missing \ + -Wundeclared-selector \ + -Wundef \ + -Wundefined-inline \ + -Wundefined-internal \ + -Wundefined-reinterpret-cast \ + -Wunicode \ + -Wunicode-whitespace \ + -Wuninitialized \ + -Wunknown-warning-option \ + -Wunnamed-type-template-args \ + -Wunneeded-internal-declaration \ + -Wunneeded-member-function \ + -Wunsequenced \ + -Wunsupported-visibility \ + -Wunused \ + -Wunused-argument \ + -Wunused-command-line-argument \ + -Wunused-comparison \ + -Wunused-exception-parameter \ + -Wunused-function \ + -Wunused-label \ + -Wunused-member-function \ + -Wunused-parameter \ + -Wunused-private-field \ + -Wunused-result \ + -Wunused-sanitize-argument \ + -Wunused-value \ + -Wunused-variable \ + -Wunused-volatile-lvalue \ + -Wuser-defined-literals \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-conversion \ + -Wvector-conversions \ + -Wvexing-parse \ + -Wvisibility \ + -Wvla \ + -Wvla-extension \ + -Wvolatile-register-var \ + -Wweak-template-vtables \ + -Wweak-vtables \ + -Wwrite-strings \ + -Wzero-length-array diff --git a/src/app/app.pro b/src/app/app.pro index 1990680eb..46934156a 100644 --- a/src/app/app.pro +++ b/src/app/app.pro @@ -117,46 +117,7 @@ CONFIG(debug, debug|release){ -isystem "$${OUT_PWD}/$${UI_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - -O0 \ - -Wall \ - -Wextra \ - -pedantic \ - -Weffc++ \ - -Woverloaded-virtual \ - -Wctor-dtor-privacy \ - -Wnon-virtual-dtor \ - -Wold-style-cast \ - -Wconversion \ - -Winit-self \ - -Wstack-protector \ - -Wunreachable-code \ - -Wcast-align \ - -Wcast-qual \ - -Wdisabled-optimization \ - -Wfloat-equal \ - -Wformat=2 \ - -Wimport \ - -Wmissing-include-dirs \ - -Wpacked \ - -Wredundant-decls \ - -Winline \ - -Winvalid-pch \ - -Wunsafe-loop-optimizations \ - -Wlong-long \ - -Wmissing-format-attribute \ - -Wswitch-default \ - -Wuninitialized \ - -Wvariadic-macros \ - -Wlogical-op \ - -Wnoexcept \ - -Wmissing-noreturn \ - -Wpointer-arith \ - -Wstrict-null-sentinel \ - -Wstrict-overflow=5 \ - -Wundef \ - -Wno-unused \ - -gdwarf-3 \ - -ftrapv + $$GCC_CXXFLAGS } #Turn on Clang warnings clang*{ @@ -170,373 +131,7 @@ CONFIG(debug, debug|release){ -isystem "$${OUT_PWD}/$${UI_DIR}" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \ -isystem "$${OUT_PWD}/$${RCC_DIR}" \ - -O0 \ - -fparse-all-comments \ - -Wabi \ - -Wabstract-final-class \ - -Wabstract-vbase-init \ - -Waddress \ - -Waddress-of-array-temporary \ - -Waddress-of-temporary \ - -Waggregate-return \ - -Wall \ - -Wambiguous-macro \ - -Wambiguous-member-template \ - -Wanalyzer-incompatible-plugin \ - -Wanonymous-pack-parens \ - -Warc \ - -Warc-abi \ - -Warc-bridge-casts-disallowed-in-nonarc \ - -Warc-maybe-repeated-use-of-weak \ - -Warc-non-pod-memaccess \ - -Warc-performSelector-leaks \ - -Warc-repeated-use-of-weak \ - -Warc-retain-cycles \ - -Warc-unsafe-retained-assign \ - -Warray-bounds \ - -Warray-bounds-pointer-arithmetic \ - -Wasm \ - -Wasm-operand-widths \ - -Wassign-enum \ - -Watomic-properties \ - -Watomic-property-with-user-defined-accessor \ - -Wattributes \ - -Wauto-import \ - -Wauto-storage-class \ - -Wauto-var-id \ - -Wavailability \ - -Wbackslash-newline-escape \ - -Wbad-array-new-length \ - -Wbad-function-cast \ - -Wbind-to-temporary-copy \ - -Wbitfield-constant-conversion \ - -Wbitwise-op-parentheses \ - -Wbool-conversion \ - -Wbool-conversions \ - -Wbuiltin-macro-redefined \ - -Wbuiltin-requires-header \ - -Wc++-compat \ - -Wc++0x-compat \ - -Wc++0x-extensions \ - -Wc++0x-narrowing \ - -Wc++11-compat \ - -Wc++11-compat-pedantic \ - -Wc++11-compat-reserved-user-defined-literal \ - -Wc++11-extensions \ - -Wc++11-extra-semi \ - -Wc++11-long-long \ - -Wc++11-narrowing \ - -Wc11-extensions \ - -Wcast-align \ - -Wcast-of-sel-type \ - -Wcast-qual \ - -WCFString-literal \ - -Wchar-align \ - -Wchar-subscripts \ - -Wcomment \ - -Wcomments \ - -Wcompare-distinct-pointer-types \ - -Wcomplex-component-init \ - -Wconditional-type-mismatch \ - -Wconditional-uninitialized \ - -Wconfig-macros \ - -Wconstant-conversion \ - -Wconstant-logical-operand \ - -Wconstexpr-not-const \ - -Wconversion \ - -Wconversion-null \ - -Wno-covered-switch-default \ - -Wctor-dtor-privacy \ - -Wcustom-atomic-properties \ - -Wdangling-else \ - -Wdangling-field \ - -Wdangling-initializer-list \ - -Wdeclaration-after-statement \ - -Wdelegating-ctor-cycles \ - -Wdelete-incomplete \ - -Wdelete-non-virtual-dtor \ - -Wdeprecated \ - -Wdeprecated-declarations \ - -Wdeprecated-implementations \ - -Wdeprecated-objc-isa-usage \ - -Wdeprecated-objc-pointer-introspection \ - -Wdeprecated-objc-pointer-introspection-performSelector \ - -Wdeprecated-register \ - -Wdeprecated-writable-strings \ - -Wdirect-ivar-access \ - -Wdisabled-macro-expansion \ - -Wdisabled-optimization \ - -Wdiscard-qual \ - -Wdistributed-object-modifiers \ - -Wdiv-by-zero \ - -Wdivision-by-zero \ - -Wdocumentation \ - -Wdocumentation-deprecated-sync \ - -Wdocumentation-html \ - -Wdollar-in-identifier-extension \ - -Wduplicate-decl-specifier \ - -Wduplicate-enum \ - -Wduplicate-method-arg \ - -Wduplicate-method-match \ - -Wdynamic-class-memaccess \ - -Weffc++ \ - -Wembedded-directive \ - -Wempty-body \ - -Wempty-translation-unit \ - -Wendif-labels \ - -Wenum-compare \ - -Wenum-conversion \ - -Wexplicit-ownership-type \ - -Wextended-offsetof \ - -Wextern-initializer \ - -Wextra \ - -Wextra-semi \ - -Wextra-tokens \ - -Wflexible-array-extensions \ - -Wfloat-equal \ - -Wformat \ - -Wformat-extra-args \ - -Wformat-invalid-specifier \ - -Wformat-non-iso \ - -Wformat-nonliteral \ - -Wformat-security \ - -Wformat-y2k \ - -Wformat-zero-length \ - -Wformat=2 \ - -Wfour-char-constants \ - -Wgcc-compat \ - -Wgnu \ - -Wgnu-array-member-paren-init \ - -Wgnu-designator \ - -Wgnu-static-float-init \ - -Wheader-guard \ - -Wheader-hygiene \ - -Widiomatic-parentheses \ - -Wignored-attributes \ - -Wignored-qualifiers \ - -Wimplicit \ - -Wimplicit-atomic-properties \ - -Wimplicit-conversion-floating-point-to-bool \ - -Wimplicit-exception-spec-mismatch \ - -Wimplicit-fallthrough \ - -Wimplicit-fallthrough-per-function \ - -Wimplicit-function-declaration \ - -Wimplicit-int \ - -Wimplicit-retain-self \ - -Wimport \ - -Wimport-preprocessor-directive-pedantic \ - -Wincompatible-library-redeclaration \ - -Wincompatible-pointer-types \ - -Wincompatible-pointer-types-discards-qualifiers \ - -Wincomplete-implementation \ - -Wincomplete-module \ - -Wincomplete-umbrella \ - -Winherited-variadic-ctor \ - -Winit-self \ - -Winitializer-overrides \ - -Winline \ - -Wint-conversion \ - -Wint-conversions \ - -Wint-to-pointer-cast \ - -Wint-to-void-pointer-cast \ - -Winteger-overflow \ - -Winvalid-constexpr \ - -Winvalid-iboutlet \ - -Winvalid-noreturn \ - -Winvalid-offsetof \ - -Winvalid-pch \ - -Winvalid-pp-token \ - -Winvalid-source-encoding \ - -Winvalid-token-paste \ - -Wknr-promoted-parameter \ - -Wlanguage-extension-token \ - -Wlarge-by-value-copy \ - -Wliteral-conversion \ - -Wliteral-range \ - -Wlocal-type-template-args \ - -Wlogical-not-parentheses \ - -Wlogical-op-parentheses \ - -Wlong-long \ - -Wloop-analysis \ - -Wmain \ - -Wmain-return-type \ - -Wmalformed-warning-check \ - -Wmethod-signatures \ - -Wmicrosoft \ - -Wmicrosoft-exists \ - -Wmismatched-parameter-types \ - -Wmismatched-return-types \ - -Wmismatched-tags \ - -Wmissing-braces \ - -Wmissing-declarations \ - -Wmissing-field-initializers \ - -Wmissing-format-attribute \ - -Wmissing-include-dirs \ - -Wmissing-method-return-type \ - -Wmissing-noreturn \ - -Wmissing-prototypes \ - -Wmissing-selector-name \ - -Wmissing-sysroot \ - -Wmissing-variable-declarations \ - -Wmodule-conflict \ - -Wmost \ - -Wmultichar \ - -Wnarrowing \ - -Wnested-externs \ - -Wnewline-eof \ - -Wnon-gcc \ - -Wnon-literal-null-conversion \ - -Wnon-pod-varargs \ - -Wnon-virtual-dtor \ - -Wnonnull \ - -Wnonportable-cfstrings \ - -WNSObject-attribute \ - -Wnull-arithmetic \ - -Wnull-character \ - -Wnull-conversion \ - -Wnull-dereference \ - -Wodr \ - -Wold-style-cast \ - -Wold-style-definition \ - -Wout-of-line-declaration \ - -Wover-aligned \ - -Woverflow \ - -Woverlength-strings \ - -Woverloaded-shift-op-parentheses \ - -Woverloaded-virtual \ - -Woverriding-method-mismatch \ - -Wpacked \ - -Wparentheses \ - -Wparentheses-equality \ - -Wpedantic \ - -Wpointer-arith \ - -Wpointer-sign \ - -Wpointer-to-int-cast \ - -Wpointer-type-mismatch \ - -Wpredefined-identifier-outside-function \ - -Wprivate-extern \ - -Wprotocol \ - -Wprotocol-property-synthesis-ambiguity \ - -Wreadonly-iboutlet-property \ - -Wreceiver-expr \ - -Wreceiver-forward-class \ - -Wreceiver-is-weak \ - -Wredundant-decls \ - -Wreinterpret-base-class \ - -Wreorder \ - -Wrequires-super-attribute \ - -Wreserved-user-defined-literal \ - -Wreturn-stack-address \ - -Wreturn-type \ - -Wreturn-type-c-linkage \ - -Wsection \ - -Wselector \ - -Wselector-type-mismatch \ - -Wself-assign \ - -Wself-assign-field \ - -Wsemicolon-before-method-body \ - -Wsentinel \ - -Wsequence-point \ - -Wserialized-diagnostics \ - -Wshadow-ivar \ - -Wshift-count-negative \ - -Wshift-count-overflow \ - -Wshift-op-parentheses \ - -Wshift-overflow \ - -Wshift-sign-overflow \ - -Wshorten-64-to-32 \ - -Wsign-compare \ - -Wsign-conversion \ - -Wsign-promo \ - -Wsizeof-array-argument \ - -Wsizeof-array-decay \ - -Wsizeof-pointer-memaccess \ - -Wsometimes-uninitialized \ - -Wsource-uses-openmp \ - -Wstack-protector \ - -Wstatic-float-init \ - -Wstatic-in-inline \ - -Wstatic-local-in-inline \ - -Wstatic-self-init \ - -Wstrict-aliasing \ - -Wstrict-aliasing=0 \ - -Wstrict-aliasing=1 \ - -Wstrict-aliasing=2 \ - -Wstrict-overflow \ - -Wstrict-overflow=0 \ - -Wstrict-overflow=1 \ - -Wstrict-overflow=2 \ - -Wstrict-overflow=3 \ - -Wstrict-overflow=4 \ - -Wstrict-overflow=5 \ - -Wstrict-prototypes \ - -Wstrict-selector-match \ - -Wstring-compare \ - -Wstring-conversion \ - -Wstring-plus-int \ - -Wstrlcpy-strlcat-size \ - -Wstrncat-size \ - -Wsuper-class-method-mismatch \ - -Wswitch \ - -Wswitch-default \ - -Wswitch-enum \ - -Wsynth \ - -Wtautological-compare \ - -Wtautological-constant-out-of-range-compare \ - -Wtentative-definition-incomplete-type \ - -Wthread-safety \ - -Wthread-safety-analysis \ - -Wthread-safety-attributes \ - -Wthread-safety-beta \ - -Wthread-safety-precise \ - -Wtrigraphs \ - -Wtype-limits \ - -Wtype-safety \ - -Wtypedef-redefinition \ - -Wtypename-missing \ - -Wundeclared-selector \ - -Wundef \ - -Wundefined-inline \ - -Wundefined-internal \ - -Wundefined-reinterpret-cast \ - -Wunicode \ - -Wunicode-whitespace \ - -Wuninitialized \ - -Wunknown-warning-option \ - -Wunnamed-type-template-args \ - -Wunneeded-internal-declaration \ - -Wunneeded-member-function \ - -Wunsequenced \ - -Wunsupported-visibility \ - -Wunused \ - -Wunused-argument \ - -Wunused-command-line-argument \ - -Wunused-comparison \ - -Wunused-exception-parameter \ - -Wunused-function \ - -Wunused-label \ - -Wunused-member-function \ - -Wunused-parameter \ - -Wunused-private-field \ - -Wunused-result \ - -Wunused-sanitize-argument \ - -Wunused-value \ - -Wunused-variable \ - -Wunused-volatile-lvalue \ - -Wuser-defined-literals \ - -Wvarargs \ - -Wvariadic-macros \ - -Wvector-conversion \ - -Wvector-conversions \ - -Wvexing-parse \ - -Wvisibility \ - -Wvla \ - -Wvla-extension \ - -Wvolatile-register-var \ - -Wweak-template-vtables \ - -Wweak-vtables \ - -Wwrite-strings \ - -Wzero-length-array + $$CLANG_CXXFLAGS } } else { *-g++{#Don't use additional GCC keys on Windows system. diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index 5bb2a11b5..aa68c101e 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -547,3 +547,7 @@ const QHash > *VContainer::DataVariab { return &d->variables; } + +//--------------------------------------------------------------------------------------------------------------------- +VContainerData::~VContainerData() +{} diff --git a/src/app/container/vcontainer.h b/src/app/container/vcontainer.h index 341bfcff7..3676a80ea 100644 --- a/src/app/container/vcontainer.h +++ b/src/app/container/vcontainer.h @@ -58,7 +58,7 @@ public: variables(data.variables), details(data.details) {} - virtual ~VContainerData() {} + virtual ~VContainerData(); QString sizeName; QString heightName; @@ -78,7 +78,7 @@ public: }; #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif /** diff --git a/src/app/container/vcurvelength_p.h b/src/app/container/vcurvelength_p.h index f9cf6a956..d4759e4a5 100644 --- a/src/app/container/vcurvelength_p.h +++ b/src/app/container/vcurvelength_p.h @@ -52,14 +52,17 @@ public: :QSharedData(var), id(var.id), parentId(var.parentId) {} - virtual ~VCurveLengthData() {} + virtual ~VCurveLengthData(); quint32 id; quint32 parentId; }; +VCurveLengthData::~VCurveLengthData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VCURVELENGTH_P_H diff --git a/src/app/container/vincrement_p.h b/src/app/container/vincrement_p.h index 7d8508bb0..57eca4d99 100644 --- a/src/app/container/vincrement_p.h +++ b/src/app/container/vincrement_p.h @@ -52,14 +52,17 @@ public: :QSharedData(incr), id(incr.id) {} - virtual ~VIncrementData() {} + virtual ~VIncrementData(); /** @brief id each increment have unique identificator */ quint32 id; }; +VIncrementData::~VIncrementData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VINCREMENT_P_H diff --git a/src/app/container/vinternalvariable_p.h b/src/app/container/vinternalvariable_p.h index a21d883f5..eeb97d956 100644 --- a/src/app/container/vinternalvariable_p.h +++ b/src/app/container/vinternalvariable_p.h @@ -49,7 +49,7 @@ public: :QSharedData(var), type(var.type), value(var.value), name(var.name) {} - virtual ~VInternalVariableData() {} + virtual ~VInternalVariableData(); VarType type; @@ -59,8 +59,11 @@ public: QString name; }; +VInternalVariableData::~VInternalVariableData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VINTERNALVARIABLE_P_H diff --git a/src/app/container/vlineangle_p.h b/src/app/container/vlineangle_p.h index 30be09ceb..d8c26ba96 100644 --- a/src/app/container/vlineangle_p.h +++ b/src/app/container/vlineangle_p.h @@ -52,14 +52,17 @@ public: :QSharedData(var), p1Id(var.p1Id), p2Id(var.p2Id) {} - virtual ~VLineAngleData() {} + virtual ~VLineAngleData(); quint32 p1Id; quint32 p2Id; }; +VLineAngleData::~VLineAngleData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VLINEANGLE_P_H diff --git a/src/app/container/vlinelength_p.h b/src/app/container/vlinelength_p.h index df24de65b..ac37bd5f4 100644 --- a/src/app/container/vlinelength_p.h +++ b/src/app/container/vlinelength_p.h @@ -52,14 +52,17 @@ public: :QSharedData(var), p1Id(var.p1Id), p2Id(var.p2Id) {} - virtual ~VLengthLineData() {} + virtual ~VLengthLineData(); quint32 p1Id; quint32 p2Id; }; +VLengthLineData::~VLengthLineData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VLINELENGTH_P_H diff --git a/src/app/container/vmeasurement_p.h b/src/app/container/vmeasurement_p.h index c11b00210..dec94e809 100644 --- a/src/app/container/vmeasurement_p.h +++ b/src/app/container/vmeasurement_p.h @@ -52,7 +52,7 @@ public: :QSharedData(m), gui_text(m.gui_text), _tagName(m._tagName) {} - virtual ~VMeasurementData() {} + virtual ~VMeasurementData(); /** @brief description description measurement */ QString gui_text; @@ -60,8 +60,11 @@ public: QString _tagName; }; +VMeasurementData::~VMeasurementData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VMEASUREMENT_P_H diff --git a/src/app/container/vvariable_p.h b/src/app/container/vvariable_p.h index 9efcb1972..57dbb3812 100644 --- a/src/app/container/vvariable_p.h +++ b/src/app/container/vvariable_p.h @@ -56,7 +56,7 @@ public: :QSharedData(var), base(var.base), ksize(var.ksize), kheight(var.kheight), description(var.description) {} - virtual ~VVariableData() {} + virtual ~VVariableData(); /** @brief base value in base size and height */ qreal base; @@ -71,8 +71,11 @@ public: QString description; }; +VVariableData::~VVariableData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VVARIABLE_P_H diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index a1477c76b..afd673bdb 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -96,6 +96,7 @@ DialogPatternXmlEdit::DialogPatternXmlEdit(QWidget *parent, VPattern *xmldoc) bool DialogPatternXmlEdit::CheckChanges(QString &message, QDomNode testRoot) { + Q_UNUSED(testRoot) message="OK"; return true; } @@ -893,6 +894,7 @@ void DialogPatternXmlEdit::ButtonSetClicked() //--------------------------------------------------------------------------------------------------------------------- void DialogPatternXmlEdit::NameTextEdited(QString newtext) { + Q_UNUSED(newtext) //QMessageBox::information(this, "nameTextEdited", QString("%1").arg(newtext)); ui->pushButton_Set_Values->setEnabled(true); ui->pushButton_Cancel_Values->setEnabled(true); @@ -901,6 +903,7 @@ void DialogPatternXmlEdit::NameTextEdited(QString newtext) //--------------------------------------------------------------------------------------------------------------------- void DialogPatternXmlEdit::ValueTextEdited(QString newtext) { + Q_UNUSED(newtext) //QMessageBox::information(this, "valueTextEdited", QString("%1").arg(newtext)); ui->pushButton_Set_Values->setEnabled(true); ui->pushButton_Cancel_Values->setEnabled(true); diff --git a/src/app/dialogs/app/dialogpatternxmledit.h b/src/app/dialogs/app/dialogpatternxmledit.h index 498701075..cbdf94a1a 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.h +++ b/src/app/dialogs/app/dialogpatternxmledit.h @@ -76,7 +76,6 @@ public: QDomNode GetDocNode(); /** * @brief SetDocNode set tree element DomNode - * @param node */ inline void SetDocNode(QDomNode node) { @@ -312,38 +311,30 @@ public: /** * @brief ApplyAttributeChange change or add attribute for node * @param domElement : node containing attribute - * @param name - * @param value * @return true on success */ bool ApplyAttributeChange(QDomNode domElement, QString name, QString value); /** * @brief ApplyNodeChange Change name or text content of node * @param domElement node - * @param name * @param value text content of node * @return true on success */ bool ApplyNodeChange(QDomNode domElement, QString name, QString value); /** * @brief ApplyNodeAdd add node as child of domElement and set DocNode of treeElement - * @param domElement * @param treeElement the XMLTreeElement of added node - * @param name - * @param value * @return true on success */ bool ApplyNodeAdd(QDomNode domElement, VXMLTreeElement* treeElement, QString name, QString value); /** * @brief ApplyAttributeDelete delete attribute for node - * @param domElement * @param name attribute name * @return true on success */ bool ApplyAttributeDelete(QDomNode domElement, QString name); /** * @brief ApplyNodeDelete delete node domElement - * @param domElement * @return true on success */ bool ApplyNodeDelete(QDomNode domElement); diff --git a/src/app/dialogs/tools/dialogdetail.cpp b/src/app/dialogs/tools/dialogdetail.cpp index 3d6a014f0..08b61a90a 100644 --- a/src/app/dialogs/tools/dialogdetail.cpp +++ b/src/app/dialogs/tools/dialogdetail.cpp @@ -100,6 +100,7 @@ void DialogDetail::ChosenObject(quint32 id, const SceneObject &type) break; case (SceneObject::Line): case (SceneObject::Detail): + case (SceneObject::Unknown): default: qDebug()<kAsm2 = QLineF ( this->p4.toQPointF(), this->p3 ).length()/L; } - virtual ~VSplineData() {} + virtual ~VSplineData(); /** @brief p1 first spline point. */ VPointF p1; @@ -115,8 +115,11 @@ public: qreal kCurve; }; +VSplineData::~VSplineData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VSPLINE_P_H diff --git a/src/app/geometry/vsplinepath_p.h b/src/app/geometry/vsplinepath_p.h index c359fd730..c671c1f3e 100644 --- a/src/app/geometry/vsplinepath_p.h +++ b/src/app/geometry/vsplinepath_p.h @@ -54,7 +54,7 @@ public: : QSharedData(splPath), path(splPath.path), kCurve(splPath.kCurve), maxCountPoints(splPath.maxCountPoints) {} - virtual ~VSplinePathData() {} + virtual ~VSplinePathData(); /** * @brief path list spline point. @@ -70,8 +70,11 @@ public: qint32 maxCountPoints; }; +VSplinePathData::~VSplinePathData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VSPLINEPATH_P_H diff --git a/src/app/geometry/vsplinepoint_p.h b/src/app/geometry/vsplinepoint_p.h index c3cc1b545..b1fe74429 100644 --- a/src/app/geometry/vsplinepoint_p.h +++ b/src/app/geometry/vsplinepoint_p.h @@ -62,7 +62,7 @@ public: kAsm2(point.kAsm2) {} - virtual ~VSplinePointData() {} + virtual ~VSplinePointData(); /** @brief pSpline point. */ VPointF pSpline; @@ -80,8 +80,11 @@ public: qreal kAsm2; }; +VSplinePointData::~VSplinePointData() +{} + #ifdef Q_CC_GNU - #pragma GCC diagnostic pop +#pragma GCC diagnostic pop #endif #endif // VSPLINEPOINT_P_H diff --git a/src/app/tools/drawTools/vdrawtool.cpp b/src/app/tools/drawTools/vdrawtool.cpp index 408b07b97..e0688525a 100644 --- a/src/app/tools/drawTools/vdrawtool.cpp +++ b/src/app/tools/drawTools/vdrawtool.cpp @@ -204,7 +204,7 @@ void VDrawTool::SetFactor(qreal factor) * Try calculate formula. If find error show dialog that allow user try fix formula. If user can't throw exception. In * successes case return result calculation and fixed formula string. If formula ok don't touch formula. * - * @param toolId[in] tool's id. + * @param toolId [in] tool's id. * @param formula [in|out] string with formula. * @param data [in] container with variables. Need for math parser. * @throw QmuParserError. diff --git a/src/app/tools/drawTools/vtoolcutarc.cpp b/src/app/tools/drawTools/vtoolcutarc.cpp index f7cad6a1f..86240aacc 100644 --- a/src/app/tools/drawTools/vtoolcutarc.cpp +++ b/src/app/tools/drawTools/vtoolcutarc.cpp @@ -280,7 +280,6 @@ void VToolCutArc::SaveDialog(QDomElement &domElement) * @brief RefreshCurve refresh curve on scene. * @param curve curve. * @param curveId curve id. - * @param tr point type. */ void VToolCutArc::RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction) diff --git a/src/app/tools/drawTools/vtoolcutspline.cpp b/src/app/tools/drawTools/vtoolcutspline.cpp index 1af6dbb10..237f36b60 100644 --- a/src/app/tools/drawTools/vtoolcutspline.cpp +++ b/src/app/tools/drawTools/vtoolcutspline.cpp @@ -292,7 +292,6 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement) * @brief RefreshCurve refresh curve on scene. * @param curve curve. * @param curveId curve id. - * @param tr point type. */ void VToolCutSpline::RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction) diff --git a/src/app/tools/drawTools/vtoolcutsplinepath.cpp b/src/app/tools/drawTools/vtoolcutsplinepath.cpp index fc8d73562..cafe7c916 100644 --- a/src/app/tools/drawTools/vtoolcutsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolcutsplinepath.cpp @@ -347,7 +347,6 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement) * @brief RefreshCurve refresh curve on scene. * @param curve curve. * @param curveId curve id. - * @param tr point type. */ void VToolCutSplinePath::RefreshCurve(VSimpleCurve *curve, quint32 curveId, SimpleCurvePoint curvePosition, PathDirection direction) diff --git a/src/app/tools/drawTools/vtoollinepoint.cpp b/src/app/tools/drawTools/vtoollinepoint.cpp index 8f66014ac..7a60f5bb3 100644 --- a/src/app/tools/drawTools/vtoollinepoint.cpp +++ b/src/app/tools/drawTools/vtoollinepoint.cpp @@ -36,7 +36,7 @@ * @param data container with variables. * @param id object id in container. * @param typeLine line type. - * @param formulaLength string with length formula. + * @param formula string with length formula. * @param basePointId id base line point. * @param angle line angle. * @param parent parent object. diff --git a/src/app/tools/drawTools/vtoolpointofcontact.cpp b/src/app/tools/drawTools/vtoolpointofcontact.cpp index dd8d4f27e..b857398ef 100644 --- a/src/app/tools/drawTools/vtoolpointofcontact.cpp +++ b/src/app/tools/drawTools/vtoolpointofcontact.cpp @@ -41,7 +41,7 @@ const QString VToolPointOfContact::ToolType = QStringLiteral("pointOfContact"); * @param doc dom document container. * @param data container with variables. * @param id object id in container. - * @param arcRadius string with formula radius arc. + * @param radius string with formula radius arc. * @param center id center arc point. * @param firstPointId id first line point. * @param secondPointId id second line point. @@ -85,7 +85,7 @@ void VToolPointOfContact::setDialog() //--------------------------------------------------------------------------------------------------------------------- /** * @brief FindPoint return point intersection line and arc. - * @param arcRadius string with formula arc radius. + * @param radius string with formula arc radius. * @param center center arc point. * @param firstPoint first line point. * @param secondPoint second line point. @@ -150,7 +150,7 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi /** * @brief Create help create tool. * @param _id tool id, 0 if tool doesn't exist yet. - * @param arcRadius string with formula radius arc. + * @param radius string with formula radius arc. * @param center id center arc point. * @param firstPointId id first line point. * @param secondPointId id second line point. diff --git a/src/app/tools/drawTools/vtoolsinglepoint.cpp b/src/app/tools/drawTools/vtoolsinglepoint.cpp index 2eaf41d5f..e14dbf566 100644 --- a/src/app/tools/drawTools/vtoolsinglepoint.cpp +++ b/src/app/tools/drawTools/vtoolsinglepoint.cpp @@ -211,7 +211,7 @@ void VToolSinglePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) VToolPoint::hoverLeaveEvent(event); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); } //--------------------------------------------------------------------------------------------------------------------- @@ -230,7 +230,7 @@ void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); } VToolPoint::mouseReleaseEvent(event); } diff --git a/src/app/tools/drawTools/vtoolsplinepath.cpp b/src/app/tools/drawTools/vtoolsplinepath.cpp index d87759211..6184a8710 100644 --- a/src/app/tools/drawTools/vtoolsplinepath.cpp +++ b/src/app/tools/drawTools/vtoolsplinepath.cpp @@ -245,7 +245,7 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath) //--------------------------------------------------------------------------------------------------------------------- /** * @brief UpdatePathPoint update spline path in pattern file. - * @brief doc dom document container. + * @param doc dom document container. * @param node tag in file. * @param path spline path. */ diff --git a/src/app/tools/nodeDetails/vabstractnode.cpp b/src/app/tools/nodeDetails/vabstractnode.cpp index ae02381c8..8a9a10ec2 100644 --- a/src/app/tools/nodeDetails/vabstractnode.cpp +++ b/src/app/tools/nodeDetails/vabstractnode.cpp @@ -140,5 +140,6 @@ void VAbstractNode::RestoreReferens() //--------------------------------------------------------------------------------------------------------------------- void VAbstractNode::SaveOptions(QDomElement &tag, QSharedPointer &obj) { - + Q_UNUSED(tag) + Q_UNUSED(obj) } diff --git a/src/app/tools/vabstracttool.cpp b/src/app/tools/vabstracttool.cpp index 3147abb45..96d83100f 100644 --- a/src/app/tools/vabstracttool.cpp +++ b/src/app/tools/vabstracttool.cpp @@ -246,7 +246,6 @@ QPointF VAbstractTool::addVector(const QPointF &p, const QPointF &p1, const QPoi //--------------------------------------------------------------------------------------------------------------------- /** * @brief DeleteTool full delete object form scene and file. - * @param tool tool */ void VAbstractTool::DeleteTool(bool ask) { diff --git a/src/app/tools/vtooldetail.cpp b/src/app/tools/vtooldetail.cpp index 4cbe065ba..32b60be4e 100644 --- a/src/app/tools/vtooldetail.cpp +++ b/src/app/tools/vtooldetail.cpp @@ -373,7 +373,8 @@ void VToolDetail::keyReleaseEvent(QKeyEvent *event) //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::SaveOptions(QDomElement &tag, QSharedPointer &obj) { - + Q_UNUSED(tag) + Q_UNUSED(obj) } //--------------------------------------------------------------------------------------------------------------------- @@ -441,7 +442,6 @@ void VToolDetail::RemoveReferens() //--------------------------------------------------------------------------------------------------------------------- /** * @brief AddNode add node to the file. - * @param dom document container * @param domElement tag in xml tree. * @param node node of detail. */ @@ -490,7 +490,7 @@ QString VToolDetail::getTagName() const //--------------------------------------------------------------------------------------------------------------------- void VToolDetail::ShowVisualization(bool show) { - + Q_UNUSED(show) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/tools/vtooluniondetails.cpp b/src/app/tools/vtooluniondetails.cpp index 54db8727d..48fdbb6a5 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/app/tools/vtooluniondetails.cpp @@ -444,7 +444,7 @@ QString VToolUnionDetails::getTagName() const //--------------------------------------------------------------------------------------------------------------------- void VToolUnionDetails::ShowVisualization(bool show) { - + Q_UNUSED(show) } //--------------------------------------------------------------------------------------------------------------------- @@ -759,7 +759,8 @@ void VToolUnionDetails::RefreshDataInFile() //--------------------------------------------------------------------------------------------------------------------- void VToolUnionDetails::SaveOptions(QDomElement &tag, QSharedPointer &obj) { - + Q_UNUSED(tag) + Q_UNUSED(obj) } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/visualization/vcontrolpointspline.cpp b/src/app/visualization/vcontrolpointspline.cpp index d8da56d50..6f86a79a3 100644 --- a/src/app/visualization/vcontrolpointspline.cpp +++ b/src/app/visualization/vcontrolpointspline.cpp @@ -98,7 +98,7 @@ void VControlPointSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine()))); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); QGraphicsEllipseItem::hoverLeaveEvent(event); } @@ -136,7 +136,7 @@ void VControlPointSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); } QGraphicsEllipseItem::mouseReleaseEvent(event); } diff --git a/src/app/visualization/vgraphicssimpletextitem.cpp b/src/app/visualization/vgraphicssimpletextitem.cpp index 538adb85a..3cc8af990 100644 --- a/src/app/visualization/vgraphicssimpletextitem.cpp +++ b/src/app/visualization/vgraphicssimpletextitem.cpp @@ -122,7 +122,7 @@ void VGraphicsSimpleTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) this->setBrush(Qt::black); //Disable cursor-arrow-openhand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png"), 1, 1); + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-openhand.png")); QGraphicsSimpleTextItem::hoverLeaveEvent(event); } @@ -152,7 +152,7 @@ void VGraphicsSimpleTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick) { //Disable cursor-arrow-closehand - VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png"), 1, 1); + VApplication::restoreOverrideCursor(QStringLiteral("://cursor/cursor-arrow-closehand.png")); } QGraphicsSimpleTextItem::mouseReleaseEvent(event); } diff --git a/src/app/visualization/vistoolsplinepath.cpp b/src/app/visualization/vistoolsplinepath.cpp index 5e022ec7c..18bbdbe89 100644 --- a/src/app/visualization/vistoolsplinepath.cpp +++ b/src/app/visualization/vistoolsplinepath.cpp @@ -66,7 +66,7 @@ void VisToolSplinePath::RefreshGeometry() { for (int i = 0; i < pathPoints.size(); ++i) { - QGraphicsEllipseItem *point = this->getPoint(i); + QGraphicsEllipseItem *point = this->getPoint(static_cast(i)); DrawPoint(point, pathPoints.at(i).P().toQPointF(), supportColor); } @@ -113,13 +113,10 @@ void VisToolSplinePath::setMode(const Mode &value) //--------------------------------------------------------------------------------------------------------------------- QGraphicsEllipseItem *VisToolSplinePath::getPoint(unsigned int i) { - if (points.size() == 0) + SCASSERT(i >= 0) + if (static_cast(points.size() - 1) >= i && points.isEmpty() == false) { - nullptr; - } - else if (static_cast(points.size() - 1) >= i && points.isEmpty() == false) - { - return points.at(i); + return points.at(static_cast(i)); } else { diff --git a/src/app/widgets/undoevent.cpp b/src/app/widgets/undoevent.cpp index 566d27364..bdbadd91c 100644 --- a/src/app/widgets/undoevent.cpp +++ b/src/app/widgets/undoevent.cpp @@ -32,3 +32,7 @@ UndoEvent::UndoEvent() :QEvent(UNDO_EVENT) {} + +//--------------------------------------------------------------------------------------------------------------------- +UndoEvent::~UndoEvent() +{} diff --git a/src/app/widgets/undoevent.h b/src/app/widgets/undoevent.h index 86b0b5d49..e3f1fc75c 100644 --- a/src/app/widgets/undoevent.h +++ b/src/app/widgets/undoevent.h @@ -38,6 +38,7 @@ class UndoEvent : public QEvent { public: UndoEvent(); + virtual ~UndoEvent(); }; #endif // UNDOEVENT_H diff --git a/src/app/widgets/vapplication.cpp b/src/app/widgets/vapplication.cpp index e4315d1d1..30f0543fa 100644 --- a/src/app/widgets/vapplication.cpp +++ b/src/app/widgets/vapplication.cpp @@ -2052,7 +2052,7 @@ void VApplication::setOverrideCursor(const QString &pixmapPath, int hotX, int ho } //--------------------------------------------------------------------------------------------------------------------- -void VApplication::restoreOverrideCursor(const QString &pixmapPath, int hotX, int hotY) +void VApplication::restoreOverrideCursor(const QString &pixmapPath) { #ifndef QT_NO_CURSOR QPixmap oldPixmap; diff --git a/src/app/widgets/vapplication.h b/src/app/widgets/vapplication.h index 005026cf2..cb2ede052 100644 --- a/src/app/widgets/vapplication.h +++ b/src/app/widgets/vapplication.h @@ -97,7 +97,7 @@ public: VPattern *getCurrentDocument()const; static void setOverrideCursor(const QString & pixmapPath, int hotX = -1, int hotY = -1); - static void restoreOverrideCursor(const QString & pixmapPath, int hotX = -1, int hotY = -1); + static void restoreOverrideCursor(const QString & pixmapPath); static QStringList LabelLanguages(); private: diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 9187c93fe..4c649f58c 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -294,8 +294,6 @@ bool VPattern::ChangeNamePP(const QString& oldName, const QString &newName) /** * @brief Parse parse file. * @param parse parser file mode. - * @param sceneDraw pointer to draw scene. - * @param sceneDetail pointer to details scene. */ void VPattern::Parse(const Document &parse) { @@ -841,8 +839,6 @@ void VPattern::customEvent(QEvent *event) //--------------------------------------------------------------------------------------------------------------------- /** * @brief ParseDrawElement parse draw tag. - * @param sceneDraw draw scene. - * @param sceneDetail details scene. * @param node node. * @param parse parser file mode. */ @@ -882,8 +878,6 @@ void VPattern::ParseDrawElement(const QDomNode &node, const Document &parse) //--------------------------------------------------------------------------------------------------------------------- /** * @brief ParseDrawMode parse draw tag with draw mode. - * @param sceneDraw draw scene. - * @param sceneDetail details scene. * @param node node. * @param parse parser file mode. * @param mode draw mode. @@ -937,7 +931,6 @@ void VPattern::ParseDrawMode(const QDomNode &node, const Document &parse, const //--------------------------------------------------------------------------------------------------------------------- /** * @brief ParseDetailElement parse detail tag. - * @param sceneDetail detail scene. * @param domElement tag in xml tree. * @param parse parser file mode. */ @@ -1010,7 +1003,6 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document //--------------------------------------------------------------------------------------------------------------------- /** * @brief ParseDetails parse details tag. - * @param sceneDetail detail scene. * @param domElement tag in xml tree. * @param parse parser file mode. */ @@ -1688,8 +1680,8 @@ QString VPattern::GetLabelBase(unsigned int index) const } QString base; - int count = qFloor(index/alphabet.size()); - int number = index - alphabet.size() * count; + int count = qFloor(index/static_cast(alphabet.size())); + int number = static_cast(index) - alphabet.size() * count; int i = 0; do { @@ -2371,7 +2363,7 @@ QString VPattern::GenerateLabel(const LabelType &type) const int i = 0; for (;;) { - name = GetLabelBase(drawList.size() + i); + name = GetLabelBase(static_cast(drawList.size() + i)); if (data->IsUnique(name)) { return name; @@ -2402,7 +2394,7 @@ QString VPattern::GenerateLabel(const LabelType &type) const } } - QString labelBase = GetLabelBase(index); + QString labelBase = GetLabelBase(static_cast(index)); qint32 num = 1; QString name; diff --git a/src/libs/qmuparser/qmuparser.pro b/src/libs/qmuparser/qmuparser.pro index c508ff4f6..648586770 100644 --- a/src/libs/qmuparser/qmuparser.pro +++ b/src/libs/qmuparser/qmuparser.pro @@ -73,397 +73,34 @@ CONFIG(debug, debug|release){ # Debug unix { *-g++{ - QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtCore" -isystem "$${MOC_DIR}" \ - -O0 -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \ - -Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self -Wstack-protector \ - -Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \ - -Wformat=2 -Wimport \ - -Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \ - -Wmissing-include-dirs -Wpacked -Wredundant-decls -Winline \ - -Wswitch-default -Wuninitialized -Wvariadic-macros \ - -Wlogical-op -Wnoexcept -Wmissing-noreturn -Wpointer-arith\ - -Wstrict-null-sentinel -Wstrict-overflow=5 -Wundef -Wno-unused -gdwarf-3 \ - -ftrapv + QMAKE_CXXFLAGS += \ + -isystem "/usr/include/qt5" \ + -isystem "/usr/include/qt5/QtWidgets" \ + -isystem "/usr/include/qt5/QtXml" \ + -isystem "/usr/include/qt5/QtGui" \ + -isystem "/usr/include/qt5/QtXmlPatterns" \ + -isystem "/usr/include/qt5/QtCore" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_CXXFLAGS } #Turn on Clang warnings clang*{ QMAKE_CXXFLAGS += \ -isystem "/usr/include/qt5" \ + -isystem "/usr/include/qt5/QtWidgets" \ + -isystem "/usr/include/qt5/QtXml" \ + -isystem "/usr/include/qt5/QtGui" \ -isystem "/usr/include/qt5/QtCore" \ + -isystem "/usr/include/qt5/QtXmlPatterns" \ -isystem "$${OUT_PWD}/$${MOC_DIR}" \ - -O0 \ - -fparse-all-comments \ - -Wabi \ - -Wabstract-final-class \ - -Wabstract-vbase-init \ - -Waddress \ - -Waddress-of-array-temporary \ - -Waddress-of-temporary \ - -Waggregate-return \ - -Wall \ - -Wambiguous-macro \ - -Wambiguous-member-template \ - -Wanalyzer-incompatible-plugin \ - -Wanonymous-pack-parens \ - -Warc \ - -Warc-abi \ - -Warc-bridge-casts-disallowed-in-nonarc \ - -Warc-maybe-repeated-use-of-weak \ - -Warc-non-pod-memaccess \ - -Warc-performSelector-leaks \ - -Warc-repeated-use-of-weak \ - -Warc-retain-cycles \ - -Warc-unsafe-retained-assign \ - -Warray-bounds \ - -Warray-bounds-pointer-arithmetic \ - -Wasm \ - -Wasm-operand-widths \ - -Wassign-enum \ - -Watomic-properties \ - -Watomic-property-with-user-defined-accessor \ - -Wattributes \ - -Wauto-import \ - -Wauto-storage-class \ - -Wauto-var-id \ - -Wavailability \ - -Wbackslash-newline-escape \ - -Wbad-array-new-length \ - -Wbad-function-cast \ - -Wbind-to-temporary-copy \ - -Wbitfield-constant-conversion \ - -Wbitwise-op-parentheses \ - -Wbool-conversion \ - -Wbool-conversions \ - -Wbuiltin-macro-redefined \ - -Wbuiltin-requires-header \ - -Wc++-compat \ - -Wc++0x-compat \ - -Wc++0x-extensions \ - -Wc++0x-narrowing \ - -Wc++11-compat \ - -Wc++11-compat-pedantic \ - -Wc++11-compat-reserved-user-defined-literal \ - -Wc++11-extensions \ - -Wc++11-extra-semi \ - -Wc++11-long-long \ - -Wc++11-narrowing \ - -Wc11-extensions \ - -Wcast-align \ - -Wcast-of-sel-type \ - -Wcast-qual \ - -WCFString-literal \ - -Wchar-align \ - -Wchar-subscripts \ - -Wcomment \ - -Wcomments \ - -Wcompare-distinct-pointer-types \ - -Wcomplex-component-init \ - -Wconditional-type-mismatch \ - -Wconditional-uninitialized \ - -Wconfig-macros \ - -Wconstant-conversion \ - -Wconstant-logical-operand \ - -Wconstexpr-not-const \ - -Wconversion \ - -Wconversion-null \ - -Wno-covered-switch-default \ - -Wctor-dtor-privacy \ - -Wcustom-atomic-properties \ - -Wdangling-else \ - -Wdangling-field \ - -Wdangling-initializer-list \ - -Wdeclaration-after-statement \ - -Wdelegating-ctor-cycles \ - -Wdelete-incomplete \ - -Wdelete-non-virtual-dtor \ - -Wdeprecated \ - -Wdeprecated-declarations \ - -Wdeprecated-implementations \ - -Wdeprecated-objc-isa-usage \ - -Wdeprecated-objc-pointer-introspection \ - -Wdeprecated-objc-pointer-introspection-performSelector \ - -Wdeprecated-register \ - -Wdeprecated-writable-strings \ - -Wdirect-ivar-access \ - -Wdisabled-macro-expansion \ - -Wdisabled-optimization \ - -Wdiscard-qual \ - -Wdistributed-object-modifiers \ - -Wdiv-by-zero \ - -Wdivision-by-zero \ - -Wdocumentation \ - -Wdocumentation-deprecated-sync \ - -Wdocumentation-html \ - -Wdollar-in-identifier-extension \ - -Wduplicate-decl-specifier \ - -Wduplicate-enum \ - -Wduplicate-method-arg \ - -Wduplicate-method-match \ - -Wdynamic-class-memaccess \ - -Weffc++ \ - -Wembedded-directive \ - -Wempty-body \ - -Wempty-translation-unit \ - -Wendif-labels \ - -Wenum-compare \ - -Wenum-conversion \ - -Wexplicit-ownership-type \ - -Wextended-offsetof \ - -Wextern-initializer \ - -Wextra \ - -Wextra-semi \ - -Wextra-tokens \ - -Wflexible-array-extensions \ - -Wfloat-equal \ - -Wformat \ - -Wformat-extra-args \ - -Wformat-invalid-specifier \ - -Wformat-non-iso \ - -Wformat-nonliteral \ - -Wformat-security \ - -Wformat-y2k \ - -Wformat-zero-length \ - -Wformat=2 \ - -Wfour-char-constants \ - -Wgcc-compat \ - -Wgnu \ - -Wgnu-array-member-paren-init \ - -Wgnu-designator \ - -Wgnu-static-float-init \ - -Wheader-guard \ - -Wheader-hygiene \ - -Widiomatic-parentheses \ - -Wignored-attributes \ - -Wignored-qualifiers \ - -Wimplicit \ - -Wimplicit-atomic-properties \ - -Wimplicit-conversion-floating-point-to-bool \ - -Wimplicit-exception-spec-mismatch \ - -Wimplicit-fallthrough \ - -Wimplicit-fallthrough-per-function \ - -Wimplicit-function-declaration \ - -Wimplicit-int \ - -Wimplicit-retain-self \ - -Wimport \ - -Wimport-preprocessor-directive-pedantic \ - -Wincompatible-library-redeclaration \ - -Wincompatible-pointer-types \ - -Wincompatible-pointer-types-discards-qualifiers \ - -Wincomplete-implementation \ - -Wincomplete-module \ - -Wincomplete-umbrella \ - -Winherited-variadic-ctor \ - -Winit-self \ - -Winitializer-overrides \ - -Winline \ - -Wint-conversion \ - -Wint-conversions \ - -Wint-to-pointer-cast \ - -Wint-to-void-pointer-cast \ - -Winteger-overflow \ - -Winvalid-constexpr \ - -Winvalid-iboutlet \ - -Winvalid-noreturn \ - -Winvalid-offsetof \ - -Winvalid-pch \ - -Winvalid-pp-token \ - -Winvalid-source-encoding \ - -Winvalid-token-paste \ - -Wknr-promoted-parameter \ - -Wlanguage-extension-token \ - -Wlarge-by-value-copy \ - -Wliteral-conversion \ - -Wliteral-range \ - -Wlocal-type-template-args \ - -Wlogical-not-parentheses \ - -Wlogical-op-parentheses \ - -Wlong-long \ - -Wloop-analysis \ - -Wmain \ - -Wmain-return-type \ - -Wmalformed-warning-check \ - -Wmethod-signatures \ - -Wmicrosoft \ - -Wmicrosoft-exists \ - -Wmismatched-parameter-types \ - -Wmismatched-return-types \ - -Wmismatched-tags \ - -Wmissing-braces \ - -Wmissing-declarations \ - -Wmissing-field-initializers \ - -Wmissing-format-attribute \ - -Wmissing-include-dirs \ - -Wmissing-method-return-type \ - -Wmissing-noreturn \ - -Wmissing-prototypes \ - -Wmissing-selector-name \ - -Wmissing-sysroot \ - -Wmissing-variable-declarations \ - -Wmodule-conflict \ - -Wmost \ - -Wmultichar \ - -Wnarrowing \ - -Wnested-externs \ - -Wnewline-eof \ - -Wnon-gcc \ - -Wnon-literal-null-conversion \ - -Wnon-pod-varargs \ - -Wnon-virtual-dtor \ - -Wnonnull \ - -Wnonportable-cfstrings \ - -WNSObject-attribute \ - -Wnull-arithmetic \ - -Wnull-character \ - -Wnull-conversion \ - -Wnull-dereference \ - -Wodr \ - -Wold-style-cast \ - -Wold-style-definition \ - -Wout-of-line-declaration \ - -Wover-aligned \ - -Woverflow \ - -Woverlength-strings \ - -Woverloaded-shift-op-parentheses \ - -Woverloaded-virtual \ - -Woverriding-method-mismatch \ - -Wpacked \ - -Wparentheses \ - -Wparentheses-equality \ - -Wpedantic \ - -Wpointer-arith \ - -Wpointer-sign \ - -Wpointer-to-int-cast \ - -Wpointer-type-mismatch \ - -Wpredefined-identifier-outside-function \ - -Wprivate-extern \ - -Wprotocol \ - -Wprotocol-property-synthesis-ambiguity \ - -Wreadonly-iboutlet-property \ - -Wreceiver-expr \ - -Wreceiver-forward-class \ - -Wreceiver-is-weak \ - -Wredundant-decls \ - -Wreinterpret-base-class \ - -Wreorder \ - -Wrequires-super-attribute \ - -Wreserved-user-defined-literal \ - -Wreturn-stack-address \ - -Wreturn-type \ - -Wreturn-type-c-linkage \ - -Wsection \ - -Wselector \ - -Wselector-type-mismatch \ - -Wself-assign \ - -Wself-assign-field \ - -Wsemicolon-before-method-body \ - -Wsentinel \ - -Wsequence-point \ - -Wserialized-diagnostics \ - -Wshadow-ivar \ - -Wshift-count-negative \ - -Wshift-count-overflow \ - -Wshift-op-parentheses \ - -Wshift-overflow \ - -Wshift-sign-overflow \ - -Wshorten-64-to-32 \ - -Wsign-compare \ - -Wsign-conversion \ - -Wsign-promo \ - -Wsizeof-array-argument \ - -Wsizeof-array-decay \ - -Wsizeof-pointer-memaccess \ - -Wsometimes-uninitialized \ - -Wsource-uses-openmp \ - -Wstack-protector \ - -Wstatic-float-init \ - -Wstatic-in-inline \ - -Wstatic-local-in-inline \ - -Wstatic-self-init \ - -Wstrict-aliasing \ - -Wstrict-aliasing=0 \ - -Wstrict-aliasing=1 \ - -Wstrict-aliasing=2 \ - -Wstrict-overflow \ - -Wstrict-overflow=0 \ - -Wstrict-overflow=1 \ - -Wstrict-overflow=2 \ - -Wstrict-overflow=3 \ - -Wstrict-overflow=4 \ - -Wstrict-overflow=5 \ - -Wstrict-prototypes \ - -Wstrict-selector-match \ - -Wstring-compare \ - -Wstring-conversion \ - -Wstring-plus-int \ - -Wstrlcpy-strlcat-size \ - -Wstrncat-size \ - -Wsuper-class-method-mismatch \ - -Wswitch \ - -Wswitch-default \ - -Wswitch-enum \ - -Wsynth \ - -Wtautological-compare \ - -Wtautological-constant-out-of-range-compare \ - -Wtentative-definition-incomplete-type \ - -Wthread-safety \ - -Wthread-safety-analysis \ - -Wthread-safety-attributes \ - -Wthread-safety-beta \ - -Wthread-safety-precise \ - -Wtrigraphs \ - -Wtype-limits \ - -Wtype-safety \ - -Wtypedef-redefinition \ - -Wtypename-missing \ - -Wundeclared-selector \ - -Wundef \ - -Wundefined-inline \ - -Wundefined-internal \ - -Wundefined-reinterpret-cast \ - -Wunicode \ - -Wunicode-whitespace \ - -Wuninitialized \ - -Wunknown-warning-option \ - -Wunnamed-type-template-args \ - -Wunneeded-internal-declaration \ - -Wunneeded-member-function \ - -Wunsequenced \ - -Wunsupported-visibility \ - -Wunused \ - -Wunused-argument \ - -Wunused-command-line-argument \ - -Wunused-comparison \ - -Wunused-exception-parameter \ - -Wunused-function \ - -Wunused-label \ - -Wunused-member-function \ - -Wunused-parameter \ - -Wunused-private-field \ - -Wunused-result \ - -Wunused-sanitize-argument \ - -Wunused-value \ - -Wunused-variable \ - -Wunused-volatile-lvalue \ - -Wuser-defined-literals \ - -Wvarargs \ - -Wvariadic-macros \ - -Wvector-conversion \ - -Wvector-conversions \ - -Wvexing-parse \ - -Wvisibility \ - -Wvla \ - -Wvla-extension \ - -Wvolatile-register-var \ - -Wweak-template-vtables \ - -Wweak-vtables \ - -Wwrite-strings \ - -Wzero-length-array + $$CLANG_CXXFLAGS } } else { *-g++{#Don't use additional GCC keys on Windows system. QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic } } + }else{ # Release *-g++{ diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index c4c30f0ee..5b6da2a6f 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -58,8 +58,6 @@ const QStringList QmuParserBase::c_DefaultOprt{"<=", ">=", "!=", "==", "<", ">", //--------------------------------------------------------------------------------------------------------------------- /** * @brief Constructor. - * @param a_szFormula the formula to interpret. - * @throw ParserException if a_szFormula is null. */ QmuParserBase::QmuParserBase() :m_pParseFormula(&QmuParserBase::ParseString), m_vRPN(), m_vStringBuf(), m_vStringVarBuf(), m_pTokenReader(), @@ -369,7 +367,7 @@ void QmuParserBase::CheckName(const QString &a_sName, const QString &a_szCharSet //--------------------------------------------------------------------------------------------------------------------- /** * @brief Set the formula. - * @param a_strFormula Formula as string_type + * @param a_sExpr Formula as string_type * @throw ParserException in case of syntax errors. * * Triggers first time calculation thus the creation of the bytecode and scanning of used variables. @@ -491,7 +489,7 @@ void QmuParserBase::DefineOprt( const QString &a_sName, fun_type2 a_pFun, unsign } } - AddCallback(a_sName, QmuParserCallback(a_pFun, a_bAllowOpt, a_iPrec, a_eAssociativity), m_OprtDef, + AddCallback(a_sName, QmuParserCallback(a_pFun, a_bAllowOpt, static_cast(a_iPrec), a_eAssociativity), m_OprtDef, ValidOprtChars() ); } @@ -655,6 +653,7 @@ const varmap_type& QmuParserBase::GetUsedVar() const } catch (const QmuParserError &e) { + Q_UNUSED(e) // Make sure to stay in string parse mode, dont call ReInit() // because it deletes the array with the used variables m_pParseFormula = &QmuParserBase::ParseString; @@ -722,7 +721,7 @@ QmuParserBase::token_type QmuParserBase::ApplyStrFunc(const token_type &a_FunTok //--------------------------------------------------------------------------------------------------------------------- /** * @brief Apply a function token. - * @param iArgCount Number of Arguments actually gathered used only for multiarg functions. + * @param a_iArgCount Number of Arguments actually gathered used only for multiarg functions. * @post The result is pushed to the value stack * @post The function token is removed from the stack * @throw QmuParserError if Argument count does not mach function requirements. @@ -893,8 +892,8 @@ void QmuParserBase::ApplyBinOprt(QStack &a_stOpt, QStack //--------------------------------------------------------------------------------------------------------------------- /** * @brief Apply a binary operator. - * @param a_stOpt The operator stack - * @param a_stVal The value stack + * @param stOpt The operator stack + * @param stVal The value stack */ void QmuParserBase::ApplyRemainingOprt(QStack &stOpt, QStack &stVal) const { @@ -1015,7 +1014,7 @@ qreal QmuParserBase::ParseCmdCodeBulk(int nOffset, int nThreadID) const #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wfloat-equal" #endif - Stack[sidx] = Stack[sidx] && Stack[sidx+1]; + Stack[sidx] = static_cast(Stack[sidx]) && static_cast(Stack[sidx+1]); #ifdef Q_CC_GNU #pragma GCC diagnostic pop #endif @@ -1026,7 +1025,7 @@ qreal QmuParserBase::ParseCmdCodeBulk(int nOffset, int nThreadID) const #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wfloat-equal" #endif - Stack[sidx] = Stack[sidx] || Stack[sidx+1]; + Stack[sidx] = static_cast(Stack[sidx]) || static_cast(Stack[sidx+1]); #ifdef Q_CC_GNU #pragma GCC diagnostic pop #endif @@ -1335,6 +1334,9 @@ void QmuParserBase::CreateRPN() const } ++stArgCount.top(); // fallthrough intentional (no break!) + #ifdef Q_CC_CLANG + [[clang::fallthrough]]; + #endif case cmEND: ApplyRemainingOprt(stOpt, stVal); break; @@ -1391,6 +1393,9 @@ void QmuParserBase::CreateRPN() const case cmIF: m_nIfElseCounter++; // fallthrough intentional (no break!) + #ifdef Q_CC_CLANG + [[clang::fallthrough]]; + #endif case cmLE: case cmGE: case cmNEQ: @@ -1554,7 +1559,7 @@ qreal QmuParserBase::ParseString() const * * @param a_iErrc [in] The error code of type #EErrorCodes. * @param a_iPos [in] The position where the error was detected. -* @param a_strTok [in] The token string representation associated with the error. +* @param a_sTok [in] The token string representation associated with the error. * @throw ParserException always throws thats the only purpose of this function. */ void Q_NORETURN QmuParserBase::Error(EErrorCodes a_iErrc, int a_iPos, const QString &a_sTok) const diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index 803b5da59..026949300 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -124,7 +124,7 @@ void QmuParserByteCode::AddVar(qreal *a_pVar) *
  • the value stored in #mc_iSizeVal number of bytecode entries.
  • * * - * @param a_pVal Value to be added. + * @param a_fVal Value to be added. * @throw nothrow */ void QmuParserByteCode::AddVal(qreal a_fVal) @@ -144,7 +144,7 @@ void QmuParserByteCode::AddVal(qreal a_fVal) //--------------------------------------------------------------------------------------------------------------------- void QmuParserByteCode::ConstantFolding(ECmdCode a_Oprt) { - std::size_t sz = m_vRPN.size(); + int sz = m_vRPN.size(); qreal &x = m_vRPN[sz-2].Val.data2, &y = m_vRPN[sz-1].Val.data2; switch (a_Oprt) @@ -230,7 +230,7 @@ void QmuParserByteCode::AddOp(ECmdCode a_Oprt) if (m_bEnableOptimizer) { - std::size_t sz = m_vRPN.size(); + int sz = m_vRPN.size(); // Check for foldable constants like: // cmVAL cmVAL cmADD @@ -413,12 +413,12 @@ void QmuParserByteCode::AddFun(generic_fun_type a_pFun, int a_iArgc) { if (a_iArgc>=0) { - m_iStackPos = m_iStackPos - a_iArgc + 1; + m_iStackPos = m_iStackPos - static_cast(a_iArgc) + 1; } else { // function with unlimited number of arguments - m_iStackPos = m_iStackPos + a_iArgc + 1; + m_iStackPos = static_cast(static_cast(m_iStackPos) + a_iArgc + 1); } m_iMaxStackSize = qMax(m_iMaxStackSize, static_cast(m_iStackPos)); @@ -438,7 +438,7 @@ void QmuParserByteCode::AddFun(generic_fun_type a_pFun, int a_iArgc) */ void QmuParserByteCode::AddBulkFun(generic_fun_type a_pFun, int a_iArgc) { - m_iStackPos = m_iStackPos - a_iArgc + 1; + m_iStackPos = static_cast(static_cast(m_iStackPos) - a_iArgc + 1); m_iMaxStackSize = qMax(m_iMaxStackSize, static_cast(m_iStackPos)); SToken tok; @@ -458,7 +458,7 @@ void QmuParserByteCode::AddBulkFun(generic_fun_type a_pFun, int a_iArgc) */ void QmuParserByteCode::AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx) { - m_iStackPos = m_iStackPos - a_iArgc + 1; + m_iStackPos = static_cast(static_cast(m_iStackPos) - a_iArgc + 1); SToken tok; tok.Cmd = cmFUNC_STR; diff --git a/src/libs/qmuparser/qmuparserbytecode.h b/src/libs/qmuparser/qmuparserbytecode.h index 7140fe97d..8ef932e03 100644 --- a/src/libs/qmuparser/qmuparserbytecode.h +++ b/src/libs/qmuparser/qmuparserbytecode.h @@ -102,8 +102,8 @@ public: void EnableOptimizer(bool bStat); void Finalize(); void clear(); - std::size_t GetMaxStackSize() const; - int GetSize() const; + int GetMaxStackSize() const; + int GetSize() const; const SToken* GetBase() const; void AsciiDump(); private: @@ -117,12 +117,12 @@ private: unsigned m_iStackPos; /** @brief Maximum size needed for the stack. */ - std::size_t m_iMaxStackSize; + unsigned m_iMaxStackSize; /** @brief The actual rpn storage. */ - rpn_type m_vRPN; + rpn_type m_vRPN; - bool m_bEnableOptimizer; + bool m_bEnableOptimizer; void ConstantFolding(ECmdCode a_Oprt); }; @@ -134,9 +134,9 @@ inline void QmuParserByteCode::EnableOptimizer(bool bStat) } //--------------------------------------------------------------------------------------------------------------------- -inline std::size_t QmuParserByteCode::GetMaxStackSize() const +inline int QmuParserByteCode::GetMaxStackSize() const { - return m_iMaxStackSize+1; + return static_cast(m_iMaxStackSize+1); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/qmuparser/qmuparsercallback.cpp b/src/libs/qmuparser/qmuparsercallback.cpp index df19b7fb0..6f1cd95da 100644 --- a/src/libs/qmuparser/qmuparsercallback.cpp +++ b/src/libs/qmuparser/qmuparsercallback.cpp @@ -310,14 +310,19 @@ QmuParserCallback::QmuParserCallback() QmuParserCallback::QmuParserCallback ( const QmuParserCallback &ref ) : m_pFun ( ref.m_pFun ), m_iArgc ( ref.m_iArgc ), m_iPri ( ref.m_iPri ), m_eOprtAsct ( ref.m_eOprtAsct ), m_iCode ( ref.m_iCode ), m_iType ( ref.m_iType ), m_bAllowOpti ( ref.m_bAllowOpti ) +{} + +//--------------------------------------------------------------------------------------------------------------------- +QmuParserCallback &QmuParserCallback::operator=(const QmuParserCallback &a_Fun) { - m_pFun = ref.m_pFun; - m_iArgc = ref.m_iArgc; - m_bAllowOpti = ref.m_bAllowOpti; - m_iCode = ref.m_iCode; - m_iType = ref.m_iType; - m_iPri = ref.m_iPri; - m_eOprtAsct = ref.m_eOprtAsct; + m_pFun = a_Fun.m_pFun; + m_iArgc = a_Fun.m_iArgc; + m_bAllowOpti = a_Fun.m_bAllowOpti; + m_iCode = a_Fun.m_iCode; + m_iType = a_Fun.m_iType; + m_iPri = a_Fun.m_iPri; + m_eOprtAsct = a_Fun.m_eOprtAsct; + return *this; } } // namespace qmu diff --git a/src/libs/qmuparser/qmuparsercallback.h b/src/libs/qmuparser/qmuparsercallback.h index eac19aa21..f6573a5f9 100644 --- a/src/libs/qmuparser/qmuparsercallback.h +++ b/src/libs/qmuparser/qmuparsercallback.h @@ -77,6 +77,7 @@ public: QmuParserCallback(strfun_type3 a_pFun, bool a_bAllowOpti); QmuParserCallback(); QmuParserCallback(const QmuParserCallback &a_Fun); + QmuParserCallback &operator=(const QmuParserCallback &a_Fun); QmuParserCallback* Clone() const; bool IsOptimizable() const; diff --git a/src/libs/qmuparser/qmuparsererror.cpp b/src/libs/qmuparser/qmuparsererror.cpp index fdcc0a27a..594fe89df 100644 --- a/src/libs/qmuparser/qmuparsererror.cpp +++ b/src/libs/qmuparser/qmuparsererror.cpp @@ -127,10 +127,10 @@ QmuParserError::QmuParserError ( const QString &sMsg ) //--------------------------------------------------------------------------------------------------------------------- /** * @brief Construct an error object. - * @param [in] a_iErrc the error code. + * @param [in] iErrc the error code. * @param [in] sTok The token string related to this error. * @param [in] sExpr The expression related to the error. - * @param [in] a_iPos the position in the expression where the error occured. + * @param [in] iPos the position in the expression where the error occured. */ QmuParserError::QmuParserError ( EErrorCodes iErrc, const QString &sTok, const QString &sExpr, int iPos ) : QException(), m_sMsg(), m_sExpr ( sExpr ), m_sTok ( sTok ), m_iPos ( iPos ), m_iErrc ( iErrc ), @@ -144,8 +144,8 @@ QmuParserError::QmuParserError ( EErrorCodes iErrc, const QString &sTok, const Q //--------------------------------------------------------------------------------------------------------------------- /** * @brief Construct an error object. - * @param [in] iErrc the error code. - * @param [in] iPos the position in the expression where the error occured. + * @param [in] a_iErrc the error code. + * @param [in] a_iPos the position in the expression where the error occured. * @param [in] sTok The token string related to this error. */ QmuParserError::QmuParserError ( EErrorCodes a_iErrc, int a_iPos, const QString &sTok ) diff --git a/src/libs/qmuparser/qmuparsertoken.h b/src/libs/qmuparser/qmuparsertoken.h index 4c40a0820..933f4ebde 100644 --- a/src/libs/qmuparser/qmuparsertoken.h +++ b/src/libs/qmuparser/qmuparsertoken.h @@ -218,12 +218,12 @@ public: * Member variables not necessary for variable tokens will be invalidated. * @throw nothrow */ - QmuParserToken& SetString ( const TString &a_strTok, std::size_t a_iSize ) + QmuParserToken& SetString ( const TString &a_strTok, int a_iSize ) { m_iCode = cmSTRING; m_iType = tpSTR; m_strTok = a_strTok; - m_iIdx = static_cast ( a_iSize ); + m_iIdx = a_iSize; m_pTok = 0; m_pCallback.reset ( 0 ); diff --git a/src/libs/qmuparser/qmuparsertokenreader.cpp b/src/libs/qmuparser/qmuparsertokenreader.cpp index 2cc4aa02e..94deeba63 100644 --- a/src/libs/qmuparser/qmuparsertokenreader.cpp +++ b/src/libs/qmuparser/qmuparsertokenreader.cpp @@ -306,7 +306,7 @@ void QmuParserTokenReader::SetParent ( QmuParserBase *a_pParent ) * @brief Extract all characters that belong to a certain charset. * * @param a_szCharSet [in] Const char array of the characters allowed in the token. - * @param a_strTok [out] The string that consists entirely of characters listed in a_szCharSet. + * @param a_sTok [out] The string that consists entirely of characters listed in a_szCharSet. * @param a_iPos [in] Position in the string from where to start reading. * @return The Position of the first character not listed in a_szCharSet. * @throw nothrow @@ -316,7 +316,7 @@ int QmuParserTokenReader::ExtractToken ( const QString &a_szCharSet, QString &a_ const std::wstring m_strFormulaStd = m_strFormula.toStdWString(); const std::wstring a_szCharSetStd = a_szCharSet.toStdWString(); - int iEnd = static_cast(m_strFormulaStd.find_first_not_of ( a_szCharSetStd, a_iPos )); + int iEnd = static_cast(m_strFormulaStd.find_first_not_of ( a_szCharSetStd, static_cast(a_iPos) )); if ( iEnd == static_cast(string_type::npos) ) { @@ -346,7 +346,7 @@ int QmuParserTokenReader::ExtractOperatorToken ( QString &a_sTok, int a_iPos ) c const std::wstring m_strFormulaStd = m_strFormula.toStdWString(); const std::wstring oprtCharsStd = m_pParser->ValidInfixOprtChars().toStdWString(); - int iEnd = static_cast( m_strFormulaStd.find_first_not_of ( oprtCharsStd, a_iPos ) ); + int iEnd = static_cast( m_strFormulaStd.find_first_not_of ( oprtCharsStd, static_cast(a_iPos) ) ); if ( iEnd == static_cast( string_type::npos ) ) { iEnd = static_cast( m_strFormulaStd.length() ); @@ -1015,7 +1015,7 @@ bool QmuParserTokenReader::IsString ( token_type &a_Tok ) * * @param a_iErrc [in] The error code of type #EErrorCodes. * @param a_iPos [in] The position where the error was detected. - * @param a_strTok [in] The token string representation associated with the error. + * @param a_sTok [in] The token string representation associated with the error. * @throw ParserException always throws thats the only purpose of this function. */ void Q_NORETURN QmuParserTokenReader::Error ( EErrorCodes a_iErrc, int a_iPos, const QString &a_sTok ) const diff --git a/src/libs/vpropertyexplorer/vproperty.cpp b/src/libs/vpropertyexplorer/vproperty.cpp index ed0bd6e99..2b185a256 100644 --- a/src/libs/vpropertyexplorer/vproperty.cpp +++ b/src/libs/vpropertyexplorer/vproperty.cpp @@ -414,3 +414,6 @@ void VProperty::ValueChildChanged(const QVariant &value, int typeForParent) Q_UNUSED(value) Q_UNUSED(typeForParent) } + +UserChangeEvent::~UserChangeEvent() +{} diff --git a/src/libs/vpropertyexplorer/vproperty.h b/src/libs/vpropertyexplorer/vproperty.h index 2a57c9d66..fd33f589f 100644 --- a/src/libs/vpropertyexplorer/vproperty.h +++ b/src/libs/vpropertyexplorer/vproperty.h @@ -41,6 +41,7 @@ class UserChangeEvent : public QEvent { public: UserChangeEvent() : QEvent(static_cast(MyCustomEventType)) {} + virtual ~UserChangeEvent(); }; class VPropertyPrivate; diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pro b/src/libs/vpropertyexplorer/vpropertyexplorer.pro index 1fc339927..69068d79c 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pro +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pro @@ -95,4 +95,43 @@ unix { INSTALLS += target } -QMAKE_CXXFLAGS += -gdwarf-3 +CONFIG(debug, debug|release){ + # Debug + unix { + *-g++{ + QMAKE_CXXFLAGS += \ + -isystem "/usr/include/qt5" \ + -isystem "/usr/include/qt5/QtWidgets" \ + -isystem "/usr/include/qt5/QtXml" \ + -isystem "/usr/include/qt5/QtGui" \ + -isystem "/usr/include/qt5/QtXmlPatterns" \ + -isystem "/usr/include/qt5/QtCore" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$GCC_CXXFLAGS + } + #Turn on Clang warnings + clang*{ + QMAKE_CXXFLAGS += \ + -isystem "/usr/include/qt5" \ + -isystem "/usr/include/qt5/QtWidgets" \ + -isystem "/usr/include/qt5/QtXml" \ + -isystem "/usr/include/qt5/QtGui" \ + -isystem "/usr/include/qt5/QtCore" \ + -isystem "/usr/include/qt5/QtXmlPatterns" \ + -isystem "$${OUT_PWD}/$${MOC_DIR}" \ + $$CLANG_CXXFLAGS + } + } else { + *-g++{#Don't use additional GCC keys on Windows system. + QMAKE_CXXFLAGS += -O0 -Wall -Wextra -pedantic + } + } + +}else{ + # Release + *-g++{ + QMAKE_CXXFLAGS += -O2 + } + + DEFINES += QT_NO_DEBUG_OUTPUT +} diff --git a/src/libs/vpropertyexplorer/vpropertyformview.h b/src/libs/vpropertyexplorer/vpropertyformview.h index 1a26e6f4c..1d7c67a4f 100644 --- a/src/libs/vpropertyexplorer/vpropertyformview.h +++ b/src/libs/vpropertyexplorer/vpropertyformview.h @@ -60,7 +60,7 @@ public slots: //! Set the property set to use. Note that if using a property set directly, adding and removing properties to the //! property set leads to undifined behaviour for the property set misses notification signals. - //! \param model The property set to use + //! \param property_set The property set to use void setPropertySet(VPropertySet* property_set); //! Called when a row gets removed in the model diff --git a/src/libs/vpropertyexplorer/vpropertymodel.h b/src/libs/vpropertyexplorer/vpropertymodel.h index 615507c17..9e07b2392 100644 --- a/src/libs/vpropertyexplorer/vpropertymodel.h +++ b/src/libs/vpropertyexplorer/vpropertymodel.h @@ -106,7 +106,6 @@ public: //! Returns the ID of the property within the model //! The concept of property IDs is, that the object that manages the properties //! and not the properties themselves handle the IDs. - //! \param property //! \return Returns the ID under which the property is stored within the model virtual QString getPropertyID(VProperty* prop) const; @@ -133,7 +132,6 @@ public: //! \param property_set The new property set. Setting this to NULL has the same effect as calling clear. //! \param emit_signals Default: true. Set this to false if you want to prevent the model from emmiting the reset //! model signals - //! \return A constant pointer to the property set or NULL if there currently is none. virtual void setPropertySet(VPropertySet* property_set, bool emit_signals = true); //! Removes a property from the model and returns it