summaryrefslogtreecommitdiff
path: root/cppu
AgeCommit message (Collapse)AuthorFilesLines
2016-07-04Fix some spelling errors in comments and stringsOtto Kekäläinen1-3/+3
Change-Id: Iecd6b5e13d6be14651f77d8e37f01117ba15a11e Reviewed-on: https://gerrit.libreoffice.org/26883 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-05-31teach refcounting clang plugin about uno::ReferenceNoel Grandin1-2/+9
uno::Reference is only allowed to used with classes that have a ::static_type member. So convert all those places to rtl::Reference. Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and uno::Reference to make this a little smoother? Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3 Reviewed-on: https://gerrit.libreoffice.org/25516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30Some clean up of uses of css::uno::Any::setValueStephan Bergmann1-5/+3
Change-Id: I04e8aef35a6083b61d775c8eb3f96757da2b31bd
2016-05-18clang-tidy modernize-make-sharedNoel Grandin1-1/+1
Change-Id: I3fa866bfb3093fc876474a9d9db29fe05dc2af3a Reviewed-on: https://gerrit.libreoffice.org/25056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-10Replace 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. Change-Id: I342a7610a107db7d7a344ea9cbddfd9714d7e9ca
2016-05-10Insert explicit "break" when falling through to empty next caseStephan Bergmann1-1/+2
...which itself only contains a "break" (or nothing at all at the end of the "switch"), as otherwise Clang -Wimplicit-fallthrough would warn about these. Change-Id: I25c1cf2ca74dfeba7ca0385ca8f1c1bf30bbf91b
2016-05-06cppu: replace boost::is_same with std::is_sameMichael Stahl1-5/+5
Change-Id: I7014737403da4b53b83488d17399b1c214b7a5db
2016-05-03Handle wchar_t as native C++11 type on windowsDavid Ostrovsky1-60/+0
The option /Zc:wchar_t- prevented to use wchar_t as a built-in type according to the C++ standard. In Visual C++ 6.0 and earlier, wchar_t was not implemented as a built-in type, but was declared in wchar.h as a typedef for unsigned short. Now, years later after the end of life this outdated toolchain, there is no reason not to use native type. The only issue could be the ABI compatibility. But on a quick look at least, it looks like none of the mangled C++ symbols in the stable URE interface actually depend on wchar_t. We forgot to get rid of /Zc:wchar_t- in 5.1. Do that for LibreOffice 5.2, though. Change-Id: I8d6b380660859efa44c83c830734978d31d756a0 Reviewed-on: https://gerrit.libreoffice.org/22589 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-05-01tdf#97499 Fixed containers parameters clearing #8tymyjan1-1/+1
Change-Id: I82ca89ac483e9742be0d38a3c6882a240c7c38d8 Reviewed-on: https://gerrit.libreoffice.org/24499 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-25Cannot extract Any to sal_uInt32Stephan Bergmann1-84/+0
...which has the same underlying type as sal_Bool Change-Id: Ief5a9b9a4d286488efe6e67ee72e7cc23d6f4075
2016-04-21loplugin:salbool: sal_Bool[] -> bool[]Stephan Bergmann1-13/+13
Change-Id: I3c5bf7a53c9ae173f8fce885ecf022f092aa43a9
2016-04-21clang-tidy modernize-loop-convert in c*Noel Grandin1-2/+2
Change-Id: I77d2548f8be97792660761e6156cd24734a95aaf
2016-04-20loplugin:salbool: Automatic rewrite of sal_False/TrueStephan Bergmann8-46/+46
Change-Id: I47acc5590a935c7f9089231efbb1319664942f16
2016-04-20Use cast to bool to normalize sal_Bool valuesStephan Bergmann3-7/+7
Change-Id: I8a886f752d2a16ec4c10656bcd0b3631647971b2
2016-04-18clean-up: unused using declarations and includesJochen Nitschke1-2/+0
Searched source for using declarations. Checked if those symbols reappear in the source file, even in comments or dead code but not in #include statements. If they don't reappear, remove the declaration. Remove includes whose symbol got removed. Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0 Reviewed-on: https://gerrit.libreoffice.org/24148 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-08tdf#94306 replace boost::noncopyable in cppuhelperJochen Nitschke2-4/+8
and related modules. Replace with C++11 delete copy-constructur and copy-assignment. Change-Id: I18aa9fe4ff696f9b5472cbe4cd0097cb174618b7 Reviewed-on: https://gerrit.libreoffice.org/23904 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-04-04tdf#97499 Fixed containers parameters clearing #4tymyjan1-2/+1
Change-Id: I7c96181399f4d7e62d4aceca404b22d68f903513 Reviewed-on: https://gerrit.libreoffice.org/23754 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-01tdf#97966 Drop 'static' keywordsWastack1-3/+3
Including no keywords from extern "C" blocks Change-Id: I18ddafbf3d41f6779fb43e36ba1f1c48b37757a0 Reviewed-on: https://gerrit.libreoffice.org/23671 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-01loplugin:staticanonymousStephan Bergmann1-2/+2
Change-Id: I1a96ef6bff7a99ab46f7c88722426cba48b46c81
2016-03-29uno/check.cxx: use alignment calculated at runtime instead of hardcodeDouglas Mencken1-23/+20
Change-Id: I0f9a48ef01bee4153cd9231bdef4b5a763b6bda2 Reviewed-on: https://gerrit.libreoffice.org/23283 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-22android version can also be compiled for x86Christian Lohmaier1-1/+2
and x86 has smaller alignment than arm or a x86_64 host, so needs the MAX_ALIGNMENT_4 to not trigger the static_asserts Change-Id: I5643a33e4975e7bad20693f99fb8bbd5248c7c1c
2016-03-22tdf#84323: Make osl::Condition::wait more readableGurkaran1-2/+2
It is to improve the readability of calls to osl::Condition::wait. Change-Id: I5945343c5a7e4729ab599380414d18280bd176fe Signed-off-by: Gurkaran <gurkran@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/23417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-11cppu: SAL_WARN_IF() -> SAL_INFO_IF() where it was dbglevel=2-specific beforeMiklos Vajna1-9/+9
As these fire already during the build. Change-Id: I750ea04be317fffb8bc321a2b7b4da0447789c8f
2016-03-11Let's use the iterator return by erase method of iterator listJulien Nabet1-3/+2
and avoid to retrieve list->begin and loop from the first element Change-Id: I536b7a03c4033b02a7226d25f64764c10c28bdd0 Reviewed-on: https://gerrit.libreoffice.org/23126 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-10Remove unnecessary parenthesesStephan Bergmann1-9/+9
Change-Id: I6815a02ae8f47c40c3b8cf5692126142de867480
2016-03-10Fixed minor negation bug in SAL_WARN_IFrohan1-9/+9
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-09typoStephan Bergmann1-23/+23
Change-Id: Id990e76769c3b5e2e048f3faf754efbae2b41c3f
2016-03-09Use plain assert (to complement use of static_assert above)Stephan Bergmann1-32/+24
Change-Id: Id4ac9e86a6af3fa84f7a9680051dfe2564f8c5c5
2016-03-08Extract static_asserts out of OSL_DEBUG_LEVEL > 0Stephan Bergmann1-87/+95
Change-Id: I604b41a5063728833d57e2589e6d3ec39eb67166
2016-03-08Clean up namespaceStephan Bergmann1-1/+1
Change-Id: I8207f7906cb8914b6c272efaf8f136a1bce7e4b0
2016-03-08Extract checking code to its own check.cxxStephan Bergmann3-254/+283
Change-Id: I9d5b14c374ce62ac7b970faa30c38a5a76568ed4
2016-03-08loplugin:cstylecastStephan Bergmann1-1/+1
Change-Id: I3771f84ec94c62988c075dd26ee1de17200af705
2016-03-08Remove redundant checks (that trigger loplugin:implicitboolconversion])Stephan Bergmann1-4/+4
Change-Id: I86c0b56b7d330e3e3450a5806a89ca8fb7a1bfae
2016-03-08tdf#91794: Remove OSL_DEBUG_LEVEL > 1 conditionalsRohan Kumar5-146/+95
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-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>
2016-02-15tdf#57950: Replace chained O(U)StringBuffer::append() with operator+Arnold Dumas1-4/+1
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-09Remove 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 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-01-18Avoid -Werror,-Wdelete-non-virtual-dtor with current Clang trunkStephan Bergmann1-2/+4
Change-Id: I5300cd6ff2c924a4acc01ba7f4478a0db50aa08c
2016-01-10Fix typosAndrea Gelmini2-2/+2
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-03loplugin:implicitboolconversionAndrzej Hunt1-2/+2
Change-Id: I2ef26c34a424e653d85597c85baa736c19004313
2016-01-03cppcheck: allocaCalledCaolán McNamara2-28/+25
Change-Id: I4e2345cdf9fd8d088f3522d563263b65abedb7c9
2015-11-28Adapt to true wchar_t in clang-clStephan Bergmann1-7/+14
Change-Id: I14c2dc0be12151b5d4ea2ba3b65030f6f4494905
2015-11-25i125711 - Illumos port: generalize MAX_ALIGNMENT for SolarisPedro Giffuni1-2/+4
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-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>