1275 Commits

Author SHA1 Message Date
rohan
5c4717416b Fixed minor negation bug in SAL_WARN_IF
I corrected the mistake that i did while converting OSL_ENSURE to
SAL_WARN_IF while submitting a patch regarding removing OSL_DEBUG_LEVEL > 1
conditionals. Thanks to Julien Nabet :)

Change-Id: I374373bf151a43b1ababf4c28b509da71068f755
Reviewed-on: https://gerrit.libreoffice.org/23112
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-10 10:14:03 +00:00
Stephan Bergmann
50bf3061e6 typo
Change-Id: Id990e76769c3b5e2e048f3faf754efbae2b41c3f
2016-03-09 09:26:37 +01:00
Stephan Bergmann
524ae3589c Use plain assert (to complement use of static_assert above)
Change-Id: Id4ac9e86a6af3fa84f7a9680051dfe2564f8c5c5
2016-03-09 09:17:23 +01:00
Stephan Bergmann
ea5bc30fbb Extract static_asserts out of OSL_DEBUG_LEVEL > 0
Change-Id: I604b41a5063728833d57e2589e6d3ec39eb67166
2016-03-08 21:37:42 +01:00
Stephan Bergmann
4f56db98af Clean up namespace
Change-Id: I8207f7906cb8914b6c272efaf8f136a1bce7e4b0
2016-03-08 21:37:42 +01:00
Stephan Bergmann
7024c86b17 Extract checking code to its own check.cxx
Change-Id: I9d5b14c374ce62ac7b970faa30c38a5a76568ed4
2016-03-08 21:37:42 +01:00
Stephan Bergmann
c94f5b0260 loplugin:cstylecast
Change-Id: I3771f84ec94c62988c075dd26ee1de17200af705
2016-03-08 18:16:18 +01:00
Stephan Bergmann
c2fe73d6a9 Remove redundant checks (that trigger loplugin:implicitboolconversion])
Change-Id: I86c0b56b7d330e3e3450a5806a89ca8fb7a1bfae
2016-03-08 18:15:52 +01:00
Rohan Kumar
05bca56923 tdf#91794: Remove OSL_DEBUG_LEVEL > 1 conditionals
Updates pointed by sberg

Change-Id: Ie12548dfa9ad3a6836efbfe64153bc075f138fc6
Reviewed-on: https://gerrit.libreoffice.org/22622
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-08 16:57:42 +00:00
Norbert Thiebaud
369b33903a WaE 0xdeadbeaf 32 bits litteral casting to 64 bits pointer
Change-Id: I9769a1d9707cc958329f1c05ccbed780983faf14
Reviewed-on: https://gerrit.libreoffice.org/22600
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2016-02-22 02:32:13 +00:00
Arnold Dumas
53bf3ea58e tdf#57950: Replace chained O(U)StringBuffer::append() with operator+
Change-Id: Ic76cf0130ebec4cf723b83d82f59ae45bfcb3ea1
Reviewed-on: https://gerrit.libreoffice.org/22350
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-15 07:38:21 +00:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Stephan Bergmann
f8779bbcef Avoid -Werror,-Wdelete-non-virtual-dtor with current Clang trunk
Change-Id: I5300cd6ff2c924a4acc01ba7f4478a0db50aa08c
2016-01-18 20:24:40 +01:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Andrzej Hunt
4a8c0d3135 loplugin:implicitboolconversion
Change-Id: I2ef26c34a424e653d85597c85baa736c19004313
2016-01-03 17:42:10 -08:00
Caolán McNamara
5e9db55def cppcheck: allocaCalled
Change-Id: I4e2345cdf9fd8d088f3522d563263b65abedb7c9
2016-01-03 20:39:42 +00:00
Stephan Bergmann
0475ab7208 Adapt to true wchar_t in clang-cl
Change-Id: I14c2dc0be12151b5d4ea2ba3b65030f6f4494905
2015-11-28 08:44:52 +01:00
Pedro Giffuni
c6dbbdf851 i125711 - Illumos port: generalize MAX_ALIGNMENT for Solaris
GCC in Ilumos appears to behave exactly like the Solaris SUNPRO
compiler so generalize the case for Solaris.

(cherry picked from commit e1da117c49fc02af9543e32526bf1c04657534c4)

Change-Id: I3fa619f34c35608b187c3aa394552ac78c3f0c20
2015-11-25 20:59:45 +00:00
Noel Grandin
aad80e0b9a cppcheck:useInitializationList
Change-Id: I744ff3e268fbffca9499121f3567640934aaae51
Reviewed-on: https://gerrit.libreoffice.org/20110
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-22 12:14:53 +00:00
Stephan Bergmann
0b07406f71 Use C++11 char16_t for sal_Unicode
...in LIBO_INTERNAL_ONLY, __cplusplus, non-MSVC case.

It turns out that sal_Unicode happens to not be mangled into any symbols that
make up the stable URE interface, so (for LIBO_INTERNAL_ONLY, at least) we are
free to replace the typedef to sal_uInt16 with a typedef to any integral type
layout-compatible with that.  (sal_Unicode does appear in some symbols in sal's
PRIVATE_textenc.1 section, but that is private between the sal and sal_textenc
libraries, so changing those symbols does not require a change of SONAME.)
C++11 chart16_t is the obvious choice (and will ultimately allow using u"..."
to write literals of type array-of-sal_Unicode).  Reportedly, char16_t is
supported since GCC 4.4 and Clang 2.9 but will only be available in MSVC 2015.

