67 Commits

Author SHA1 Message Date
Stephan Bergmann
593f3b703c Re-enable loplugin:sallogareas
I had it locally enabled for like a month now, and it did not produce any more
noise than any of the other plugins, but quite some amount of malformed area
designators had been introduced over time.

Change-Id: I642591496bb9338246ba43a3d988481930c087fb
2016-01-06 16:48:15 +01:00
Noel Grandin
00ea9e5e4e update constantfunction loplugin
Change-Id: I7917e5e17e88868a5e315bce11099d32a07ca39e
2015-12-15 10:40:50 +02:00
Stephan Bergmann
4a1edf626a More loplugin:nullptr automatic rewrite (within templates)
Change-Id: I9bc06cfb5eeb38fd7ae7fb25f876ea9f96e4a65a
2015-12-10 17:34:31 +01:00
Stephan Bergmann
fb8a3fac5d loplugin:nullptr: More NULL -> nullptr automatic rewrite
Change-Id: Ie83819e2bcdc5fa160b39296b005ca9a5ff74b1d
2015-12-10 08:06:06 +01:00
Stephan Bergmann
b0339005b8 loplugin:sallogareas
Change-Id: I2220ab194384fb397716bf3227d38716ba54f537
2015-11-19 16:05:35 +01:00
Noel Grandin
d9e6270392 loplugin:unnecessaryvirtual
update the plugin with lessons learned from the mergeclasses plugin and
re-run it

Change-Id: I9d622eb3d05fceaf8fa764c533c8fa5dfb4c7711
Reviewed-on: https://gerrit.libreoffice.org/20015
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-17 12:26:32 +00:00
Samuel Mehrbrodt
40fa83871e Move CommandInfoProvider to vcl and use it from there
Change-Id: If7e3ef81cad8974bc54f359096e3ecc700fa62d6
Reviewed-on: https://gerrit.libreoffice.org/19984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-11-16 14:48:47 +00:00
Samuel Mehrbrodt
099f1016fa Cleanup: Consolidate the different ways to get command labels/tooltips
Change-Id: Ieab809a3122c9d592894b84ec2e68195a4e02dde
2015-11-16 08:08:09 +01:00
Oliver Specht
fa91dd31f3 5th step to remove tools/rtti.hxx
tools/rtti.hxx removed
completed the interface of some Sdr.*  Items
and removed pseudo items

Change-Id: I0cdcd01494be35b97a27d5985aa908affa96048a
Reviewed-on: https://gerrit.libreoffice.org/19837
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
2015-11-11 10:49:30 +00:00
Stephan Bergmann
986c495052 Missing isInLokIncludeFile check
Change-Id: I6577987f3f3717337e6607ffbe38397f229978f0
2015-11-10 11:26:03 +01:00
Stephan Bergmann
1cd6e2e08e Keep LibreOfficeKit.hxx compatible with C++03
Change-Id: Ic2f123c9b341dbb421b766c3bba1fc56c1bfb41d
2015-11-10 11:08:30 +01:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00
Noel Grandin
382eb1a23c remove untyped Link<>
Change-Id: I809f9e10309ceadda0a82c3818277323b34ec61b
Reviewed-on: https://gerrit.libreoffice.org/19491
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-21 07:44:43 +00:00
Stephan Bergmann
bff4c13475 Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY code
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-10-12 17:52:26 +02:00
Stephan Bergmann
f94d4952dc Commit loplugin:returnunique to store/, for reference
Change-Id: I359d8ab47276e5c801522251d5e141946d94ca5d
2015-10-06 12:44:37 +02:00
Noel Grandin
403c13487c loplugin:unusedmethods
Change-Id: I6801618efb5a66d24156fa429e026acb6ca03aba
Reviewed-on: https://gerrit.libreoffice.org/17506
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-05 09:39:22 +00:00
Noel Grandin
56365c650c forgot to add this - the python file for the unnnecessaryvirtual
clang plugin

