1454 Commits

Author SHA1 Message Date
Noel Grandin
4d41b2e42f loplugin:unusedfields
Change-Id: I81bcf4f56599146536ba8d66cc86fa5a08737298
Reviewed-on: https://gerrit.libreoffice.org/41556
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-25 13:10:03 +02:00
Noel Grandin
1b694dad64 loplugin:unusedmethods
Change-Id: Iaaf9092ec4d6189492906648b84494d087fed81f
Reviewed-on: https://gerrit.libreoffice.org/41539
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-25 09:04:26 +02:00
Noel Grandin
c66568d6b0 loplugin:useuniqueptr, look for containers..
that can use std::unique_ptr, and apply it in i18npool

Change-Id: Ib410abaf73d5f392c7a7a9a322872b08c948f9e9
Reviewed-on: https://gerrit.libreoffice.org/41438
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-23 18:35:00 +02:00
Andrea Gelmini
e725111f82 ctypeitm no more exists
File deleted on commit 08566ea51944

Change-Id: Iccf35edc92c99779be519a4c722fa5d9bcef4b34
Reviewed-on: https://gerrit.libreoffice.org/41434
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-23 08:47:15 +02:00
Stephan Bergmann
4eaaa812ce Adapt tests to Windows
Change-Id: I8d33234196060f96ad47c9d0fead4f31218f8bdd
2017-08-21 11:11:26 +02:00
Jochen Nitschke
5704bc5578 svtools: remove function with unused return value
and inline only functionality

Change-Id: I79b0ec29dcc35e9dc92aaac9fb191c882a9b0621
Reviewed-on: https://gerrit.libreoffice.org/41362
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-20 18:45:30 +02:00
Noel Grandin
84c0687f09 don't use boost in compilerplugins
Change-Id: Ic1610e99cd2d11d1a536a6f3e66b44417ee59793
2017-08-18 15:08:33 +02:00
Noel Grandin
256c28ae33 new loplugin:expressionalwayszero
The code in SvXMLExportItemMapper::exportXML was broken as far back as
its introduction in

    commit 0c28e3c480a95c03b513c55f029b979bcd9c0401
    "Move SvXMLAttrContainerItem to SVX, moved writer only code to sw"

Change-Id: I90043ce8b7263aa56fd0883d350e29b97eeaf99b
Reviewed-on: https://gerrit.libreoffice.org/41282
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-18 14:19:20 +02:00
Stephan Bergmann
d7a9abdce5 Report full type info (plus the desugared type as "aka")
Change-Id: I647b1c3e479e0be01ed7ea16e1ad3dd9bed9ba6a
2017-08-18 10:23:42 +02:00
Noel Grandin
eea6d3951b loplugin:unnecessaryparen
look for  statements like

    return (function());

Change-Id: I906cf2183489f87225b99b987caca67e39b26cc3
Reviewed-on: https://gerrit.libreoffice.org/41260
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-18 08:49:37 +02:00
Noel Grandin
f0348fb4bf these comments no longer valid
Change-Id: I263116383a9342f9600d6cd1622a941afe83634e
2017-08-17 16:52:32 +02:00
Noel Grandin
19522f0588 fix compiler error in passparamsbyref
Under clang-3.8 we get:

compilerplugins/clang/passparamsbyref.cxx:158:31: error: no member named
'isAssignmentOp' in 'clang::CXXOperatorCallExpr'

Change-Id: Icfba2b624f53f07418674237adc5a47819f73c43
2017-08-17 16:18:15 +02:00
Noel Grandin
d21b119df3 loplugin:passstuffbyref ignore params that are assigned to
makes writing nice code awkward sometimes.

Also split plugin into two different plugins, the logic was getting
tangled up.

Change-Id: I232e314d29c766c160c29373988dc37a466505be
2017-08-17 13:18:34 +02:00
Noel Grandin
b0d7b8fa63 new loplugin convertuintptr
an experiment to see if I can make the process of eliminating
sal_uIntPtr a little easier

Change-Id: I808185fbf18826cb9ab5612a7be4148d52045957
2017-08-17 13:18:34 +02:00
Noel Grandin
ea43e0e3ce display oncevar loplugin by default
seems to be annoying some people. I'll run this one myself, and at some
stage create some code for enabling a subset of extra plugins via
configure.ac

Change-Id: Ia95701f63f65751d75b5a3fecffb1fc1a82f38e0
2017-08-17 12:10:09 +02:00
Noel Grandin
a4602c791f add sal_uLong to droplong loplugin
Change-Id: Ief92b4ee97f561613bc730a91c27fe192f485d77
2017-08-17 09:25:46 +02:00
Noel Grandin
9fb742489b move deadclass plugin to store
<sberg> noelgrandin, and is loplugin:deadclass even sound?

    struct B { B(B const &) {} }; struct D: B { D(): B(*this) {} };

