Commit Graph

1186 Commits

Author SHA1 Message Date
Julien Nabet
2a65bf32ec Revert "Typo: iff->if"
This reverts commit cf92da3d6e.

iff can mean "if and only if" so not a typo
2015-06-23 20:42:27 +02:00
Julien Nabet
cf92da3d6e Typo: iff->if
Change-Id: I3fc60856b5a56e71d70b55c89323be074bdec3b3
2015-06-23 20:30:11 +02:00
Takeshi Abe
0980095619 Replace boost::scoped_array<T> with std::unique_ptr<T[]>
This may reduce some degree of dependency on boost.
Done by running a script like:

git grep -l '#include  *.boost/scoped_array.hpp.' \
 | xargs sed -i -e 's@#include  *.boost/scoped_array.hpp.@#include <memory>@'
git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \
 | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/'

... and then killing duplicate or unnecessary includes,
while changing manually
m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx,
extensions/source/ole/unoconversionutilities.hxx, and
extensions/source/ole/oleobjw.cxx.

Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Reviewed-on: https://gerrit.libreoffice.org/16289
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-17 15:50:45 +00:00
Caolán McNamara
ad62165065 cppcheck: noExplicitConstructor
Change-Id: Ic33ee6936f40bec4f3a82aea39a180ae6e9a0928
2015-06-09 10:34:00 +01:00
Stephan Bergmann
cd14c53664 loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I2d60f21219adfe9935ad69620f3a7bd856f96376
2015-06-08 16:24:16 +02:00
Stephan Bergmann
75aa1bf8ec loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: Ied61df6c80a05037fc6335c098c9ac2671ad1c4d
2015-06-02 11:26:02 +02:00
Julien Nabet
3aebc670e1 Remove include stdio (part2)
Change-Id: Iae58d107d8df1c543a165086fb2b7c288e7121dd
Reviewed-on: https://gerrit.libreoffice.org/15775
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2015-05-18 05:33:52 +00:00
Stephan Bergmann
0bfc98e63b loplugin:redundantcast: reinterpret_cast to void*
Change-Id: I947b49cfb15f0e7d6ddfaae386656c70e4bd48ba
2015-05-12 18:27:54 +02:00
Stephan Bergmann
7e61f39f89 loplugin:cstylecast: nop between pointer types of exactly same spelling
Change-Id: Id980379f57590759ebc9b862aad3c6dfb04ddef7
2015-05-11 12:49:21 +02:00
Stephan Bergmann
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
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
Stephan Bergmann
2fc4a8c811 Add support for cppu::UnoType<void>
Change-Id: I88259ffaffc73979c240721d2db166c79d3085f1
2015-04-01 12:48:44 +02:00
Stephan Bergmann
bfcdcdb63a Replace remaining getCppuType et al with cppu::UnoType
Change-Id: Ied1a4e7226de4ae1d1c24af90ae9397ba80f404a
2015-04-01 08:37:54 +02:00
Stephan Bergmann
96f5b780f0 Use OUString::unacquired
found with

  git grep -E '\* *\<reinterpret_cast\>[^>]+\<OUString\>'

Change-Id: I9306d4ad8e3b1664f54cb7df86f2d79bfd3c6cb9
2015-03-31 17:45:27 +02:00
Stephan Bergmann
c57ffac695 Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: I22ee2cbacad8b19bb55db234e816d401edcf4a35
2015-03-31 13:12:58 +02:00
Stephan Bergmann
1777f6fedb Clean up C-style casts from pointers to void
Change-Id: I834eb4ecd0fa71caf6fa746901367fac8b538305
2015-03-28 19:09:18 +01:00
Julien Nabet
48f0a5ed35 Typos
Change-Id: I845a85e1aad4a0708f2b43f7d94606b4b5513ee4
2015-02-18 21:59:02 +01:00
Caolán McNamara
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
Michael Stahl
4e12f9553b cppu: convert some OSL_TRACE
Change-Id: I5dc00f7b03b51916b1331c4ba64064a5aa5930c9
2015-01-29 21:48:13 +01:00
Michael Stahl
585b789ead cppu: the LogBrige really needs its own SAL_LOG area
Change-Id: I129f3dc1597035664e4ff284276cb0d49a560ab5
2015-01-29 21:48:13 +01:00
Stephan Bergmann
4e3da621fe Some more loplugin:cstylecast clean-up
Change-Id: I132d22e2af3cf673c17d8964f690d48990834884
2015-01-28 13:50:37 +01:00
Stephan Bergmann
9193a15fc5 Some more loplugin:cstylecast: cppu
Change-Id: Iec1251648031afa9eddd7445135fb08dc74821bd
2015-01-20 09:06:46 +01:00
Caolán McNamara
d5c3a25aae valgrind: uninitialized variable
Change-Id: I1e166c7e3b58ed565aaf478fa0b6505d1f68b604
2015-01-08 09:23:21 +00:00
Caolán McNamara
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
Stephan Bergmann
4e59046114 Fix include
Change-Id: Ie5253f9b32bb6ed1099eca75b442ba26528f2b32
2015-01-05 17:48:23 +01:00
Stephan Bergmann
64ccf3ff30 Include function declarations
Change-Id: Ib1ce66bf9ec71280409335c0a5022ecfe229f494
2015-01-05 17:25:50 +01:00
Stephan Bergmann
c662bf350f Mark function declarations as CPPU_DLLPUBLIC, not only definitions
<http://msdn.microsoft.com/en-us/library/8fskxacy.aspx> "Importing into an
Application Using __declspec(dllimport)":  "Using __declspec(dllimport) is
optional on function declarations, but the compiler produces more efficient code
if you use this keyword."

