summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2018-09-16rename conststringfield loplugin to staticconstfieldNoel Grandin
in preparation for making it more general Change-Id: I2fc8d0f99140dc7ef72341f8cbf28d6536ebd61f Reviewed-on: https://gerrit.libreoffice.org/60525 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-14Check that loplugin:unreffun warns for explicitly "extern" functionsStephan Bergmann
Change-Id: Ic43f007af4480b358916c2b27796a9b248ea9eb7 Reviewed-on: https://gerrit.libreoffice.org/60496 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-14Improve loplugin:simplifyconstruct warningsStephan Bergmann
Change-Id: I0a64d0eb9938d5a99416dbe4078ba4c05e5d588b Reviewed-on: https://gerrit.libreoffice.org/60465 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-13loplugin:simplifyconstruct exclude std::unique_ptr with custom deleterNoel Grandin
Change-Id: I8f4ba883747a2aace88786ef807fd7c338bef5da
2018-09-13new loplugin simplifyconstructNoel Grandin
no need to init smart pointers with nullptr, they all have default constructors that do this already Change-Id: Ief20c060daa0def8c1aa82f1cf8dc4bc696761e9 Reviewed-on: https://gerrit.libreoffice.org/59818 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-13new loplugin:constfieldsNoel Grandin
look for fields which are only assigned to in the constructor, so they can be made const Change-Id: I0b76817c2181227b04f6a29d6a808f5e31999765 Reviewed-on: https://gerrit.libreoffice.org/60393 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-12loplugin:unusedmethodsNoel Grandin
Change-Id: I0f96c41ab61bd4bfaf6c36d78d0a2ca768da0032 Reviewed-on: https://gerrit.libreoffice.org/60314 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11loplugin:unusedfieldsNoel Grandin
Change-Id: Ic7871f3a40668ba73aa0f0067a45455920d55890 Reviewed-on: https://gerrit.libreoffice.org/60313 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11loplugin:unusedmethodsNoel Grandin
Change-Id: I34009aabf0befb346470b5c0d96ad8fc476b7c4e Reviewed-on: https://gerrit.libreoffice.org/60300 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11loplugin:unusedfieldsNoel Grandin
Change-Id: I876183559a7d9f1e6d914fbf37d7ffe91459144e Reviewed-on: https://gerrit.libreoffice.org/60278 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11loplugin:constantparamNoel Grandin
Change-Id: Ia11bf93768d5f722b7fe62df15f24809cb7e7f04 Reviewed-on: https://gerrit.libreoffice.org/60280 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11fix loplugin:unusedmethodsNoel Grandin
revert the part of commit 9f4d23c15115d64febd6bf01f870cc157badd350 Date: Mon Aug 13 17:24:26 2018 +0200 filter out some of the AST in the plugins that applied to this plugin. Turns out it really needs to see __all__ the code in order to produce good results. Change-Id: If580a701049d2570f2a833327b2189641090079b Reviewed-on: https://gerrit.libreoffice.org/60279 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-11prevent crashes when running the global-analysis pluginsNoel Grandin
Change-Id: Ib50583289afd6212d5d5aedd3d6b7ede75902052 Reviewed-on: https://gerrit.libreoffice.org/60277 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-08Replace find_if with proper quantifier algorithmsArkadiy Illarionov
Missed in 085269d25a705b656436feac47149296b4b4b35d Change-Id: I3cfab57232908b48d090658e0fbc948d62b3fc6f Reviewed-on: https://gerrit.libreoffice.org/60180 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-07weld writer page style dialog and SvxBorderBackgroundDlgCaolán McNamara
writer, format page is complete Change-Id: I09f6e4354461c4374cdb0d0e0754dfee35415b45 Reviewed-on: https://gerrit.libreoffice.org/60058 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-03loplugin:useuniqueptr update exclusionsNoel Grandin
Change-Id: I9c741dbaba772550b4d68406fff50d8b0ac60874 Reviewed-on: https://gerrit.libreoffice.org/59923 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-30Fix typosAndrea Gelmini
Change-Id: Ia658776bce8744e7b771559ca12b94a20923fc52 Reviewed-on: https://gerrit.libreoffice.org/59782 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-29new loplugin:oustringbufferNoel Grandin
look for places where we are appending the temporary result of adding strings together, to an OUStringBuffer, where we could rather call append repeatedly and avoid the temporary creation Change-Id: I481435124291ac7fb54b91a78344a9fe5b379a82 Reviewed-on: https://gerrit.libreoffice.org/59708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-23filter out AST in more pluginsNoel Grandin
I seem to have missed quite a few in commit 9f4d23c15115d64febd6bf01f870cc157badd350 filter out some of the AST in the plugins This nets me another 14% improvement Change-Id: I39b980b49ced560f768045dbedd3ddfef29306c1 Reviewed-on: https://gerrit.libreoffice.org/59501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-23Avoid warnings about unused private fieldsStephan Bergmann
Change-Id: If8fa47120f8dd7453a30f28ca9f726cbcbb80dc2
2018-08-22new loplugin:conststringfieldNoel Grandin
Look for const string fields which can be static, and mostly convert them to OUStringLiteral And add a getLength() method to OUStringLiteral to make the transition easier. Remove dead code in XclExpRoot::GenerateDefaultEncryptionData, default password is never empty. Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091 Reviewed-on: https://gerrit.libreoffice.org/59204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22improvements to loplugin:useuniqueptrNoel Grandin
find more patterns of deleting member data Change-Id: I8913e364200dad8405bac30dd8cab2a68c8bee8f Reviewed-on: https://gerrit.libreoffice.org/59233 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22rename FontSelectPatternAttributes to FontSelectPatternCaolán McNamara
Change-Id: I2c018e2e61707c0d89178b0cb38a0918906e23cb Reviewed-on: https://gerrit.libreoffice.org/59390 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-21loplugin useuniqueptr improvementNoel Grandin
passing owning pointers to constructors Change-Id: I4e64cabbf449393b77162a845b3138be415e2dc9 Reviewed-on: https://gerrit.libreoffice.org/59346 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-19Translate German variable namesJohnny_M
Change-Id: I6b5fb91cbf32ce082fb77989e1b9ac5e8ecfe438 Reviewed-on: https://gerrit.libreoffice.org/59283 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-18new loplugin intvsfloatNoel Grandin
This was a good idea from mike kaganski as a consequence of https://gerrit.libreoffice.org/55359 Unfortunately, clang/llvm is not yet up to the job of doing floating point evaluation, I get tons of crashes all over the evaluate infrastruction inside clang, so this will need to wait until clang's code matures. So park it in store for now Change-Id: I5ba4de8323e462b4fd4db301e4d116a81fd56ed3 Reviewed-on: https://gerrit.libreoffice.org/59254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-17update loplugin returnconstantNoel Grandin
to find more stuff, and return less false positives Change-Id: I24cacbb825c1f7484fd568230051b1a57dbc663f Reviewed-on: https://gerrit.libreoffice.org/59137 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-17Avoid loplugin:redundantcast false positive involving decltypeStephan Bergmann
..with libc++ on macOS: > /Users/stephan/Software/lo2/core/sw/source/core/doc/CntntIdxStore.cxx:238:44: error: static_cast from 'decltype(__x.base() - __y.base())' (aka 'long') prvalue to 'long' prvalue is redundant [loplugin:redundantcast] > const MarkEntry aEntry = { static_cast<long>(ppBkmk - pMarkAccess->getAllMarksBegin()), false, pBkmk->GetMarkPos().nContent.GetIndex() }; > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I94ab3d828482462c0fde26e19c9cc6508efa00fe Reviewed-on: https://gerrit.libreoffice.org/59240 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-16Adapt loplugin:ptrvector to libc++ (on macOS)Stephan Bergmann
...where it produced false positive > /Users/stephan/Software/lo2/core/UnoControls/source/controls/progressmonitor.cxx:245:21: error: do not call operator== on a std container containing a unique_ptr const class std::__1::__wrap_iter<class std::__1::unique_ptr<struct unocontrols::IMPL_TextlistItem, struct std::__1::default_delete<struct unocontrols::IMPL_TextlistItem> > *> [loplugin:ptrvector] > if (itr != maTextlist_Top.end()) > ^ Change-Id: I8a8b6f30145e6aff2caa03c03f0fd20af0ba42b5 Reviewed-on: https://gerrit.libreoffice.org/59181 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-14Adapt new code to getLocStart renameStephan Bergmann
Change-Id: I96cabd351e06de6b3e728c456bd05156572822c9
2018-08-14filter out some of the AST in the pluginsNoel Grandin
by checking if the current namespace decl is in our code, so we have to scan less stuff, which results in a 10% perf improvement for me Change-Id: Idf0e30d57b6d0dcd13daa9ed679c28b9d233d387 Reviewed-on: https://gerrit.libreoffice.org/58942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14SvxCharSetColorItem can be removedNoel Grandin
and just use SvxColorItem in its stead, all of it's special functionality has been removed over time Change-Id: I61a4d1fb92d9dccbdfc5bbb6d1a41692b83eb320 Reviewed-on: https://gerrit.libreoffice.org/58938 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-13Various loplugin warnings in mysqlStephan Bergmann
I assume the "0 == " around columnStringValue.equalsIgnoreAsciiCase in ODatabaseMetaData::getSchemas (mysqlc/source/mysqlc_databasemetadata.cxx) was just a thinko, as the latter already returns sal_Bool, not a <0 / 0 / >0 integer value. (Rebased atop ce24919c01d1ab77f962137ff04a31dd5ec944af "loplugin, various in mysqlc", which covered the same warnings, but didn't consider the negated call to equalsIgnoreAsciiCase to be an accident as I do here (see above), and accidentally reversed the logic of OResultSetMetaData::isNullable in mysqlc/source/mysqlc_resultsetmetadata.cxx, I think.) Change-Id: Ie89cc8ef7c7638d28307a4b240930d387d75b8f2 Reviewed-on: https://gerrit.libreoffice.org/58908 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-11loplugin:unusedmethodsNoel Grandin
mostly this seems to be fallout from commit 089a4f245325a5be5cd5951d85305d791b4d9cb6 Date: Mon Aug 6 14:55:04 2018 +0200 remove Calc's software interpreter Change-Id: Ib48696e724969a28a7d41155ba1573fd9cd58be6 Reviewed-on: https://gerrit.libreoffice.org/58869 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-10Avoid -Werror=deprecated-declarations with recent Clang trunkStephan Bergmann
...which first added alternative names to and then deprecated getLocBegin/End Change-Id: Iaefb8ce259057abfa6cd20f0b63c0ef2949a96b2 Reviewed-on: https://gerrit.libreoffice.org/58820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-09loplugin:unusedmethodsNoel Grandin
Change-Id: I0308ddd467ab6e283c0503f98885a248eb28290c Reviewed-on: https://gerrit.libreoffice.org/58738 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-08loplugin:singlevalfieldsNoel Grandin
Change-Id: I75554209ad247173381ea96a14c8bf532bed13a8 Reviewed-on: https://gerrit.libreoffice.org/58724 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-08loplugin:unnecessaryvirtualNoel Grandin
Change-Id: I3fe82f6e3aad299fe42d6256c0deaba1339df0c1 Reviewed-on: https://gerrit.libreoffice.org/58708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-08loplugin:unusedfieldsNoel Grandin
Change-Id: I9ae44279f1cce06bd6868005fbb878ba4894aed7 Reviewed-on: https://gerrit.libreoffice.org/58706 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-02loplugin:stringloop in variousNoel Grandin
Change-Id: Ia400e67108e622ae63a8d59667eae96c858f22dc Reviewed-on: https://gerrit.libreoffice.org/58463 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-31loplugin:unnecessaryoverride small improvementNoel Grandin
when we have two definitions of the same method in a straight inheritance path up our hierarchy, we were missing a warning Change-Id: Ibc0f11644c7321a0d5618024860c2503665d8835 Reviewed-on: https://gerrit.libreoffice.org/58354 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-30loplugin:useuniqueptr in SwGrfExtPageNoel Grandin
Change-Id: Ic71cf09b6a443f6918b074010fe53ea0843bf246 Reviewed-on: https://gerrit.libreoffice.org/58238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-28Prevent loplugin:unreffun on explicitly defaulted special membersStephan Bergmann
...as started to appear (with sufficiently recent Clang versions only, it appears) after c5fcb476ac8eab18152a7f6d0487daa56231fcf8 "toolkit: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)": > [CXX] toolkit/source/controls/spinningprogress.cxx > toolkit/source/controls/spinningprogress.cxx:38:5: error: Unreferenced externally invisible function definition [loplugin:unreffun] > SpinningProgressControlModel(SpinningProgressControlModel &&) = default; > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Id78cd2d801e9760dde9e0a594e2b62ec20840204 Reviewed-on: https://gerrit.libreoffice.org/58180 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-27new loplugin:stringloop, and applied in variousNoel Grandin
look for OUString being appended to in a loop, better to use OUStringBuffer to accumulate the results. Change-Id: Ia36e06e2781a7c546ce9cbad62727aa4c5f10c4b Reviewed-on: https://gerrit.libreoffice.org/58092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-26fix warning towards clang7Noel Grandin
warning: binding reference member 'n1_' to stack allocated parameter 'n1' Change-Id: Ifa4c1520453e00d6fc35411fa0edbf2bf2b42708
2018-07-26Silence loplugin:staticaccess in Windows ATL macros (clang-cl)Stephan Bergmann
Change-Id: I18cde30e132b8209d189e9438b49a1c3e5a36672 Reviewed-on: https://gerrit.libreoffice.org/57997 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-25new loplugin:returnconstantNoel Grandin
look for methods that always return the same value Change-Id: I5f1c5b58a985ecf5f7765a2d4ebd464eae5ef76f Reviewed-on: https://gerrit.libreoffice.org/57973 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr in rptui::ConditionNoel Grandin
Change-Id: I1197be1f7ea8b621dedef41fdd0a664cb6d90374 Reviewed-on: https://gerrit.libreoffice.org/57879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr fix check for DELETEZ inside compound stmtNoel Grandin
Change-Id: Id748b8b0c9cfe8c288dfafb5d0c2a83a8de2c91c Reviewed-on: https://gerrit.libreoffice.org/57871 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr in SwHTMLWriterNoel Grandin
Change-Id: I67f3dd615e798f8ac865b57332f6153530d81929 Reviewed-on: https://gerrit.libreoffice.org/57863 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>