Change-Id: Idadd379b925aa6f9de6c625bffa8560ec4192ac7
2017-08-16 13:17:07 +02:00
Noel Grandin
3ee1174e7b remove leftover debugging output
Change-Id: Ide78daefced91fff2efeeb25dace6f722acfa3e9
2017-08-16 09:35:11 +02:00
Noel Grandin
3281628e1c loplugin:redundantcast ignore functional casts involving typedefs
<sberg> noelgrandin, 718cdd43c25783d9cd402e381123efe3981cc514 now also
looks through typedef sugar, e.g. complaining about a gdouble -> double
expl. conversion in configmgr/source/dconf.cxx;
I think we want to remain silent about such conversions involving typedefs
<noelgrandin> sberg, ah, good point.

Change-Id: Icbb0d6be273f53e507c91556cf0ccb5a5c03e5a1
Reviewed-on: https://gerrit.libreoffice.org/41175
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-15 15:45:34 +02:00
Noel Grandin
718cdd43c2 loplugin:redundantcast, find more functional casts
In the enum types that caused the problem look like this when I dump
then:

EnumType 0xdb45770 'enum SvxFrameDirection'
`-Enum 0xdb456d8 'SvxFrameDirection'

SubstTemplateTypeParmType 0xdb61200 'enum SvxFrameDirection' sugar
|-TemplateTypeParmType 0xd7518f0 'EnumT' dependent depth 0 index 0
| `-TemplateTypeParm 0xd7518a8 'EnumT'
`-EnumType 0xdb45770 'enum SvxFrameDirection'
  `-Enum 0xdb456d8 'SvxFrameDirection'

Change-Id: Id8fedabe43b7a27df61a2320a9acbf54d2dc7882
Reviewed-on: https://gerrit.libreoffice.org/41169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-15 13:46:29 +02:00
Andrea Gelmini
882e9ff39f Fix typos
Change-Id: Ic95ec7c8a36ef5d19eac93b7eed8a7de2ec8904f
Reviewed-on: https://gerrit.libreoffice.org/41153
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-14 23:36:31 +02:00
Noel Grandin
0c3bd1d482 new loplugin:droplong
The types 'long' and 'unsigned long' are different sizes on different
platforms, making them wholy unsuitable for portable code.
And when I mean different sizes, I mean 64bit Linux and 64bit Windows
have different bit sizes.

Change-Id: Id4d8cd709bf71a3f85ed6515fae2b0a21ae8c25d
Reviewed-on: https://gerrit.libreoffice.org/41130
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-14 09:14:39 +02:00
Noel Grandin
4d89865ef2 new loplugin:deadclass
look for classes which only have copy/move constructors, and so are
effectively dead

Change-Id: I0b844f301e2200c2b40031856bfdb0b0e2c8f77d
Reviewed-on: https://gerrit.libreoffice.org/41039
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-11 21:20:25 +02:00
Noel Grandin
40ea896e5c loplugin:unnecessaryvirtual
Change-Id: I7aa23e56f2c126bf505262454408340b557f13cf
Reviewed-on: https://gerrit.libreoffice.org/40865
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-08 12:33:03 +02:00
Noel Grandin
a209172669 loplugin:constantparam
Change-Id: Ib92aba17c46a4ada75c2a0630f281759d995f32e
Reviewed-on: https://gerrit.libreoffice.org/40843
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-08 08:08:35 +02:00
Noel Grandin
959ace5861 loplugin:constparams in sw part10
Change-Id: I7d708c3e6157d0b8690b433d3363d2c0745b2410
Reviewed-on: https://gerrit.libreoffice.org/40832
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-07 15:27:38 +02:00
Stephan Bergmann
1ac8d90d84 -Werror=unused-function
Change-Id: Ia98b64a5500b99c5a6f20c723d96d9c4686f3271
2017-08-07 13:12:59 +02:00
Noel Grandin
06e2246f16 loplugin:constparams in sw part9
Change-Id: I2edba9cde5a5efd06815a55632703b706ca523c7
Reviewed-on: https://gerrit.libreoffice.org/40830
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-07 13:09:50 +02:00
Stephan Bergmann
dbeab89b5b Adopt loplugin:casttovoid to Objective C
Change-Id: I71bad86a383a9b906b02ec968dc32e9acd0bec26
2017-08-07 08:00:07 +02:00
Andrea Gelmini
35a2d88288 Fix typos
Change-Id: Ib7f43bf17ab8b9fb9d961a908d7620b50826a975
Reviewed-on: https://gerrit.libreoffice.org/40688
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-05 00:32:50 +02:00
Noel Grandin
902d87147d loplugin:constparams in sw part3
Change-Id: I05ad3204af4e6ec3c832b185a1b35fdb75a229b2
Reviewed-on: https://gerrit.libreoffice.org/40760
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-04 11:55:27 +02:00
Noel Grandin
98d7b40986 loplugin:constparams in sw part2
Change-Id: I51ae0e8caaf46f141d3d15ace47612df1e476de7
Reviewed-on: https://gerrit.libreoffice.org/40735
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03 21:32:05 +02:00
Noel Grandin
5176c1dd60 loplugin:constparams in sw part1
Change-Id: Id8d8afe268a82585ec2d3699411073dfb905d6ba
Reviewed-on: https://gerrit.libreoffice.org/40734
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03 20:49:15 +02:00
Noel Grandin
d5630adf33 loplugin:checkunusedparams in various
Change-Id: I4f54940a9ebdcd47776b2a5f7bae6e49b633ee44
Reviewed-on: https://gerrit.libreoffice.org/40706
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03 13:13:17 +02:00
Noel Grandin
dafae0fe31 loplugin:constparams in sd
Change-Id: I833c6da99d5ccb8f6a8b5c905bee73b75fde0a89
Reviewed-on: https://gerrit.libreoffice.org/40700
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03 11:06:54 +02:00
Noel Grandin
fb8b0585d9 loplugin:checkunusedparams in sw
Change-Id: I8a6b2647375a54720cd9fd765cc51c9ff43c8190
Reviewed-on: https://gerrit.libreoffice.org/40682
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-02 20:52:47 +02:00
Noel Grandin
3dcf6dfcee remove unnecessary use of 'this->'
Change-Id: I5c115389af7d24c18ddaf5fbec8c00f35017a5b4
Reviewed-on: https://gerrit.libreoffice.org/40671
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-02 13:45:36 +02:00
Caolán McNamara
13fac4894f normalize resource locale ctor construction mechanisms
make them all the same and share std::locales more

