Clang warnings.

--HG--
branch : develop
This commit is contained in:
dismine 2014-09-11 19:52:02 +03:00
parent e4bf36e68e
commit 2766628037
56 changed files with 640 additions and 911 deletions

View File

@ -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

View File

@ -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.

View File

@ -547,3 +547,7 @@ const QHash<QString, QSharedPointer<VInternalVariable> > *VContainer::DataVariab
{
return &d->variables;
}
//---------------------------------------------------------------------------------------------------------------------
VContainerData::~VContainerData()
{}

View File

@ -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
/**

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -100,6 +100,7 @@ void DialogDetail::ChosenObject(quint32 id, const SceneObject &type)
break;
case (SceneObject::Line):
case (SceneObject::Detail):
case (SceneObject::Unknown):
default:
qDebug()<<tr("Got wrong scene object. Ignore.");
break;

View File

@ -37,3 +37,7 @@ VExceptionUndo::VExceptionUndo(const QString &what)
VExceptionUndo::VExceptionUndo(const VExceptionUndo &e)
:VException(e)
{}
//---------------------------------------------------------------------------------------------------------------------
VExceptionUndo::~VExceptionUndo() noexcept (true)
{}

View File

@ -36,7 +36,7 @@ class VExceptionUndo : public VException
public:
VExceptionUndo(const QString &what);
VExceptionUndo(const VExceptionUndo &e);
virtual ~VExceptionUndo() noexcept (true){}
virtual ~VExceptionUndo() noexcept (true);
};
#endif // VEXCEPTIONUNDO_H

View File

@ -67,7 +67,7 @@ public:
radius(arc.radius), formulaRadius(arc.formulaRadius), center(arc.center)
{}
virtual ~VArcData() {}
virtual ~VArcData();
/** @brief f1 start angle in degree. */
qreal f1;
@ -91,8 +91,11 @@ public:
VPointF center;
};
VArcData::~VArcData()
{}
#ifdef Q_CC_GNU
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif
#endif // VARC_P_H

View File

@ -52,7 +52,7 @@ public:
:QSharedData(obj), _id(obj._id), type(obj.type), idObject(obj.idObject), _name(obj._name), mode(obj.mode)
{}
virtual ~VGObjectData() {}
virtual ~VGObjectData();
/** @brief _id id in container. Ned for arcs, spline and spline paths. */
quint32 _id;
@ -70,8 +70,11 @@ public:
Draw mode;
};
VGObjectData::~VGObjectData()
{}
#ifdef Q_CC_GNU
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif
#endif // VGOBJECT_P_H

View File

@ -62,7 +62,7 @@ public:
:_mx(mx), _my(my), _x(point.x()), _y(point.y())
{}
virtual ~VPointFData() {}
virtual ~VPointFData();
/** @brief _mx offset name respect to x */
qreal _mx;
@ -77,8 +77,11 @@ public:
qreal _y;
};
VPointFData::~VPointFData()
{}
#ifdef Q_CC_GNU
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif
#endif // VPOINTF_P_H

View File

@ -85,7 +85,7 @@ public:
this->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

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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.

View File

@ -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.

View File

@ -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);
}

View File

@ -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.
*/

View File

@ -140,5 +140,6 @@ void VAbstractNode::RestoreReferens()
//---------------------------------------------------------------------------------------------------------------------
void VAbstractNode::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
{
Q_UNUSED(tag)
Q_UNUSED(obj)
}

View File

@ -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)
{

View File

@ -373,7 +373,8 @@ void VToolDetail::keyReleaseEvent(QKeyEvent *event)
//---------------------------------------------------------------------------------------------------------------------
void VToolDetail::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &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)
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -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<VGObject> &obj)
{
Q_UNUSED(tag)
Q_UNUSED(obj)
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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<unsigned>(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<unsigned int>(points.size() - 1) >= i && points.isEmpty() == false)
{
nullptr;
}
else if (static_cast<unsigned int>(points.size() - 1) >= i && points.isEmpty() == false)
{
return points.at(i);
return points.at(static_cast<int>(i));
}
else
{

View File

@ -32,3 +32,7 @@
UndoEvent::UndoEvent()
:QEvent(UNDO_EVENT)
{}
//---------------------------------------------------------------------------------------------------------------------
UndoEvent::~UndoEvent()
{}

View File

@ -38,6 +38,7 @@ class UndoEvent : public QEvent
{
public:
UndoEvent();
virtual ~UndoEvent();
};
#endif // UNDOEVENT_H

View File

@ -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;

View File

@ -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:

View File

@ -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<unsigned int>(alphabet.size()));
int number = static_cast<int>(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<unsigned int>(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<unsigned int>(index));
qint32 num = 1;
QString name;

View File

@ -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++{

View File

@ -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<int>(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<token_type> &a_stOpt, QStack<token_type>
//---------------------------------------------------------------------------------------------------------------------
/**
* @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<token_type> &stOpt, QStack<token_type> &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<bool>(Stack[sidx]) && static_cast<bool>(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<bool>(Stack[sidx]) || static_cast<bool>(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

View File

@ -124,7 +124,7 @@ void QmuParserByteCode::AddVar(qreal *a_pVar)
* <li>the value stored in #mc_iSizeVal number of bytecode entries.</li>
* </ul>
*
* @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<unsigned int>(a_iArgc) + 1;
}
else
{
// function with unlimited number of arguments
m_iStackPos = m_iStackPos + a_iArgc + 1;
m_iStackPos = static_cast<unsigned int>(static_cast<int>(m_iStackPos) + a_iArgc + 1);
}
m_iMaxStackSize = qMax(m_iMaxStackSize, static_cast<size_t>(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<unsigned int>(static_cast<int>(m_iStackPos) - a_iArgc + 1);
m_iMaxStackSize = qMax(m_iMaxStackSize, static_cast<size_t>(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<unsigned int>(static_cast<int>(m_iStackPos) - a_iArgc + 1);
SToken tok;
tok.Cmd = cmFUNC_STR;

View File

@ -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<int>(m_iMaxStackSize+1);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -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

View File

@ -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;

View File

@ -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 )

View File

@ -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<int> ( a_iSize );
m_iIdx = a_iSize;
m_pTok = 0;
m_pCallback.reset ( 0 );

View File

@ -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<int>(m_strFormulaStd.find_first_not_of ( a_szCharSetStd, a_iPos ));
int iEnd = static_cast<int>(m_strFormulaStd.find_first_not_of ( a_szCharSetStd, static_cast<std::size_t>(a_iPos) ));
if ( iEnd == static_cast<int>(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<int>( m_strFormulaStd.find_first_not_of ( oprtCharsStd, a_iPos ) );
int iEnd = static_cast<int>( m_strFormulaStd.find_first_not_of ( oprtCharsStd, static_cast<std::size_t>(a_iPos) ) );
if ( iEnd == static_cast<int>( string_type::npos ) )
{
iEnd = static_cast<int>( 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

View File

@ -414,3 +414,6 @@ void VProperty::ValueChildChanged(const QVariant &value, int typeForParent)
Q_UNUSED(value)
Q_UNUSED(typeForParent)
}
UserChangeEvent::~UserChangeEvent()
{}

View File

@ -41,6 +41,7 @@ class UserChangeEvent : public QEvent
{
public:
UserChangeEvent() : QEvent(static_cast<QEvent::Type>(MyCustomEventType)) {}
virtual ~UserChangeEvent();
};
class VPropertyPrivate;

View File

@ -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
}

View File

@ -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

View File

@ -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