Change-Id: I1392ad1834dc590cec12e379d6478c42b1bbbc20
2015-06-09 10:08:10 +02:00
Noel Grandin
81b954718f loplugin:unnecessaryvirtuals
Improve the plugin a little.
Create a python script to process the output.
Run it again.

Change-Id: I05c21d8a21c8f4243af739c412fda0a521f9b5f0
2015-06-09 10:06:57 +02:00
Noel Grandin
24600dcf31 loplugin:constantfunction
Change-Id: I7cb5b0c2cf9ade557173ca596ea5d42d853ff448
2015-05-22 09:59:46 +02:00
Tomaž Vajngerl
f1b0cf258d Move paint method rewriter to store
Change-Id: If2bbd355a293e0a0feed7db8f179a0bdcf6dce43
2015-04-29 11:21:47 +09:00
Noel Grandin
71b809959b remove unnecessary use of void in function declarations
ie.
    void f(void);
becomes
    void f();

I used the following command to make the changes:

  git grep -lP '\(\s*void\s*\)' -- *.cxx \
    | xargs perl -pi -w -e 's/(\w+)\s*\(\s*void\s*\)/$1\(\)/g;'

and ran it for both .cxx and .hxx files.

Change-Id: I314a1b56e9c14d10726e32841736b0ad5eef8ddd
2015-04-15 11:47:12 +02:00
Noel Grandin
6aa542445f move the constantfunction plugin into /store
as sberg points out, it needs a massive blacklist, which is going
to be a pain to maintain. Until I can think of a way to make this
more resilient, move it where it can't bother people.

Change-Id: I64fc498146a3cb4ea9c1e37150c4ef50023b7bd5
2015-03-26 14:24:43 +02:00
Stephan Bergmann
a6f8766d35 loplugin:deletedspecial (Mac OS X)
Change-Id: Ia09e2e7b3e40bd04da64b52fe29258017b90b156
2015-02-07 17:24:43 +01:00
Stephan Bergmann
d2e9b222d7 loplugin:deletedspecial to help add SAL_DELETED_FUNCTION annotations
...to special member function declarations that were left undefined.  Helps
compilers do a better job at identifiying unused class members.  This plugin
uses heuristics and whitelists do identify applicable declarations, but is not
appropriate for "unattended" use so is placed into store/.

The following commits contain the results of running this plugin, per module:

* Declarations of undefined special member functions are mmarked
  SAL_DELETED_FUNCTION (aka "= delete", which is deemed superior to deriving the
  class from boost::noncopyable, cf. Howard Hinnant's reply to
  <http://stackoverflow.com/questions/7823990/what-are-the-advantages-of-boostnoncopyable>.

* Any redundant "explicit" or SAL_DLLPRIVATE markers are removed from the
  deleted definitions.

* Some redundant declarations of undefined default ctors are simply removed;
  smelled like clueless cargo-cult to have them declared at all.

* Some declarations of undefined operator == etc. are left in (and marked
  SAL_DELETED_FUNCTION) for now, to be on the safe side, though they are likely
  clueless cargo-cult, too.

* Most "static-only" classes are replaced with namespaces (and some where that
  would be non-trivial due to private members are marked TODO for later).

* Newly identified unused class members are removed.

Change-Id: Ibeaae4fd579d7a0971a2c2a654a2263acd13414a
2015-02-07 12:35:55 +01:00
Noel Grandin
414d84232d move these plugins into /store
we don't need to run them on an ongoing basis, and the current code
does not compile with older versions of clang.

Change-Id: I07ccacf7ff7b00e8e2453fff91a3f487dd5abed9
2015-01-26 09:39:18 +02:00
Stephan Bergmann
f569c4197c Improve loplugin:revisibility
(for non-Windows--only code, as MSVC would complain about such cases anyway)

Change-Id: Id6daf61b79bd31529bdaeb7c6df4f354731ae7d7
2015-01-05 17:25:51 +01:00
Stephan Bergmann
9720e8e5ef Some loplugin:revisibility clean-up
Stumbled across such redundant visibility re-specifications when looking at the
odd case of cppu_unsatisfied_iquery_msg declared CPPU_DLLPUBLIC in
cppu/source/cppu/cppu_opt.cxx and used in inline code in
include/com/sun/star/uno/Reference.hxx with only a declaration lacking
CPPU_DLLPUBLIC visible, and wondering how that actually works on Windows.

However, this plugin is probably not worth it being run all the time, so
committing it to compilerplugins/clang/store/.

Change-Id: Ibc3c4e7499213de1b419ce7eb85455cb832e1510
2015-01-05 13:10:48 +01:00
Noel Grandin
c20a0120d8 move the cstylecast clang plugin out of /store
Change-Id: Iee78bd688ddb3e02deb1a3636d6a604838e97b09
2014-12-04 13:38:53 +02:00
Stephan Bergmann
a0db0648f6 Problematic casts in gendata.hxx are already under control
Change-Id: If3b0f667b379b7973364c93be4b88347e5768223
2014-12-04 11:57:31 +01:00
Noel Grandin
14c94c97ff cstylecast plugin - exclude some more files
Change-Id: I4dc6cc7f461fa11d12bf6fd9700befe4bbdac62c
2014-12-04 11:19:19 +02:00
Stephan Bergmann
eff69c6b4c Run loplugin:cstylecast on C++ and Ojbective C++ code
Change-Id: I4035318d35d468fa93d4dcfe56f9b0434fd1dfe7
2014-12-04 08:22:09 +01:00
Bjoern Michaelsen
6e226f5ed8 also look for cascading assignments
Change-Id: I7fa18403698530eec379589c76631f0aa367b215
Reviewed-on: https://gerrit.libreoffice.org/12991
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-11-20 18:17:03 +00:00
Bjoern Michaelsen
395d6a96aa cascading conditional operators, give a hint on complexity
Change-Id: Ie9d0b07a32cc17705db735ea18f70f28d57badd4
Reviewed-on: https://gerrit.libreoffice.org/12990
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-11-20 18:16:02 +00:00
Bjoern Michaelsen
b736204f3b add clang plugin for detecting cascading condops
Change-Id: I1b782bb04b09bee5c3db2261f9390a7b2edf4564
Reviewed-on: https://gerrit.libreoffice.org/12967
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
2014-11-19 14:58:40 +00:00
Andrea Gelmini
da40cac540 Fix common typos. No automatic tools. Handmade…
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959
Reviewed-on: https://gerrit.libreoffice.org/12164
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-12 11:04:11 +00:00
Noel Grandin
5f15cc01b3 new loplugin: use more efficient find() methods
(Original idea from Kendy)
Look for code that is calling std::find on a sorted container
(set/map/vector) and warn about it - the code should be using
the find method on the container itself, since that is considerably faster.

Change-Id: Ib74e5d3faa836eeb0df16a736d202696626bdfd2
2014-11-05 15:59:23 +02:00
Noel Grandin
07ca074e42 cstylecast plugin: ignore templates, improve message
Change-Id: I8347010d5607dc2cbb113b33f1cb2cc78ec106d2
2014-09-29 12:50:35 +02:00
Stephan Bergmann
5a9a3da719 loplugin:nullptr
A plugin to warn about and rewrite null pointer constants that are not written
as nullptr (in C++11 code) resp. NULL (in C and C++03 code).  It is not
activated for the following reasons:

* At least the call to

  pImpl->aFmtNms.insert(pImpl->aFmtNms.begin() + nPos, nullptr);

  in svx/source/items/clipfmtitem.cxx would require
  <https://svn.boost.org/trac/boost/ticket/10540> "missing std::nullptr_t
  support in boost/type_traits/is_pointer.hpp" to be fixed first.

* Additions of code that violate the plugin would probably be frequent, causing
  unnecessary grief for those building with plugins enabled.

* It did not find anything interesting, apart from the above Boost bug and the
  mildly interesting 1da153b617b80887680be65c1854ef8080c2e1c9 "Consistently use
  APP_WRITER as an integer, never as a nullptr."

Anyway,

  until make -O -j4 -k check; do make -O -j1 -k check \
    COMPILER_PLUGIN_TOOL=nullptr UPDATE_FILES=all; done

sucessfully executed on a recent master and resulted in

  6798 files changed, 60919 insertions(+), 60919 deletions(-)

Change-Id: I1260227949868e73fcb63fda13d83e79fde685d7
2014-09-25 17:43:23 +02:00
Tor Lillqvist
dac678d44e Deactivate the sallogareas plugin
It's boring and a waste of time to have to keep registering in
include/sal/log-areas.dox new log areas that other people have introduced.

We don't really have a uniform policy for logging anyway, so why bother trying
to enforce a such for the log areas? Anybody uses whatever log areas and log
output style and formatting they want in the code they happen to be working
on. And that's fine with me. We were supposed to be the project that avoids
unnecessary process, rules and bureaucracy, right?

Change-Id: I6bddcb56b58edcd885e5dc743c8730878de0036d
2014-09-11 09:28:35 +03:00
Stephan Bergmann
889e27c165 codebase is not yet cleaned up for loplugin:cstylecast
Change-Id: Ic2faece46bebea046eee984a0d53d9cd2892e0c9
2014-09-08 09:04:19 +02:00
Juan Picca
9f282bdd86 compilerplugins: Fix tutorials plugins
Broken in commit 1f078fcaddd45bb074e4d0a4933db01f6e8b623e

Change-Id: Ica93c3b9309b2ae4d973ccc34a84b5accac7472c
Reviewed-on: https://gerrit.libreoffice.org/10478
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-07-24 08:17:16 +00:00
Stephan Bergmann
9263b101c3 Activate the "suspicious cast to sal_Bool" parts of loplugin:salbool
Change-Id: I78a368ef2899b2462251b45a327fc7b1f31fe764
2014-07-01 17:49:10 +02:00
Noel Grandin
a74193306a compilerplugins: move isUnoIncludeFile to base class
to reduce copy-pasted code

Change-Id: I7728d85dea7d0161998c326d6648ca681a8250d0
2014-06-24 12:48:17 +02:00
Thomas Arnhold
72bc94cc8b salbool: fix comment
accidently removed by 5babf1b9037eb283798322eecd8334e6ff1db655

maybe obsolete now

Change-Id: Id1b8ce21e08ce2df5668252406bad6fb549b5206
2014-04-15 21:22:05 +02:00
Stephan Bergmann
b2ecb3485b Better be specific
Change-Id: Ibb9b5b8f53ab8fdeba6d3db295339ead4bde7b6e
2014-04-15 15:42:00 +02:00
Noel Grandin
ffbc86f5ac add "include/comphelper" to list of includes to ignore
since it only contains a single sal_Bool site now, and we want
to leave that alone since it's a copy of similar stuff in cppuhelper.

Change-Id: I3cf4cf5f67e95d5b6f70371181f77c5451fcbf50
2014-04-15 15:23:28 +02:00
Noel Grandin
5babf1b903 remove unnecessary scope qualifier from sal_Bool uses
i.e. convert "::sal_Bool" to "sal_Bool"

Change-Id: Ie5943aee4fee617bf2670655558927ed25b7e067
2014-04-03 13:54:02 +02:00
Luboš Luňák
f7859e5282 fix filename detection in clang plugins
SourceManager::getFilename() returns "<stdin>" whenever icecream is used.

Change-Id: I4e3e1b90880c5fd2b53f20e4ce3e38e3a0486973
2014-03-23 16:26:53 +01:00
Stephan Bergmann
d44a3aa976 Save the stdexception rewriter plugin used in...
...5e21a413c788f839a66d9e4c14e745ed18058db8 "retrofit std::exception into
overriding exception specs."

Change-Id: If802bbd26b91438f3f46fe18bc763d27967bac5c
2014-02-28 10:44:53 +01:00
Alexander Wilms
15e0b08ab5 Remove visual noise from compilerplugins
Change-Id: Ibfed0b64bd60804fa377b5e25e5f197a7772d605
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-02-27 11:10:28 +01:00