Commit Graph

312 Commits

Author SHA1 Message Date
4712396b3b loplugin: defaultparams
Change-Id: I906912f29448bfc72e8139546aa09525c959867f
2015-08-11 09:48:17 +02:00
171990764e com::sun::star-css in cppu,cppuhelper
Change-Id: I84a412f587fd66f6c0610f083e61cf0fa079d4d9
Reviewed-on: https://gerrit.libreoffice.org/17384
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-29 06:44:57 +00:00
cbce40e965 Make content of OSL_ASSERT, DBG_ASSERT, etc. visiblie in non-debug builds
...to avoid lots of loplugin:staticmethods warnings.  Also enables DBG_ASSERT
etc. also for --enable-debug builds in addition to --enable-dbgutil builds.

Change-Id: Ib89ecd9ab8ce7abb2c64790ace248b31f9d2b64d
2015-07-13 18:14:11 +02:00
81275d4725 Avoid loplugin:redundantcast in non-debug build
Change-Id: Ib5f57ba5154c56b89ab550aef5a87ee27539ddd9
2015-07-08 20:56:19 +02:00
a212bd0e36 loplugin:stringconstant: handle OUString+=OUString(literal)
Change-Id: I55363639900450c9780dd187805ce0500f68a2f4
2015-06-26 13:55:30 +02:00
ad62165065 cppcheck: noExplicitConstructor
Change-Id: Ic33ee6936f40bec4f3a82aea39a180ae6e9a0928
2015-06-09 10:34:00 +01:00
cd14c53664 loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I2d60f21219adfe9935ad69620f3a7bd856f96376
2015-06-08 16:24:16 +02:00
7e61f39f89 loplugin:cstylecast: nop between pointer types of exactly same spelling
Change-Id: Id980379f57590759ebc9b862aad3c6dfb04ddef7
2015-05-11 12:49:21 +02:00
6ff2d84ade Various #include <sal/log.hxx> fixups
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx>
(and don't make use of it themselves), but many other files happen to depend on
it.  Cleaned up some, but something like

  grep -FwL sal/log.hxx $(git grep -Elw \
    'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF') -- \*.cxx)

shows lots more files that potentially need fixing before the include can be
removed from rtl/string.hxx and rtl/ustring.hxx.

Change-Id: Ibf033363e83d37851776f392dc0b077381cd8b90
2015-04-22 09:57:47 +02:00
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
c57ffac695 Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: I22ee2cbacad8b19bb55db234e816d401edcf4a35
2015-03-31 13:12:58 +02:00
1777f6fedb Clean up C-style casts from pointers to void
Change-Id: I834eb4ecd0fa71caf6fa746901367fac8b538305
2015-03-28 19:09:18 +01:00
4d6a509efe convert all remaining BOOST_STATIC_ASSERT to static_assert
and we can include a few less headers

Change-Id: Id742849ff4c1c37a2b861aa3d6ab823f00ea87f8
2015-02-05 22:21:49 +00:00
4e12f9553b cppu: convert some OSL_TRACE
Change-Id: I5dc00f7b03b51916b1331c4ba64064a5aa5930c9
2015-01-29 21:48:13 +01:00
4e3da621fe Some more loplugin:cstylecast clean-up
Change-Id: I132d22e2af3cf673c17d8964f690d48990834884
2015-01-28 13:50:37 +01:00
9193a15fc5 Some more loplugin:cstylecast: cppu
Change-Id: Iec1251648031afa9eddd7445135fb08dc74821bd
2015-01-20 09:06:46 +01:00
d5c3a25aae valgrind: uninitialized variable
Change-Id: I1e166c7e3b58ed565aaf478fa0b6505d1f68b604
2015-01-08 09:23:21 +00:00
900a2996c4 coverity#1261762 Resource leak
still leaks the handle of course, but c++izes the code and hides
the leak from coverity as a side-effect

Change-Id: Ieaab1545a98da1d699df93d020f0cb452ddf2516
2015-01-08 09:10:42 +00:00
f76f40560e More unnamed namespace clean-up
Change-Id: Iaba8b9b3415c357990b795b6f23b98929ac5e00a
2015-01-05 14:02:27 +01:00
406629e9a0 These extern "C" functions are not in an unnamed namespace
Change-Id: I185b29c185094176e0992fc84c9cc82ff93de9c2
2015-01-05 13:53:26 +01:00
debced0f29 These extern "C" functions are not in namespace cppu
Change-Id: Ia98b32bd8451051750fbf810958bdcfe584ea7be
2015-01-05 13:47:54 +01:00
da2d66ce56 include
Change-Id: I77d06a70f9c000f800b9b31d3b04aafe77754446
2015-01-05 13:32:42 +01:00
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
305b90c999 OSL_FAIL -> SAL_WARN
Change-Id: I82ce1030e69f8794c9fdbdc138541e5d7e0541d4
2015-01-02 17:08:48 +01:00
7f476fea47 boost::unordered_map -> c++11 std::unordered_map
Change-Id: I28438000c2b0a8e6ce4f5640f861f572c0cb83c8
2014-12-27 23:00:45 +00:00
398c83576b document coverity#706128 Wrong sizeof argument
Change-Id: Ibb38d8b8395300501caa0fc040f03b06770fd42e
2014-12-11 11:02:06 +00:00
12bcfec04f markup with event type not checker type
Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
2014-11-05 14:58:00 +00:00
e4573efdff restore using rtl for OSL_DEBUG_LEVEL > 1
Change-Id: I6497303e1b2d8d5ffd962489657582387ab974b1
2014-10-30 09:05:17 +00:00
0371a63365 remove unnecessary 'using namespace rtl' declarations
It turns out that almost none of them were necessary.