Change-Id: I149306049987b2406622d7a0dc5dde92d283a5b3
2015-01-05 17:25:50 +01:00
Stephan Bergmann
9a6e2dd9e7 Missing const
Change-Id: I8a1c520023b493c0494ac2ac650542d8ecc11c5d
2015-01-05 14:48:29 +01:00
Stephan Bergmann
f76f40560e More unnamed namespace clean-up
Change-Id: Iaba8b9b3415c357990b795b6f23b98929ac5e00a
2015-01-05 14:02:27 +01:00
Stephan Bergmann
406629e9a0 These extern "C" functions are not in an unnamed namespace
Change-Id: I185b29c185094176e0992fc84c9cc82ff93de9c2
2015-01-05 13:53:26 +01:00
Stephan Bergmann
debced0f29 These extern "C" functions are not in namespace cppu
Change-Id: Ia98b32bd8451051750fbf810958bdcfe584ea7be
2015-01-05 13:47:54 +01:00
Stephan Bergmann
da2d66ce56 include
Change-Id: I77d06a70f9c000f800b9b31d3b04aafe77754446
2015-01-05 13:32:42 +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
Stephan Bergmann
305b90c999 OSL_FAIL -> SAL_WARN
Change-Id: I82ce1030e69f8794c9fdbdc138541e5d7e0541d4
2015-01-02 17:08:48 +01:00
Caolán McNamara
7f476fea47 boost::unordered_map -> c++11 std::unordered_map
Change-Id: I28438000c2b0a8e6ce4f5640f861f572c0cb83c8
2014-12-27 23:00:45 +00:00
Stephan Bergmann
d269b9ab6a Remove unused */qa/checkapi/
...superseded by CppunitTest_odk_checkapi

Change-Id: I5df89a1a12f496984deab153f0ba2734323c1293
2014-12-19 10:06:45 +01:00
Stephan Bergmann
a1a8654c85 cppu: Use appropriate OUString functions on string constants
Change-Id: Id1d763c83821b7af6c541cb28ff438765026ea4d
2014-12-16 17:27:35 +01:00
Caolán McNamara
398c83576b document coverity#706128 Wrong sizeof argument
Change-Id: Ibb38d8b8395300501caa0fc040f03b06770fd42e
2014-12-11 11:02:06 +00:00
Stephan Bergmann
924b378a79 Clean up includes
Change-Id: Id3aaae19d86b706fd5ddb5982340472d28a75610
2014-11-20 09:37:14 +01:00
Michael Stahl
721366ebe1 cppu: clean up public headers with include-what-you-use
Unfortunately iwyu gets quite confused by the weird cyclic dependencies
between various foo.h/foo.hxx and cppumaker generated headers, so it's
not obvious if any improvement here is realistic...

Change-Id: I0bc66f98b146712e28cabc18d56c11c08418c721
2014-11-18 18:51:48 +01:00
Caolán McNamara
df9efbd53d coverity#440589 silence Write to pointer after free
Change-Id: I85bb3b8cb0ba25e5ebd0a0fff84bda51792cc743
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-11-18 12:18:32 +01:00
Stephan Bergmann
6d2e4740a5 Assert that typelib_typedescription_release will not destroy pTDR->pType
...which is dereferenced a few lines further down; this is in preparation for a
commit addressing cid#440589.

Change-Id: I3428216258d928473f85ecd4d025c352c8c83ea0
2014-11-18 12:17:18 +01:00
Stephan Bergmann
1fc7a1d532 cid#1254675 Uncaught exception
just throw up hands in despair via std::abort instead of std::runtime_error

Change-Id: I356932ed2d76558bb4febbd2ac0a7bb6ea27bd0f
2014-11-17 11:57:43 +01:00
Michael Stahl
6a0fe37dec sal: clean up public headers with include-what-you-use
Sadly cannot forward declare "struct {...} TimeValue;".

rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h
was painful enough for now...

Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-11-17 11:06:53 +01:00
Caolán McNamara
3d87666185 coverity#704593 silence Dereference after null check
Change-Id: I3ccd6895a1ddbf46a441e60ceaaaceb945f682e4
2014-11-14 16:49:30 +00:00
Stephan Bergmann
b021fdfab3 cid#983623 Don't throw DisposedException past uno_threadpool_putJob
This improves on b68640c44e "Prevent creation of
new ORequestThreads during shutdown," which added throwing the DisposedException
from ThreadAdmin::add.  But ThreadAdmin::m_disposed can only become true via
uno_threadpool_destroy -> ThreadPool::joinWorkers -> ThreadAdmin::join, and
ThreadAdmin::add observing that can only happen via uno_threadpool_putJob ->
ThreadPool::addJob -> ThreadPool::createThread -> ORequestThread::launch ->
ThradAdmin::add, where the bridges should ensure that uno_threadpool_destroy
does not run in parallel with uno_threadpool_putJob.  So demote this from a
DisposedException to a SAL_WARN.

Change-Id: I3912ea077b7fa35827c41e82dd0a8f962ba412b6
2014-11-14 16:19:40 +01:00
Caolán McNamara
12bcfec04f markup with event type not checker type
Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
2014-11-05 14:58:00 +00:00
Andrea Gelmini
c70f1545e2 Removed duplicated includes
Change-Id: I5362d997bfa086c9fb1726efcb15132a966684f6
Reviewed-on: https://gerrit.libreoffice.org/12160
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2014-10-31 16:18:30 +00:00
Caolán McNamara
cb0e009a9e document array_vs_singleton dismissals
Change-Id: I8d7eb4c01197e885abca717c7814c61a7641ac9d
2014-10-30 10:10:09 +00:00
Caolán McNamara
e4573efdff restore using rtl for OSL_DEBUG_LEVEL > 1
Change-Id: I6497303e1b2d8d5ffd962489657582387ab974b1
2014-10-30 09:05:17 +00:00