18 Commits

Author SHA1 Message Date
Stephan Bergmann
3c7652203c Teach loplugin:redundantcast about C-style casts in macro bodies
Change-Id: Ic1fbc8dd16c4d78772fc11a9c2ce09f056e36c79
Reviewed-on: https://gerrit.libreoffice.org/35680
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-25 12:51:54 +00:00
Noel Grandin
ed76d1d350 loplugins:redundantcast teach it about c-style typedef casts
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c
Reviewed-on: https://gerrit.libreoffice.org/35558
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-23 09:48:10 +00:00
Noel Grandin
7299481834 loplugin:redundantcast find redundant c-style enum casts
Change-Id: I2dab376d87804521aed6b6bd41ad7762830fa349
Reviewed-on: https://gerrit.libreoffice.org/35467
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-22 06:47:35 +00:00
Stephan Bergmann
be06700309 Silence loplugin:redundantcast false warning
...that is curiously only reported when building with clang -std=gnu++17:

> sc/qa/unit/ucalc_condformat.cxx:185:80: error: redundant const_cast from 'ScConditionalFormat *' to 'const ScConditionalFormat *', result is implictly cast to 'const ScConditionalFormat *const' [loplugin:redundantcast]
>     CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong conditional format instance.", pCheck, const_cast<const ScConditionalFormat*>(pFormat));
>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:230:32: note: expanded from macro 'CPPUNIT_ASSERT_EQUAL_MESSAGE'
>                               (actual),                \
>                               ~^~~~~~~
> 1 error generated.
> make[1]: *** [solenv/gbuild/LinkTarget.mk:270: workdir/CxxObject/sc/qa/unit/ucalc_condformat.o] Error 1

Change-Id: If2e8577bad4ec7454d584eb59106734d47f876ad
2017-02-16 17:56:08 +01:00
Stephan Bergmann
440720e14d loplugin:redundantcast: Avoid double warnings on some const_cast
Change-Id: I1e6140fef55054899dd32465726e804fc6006394
2017-02-16 17:43:23 +01:00
Stephan Bergmann
0f22790e6b Generalize typedef-to-void* check in loplugin:redundantcast
...to also cover cases like conversion betwen LPVOID and HANDLE in Windows-only
code

Change-Id: I934fe89372ee7a12462e7ad4284b9ea2cc73ce5a
2016-12-18 22:43:26 +01:00
Stephan Bergmann
9d80c032fe loplugin:redundantcast: redundant static_casts
Change-Id: I4d50b77745d68a23136221ef06f327137e89fa7e
2016-07-08 16:47:31 +02:00
Stephan Bergmann
733198de1b Remove support for Clang < 3.4
Change-Id: I81e97c5f720535b33dd3ce72d01151765e4e93a0
2016-06-29 09:15:25 +02:00
Stephan Bergmann
1ce7176ba1 Remove support for Clang < 3.3
Change-Id: I185852a738bac10dc6d331afccfcbc7ae1225cb1
2016-06-29 08:55:27 +02:00
Stephan Bergmann
779f06f9a8 Ambiguity between clang:: and llvm::PointerType
Change-Id: I2727ef17b9ab780c608878aaca9ce0fda01b9c22
2016-03-20 13:29:50 +01:00
Stephan Bergmann
0571f3c503 loplugin:redundantcast: const_cast to same type
Change-Id: I1abdc2ab0b145e12f7fb00db529f52c11e4d7cfd
2015-05-29 12:05:09 +02:00
Stephan Bergmann
0bfc98e63b loplugin:redundantcast: reinterpret_cast to void*
Change-Id: I947b49cfb15f0e7d6ddfaae386656c70e4bd48ba
2015-05-12 18:27:54 +02:00
Stephan Bergmann
373a9b9bb6 loplugin:redundantcast: redundant const_cast followed by implicit upcast
Change-Id: I58297ba336d96358eb0683684bbd763870ef56cb
2015-04-13 12:36:36 +02:00
Stephan Bergmann
90ed482496 Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: I514e183571e4ac109f59c4bdfccdc553c36c26ee
2015-03-31 13:18:16 +02:00
Stephan Bergmann
2688a88297 Remove leftover debug code
Change-Id: I874fc4d677abb2646bffb4331a220f3812443b66
2015-03-30 13:48:45 +02:00
Stephan Bergmann
13e45d6fde loplugin:redundantcast: Don't warn about certain casts in macros
...that might depend on macro arguments and not really be redundant

Change-Id: If19de3835a4972add58965ea7c0936fad7ef6957
2015-03-28 19:09:17 +01:00
Stephan Bergmann
1c78277801 const_cast: convert some C-style casts and remove some redundant ones
Change-Id: I876736d18db6676629c283fccd65e1b6fb2bb2be
2015-03-26 15:33:41 +01:00
Stephan Bergmann
331faca18e Extract loplugin:redundantcast from loplugin:cstylecast
Change-Id: I08f17dd9cc092206083ff41bbbc178e0322e86d0
2015-01-29 22:21:04 +01:00