For plain C, we continue to use sal_uInt16.  We could theoretically use C11
char16_t from <uchar.h>, but at least the Mac OS X 10.11 SDK still does not
offer that C11 header.

For MSVC, we continue to use wchar_t (which is actually unsigned short, due to
/Zc:wchar_t-) for now.  Potential options there include dropping /Zc:wchar_t-
and using true wchar_t, or using C++11 char16_t once support for MSVC 2013 is
dropped.

Some code needed to be adapted that was written in a way assuming that
sal_Unicode is unsigned short (which indicates that changing sal_Unicode for
non-LIBO_INTERNAL_ONLY would be an ABI change).  OUStringBuffer::append can now
differentiate between being called with sal_Unicode (to append a single
character) and erroneously being called with sal_uInt16 (intending to append a
number's textual representation, for which the sal_Int32 overload must be used
instead).  Bugs found are 379fe0409e7973b36210cffa3dd1dfd4032f0ecc "Assume that
this code wants to append a number, not a character" and
dc148335a6a438848325f24c49198fba81043279 "Assume this wants to append the
numerical representation."

The GDB support for pretty-printing of sal_Unicode-related data in
solenv/gdb/libreoffice/sal.py can presumably be simplified now.

Change-Id: I445b3a80e65b7cb004d9e08b38bdc9ee93bc9401
Reviewed-on: https://gerrit.libreoffice.org/20036
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-18 15:20:43 +00:00
Stephan Bergmann
4c1f958634 Clean up
Change-Id: I9ce96ac26efd6fb46f78aa6462d693113b359bb5
2015-11-18 11:22:12 +01:00
Stephan Bergmann
4730b58d99 loplugin:nullptr (automatic rewrite)
Change-Id: I17eb40b2923793280ea220e519f97563c8490a19
2015-11-10 10:31:20 +01:00
jan iversen
6a2440ea91 cid#1338241 removed throw from C function.
Lower level C++ make a throw, this cannot be passed
back in a C function.

Change-Id: I54ace0284d0291d54f53b8947e9f4ffc2e0a56ab
Reviewed-on: https://gerrit.libreoffice.org/19873
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-11-10 07:21:43 +00:00
jan iversen
5ff684477d cid#1338242 cid#1338241 removed throw from extern "C" function
Encapsulated throw from C++ to a return false in the "C" function

Change-Id: I2fc89b0dcf434395859300b3d3890247d1288295
Reviewed-on: https://gerrit.libreoffice.org/19872
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-11-10 07:21:07 +00:00
Noel Grandin
6c80a8fe89 new loplugin: oncevar
Change-Id: If57390510dde4d166be3141b9f658a7453755d3f
Reviewed-on: https://gerrit.libreoffice.org/19815
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-09 08:34:40 +00:00
Benjamin Ni
be729e7721 tdf#94269: Replace "n" prefix for bool variables with "b"
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797
Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02 23:40:57 +01:00
Stephan Bergmann
f570f837d6 Avoid ASan new-delete-type-mismatch with -fsized-deallocation
...where "subclasses" of typelib_TypeDescription are deleted non-
polymorphically

Change-Id: I708d245e12d2e2159e9df60b61d1b37801083651
2015-11-02 10:50:24 +01:00
Stephan Bergmann
b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02:00
Stephan Bergmann
bff4c13475 Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY code
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-10-12 17:52:26 +02:00
Andrea Gelmini
3f6da86e9f Fix typos
Change-Id: I13c3dc33722f139582f27412d5d336264d3d15a3
Reviewed-on: https://gerrit.libreoffice.org/18942
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2015-09-30 13:05:20 +00:00
Caolán McNamara
22b80ac8e2 boost->std
Change-Id: I3fd9e1599c5ad812879a58cf1dabbcd393105e1c
Reviewed-on: https://gerrit.libreoffice.org/18564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-14 12:54:25 +00:00
Stephan Bergmann
b03b8c8c0c loplugin:stringconstant: OUStringBuffer: appendAscii -> append
Change-Id: I22808f7740a9a936deb9160b24fe4634f8613823
2015-08-31 08:04:07 +02:00
Stephan Bergmann
2861d5bedc Some oslCondition -> osl::Condition
Change-Id: I86cfbefd1cb8b22fca659a158b8e31d5c991de7a
2015-08-18 08:16:18 +02:00
Noel Grandin
4712396b3b loplugin: defaultparams
Change-Id: I906912f29448bfc72e8139546aa09525c959867f
2015-08-11 09:48:17 +02:00
Noel Grandin
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
Stephan Bergmann
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
Stephan Bergmann
81275d4725 Avoid loplugin:redundantcast in non-debug build
Change-Id: Ib5f57ba5154c56b89ab550aef5a87ee27539ddd9
2015-07-08 20:56:19 +02:00
Stephan Bergmann
a212bd0e36 loplugin:stringconstant: handle OUString+=OUString(literal)
Change-Id: I55363639900450c9780dd187805ce0500f68a2f4
2015-06-26 13:55:30 +02:00
Stephan Bergmann
472c0a3dcc loplugin:stringconstant: Flag more inefficiencies
Change-Id: I36ae4b57049fe4deabe785ccfecf78608461086f
2015-06-25 12:38:34 +02:00
Julien Nabet
2a65bf32ec Revert "Typo: iff->if"
This reverts commit cf92da3d6e1de14756efe3f1ee79f393a2f3787d.

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