Change-Id: I1311ed28409c682b57ea8d149bcbaf2c49133e83
Reviewed-on: https://gerrit.libreoffice.org/12133
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-29 11:28:54 +00:00
2152628832 see if we can auto-ignore new Sequence false positives as such
Change-Id: I7099dcf15843a80c25c7fb508dd9c0e8df6447e0
2014-10-27 14:34:19 +00:00
d8be5a5576 optimise UNO Sequence destructor
to avoid expensive function calls until the refcount reaches 0

Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, slightly changing it to
add a uno_type_sequence_destroy to uno/sequence2.h instead of a
uno_type_destructSequence to uno/data.h.

Change-Id: I3bbff3294f2b515fc3c68c4c6c1cb16829f5cc44
2014-10-02 13:00:08 +02:00
32d6415617 fdo#83512 Make use of OUStringHash and OStringHash
Change-Id: I33cafe68c798e3d54943ea1790fa4e73f85e525d
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-18 13:12:48 +02:00
e71bc82224 attempt to fix Android buildbot
it seems to have issues with a < token followed by a :: token.

Change-Id: I8cc6a5b6cf00a233182de273ab6aa8609326aca9
2014-09-17 08:22:58 +02:00
9685276b97 cppu and cppuhelper: loplugin: cstylecast
Add a macro in include/cppuhelper/implbase_ex.hxx
to make initialising the type_entry classes a little less verbose.

Change-Id: I0904b5b9db269c92bc89e7ce3d6c8b09350c9897
2014-09-17 07:08:23 +02:00
bcc719d52e Avoid incomplete type in fn sig to keep ubsan's RTTI-based checks happy
Change-Id: Iaa470f710295e65347c9d12a3bce0d0b68b02417
2014-08-07 18:24:41 +02:00
0d78ad871e DBG_ASSERT->assert when followed by dereference
Change-Id: Ic1c999ffdc391ea01be5711721e7c9e63179473e
2014-07-07 10:48:25 +01:00
5ace3f3b4f clang scan-build: various warnings
Change-Id: I4bdfb074b3cf6fcb49765322308dfa4b9ed67713
2014-07-01 10:56:14 +01:00
a8b32cc97a OSL_ENSURE->assert
Change-Id: Ib8ba49e89d03eaf3b3aae94dbbf121898ba9e8de
2014-06-26 16:29:14 +01:00
41e3515978 cppu: remove SAL_THROW macro
Change-Id: I2f1909f953846f0d0b6fb402b4beb373bba8b2a8
2014-06-05 08:17:49 +02:00
ed81c7fb25 fixincludeguards.sh: cppu 2014-04-19 11:10:06 +02:00
104096f175 Missing include
Change-Id: Ifbb916e72a00a9e9925fd12e7945f178d7ae200b
2014-04-04 10:05:57 +02:00
f480f26e61 Remove visual noise from cppu
Change-Id: Ib776a6e5397eb9731cf908c4015642c29b320ff6
Reviewed-on: https://gerrit.libreoffice.org/8247
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-27 06:12:56 -06:00
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
34a44156b3 cppu: sal_Bool -> bool
Change-Id: I1288f1f6f38d1475b4eb5272509e479bd9f2552d
2014-02-17 17:55:18 +01:00
a0008fd7c3 Remove needless SAL_DLLPRIVATE annotations
Change-Id: Iafaf65e5b25f5d9e00e1dc73db280f6605ad1de5
2014-02-03 16:05:09 +01:00
a2c464868a [API CHANGE] Remove UNOIDL "array" and "union" vaporware remnants from cppu
This leaves only aborting stubs (for SONAME stability) for

  typelib_static_array_type_init
  typelib_typedescription_newArray
  typelib_typedescription_newUnion

and completely removes corresponding

  typelib_ArrayTypeDescription
  typelib_UnionTypeDescription

structs and C++ inline

  getCppuArrayType*

functions.  None of this should ever have been called by client code anyway, so
while technically an API change it should not matter for practical purposes.

Change-Id: I23769d104d545533bf578762b79994e269d78c22
2014-01-31 10:18:17 +01:00
ba5261057c coverity#440026 Logically dead code
Change-Id: Ib269314be090d2d65b593b1c47fea1e10ef2582b
2014-01-28 11:29:15 +00:00
4f4a21c899 coverity#1158251 Dereference before null check
Change-Id: I724632f66d7ec64e165b039e8b9d8c43a9f5aaa7
2014-01-25 20:56:31 +00:00
a3f32769fc Fix bogus mass-conversion equalsAsciiL -> startsWith
3af99e4d59d89c343965a928681a30f36b1007d2 "convert equalsAsciiL calls to
startsWith calls" should rather have converted to oprator ==.

Change-Id: Id4a8836c5d6d570e54661c40be7214632e202b21
2014-01-21 15:54:52 +01:00
82625bb98e remove unnecessary sal_Unicode casts in OUStringBuffer::append calls
Convert code like:
    buf.append( static_cast<sal_Unicode>('!') );
to:
    buf.append( '!' );

Change-Id: Iacb03a61de65a895540940953b49620677b3d051
2014-01-07 09:43:37 +02:00