2011 Commits

Author SHA1 Message Date
Noel Grandin
81fd3bb4d7 loplugin:redundantfcast check for std::function cast
noticed by mike kaganski

Change-Id: I210f6d2655edde74d9256c6147b7d15a88180196
Reviewed-on: https://gerrit.libreoffice.org/78743
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-11 15:33:28 +02:00
Luboš Luňák
dc79dc76f1 make clangplugin analyzer use internally a PCH to speed things up
This generally makes the sharedvisitor performance reasonable.
The only costly thing that remains is compiling the large sharedvisitor.cxx,
which with optimizations takes quite some time, but there's ccache for that.

Change-Id: Iffa5fc9df34cdb5edf1cde34fc558fd007ef8263
Reviewed-on: https://gerrit.libreoffice.org/78569
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-06 12:07:23 +02:00
Luboš Luňák
ceb26770b3 split clangplugins sharedvisitor generator into two steps
Analysing all the plugin sources using just one process takes a lot of time,
so split out a separate analyzer tool that'll analyse one source and
print out the data to a .plugininfo file. The generator then will read
all of these and generate sharedvisitor.cxx . This allows parallelising
the expensive analysis.

With this commit sharedvisitor.cxx is no longer included in the repository,
as this and the next commit should make the generation fast enough.

Change-Id: Idfc33c4ea6ccfd84f829b51001c8ddeb0be09961
Reviewed-on: https://gerrit.libreoffice.org/78568
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-06 12:06:54 +02:00
Andrea Gelmini
22ef2a15bb Fixing "...."
Change-Id: Id005a7531d546dd43de13b49bcb3e93081c5ad8d
Reviewed-on: https://gerrit.libreoffice.org/78679
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06 09:15:58 +02:00
Stephan Bergmann
265552e8ab Use compat::IgnoreImplicit
...for reliable results across Clang versions.  Also, there appears to be no
need to check for CXXTemporaryObjectExpr both before and after IgnoreImplicit.

Change-Id: Ib804591b6d50073c99680d0933e21f32bba29342
Reviewed-on: https://gerrit.libreoffice.org/78640
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-05 14:13:33 +02:00
Noel Grandin
9dac199094 loplugin:noexceptmove improve feedback
Change-Id: I16612abd535812bdb9d46aa9886b1e02747aab6f
Reviewed-on: https://gerrit.libreoffice.org/78614
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-05 08:27:43 +02:00
Szabolcs Toth
5bfa8b8d5e tdf#118314 Code clean up on imestatuswindow
Change-Id: I8bc5a73a91f28fcfd22ef716e9cf87d53997b1ad
Reviewed-on: https://gerrit.libreoffice.org/77337
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: László Németh <nemeth@numbertext.org>
2019-09-04 09:12:32 +02:00
Mike Kaganski
a06b83ff92 Parent reference should be const in VCL builder entry points
Change-Id: I2331e19f5e23e0dde8edd22befc7287515adf37e
Reviewed-on: https://gerrit.libreoffice.org/78536
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-03 12:00:40 +02:00
Noel Grandin
9c4ae2ac2b loplugin:unusedfields
Change-Id: I73e94fe2bcf6e206ae8f78380abf2a399aa6dc01
Reviewed-on: https://gerrit.libreoffice.org/78365
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-01 18:35:58 +02:00
Noel Grandin
6fb4528649 loplugin:unusedmethods
Change-Id: Ifaf3860a31fc151bb7052db1b87962b8aba27c37
Reviewed-on: https://gerrit.libreoffice.org/78366
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-01 15:35:41 +02:00
Andrea Gelmini
0940229305 Fix '..'
To complete this:
https://gerrit.libreoffice.org/#/c/78312/

This is a massive replace for lines ending with
".." instead of "..."

It passed "make check" on Linux.

Change-Id: I07fa7b2e30ba9ea17a1f9a5e21c57216ba958efe
Reviewed-on: https://gerrit.libreoffice.org/78356
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
2019-09-01 11:15:11 +02:00
Noel Grandin
70093d8153 adapt to runToolOnCodeWithArgs API change in clang 10
which required including config_host in generator, which in turn
required adapting the makefile

Change-Id: Icafa3b59816f52c349fbbd76ce71305856c9ce33
Reviewed-on: https://gerrit.libreoffice.org/78293
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-30 20:44:39 +02:00
Andrea Gelmini
4b4b1689db Fix typos
Change-Id: I965ade27bdbd5d1f0e6cc902c1f01fa905e668f2
Reviewed-on: https://gerrit.libreoffice.org/78305
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-30 17:19:34 +02:00
Noel Grandin
6e4a2540d4 new loplugin:noexceptmove
idea from mike kaganski