various OModuleClient, etc, classes go away

Change-Id: I7e3ff01a69332eeacd22e3078f66a60318de62d5
Reviewed-on: https://gerrit.libreoffice.org/40634
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-02 10:36:07 +02:00
Caolán McNamara
b1d829e52e move resmgr to unotools
and the vast majority of translations is to the ui language so default
ctor with that arg

and now drop OModuleResourceClient

Change-Id: I3b85a560ffdfe5f019c2271ac56a5fe4a361522b
2017-08-01 13:42:21 +01:00
Noel Grandin
612b489d3e loplugin:checkunusedparams
the "check for taking address of function" part was generating false+

Change-Id: Iad6203850901229b7b1b2f8938c68ec703cd343f
Reviewed-on: https://gerrit.libreoffice.org/40613
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-01 11:06:26 +02:00
Noel Grandin
c394363c84 loplugin:constparams in basctl
Change-Id: If6c2b980a2916c4ee8ac108fbb84b006a35f49c5
Reviewed-on: https://gerrit.libreoffice.org/40570
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31 08:25:37 +02:00
Noel Grandin
c9253818ec loplugin:oncevar
extend oncevar to any POD type

Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0
Reviewed-on: https://gerrit.libreoffice.org/40564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31 08:25:07 +02:00
Noel Grandin
b09deb0753 loplugin:constparams handle constructors
had to change the structure of the plugin considerably, was too messy to
structure it to do the calculations on a per-function basis

Change-Id: I4edee7735f726101105c607368124a08dba21086
Reviewed-on: https://gerrit.libreoffice.org/40516
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28 14:51:56 +02:00
Noel Grandin
a63e17c6c4 loplugin:checkunusedparams more part3
Change-Id: I621fcf7ceb27238ca86d2299dfb2b8ed03c270fd
Reviewed-on: https://gerrit.libreoffice.org/40509
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28 10:46:26 +02:00
Noel Grandin
b32ead5dd2 loplugin:checkunusedparams more part1
seems I got one of the checks wrong, and was missing a bunch of stuff

Change-Id: I2c662fc4e735f8d6cbe56c6f82906a60a580331b
Reviewed-on: https://gerrit.libreoffice.org/40481
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-28 07:17:51 +02:00
Noel Grandin
620d032b18 loplugin:constparams in chart2
Change-Id: Ic325b79f04e04aa19e08a60db30b982d90f04c80
Reviewed-on: https://gerrit.libreoffice.org/40480
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-27 13:23:25 +02:00
Noel Grandin
370c71f5b1 simplify unusedfields plugin
using some wrappers around callee and caller AST nodes

Change-Id: I599a04a18caa3ada70bcb266e228208b7a81f1a1
2017-07-27 12:39:38 +02:00
Noel Grandin
8ce64dbb3d loplugin:constparams in svx
and fix a bug in the plugin itself when calling operator's like the one
on std::function<>

Change-Id: I1617607107eeff06785c1841f69e13ad2926218e
Reviewed-on: https://gerrit.libreoffice.org/40446
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-27 08:03:26 +02:00
Noel Grandin
9878293228 loplugin:unusedmethods
Change-Id: I7f26ee112ed89ee3e69c56930260565f66ff145b
Reviewed-on: https://gerrit.libreoffice.org/40442
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-26 12:25:56 +02:00
Noel Grandin
4ed70b89aa loplugin:unusedfields
Change-Id: I21e538b8e9c7a5f0fb233019efac37a3555e3c93
Reviewed-on: https://gerrit.libreoffice.org/40438
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-26 11:15:52 +02:00