summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2017-02-13convert ShellModes to scoped enumNoel Grandin
and drop read-only SHELL_MODE_DRAW_CTRL enumerator Change-Id: I2ccaeb492912c876b89ff9b5dccaa99e28a268b7
2017-02-13convert eF_ResT to scoped enumNoel Grandin
and drop read-only FLD_TAGTXT enumerator Change-Id: I718529082ce540c0e3bca37d969917d3b3a67f5e
2017-02-13convert SW_KeyState to scoped enumNoel Grandin
and drop unused InsDel_* enumerators. Also rename to SwKeyState to make it a little shorter and more consistent with other naming. Change-Id: I837ea8d64a0f26426567dcf78750939fc959a4a4
2017-02-11SourceManager::getFilename returns StringRefStephan Bergmann
Change-Id: I77db8565efe2e0d366afc8470308d7801a2a7337
2017-02-10loplugin:dynexcspec: Deallocation functions are implicitly non-throwingStephan Bergmann
...so a dynamic exception specification should be replaced with noexcept(false). Doesn't look like this omission made any difference when running the rewriter across the LO code base earlier, though. Change-Id: Ib0e2b412b65cae7c1a68e875bbddf93f3656cebb
2017-02-10Remove unnecessary blacklists from loplugin:stringconstantStephan Bergmann
Change-Id: I866a421a2b3e8830aaa7096adaef945a2264195e
2017-02-10remove unused enumerator from EncodedWordStateNoel Grandin
Change-Id: I793276d2b13bdb966e18acb8f13b4c7e77516898
2017-02-09restore constant to VerticalOrientationNoel Grandin
Removed in commit f4826959c1a5b0e6d2849d4240668b2087582848 "new loplugin:unusedenumconstants". And add a comment. Change-Id: I63d6f46aa92e31db08e51e47a62104dc7d3d3359 Reviewed-on: https://gerrit.libreoffice.org/34057 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-09remove ConnectionIdentifierType enumNoel Grandin
since we only use the AsciiCString enumerator. Consequently simplify the GetConnectionIdentifier method Change-Id: I9e1a1318d2f12bfd18edeb8479e0e7171b22d0f1 Reviewed-on: https://gerrit.libreoffice.org/34026 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-09Fix SAL_DEBUG_BACKTRACEStephan Bergmann
...after 56d071c10ca8016848f1f059aa3eb197fe928844 "rename SAL_DEBUG_TRACE to SAL_DEBUG_BACKTRACE" (looks like this doesn't get used much...)
2017-02-09loplugin:unusedenumconstants read-only constants in vcl (2)Noel Grandin
Change-Id: Ia3da23e0ef2fa710403745bd11255ed001516da4 Reviewed-on: https://gerrit.libreoffice.org/34020 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08loplugin:unusedenumconstants read-only constants in vclNoel Grandin
Change-Id: I8c81444cbecdc103cc47d9a4133b0b4d9010e0c2 Reviewed-on: https://gerrit.libreoffice.org/34018 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08loplugin:unusedenumconstants read-only constants in writerfilterNoel Grandin
Change-Id: I3cc0d696059b130a8f1f1d8d3b1908d2e84d1a75 Reviewed-on: https://gerrit.libreoffice.org/34017 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07convert DEBUG_TIME to scoped enumNoel Grandin
Change-Id: I91b286d8415ebc8c6675aca6ee143850c956c74b Reviewed-on: https://gerrit.libreoffice.org/33986 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07drop unused FONT_PROPTYPE_CELL constantNoel Grandin
which makes this enum not necessary anymore Change-Id: I0194634d357569aee502f1e8a7fd95c49e23040c Reviewed-on: https://gerrit.libreoffice.org/33967 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-07convert GalleryBrowserTravel to scoped enumNoel Grandin
and drop unused GALLERYBROWSERTRAVEL_CURRENT value Change-Id: Id91824cbe024d4b5109ee0755b518164837bc6a6 Reviewed-on: https://gerrit.libreoffice.org/33965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06loplugin:unusedenumconstants in ooxNoel Grandin
Convert FragmentHandler2::MCE_STATE to scoped enum and drop MCE_UNUSED constant Change-Id: Id0b3a81e61d77af5d3837527b008e196835f57cd Reviewed-on: https://gerrit.libreoffice.org/33954 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06loplugin:unusedenumconstants should apparently not be run by defaultStephan Bergmann
Change-Id: I42f479de39b94ca8e9c72a6e92534f602a9fad39
2017-02-06loplugin:unusedenumconstants in connectivity..cuiNoel Grandin
Convert ExpressionFunct to scoped enum and drop FUNC_CONST value. Convert MQueryExpressionBase::node_type to scoped enum and drop Unknown value. Dop PageType::Color value Change-Id: Icb1f5503c230fb91329acc7d9e1da665fa28d95e Reviewed-on: https://gerrit.libreoffice.org/33948 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06loplugin:unusedenumconstants in frameworkNoel Grandin
Convert EProtocol to scoped enum and drop E_UNKNOWN_PROTOCOL. Convert ToggleButtonToolbarController::Style to scoped enum and drop STYLE_TOGGLEBUTTON. Convert TargetHelper::ESpecialTarget to scoped enum and drop E_NOT_SPECIAL. Change-Id: I412adacac15192cf6563ce4d5e5b74bfffff4737 Reviewed-on: https://gerrit.libreoffice.org/33949 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06remove accidentally committed filesNoel Grandin
Change-Id: Ib41f16f945f6b7a5ba314b13ce8a7b24c35a8edb Reviewed-on: https://gerrit.libreoffice.org/33947 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06loplugin:unusedenumconstants in vclNoel Grandin
- drop TTCR_GLYPHSEQ - drop ImageType::Invalid - give preedit_data_t a default constructor, so my plugin spots that the eState field is being initalised to DontKnow effectively by a memset - document ToolbarIconSize::Small as unused, but can't remove since it might be stored in a user-setting somewhere Change-Id: I94b34bba83a04de16f95e4faec95b4bd29f3c652 Reviewed-on: https://gerrit.libreoffice.org/33887 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-03compilerplugins: enable loplugin:cppunitassertequals by defaultMiklos Vajna
This forces writing a comparision of two variables in the CPPUNIT_ASSERT_EQUALS(expected, actual) form, rather than CPPUNIT_ASSERT(actual == expected). The benefit is when the test fail, it's more clear what are these two values, rather than just seeing that they are not equal. In the relatively rare case when the types are not streamable, the plugin can be silenced using CPPUNIT_ASSERT(bool(it == foo.end())). But please always first consider making the type streamable instead. See commit 0e1b831b93048c68735f2e2dbdcee587db4862ef (CppunitTest_vcl_complextext: fix loplugin:cppunitassertequals warnings, 2016-12-16) for an example. Change-Id: I564fb0724836b6dbbea9262b53ad646e285a339c
2017-02-03new loplugin unusedenumvaluesNoel Grandin
Change-Id: I03d684fc35238a45a6d99855e5ee6d3a5e33740d
2017-02-02Fix copy/move ctor checkStephan Bergmann
Change-Id: I2993d5809204098e29a7560d666fa1aafb024a89
2017-02-02loplugin:stringconstant, this should be a breakNoel Grandin
after commit dce867e8c4863c969eea3515a988630b74708a43 "loplugin:stringconstant handle calls to constructors with one arg" Change-Id: Ib572d904a95aa96aab3c799f9b7cfb505fcee5e6
2017-02-01More ctor check fixesStephan Bergmann
Change-Id: Ifcce63b975fb7c4ac7e7545e3eadcc6f7f12e466
2017-02-01Fix ctor checkStephan Bergmann
Change-Id: Ie261d5412c510c045b4d93a6bf1a3d4cf4371897
2017-02-01loplugin: use TypeCheck instead of getQualifiedNameAsStringNoel Grandin
since the latter is rather slow Change-Id: Ib73cdb923585580777c2265b561c1808e93b2baa Reviewed-on: https://gerrit.libreoffice.org/33585 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01loplugin:useuniqueptr extend to check local varsNoel Grandin
just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01loplugin:stringconstant handle calls to constructors with one argNoel Grandin
Change-Id: Ide9148a908bef46ba14640dfa6f556beaf6e3f60 Reviewed-on: https://gerrit.libreoffice.org/33772 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31teach lolugin:stringconstant about calling constructorsNoel Grandin
so we can remove unnecessary calls to the OUString(literal) constructor when calling constructors like this: Foo(OUString("xxx"), 1) Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36 Reviewed-on: https://gerrit.libreoffice.org/33698 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-28loplugin:stringconstant check for unnecessary OUString constructor..Noel Grandin
..calls when creating exceptions Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe Reviewed-on: https://gerrit.libreoffice.org/33617 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27...and Clang 4 will have it, tooStephan Bergmann
Change-Id: Ia927ed7d1e7815e59ccb67246da6981c65683168
2017-01-27getExceptionSpecSourceRange is new in Clang 5Stephan Bergmann
Change-Id: Ifa9223fadeeb1fde54afc99874a1b3d855073dce
2017-01-27fix spelling containging->containingNoel Grandin
Change-Id: I49f736c049735e89ce9f71740f5c308120378a9a
2017-01-27improve "unnecessary user-declared destructor" checkNoel Grandin
to look for inline&empty destructors, where we can just let the compiler do it's thing Change-Id: Ibde8800bdfed6b77649c30ebc19921167c33dec3 Reviewed-on: https://gerrit.libreoffice.org/32999 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27Enable loplugin:dynexcspec rewriting modeStephan Bergmann
Change-Id: I73404287c387a36e224683f75e967d51d911175b
2017-01-27Make plugin rewriting work on Windows tooStephan Bergmann
...in a somewhat hacked-up way for now (see the TODO comment) Change-Id: Ida89fb8257b876cfca05b3048ce15996091c5703
2017-01-27Remove dynamic exception specifications from !LIBO_INTERNAL_ONLYStephan Bergmann
...only odk/examples/ remains to be clean up Change-Id: I875a1e8d6750b6b007bd75126b8010273e1f32d5
2017-01-26Make test work with older ClangStephan Bergmann
For some reason, e.g. Clang 3.8.1 doesn't evaluate std::strlen here (though it apparently does in other places in this file). Change-Id: Ib2b7dcc1d7b6ae47ef285bd2edb65e399dc11b79 Reviewed-on: https://gerrit.libreoffice.org/33547 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-25Bypass some lines that cause problems with Clang 3.8.1 at leastTor Lillqvist
Change-Id: I05202ee6b2f083e8aacf0a2a8f8d7b8b361a5df8
2017-01-25Minor loplugin:stringconstant improvementsStephan Bergmann
Change-Id: I0b39526c0f0854ddbb29e77ece303cf2bdd842c4
2017-01-24Use proper check for FunctionProtoTypeStephan Bergmann
...as at least MSVC SAL_CALL-annotated functions have an AttributeType wrapped around the FunctionProtoType. Change-Id: Ic085e2e3649e6b2fc8ca380047133a8edbe20589
2017-01-24teach unusedvariablecheck plugin about SfxPoolItem subclassesNoel Grandin
which can all be treated as SAL_WARN_UNUSED The eehtml.cxx change probably fixes some CJK/CTL bug somewhere Change-Id: I6852129540f316075aee907971ac19418d71dd9a
2017-01-23new loplugin useuniqueptrNoel Grandin
Change-Id: Ic7a8b32887c968d86568e4cfad7ddd1f4da7c73f Reviewed-on: https://gerrit.libreoffice.org/33339 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19New loplugin:dynexcspec: Add @throws documentationStephan Bergmann
See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. * The check for missing @throws documentation is not too specific, it just checks whether a function with dynamic exception specification has /any/ @throws clause, not necessarily exactly matching the exception types. (Many of the details in the existing dynamic exception specifications are probably not very useful, anyway.) * When adding @throws clauses, I bluntly copied the exception specifications except for dropping any mentions of std::exception (except in the rare cases where that was the only exception typed mentioned). * In many places it might have looked more natural to use trailing Doxygen comments of the ///< @throws ... kind, but Clang's getCommentForDecl unfortunately doesn't detect trailing comments on function decls. * Also, Clang's getCommentForDecl doesn't look into macros, so some trivial silly macros were expanded along the way to add comments where necessary. Change-Id: I1831d72df2d9c801d4b8dd7d708d9cefea039589
2017-01-16Use compat::isLookupContextStephan Bergmann
Change-Id: I5b4523929f971d0345f112ba4f5faff1181cee2b
2017-01-13inline InitGuardNoel Grandin
since it is only used in one place Change-Id: Ie541a255ddbe71105f6b58f02f372f4f45667d7a
2017-01-12Adapt loplugin:overrideparam to recent Clang trunk changeStephan Bergmann
Change-Id: Ia372e39bc7e51f290a6d631bf0b81fd75f4fdc1d