look for places where we can mark move operators as noexcept, which
makes some STL operations more efficient

Change-Id: Id732b89d1fcadd5ceb0ea2b9d159fed06136330f
Reviewed-on: https://gerrit.libreoffice.org/78251
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-30 08:12:07 +02:00
Stephan Bergmann
5f3c2204eb New loplugin:stdfunction
...finding dubious additions to namespace std (concentrating on functions for
now).  C++17 [namespace.std]/1: "The behavior of a C ++ program is undefined if
it adds declarations or definitions to namespace std or to a namespace within
namespace std unless otherwise specified."

This found

ad4c7b97752b4da73808402604d6f96b39d920f5 "Avoid declaring function templates in
 namespace std"
042e30a3dc057aef4a02d95960e4dd4fb8d083ae "Avoid adding a function template
 declaration to namespace std"
cae9240a76cdb0eeed92421930d3b4cbef0ac201 "Avoid adding a function declaration to
 namespace std"

Change-Id: Ic2ba54e2a8bf931d5c58cedf499c0d1229eb2166
Reviewed-on: https://gerrit.libreoffice.org/78220
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-28 12:47:21 +02:00
Noel Grandin
9e0b3423f2 loplugin:referencecasting find more redundant static_cast
Change-Id: I3a51812bbd3fcdc6b11e47cb12962f0d4fa7a2ae
Reviewed-on: https://gerrit.libreoffice.org/78191
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-27 18:42:13 +02:00
Noel Grandin
205c47443e loplugin:unusedmethods
Change-Id: I9d1abe62e7e0ae3434e0b2d440d6ccf0435e97cc
Reviewed-on: https://gerrit.libreoffice.org/78131
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-26 20:48:57 +02:00
Noel Grandin
568eea45de loplugin:unusedenumconstants
Change-Id: I4c75db3931e234d04a8d14f0a9dc9103132b0e72
Reviewed-on: https://gerrit.libreoffice.org/78137
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-26 18:51:01 +02:00
Noel Grandin
e87761688d use shared-plugin infra for some recent plugins
Change-Id: Ia9cba59718de91fed2045ffd7e0ec06d28bf37dc
Reviewed-on: https://gerrit.libreoffice.org/78118
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-26 13:48:13 +02:00
Noel Grandin
2fd083579d loplugin:returnconstval in various
Change-Id: Ib5d293417b1faeb7ef63a8df99fc1ba644989cdc
Reviewed-on: https://gerrit.libreoffice.org/78079
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-26 08:18:10 +02:00
Stephan Bergmann
9a251699d7 Improve loplugin:sequenceloop warning
...from

> sfx2/source/appl/shutdowniconaqua.mm:416:13: error: use std::as_const, or make range var const, to avoid creating a copy of the Sequence [loplugin:sequenceloop]
>             for ( auto const & newMenuProp : aNewMenu )
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

to

> sfx2/source/appl/shutdowniconaqua.mm:416:46: error: use std::as_const, or make range var const, to avoid creating a copy of the Sequence [loplugin:sequenceloop]
>             for ( auto const & newMenuProp : aNewMenu )
>             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

Change-Id: I1eabe80abeed1784a246a6e3c9b7036f664ee681
Reviewed-on: https://gerrit.libreoffice.org/77989
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-23 14:40:19 +02:00
Noel Grandin
4ad54c3471 new loplugin:returnconstval
look for code that thwarts copy-elision/move optimisations by
returning const values.

Change-Id: Iafa038d15051e06ee76d8a1c0ce8b7d234cd8488
Reviewed-on: https://gerrit.libreoffice.org/77964
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-23 09:12:16 +02:00
Stephan Bergmann
8b30e6f034 llvm::make_unique is gone from LLVM trunk
(but when targeting older versions of LLVM/Clang, COMPILER_PLUGINS_CXX can still
specify -std=c++11)

Change-Id: I1b91f2817516d015bc12b6a3faf1874ab938a3ae
Reviewed-on: https://gerrit.libreoffice.org/77866
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-21 12:37:36 +02:00
Noel Grandin
10280dabe2 loplugin:constvars, look for loop vars that can be const
Change-Id: I67ee714739800f3718f9d3facf57474cd564d855
Reviewed-on: https://gerrit.libreoffice.org/77415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-21 11:16:15 +02:00
Noel Grandin
25cce7cd24 Revert "loplugin:unusedmethods"
This reverts commit 7990680e92e4fba376ef4f9346d1bc53661bde30.

screenshot build is failing

