summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)AuthorFilesLines
2019-02-13Make loplugin:stringconcat more robustStephan Bergmann2-12/+83
Change-Id: Ib8adefd90141007c0422b4c15ba9c2cc5f707f3f Reviewed-on: https://gerrit.libreoffice.org/67762 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-13Fix typoAndrea Gelmini1-1/+1
Change-Id: I036a41bd4d46973a8b6fb51a90c6506cf3f9b8f0 Reviewed-on: https://gerrit.libreoffice.org/67748 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-02-12More loplugin:indentation Qt "emit" hackeryStephan Bergmann1-1/+2
Change-Id: I6f71546a5f6ab07bb4df6fc89213962e74984c84
2019-02-11new loplugin writeonlyvarsNoel Grandin2-0/+1295
largely based on the relevant portion of the unusedfields loplugin, but adapted for local vars Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1 Reviewed-on: https://gerrit.libreoffice.org/66835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-11use more hasPathnamePrefixNoel Grandin5-66/+45
Change-Id: I539e6aedad61d80b6ebe80104b77d720072395bd
2019-02-11remove debugging codeNoel Grandin1-7/+1
Change-Id: Ibb6f3a1c711959cb4f32541dba96f005e51c9040
2019-02-11loplugin:indentation workaround qt macrosNoel Grandin1-0/+9
Change-Id: I17bb0b462bb4ce7e8128c9ad33491aa8b691e566
2019-02-11new loplugin indentationNoel Grandin2-0/+269
look for mixed indentation in compound statements, which makes them hard to read, and sometimes makes it look like a statement is associated with a nearby if/for Change-Id: Ic8429cee1f9a86d938097a4a8769a2bce97b3361 Reviewed-on: https://gerrit.libreoffice.org/63283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-31Fix compilerplugins/clang/test/useuniqueptr.cxx for clang-clStephan Bergmann1-1/+1
...where it failed with > error: 'error' diagnostics expected but not seen: > File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 266: rather manage this var with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr] > File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 275: rather manage this member with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr] apparently due to differences in how some std types are implemented. Change-Id: Ib81ed1a1da867359e7f22bb6fb6ceb3e610e2b41 Reviewed-on: https://gerrit.libreoffice.org/67226 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-31loplugin:unusedfileds is no-op on Windows, so don't run its test thereStephan Bergmann1-2/+8
But nevertheless, make sure that the variables m_bar9/10 used in combination with css::uno::Any have UNO-compatible type. Change-Id: I241d8b5d37de60b00b5bfdc69e642872b28e8ee2 Reviewed-on: https://gerrit.libreoffice.org/67201 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-25loplugin:unusedmethodsNoel Grandin2-162/+114
Change-Id: Ifb0c479e9d1aed1cd90d78ed23902fc05db556d6 Reviewed-on: https://gerrit.libreoffice.org/66862 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-25improve loplugin constparamsNoel Grandin2-28/+35
Change-Id: Ic1833dbd030044011e7ee5f89dc35737e5469f05 Reviewed-on: https://gerrit.libreoffice.org/66586 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-18update useunique_ptr lopluginNoel Grandin2-21/+85
with more exclusions Change-Id: I95e7376ecf9c479d05b85c71f863d9ba40417538 Reviewed-on: https://gerrit.libreoffice.org/66552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-16New loplugin:emptyStephan Bergmann1-0/+186
Change-Id: I8729db064573ac21dfe6b203c5ae244d79ecc4fe Reviewed-on: https://gerrit.libreoffice.org/66430 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-11Drop o3tl/string_view.hxxStephan Bergmann1-2/+0
...now that all of its uses have been replaced with C++17 <string_view>. The LO-specific o3tl::basic_string_view ctors with OString and OUString params have meanwhile been replaced with OString and OUString conversion functions (in dac7be50cff94e0c34cdca5ac7e35c19685c40c1 "o3tl::string_view -> std::string_view (in configmgr)"), the ctor with OUStringLiteral turned out to be no longer(?) needed anyway, and the LO-specific o3tl::toOUString has meanwhile been replaced with an OUString ctor with std::u16string_view param (in 6856da30665705be6380e84cf55de954c41f15d1 "o3tl::string_view -> std::string_view (in embedserv)"). Change-Id: Ie5215b07e2387560fb7e94de8b5a963241539c64 Reviewed-on: https://gerrit.libreoffice.org/66144 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-08loplugin:constantparamNoel Grandin3-397/+357
Change-Id: Id5c7e66b8f8bc324f097dd739ce683d74fc6491b Reviewed-on: https://gerrit.libreoffice.org/65953 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-01Bump copyright year to 2019Adolfo Jayme Barrientos1-1/+1
Change-Id: I0d49ec7db57a0f7d18489dad61e86cbfdf4418cd
2018-12-28Fix typo in codeAndrea Gelmini1-1/+1
Change-Id: I3a4bfbd84735ddcc8d2d0754973f73a98e06c303 Reviewed-on: https://gerrit.libreoffice.org/65652 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-21loplugin:unnecessaryvirtualNoel Grandin1-4/+4
Change-Id: I4ca101ba838afecbbc8e841a6a9fa6c9c0460f14 Reviewed-on: https://gerrit.libreoffice.org/65497 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-21loplugin:unusedfieldsNoel Grandin4-83/+67
Change-Id: Ib41c168817c30ce11baf99c3f43005313fe484ff Reviewed-on: https://gerrit.libreoffice.org/65496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-21loplugin:unusedmethodsNoel Grandin2-140/+124
Change-Id: I63f03bd1a0510bf411341e1a04a40eb7fce2d57e Reviewed-on: https://gerrit.libreoffice.org/65495 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-13loplugin:unusedfields improve write-only logicNoel Grandin6-78/+238
when dealing with modifications to container classes (e.g. std::vector) Change-Id: Ic30043631007355ee9a3d9e3f9b6488b435182d6 Reviewed-on: https://gerrit.libreoffice.org/65050 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-13loplugin:constantparamNoel Grandin4-729/+805
Change-Id: I389f98d06058ba65a8c2d4df2bf7d4e5102659ad Reviewed-on: https://gerrit.libreoffice.org/65017 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-12weld SwCaptionOptPageCaolán McNamara1-2/+0
Change-Id: I3373a39d6d8b39717b7aec69544a9d2957db15d8 Reviewed-on: https://gerrit.libreoffice.org/65010 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-12-11loplugin:unusedfieldsNoel Grandin4-108/+56
Change-Id: I9f11c29a5bcb3512717ad01962f5645de96afe0b Reviewed-on: https://gerrit.libreoffice.org/64918 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11loplugin:useuniqueptr in svtools,toolkitsNoel Grandin1-12/+15
Change-Id: Ied7768293e7781772205c9e8f9fb743a584e3125 Reviewed-on: https://gerrit.libreoffice.org/64880 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11accessibletable.hxx no more existsAndrea Gelmini1-4/+0
Change-Id: I209c1483ee668c29e68b7a5412eff740eda348d1 Reviewed-on: https://gerrit.libreoffice.org/63849 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11loplugin:useuniqueptr in vclNoel Grandin1-2/+9
Change-Id: I24eca813321fd3919bba9d37c285484f865ea2ea Reviewed-on: https://gerrit.libreoffice.org/64877 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10cppcheck: incorrectStringBooleanErrorJulien Nabet2-3/+3
Change-Id: I7f4bce8444c6c022d856d20b06de4a4834148ea2 Reviewed-on: https://gerrit.libreoffice.org/64834 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-12-10loplugin:unnecessaryvirtualNoel Grandin2-48/+46
Change-Id: I15633651aaa914918f1e7739c4f3d4793f7d800a Reviewed-on: https://gerrit.libreoffice.org/64831 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10loplugin:unusedfieldsNoel Grandin4-118/+174
Change-Id: I03e8814407fd8e345cb07ac433db4230b4d96e10 Reviewed-on: https://gerrit.libreoffice.org/64822 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-09loplugin:unusedmethodsNoel Grandin2-176/+180
Change-Id: I4f2635d468c9ad83b3ac93733529e01a4d03f38e Reviewed-on: https://gerrit.libreoffice.org/64805 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann1-1/+1
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08Removed spurious charsAndrea Gelmini1-9/+9
$ file compilerplugins/clang/singlevalfields.results -i Before: compilerplugins/clang/singlevalfields.results: application/octet-stream; charset=binary After: compilerplugins/clang/singlevalfields.results: text/x-c; charset=iso-8859-1 Then converted to UTF-8, to avoid troubles reading it with Python/Editors without forcing latin-1, like this: UnicodeDecodeError('utf-8', b' SwWW8ImplReader::Read_F_DocInfo aName41 ZULETZTGEDRUCKT sw/source/filter/ww8/ww8par5.cxx:1569 SwWW8ImplReader::Read_F_DocInfo aName42 DERNI\xc8REIMPRESSION ', 155, 156, 'invalid continuation byte') See here: https://stackoverflow.com/questions/5552555/unicodedecodeerror-invalid-continuation-byte Change-Id: Ie54c25e069b3f12b6a28e3724f5b2d323f26f737 Reviewed-on: https://gerrit.libreoffice.org/64786 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-07loplugin:singlevalfields extend to all static varsNoel Grandin3-76/+1172
Change-Id: Ic238bb5291539fd1b7e98cb4afc9b25f37e7d528 Reviewed-on: https://gerrit.libreoffice.org/64710 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-06Remove broken rebuild of compilerplugins when CLANG_FULL_VERSION changedStephan Bergmann1-2/+0
Not all compilerplugins/clang/*.cxx depend on config_clang.h (e.g., check.cxx doesn't), so this mechanism trying to rebuild compilerplugins once the underlying Clang installation changes doesn't work reliably in practice (just debugged through this with Miklos on IRC, and it wasn't the first time that `make distclean` fixed compilerplugins for somebody after they upgraded their Clang installation). Removing the brittle mechanism shows that plugin.hxx doesn't actually depend on config_clang.h. (There's a second mechanism trying to rebuild compilerplugins once the underlying Clang installation changes, namely > # Clang most probably doesn't maintain binary compatibility, so rebuild when clang changes. > $(CLANGOUTDIR)/clang-timestamp: $(CLANGDIR)/bin/clang$(CLANG_EXE_EXT) > $(QUIET)touch $@ in compilerplugins/Makefile-clang.mk, but that doesn't work reliably either, as it depends on the newly installed clang executable being newer than our clang-timestamp file, which will be the case for self-built Clang installations, but not necessarily when updating e.g. a distro-provided Clang installation.) Change-Id: Ie576f14356b3f0e55444375095c86aa851404bf3 Reviewed-on: https://gerrit.libreoffice.org/64623 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-05loplugin:singlevalfields add checking for static class fieldsNoel Grandin3-81/+180
which required a completely different set of code Also add checking for in-class initialiser on struct/class fields Change-Id: I31e1586975aaafe23996619e2f59678c5fbc390f Reviewed-on: https://gerrit.libreoffice.org/64593 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin2-17/+48
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-04loplugin:unusedenumconstants look through parenthesesNoel Grandin5-665/+656
Change-Id: I2afdf5a56d827e283dd2362b87446ad7848cb274 Reviewed-on: https://gerrit.libreoffice.org/64452 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-02loplugin:intvsfloat get this working reliablyNoel Grandin2-28/+21
Change-Id: Ifdf1a152f6bc2e2f6edae97a5191120f630f7e49 Reviewed-on: https://gerrit.libreoffice.org/64374 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-30Make some loplugin:implicitboolconversion code use TypeCheckStephan Bergmann1-6/+3
Change-Id: If675d629784894573085122beadc6abc3e67f457 Reviewed-on: https://gerrit.libreoffice.org/64335 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-30loplugin:unusedmethodsNoel Grandin2-65/+57
Change-Id: Id0d68d659fa06a8230ed0d927b85b6b504525d1e Reviewed-on: https://gerrit.libreoffice.org/64328 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-30loplugin:unusedfieldsNoel Grandin4-190/+86
Change-Id: Ib3c797584493763773fd44fc3e8ac8b70ab0c221 Reviewed-on: https://gerrit.libreoffice.org/64326 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-30loplugin:singlevalfieldsNoel Grandin2-53/+92
Change-Id: I70dc861573fd1b3d799c88aa2a6d9a3eda0e2a43 Reviewed-on: https://gerrit.libreoffice.org/64327 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-30loplugin:unusedenumconstants ignore common patternNoel Grandin6-1522/+897
Ignore a common pattern that does not introduce any new information, merely removes information. Change-Id: I37da352c9295ec12b9dac7aad4b4792a6d726b0d Reviewed-on: https://gerrit.libreoffice.org/64255 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29loplugin:stringconstant look for unnecessary OString constructor useNoel Grandin3-57/+103
and tweak the methods in check.hxx to make them more flexible when called with dc.Class(xxx ? "foo" : "bar") Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1 Reviewed-on: https://gerrit.libreoffice.org/64207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29Revert "comment out the EvaluateAsInt compat code for now"Stephan Bergmann1-2/+1
This reverts commit da9fb5d6d9ebf9363981c370ce937d8848989fcb, obsoleted by <http://llvm.org/viewvc/llvm-project?view=revision&revision=347756> "Re-commit r347417 'Re-Reinstate 347294 with a fix for the failures.'"
2018-11-29remove unused SdrInsertFlags enum valueNoel Grandin1-2/+0
Change-Id: Ic68f2dc4e3752859c943d9885b52b70f33896aea Reviewed-on: https://gerrit.libreoffice.org/64172 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-29comment out the EvaluateAsInt compat code for nowNoel Grandin1-1/+2
sberg: Note how that Clang change keeps getting reverted; latest one is <http://llvm.org/viewvc/llvm-project?view=revision&revision=347656> "Revert r347417 'Re-Reinstate 347294 with a fix for the failures.'" But lets wait a little while to see how things settle there. Change-Id: I05b34ca1377792bcb4c557defd3e9b5d11ee2b14 Reviewed-on: https://gerrit.libreoffice.org/64168 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-28loplugin:unusedfields in swNoel Grandin4-207/+971
Change-Id: I7a9184511df96bf2a6c40e39091010a7e2974ed6 Reviewed-on: https://gerrit.libreoffice.org/64143 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>