summaryrefslogtreecommitdiff
path: root/cppu
AgeCommit message (Collapse)AuthorFilesLines
2016-07-20Replace fallthrough comments with new SAL_FALLTHROUGH macroStephan Bergmann1-1/+1
...which (in LIBO_INTERNAL_ONLY) for Clang expands to [[clang::fallthrough]] in preparation of enabling -Wimplicit-fallthrough. (This is only relevant for C++11, as neither C nor old C++ has a way to annotate intended fallthroughs.) Could use BOOST_FALLTHROUGH instead of introducing our own SAL_FALLTHROUGH, but that would require adding back in dependencies on boost_headers to many libraries where we carefully removed any remaining Boost dependencies only recently. (At least make SAL_FALLTHROUGH strictly LIBO_INTERNAL_ONLY, so its future evolution will not have any impact on the stable URE interface.) C++17 will have a proper [[fallthroug]], eventually removing the need for a macro altogether. (cherry picked from commit 14cd5182c5f64c43581c82db8c958369152226ac) Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-07-20Fix typosAndrea Gelmini2-2/+2
Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 64d624b65124ac02d8ee59b135593fd9d8eb9067) Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
2016-07-12Remove excess newlinesChris Sherlock10-19/+0
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 Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> (cherry picked from commit a238b1f8d304bf1e2ffb357937f3ec888ee8ac89) Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
2016-02-22WaE 0xdeadbeaf 32 bits litteral casting to 64 bits pointerNorbert Thiebaud2-2/+2
Change-Id: I9769a1d9707cc958329f1c05ccbed780983faf14 Reviewed-on: https://gerrit.libreoffice.org/22600 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> (cherry picked from commit 369b33903ac1870275af07451e7377ef057e1276) Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-22cppcheck:useInitializationListNoel Grandin2-4/+4
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-18Use C++11 char16_t for sal_UnicodeStephan Bergmann1-0/+53
...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-18Clean upStephan Bergmann1-443/+407
Change-Id: I9ce96ac26efd6fb46f78aa6462d693113b359bb5
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann27-510/+510
Change-Id: I17eb40b2923793280ea220e519f97563c8490a19
2015-11-10cid#1338241 removed throw from C function.jan iversen1-1/+8
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-10cid#1338242 cid#1338241 removed throw from extern "C" functionjan iversen1-3/+9
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-09new loplugin: oncevarNoel Grandin2-4/+2
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-02tdf#94269: Replace "n" prefix for bool variables with "b"Benjamin Ni1-3/+3
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-11-02Avoid ASan new-delete-type-mismatch with -fsized-deallocationStephan Bergmann1-11/+20
...where "subclasses" of typelib_TypeDescription are deleted non- polymorphically Change-Id: I708d245e12d2e2159e9df60b61d1b37801083651
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann7-36/+36
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12Replace "SAL_DELETED_FUNCTION" with "= delete" in LIBO_INTERNAL_ONLY codeStephan Bergmann1-4/+4
Change-Id: I328ac7a95ccc87732efae48b567a0556865928f3
2015-09-30Fix typosAndrea Gelmini2-2/+2
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-14boost->stdCaolán McNamara4-6/+5
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-08-31loplugin:stringconstant: OUStringBuffer: appendAscii -> appendStephan Bergmann1-1/+1
Change-Id: I22808f7740a9a936deb9160b24fe4634f8613823
2015-08-18Some oslCondition -> osl::ConditionStephan Bergmann4-28/+22
Change-Id: I86cfbefd1cb8b22fca659a158b8e31d5c991de7a
2015-08-11loplugin: defaultparamsNoel Grandin1-1/+1
Change-Id: I906912f29448bfc72e8139546aa09525c959867f
2015-07-29com::sun::star-css in cppu,cppuhelperNoel Grandin3-10/+10
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-13Make content of OSL_ASSERT, DBG_ASSERT, etc. visiblie in non-debug buildsStephan Bergmann1-2/+0
...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-08Avoid loplugin:redundantcast in non-debug buildStephan Bergmann1-8/+5
Change-Id: Ib5f57ba5154c56b89ab550aef5a87ee27539ddd9
2015-06-26loplugin:stringconstant: handle OUString+=OUString(literal)Stephan Bergmann1-3/+2
Change-Id: I55363639900450c9780dd187805ce0500f68a2f4
2015-06-25loplugin:stringconstant: Flag more inefficienciesStephan Bergmann1-2/+1
Change-Id: I36ae4b57049fe4deabe785ccfecf78608461086f
2015-06-23Revert "Typo: iff->if"Julien Nabet1-1/+1
This reverts commit cf92da3d6e1de14756efe3f1ee79f393a2f3787d. iff can mean "if and only if" so not a typo
2015-06-23Typo: iff->ifJulien Nabet1-1/+1
Change-Id: I3fc60856b5a56e71d70b55c89323be074bdec3b3
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe1-2/+2
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-09cppcheck: noExplicitConstructorCaolán McNamara5-32/+26
Change-Id: Ic33ee6936f40bec4f3a82aea39a180ae6e9a0928
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann4-8/+8
Change-Id: I2d60f21219adfe9935ad69620f3a7bd856f96376
2015-06-02loplugin:cstylecast: deal with those that are (technically) const_castStephan Bergmann1-3/+3
Change-Id: Ied61df6c80a05037fc6335c098c9ac2671ad1c4d
2015-05-18Remove include stdio (part2)Julien Nabet3-16/+2
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-12loplugin:redundantcast: reinterpret_cast to void*Stephan Bergmann1-1/+1
Change-Id: I947b49cfb15f0e7d6ddfaae386656c70e4bd48ba
2015-05-11loplugin:cstylecast: nop between pointer types of exactly same spellingStephan Bergmann1-1/+1
Change-Id: Id980379f57590759ebc9b862aad3c6dfb04ddef7
2015-04-22Various #include <sal/log.hxx> fixupsStephan Bergmann4-0/+4
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-15remove unnecessary use of void in function declarationsNoel Grandin11-66/+66
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-01Add support for cppu::UnoType<void>Stephan Bergmann2-1/+2
Change-Id: I88259ffaffc73979c240721d2db166c79d3085f1
2015-04-01Replace remaining getCppuType et al with cppu::UnoTypeStephan Bergmann3-291/+81
Change-Id: Ied1a4e7226de4ae1d1c24af90ae9397ba80f404a
2015-03-31Use OUString::unacquiredStephan Bergmann1-1/+1
found with git grep -E '\* *\<reinterpret_cast\>[^>]+\<OUString\>' Change-Id: I9306d4ad8e3b1664f54cb7df86f2d79bfd3c6cb9
2015-03-31Reduce to static_cast any reinterpret_cast from void pointersStephan Bergmann5-11/+11
Change-Id: I22ee2cbacad8b19bb55db234e816d401edcf4a35
2015-03-28Clean up C-style casts from pointers to voidStephan Bergmann13-313/+313
Change-Id: I834eb4ecd0fa71caf6fa746901367fac8b538305
2015-02-18TyposJulien Nabet1-4/+4
Change-Id: I845a85e1aad4a0708f2b43f7d94606b4b5513ee4
2015-02-05convert all remaining BOOST_STATIC_ASSERT to static_assertCaolán McNamara1-7/+4
and we can include a few less headers Change-Id: Id742849ff4c1c37a2b861aa3d6ab823f00ea87f8
2015-01-29cppu: convert some OSL_TRACEMichael Stahl1-11/+3
Change-Id: I5dc00f7b03b51916b1331c4ba64064a5aa5930c9
2015-01-29cppu: the LogBrige really needs its own SAL_LOG areaMichael Stahl1-25/+25
Change-Id: I129f3dc1597035664e4ff284276cb0d49a560ab5
2015-01-28Some more loplugin:cstylecast clean-upStephan Bergmann4-7/+7
Change-Id: I132d22e2af3cf673c17d8964f690d48990834884
2015-01-20Some more loplugin:cstylecast: cppuStephan Bergmann17-196/+189
Change-Id: Iec1251648031afa9eddd7445135fb08dc74821bd
2015-01-08valgrind: uninitialized variableCaolán McNamara1-1/+1
Change-Id: I1e166c7e3b58ed565aaf478fa0b6505d1f68b604
2015-01-08coverity#1261762 Resource leakCaolán McNamara4-30/+29
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-05Fix includeStephan Bergmann1-1/+1
Change-Id: Ie5253f9b32bb6ed1099eca75b442ba26528f2b32