Change-Id: Idfe4cac73edaf9be1e704c0bd734e858643defda
Reviewed-on: https://gerrit.libreoffice.org/77654
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-18 12:35:08 +02:00
Noel Grandin
7990680e92 loplugin:unusedmethods
Change-Id: I781a514787c83063dadd549ee043bbb264eee060
Reviewed-on: https://gerrit.libreoffice.org/77619
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-17 20:42:31 +02:00
Noel Grandin
0e0fb5eaae loplugin:unnecessaryvirtual
Change-Id: I9f2e524a4fb467ddc198fce1ff4740d3768ceeac
Reviewed-on: https://gerrit.libreoffice.org/77618
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-17 14:18:13 +02:00
Caolán McNamara
4d450704d6 move WizardMachine to vcl
Change-Id: I55cc4a6c1ad111a22a43fd66a3cd01b5b02fb7cb
Reviewed-on: https://gerrit.libreoffice.org/76902
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-16 22:32:42 +02:00
Stephan Bergmann
e380e35348 Adapt loplugin:nullptr to RecursiveASTVisitior::TraverseInitListExpr change
...<https://github.com/llvm/llvm-project/commit/
0a42fe70a566f22599e04a6f1344ca2dc5565e17> "[AST] Treat semantic form of
InitListExpr as implicit code in traversals"

Change-Id: Ifd17009fcc6933abf0e9178dbe47fb9c14b274b7
Reviewed-on: https://gerrit.libreoffice.org/77595
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-16 19:54:25 +02:00
Noel Grandin
7d7a7862a7 new loplugin:sequenceloop
look for places we should be using std::as_const on for-range
loops over uno::Sequence, to avoid triggering a copy

Change-Id: I7efb641bf09d37c87946f03428ee4eec90298c8a
Reviewed-on: https://gerrit.libreoffice.org/77441
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16 09:04:51 +02:00
Stephan Bergmann
cd6698ca91 LLVM trunk requires C++14 now
...which caused failures like

> [GEN] compilerplugins/clang/sharedvisitor/sharedvisitor.cxx
> In file included from /data/sbergman/lo/core/compilerplugins/clang/badstatics.cxx:14:
> In file included from /data/sbergman/lo/core/compilerplugins/clang/check.hxx:15:
> In file included from /data/sbergman/llvm/inst/include/clang/AST/DeclBase.h:18:
> In file included from /data/sbergman/llvm/inst/include/clang/AST/DeclarationName.h:16:
> In file included from /data/sbergman/llvm/inst/include/clang/AST/Type.h:48:
> /data/sbergman/llvm/inst/include/llvm/Support/TrailingObjects.h:252:24: error: no member named 'is_final' in namespace 'std'
>     static_assert(std::is_final<BaseTy>(), "BaseTy must be final.");
>                   ~~~~~^
[...]

However, unconditionally using -std=c++14 in generator.cxx would cause failures
for builds against older Clang (and with COMPILER_PLUGINS_CXX specifying
-std=c++11) on machines that have an old C++11-only system libstdc++.  Those
machines typically use --gcc-toolchain to use a newer non-system libstdc++ (cf.
e.g. setting CC and CXX in lode's bin/linux_clang_dbgutil_64.env), so one
solution could be to propagate such an option from CXX through to generator.cxx.
But the easier fix appears to be to instead propagate the -std option.

Change-Id: Ib081754ce8ad567305d1520e3a1ff6700fb22755
Reviewed-on: https://gerrit.libreoffice.org/77502
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-15 15:51:16 +02:00
Caolán McNamara
3c498ff3de drop newly unused EnableImageDisplay + EnableTextDisplay
Change-Id: I534c5fcfe2e8b55d0f01075b62e7168a10e805a9
Reviewed-on: https://gerrit.libreoffice.org/76819
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-08-01 22:19:41 +02:00
Noel Grandin
9496e3d2ac skip some indirection
these don't need to use std::unique_ptr

Change-Id: I03140c7957fd59443db932c37890a6742c6d3bec
Reviewed-on: https://gerrit.libreoffice.org/76800
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-01 20:07:55 +02:00
Stephan Bergmann
ed115c1bb7 missing include
Change-Id: I9c3d551d2053b53bde3b032036bc531a02217300
Reviewed-on: https://gerrit.libreoffice.org/76782
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-01 14:40:46 +02:00
Noel Grandin
12062cb281 new loplugin:mapindex
Change-Id: I6b5f73b2187009e95d4d666e03e5803f522cee06
Reviewed-on: https://gerrit.libreoffice.org/76584
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-01 09:09:34 +02:00
Stephan Bergmann
6b962889b2 Improved loplugin:stringconstant (now that GCC 7 supports it)
Change-Id: I8f83c1941b8f39b261005939f4dcf3577ae9fc6f
Reviewed-on: https://gerrit.libreoffice.org/76702
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31 16:29:45 +02:00
Caolán McNamara
588f50ac41 remove newly unused SvxCheckListBox
Change-Id: I6a5f4dfea9fbb34f02c1752140e04d1d0a8a67a7
Reviewed-on: https://gerrit.libreoffice.org/76617
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-30 21:14:11 +02:00
Gabor Kelemen
b368329430 tdf#62699 Drop (now) pass-through header include/vcl/salbtype.hxx
Change-Id: I2e2093ac3c8c6833b70d4932bc12a82a4483bde5
Reviewed-on: https://gerrit.libreoffice.org/76499
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-30 09:51:39 +02:00
Noel Grandin
5ae7908ece loplugin:unusedfields
Change-Id: I80ed513cf690f94bf4320b040b36d7f904c63482
Reviewed-on: https://gerrit.libreoffice.org/76233
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-24 15:36:24 +02:00
Noel Grandin
8d73da6696 loplugin:unusedenumconstants
Change-Id: I484b39d1060e6a563dabdde03867989b8ba067f9
Reviewed-on: https://gerrit.libreoffice.org/76237
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-24 15:10:17 +02:00
Andrea Gelmini
d29bd2ac60 Fix typos
It passed "make check"

Change-Id: I055017a7616ed4d9725c66a387c040b55e22751f
Reviewed-on: https://gerrit.libreoffice.org/76202
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-23 22:20:26 +02:00
Noel Grandin
c4bce5dafd resurrect and improve loplugin:referencecasting
Improve the plugin to avoid generating false+ with the special case of
querying XInterface (what the code calls normalisation).

Also ignore places where the querying is dealing with ambiguous base
classes.

Change-Id: I23b2b2fa6618328fafc4707b94c26582a462ea87
Reviewed-on: https://gerrit.libreoffice.org/74993
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23 13:51:18 +02:00
Noel Grandin
ac933bb93a loplugin:unusedfields
Change-Id: If1e0b32f2cce7678f454009c0180d7612b4fb7c6
Reviewed-on: https://gerrit.libreoffice.org/76119
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23 07:49:07 +02:00
Noel Grandin
ea20fcce1d close some more holes in structures
and improve the pahole script so I can just run it once over the whole
codebase

Change-Id: I7e1775974a3a61f8c0e40646158f01163ace60cc
Reviewed-on: https://gerrit.libreoffice.org/76122
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23 06:46:41 +02:00
Noel Grandin
a17b19726d loplugin:unusedmethods
Change-Id: I3bde62d674f5beaa6d19dcd22e6be15dfefe4205
Reviewed-on: https://gerrit.libreoffice.org/76118
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-23 06:46:22 +02:00
Michael Weghorn
f6d3e145d7 avmedia: Drop 'wrap_*' functions
Just call the corresponding GStreamer functions directly.
The wrapper functions are pointless since commit
6b911ae9eb9484bebbdc1323210020486f5ef33f
("Drop support for gstreamer-0.10").

Change-Id: I2963bd25a83632f4e693a1691180790452edffda
Reviewed-on: https://gerrit.libreoffice.org/76116
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-07-22 17:40:50 +02:00
Michael Weghorn
adb3e60d3f kf5/gtk3_kde5 fpickers: Drop unused 'allowRemoteUrls'
Change-Id: I591bf9fbe6e22bedda5a94334130a4f674cd66e6
Reviewed-on: https://gerrit.libreoffice.org/76110
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-07-22 16:16:30 +02:00
Jan-Marek Glogowski
d3c6ac6d0f tdf#125922 rename kde5 to kf5 + plasma5
Just as the gtk3 plugin isn't named GNOME, rename kde5 to kf5, as
it is based on the KDE frameworks 5 libraries.

This also includes:
* a convenience alias to load the kf5 VCL plugin in case someone
  requests the kde5 plugin.
* keep convenience kde5 configure switch, but warn about it
* rename detected desktop from kde5 to plasma5

Change-Id: I6764a05b81a5edbf284484c234fee2649aacf735
Reviewed-on: https://gerrit.libreoffice.org/75313
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-07-21 23:22:46 +02:00
Noel Grandin
cc3d75e14c make cppunitassertequals a shared plugin
Change-Id: Ied9c26248cb72f2146fbe1a985f825f7525fa17c
Reviewed-on: https://gerrit.libreoffice.org/75836
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19 09:06:25 +02:00
Noel Grandin
cdbe8a8700 loplugin:constantparam
and tweak the plugin to handle a crash seen with clang-9

Change-Id: Ie1ccf80c16a20dbca58e5bd081af13f75cf5ac8f
Reviewed-on: https://gerrit.libreoffice.org/75850
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-19 09:05:58 +02:00