summaryrefslogtreecommitdiff
path: root/codemaker/source/cppumaker/cpputype.cxx
AgeCommit message (Collapse)Author
2020-05-19Fix the Clang check for using <experimental/source_location>Stephan Bergmann
(see the <https://gerrit.libreoffice.org/c/core/+/93868/19# message-77dcd3b30c4ae3919354f84b46b27d934164a938> comment to "use std::experimental::source_location in uno::Exception") Change-Id: I5d682dcf97be59f1798c5c08ad13025dfee0dd4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94495 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-18use std::experimental::source_location in uno::ExceptionNoel Grandin
Clang and gcc have moved this out of experimental and into std::source_location, but only in their very latest releases. Change-Id: I9d9d9155788ee4240455ac4628b298dface4ad24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93868 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-18loplugin:flatten in codemakerNoel Grandin
Change-Id: I973ecef5df990511a41e422b73ed2314434f2871 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92479 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23size some stringbuffer to prevent re-allocNoel Grandin
Change-Id: I385587a922c555c320a45dcc6d644315b72510e9 Reviewed-on: https://gerrit.libreoffice.org/81278 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21size some stringbuffer to prevent re-allocNoel Grandin
found by the simple expidient of putting asserts in the resize routine. Where an explicit const size is used, I started with 32 and kept doubling until that site did not need resizing anymore. Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4 Reviewed-on: https://gerrit.libreoffice.org/81138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-08loplugin:redundantpointerops simplify *p.get()Noel Grandin
Change-Id: I12517651fb3f777fd08e384992bb3e84b340ad85 Reviewed-on: https://gerrit.libreoffice.org/80382 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-05Revert "Get rid of b2u/u2b helpers; use OUString's toUtf8/fromUtf8 instead"Mike Kaganski
This reverts commit 84662e9030a855c8db7cd40d9ce354b773d78c16. Change-Id: I1cc98d3201390609ae3615baa8e92c926cdcde9a Reviewed-on: https://gerrit.libreoffice.org/70294 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-05tdf#120703: partially revert commit 85456fae54029edd26df2277a9eec5e2fe3d9739Mike Kaganski
... to take into account possible differences of results of dynamic_cast vs static_cast; the change casts dynamically, as before the commit, and only adds asserts on the result of the cast. Thanks to sberg for pointing my mistake out! Change-Id: Ib77d443e5a858e744f369f58542de603f948fd1c Reviewed-on: https://gerrit.libreoffice.org/70274 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-04Get rid of b2u/u2b helpers; use OUString's toUtf8/fromUtf8 insteadMike Kaganski
These helpers are used in code generator code; so any invalid UTF-8 or UTF-16 in the conversion is programmer's error which needs fixing. Thus, the behavior of toUtf8/fromUtf8 which asserts the validity is fine here. Change-Id: I3004e233c9de59f8e348455f1f04d23e8c51ed3d Reviewed-on: https://gerrit.libreoffice.org/70249 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-01tdf#120703 PVS: Silence V522 warningsMike Kaganski
V522 There might be dereferencing of a potential null pointer. Change-Id: Ie617b41a8f8d334022cf5313b242a236baedba48 Reviewed-on: https://gerrit.libreoffice.org/70017 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-10-17clang-tidy readability-redundant-smartptr-getNoel Grandin
redundant get() call on smart pointer Change-Id: Icb5a03bbc15e79a30d3d135a507d22914d15c2bd Reviewed-on: https://gerrit.libreoffice.org/61837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-10Generate UNO exception classes as SAL_WARN_UNUSEDStephan Bergmann
...to find more places like 09978dd1fc18ce1ae707bc9e4ea1d2745ff07b61 "clang-tidy bugprone-unused-return-value" Change-Id: Ibe8b6790c701dc8270295dd1e2cbc9023b5ce018 Reviewed-on: https://gerrit.libreoffice.org/60234 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-27codemaker: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)Stephan Bergmann
...by explicitly defaulting the copy/move functions (and, where needed in turn, also a default ctor) for classes that have a user-declared dtor that does nothing other than an implicitly-defined one would do, but needs to be user- declared because it is virtual and potentially serves as a key function to emit the vtable, or is non-public, etc. (For LIBO_INTERNAL_ONLY, in cppumaker- genered code.) Change-Id: Ia13d945c10600f5793a3247f85a464170ede483d Reviewed-on: https://gerrit.libreoffice.org/58116 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-09Add missing sal/log.hxx headersGabor Kelemen
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. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from a* to configmgr Change-Id: I6ea1a7f992b1f835f5bac7a725e1135abee3f85a Reviewed-on: https://gerrit.libreoffice.org/57170 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-01-26coverity#1019311 silence Unchecked return valueCaolán McNamara
Change-Id: Ife2bfed0eecff5fe247d0fef6ee7d77626d9f0be
2018-01-19loplugin:unusedmethods also check for functions returning boolNoel Grandin
we were previously excluding them Change-Id: I48a68799b0de60b4995fae541eb363e043d4dd11 Reviewed-on: https://gerrit.libreoffice.org/48167 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-19SAL_W32 is just an alias for _WIN32Stephan Bergmann
...so consistently use the latter instead of the former Change-Id: I144d5e7c472632f93b2258461510346bc85892d9 Reviewed-on: https://gerrit.libreoffice.org/48135 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-11-27loplugin:unnecessaryparen: Warn about parentheses around literalsStephan Bergmann
...that are not composed of multiple tokens, like ("foo" "bar"). Also don't yet warn about Boolean literals, which are sometimes wrapped in parentheses to silence unreachable-code warnings. To avoid multiple warnings about code like f((0)) switch to generally using a set of ParenExpr to keep track of which occurrences have already been handled. Change-Id: I036a25a92836ec6ab6c56ea848f71bc6d63822bc Reviewed-on: https://gerrit.libreoffice.org/45317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-23loplugin:includeform: codemakerStephan Bergmann
Change-Id: If0c6726c4e096f50e2e16f2a4f7e5821457ac368
2017-10-20loplugin:constmethod in codemaker,registry,storeNoel Grandin
Change-Id: Ie75875974f054ff79bd64b1c261e79e2b78eb7fc Reviewed-on: https://gerrit.libreoffice.org/43540 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-04add << operator for css::uno::ExceptionNoel Grandin
Change-Id: Ia23dafd07133779144965682df3b7125a3214235 Reviewed-on: https://gerrit.libreoffice.org/43046 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-08-11convert std::map::insert to std::map::emplace IINoel Grandin
Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331 Reviewed-on: https://gerrit.libreoffice.org/41019 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10teach unnecessaryparen loplugin about identifiersNoel Grandin
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b Reviewed-on: https://gerrit.libreoffice.org/39737 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-30cppcheck: duplicateBreakJulien Nabet
Change-Id: Ia33dddfba35da3b495aae4edabe80b1a560674cd Reviewed-on: https://gerrit.libreoffice.org/37111 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-04More commit resurrectionStephan Bergmann
(why do people do such silly reformatting?) Change-Id: Ie9d45d7dfccb000f53fa5e8dc456f1e7c033af18
2017-04-04Move comment back to where it makes senseStephan Bergmann
It appertains to the preceding code, not the following, so it was indented for a subtle reason. Change-Id: I032033f04a1ca3a91024c11de74ef96527562b41
2017-04-04make UNO enums scoped for internal LO codeNoel Grandin
this modifies codemaker so that, for an UNO enum, we generate code that effectively looks like: #ifdef LIBO_INTERNAL_ONLY && HAVE_CX11_CONSTEXPR enum class XXX { ONE = 1 }; constexpr auto ONE = XXX_ONE; #else ...the old normal way.. #endif which means that for LO internal code, the enums are scoped. The "constexpr auto" trick acts like an alias so we don't have to use scoped naming everywhere. Change-Id: I3054ecb230e8666ce98b4a9cb87b384df5f64fb4 Reviewed-on: https://gerrit.libreoffice.org/34546 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08Remove newly-unnecessary #includes from cppumaker-generated filesStephan Bergmann
...after e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications" dropped uses of UNO exception types from those generated files. This needed first adapting client code that implicitly depended on those #includes in the generated files it included ("Add missing #includes": 6dce9c6757823b9e89863716ae70ff4e8ddd4e60, a34d9150b419ee7471b96599d877ff1091d6b567, fed3783e77e00635e50622e7229b06c9e25451f1). Change-Id: Ia1defda2d586b69092f53feef3644875192cbea4 Reviewed-on: https://gerrit.libreoffice.org/34014 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-02-01loplugin:useuniqueptr extend to check local varsNoel Grandin
just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-20Remove dynamic exception specifications from cppumaker-generated codeStephan Bergmann
See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. This leaves some #include <...Exception.hpp> in the generated code that are no longer needed by the generated files themselves. But C++ implementation classes still use dynamic exception specifications and usually don't repeat the relevant #includes, so postpone removal until the implementation classes are cleaned up in a later step. Change-Id: Ifb7df3bb12f7f10c655b85cb0626afe5050479a4
2016-11-21Delete the "Any-to-Any" template specializations for LIBO_INTERNAL_ONLYStephan Bergmann
i.e., css::uno::Any function template specializations Any::has<Any>() const Any::get(Any const &) const operator >>=(Any const &, Any &) operator <<=(Any &, Any const &) that don't make much sense (the first is always true, the rest can be replaced with operator =, which additionally supports move semantics). For 3rd-party compatibility, do this only for LIBO_INTERNAL_ONLY, however. However, some generic template code did benefit from operator >>= working also for Any, so make up for that with a new (LIBO_INTERNAL_ONLY, given that operator >>= still covers if fine for !LIBO_INTERNAL_ONLY) fromAny, complementing the existing toAny. Change-Id: I8b1b5f803f0b909808159916366d53c948206a88 Reviewed-on: https://gerrit.libreoffice.org/30022 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-23cid#1371162 etc.: Move semantics for cppumaker-generated UNO exception classesStephan Bergmann
For UNO ABI reasons, these classes need to be CPPU_GCC_DLLPUBLIC_EXPORT (so their RTTI symbols get exported), so they are careful to explicitly declare any special member functions that would otherwise be declared implicitly, to mark them CPPU_GCC_DLLPRIVATE. But for LIBO_INTERNAL_ONLY, we always use -fvisibility-inlines-hidden (except for MSVC, where it doesn't matter, as CPPU_GCC_DLLPRIVATE expands to nothing there, either), so can leave those functions implicitly declared, so not to prevent move ctor and move assign op from being implicitly declared. This covers cid#s 1371143, 1371162, 1371185, 1371189, 1371290, and 1371308. Change-Id: I468088750a02f85a4790d956c37f4c30de03f00c
2016-07-06clang-tidy performance-implicit-cast-in-loopStephan Bergmann
...where the first component of the pair returned by the iterator would be const, so an implicit conversion would be required. Change-Id: I62b6ddd799261e1dd63ea5c42a85d8b071f8b8b7
2016-05-12Silence -Werror,-Wimplicit-fallthrough under NDEBUGStephan Bergmann
Change-Id: I6abfef139197379f04e1a9df80e974c5d4021890
2016-04-08tdf#94306 replace boost::noncopyable in cppuhelperJochen Nitschke
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-01tdf#97966 Drop 'static' keywordsWastack
Including no keywords from extern "C" blocks Change-Id: Id0304994a692f1004993dda2ffd7fb819ab8e8d0 Reviewed-on: https://gerrit.libreoffice.org/23670 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-02-24convert codemaker::UnoType::Sort to scoped enumNoel Grandin
Change-Id: I70a84f777e714bcc20c2d7b06b918e3be0f3ce4a
2016-02-24convert codemaker::cpp::IdentifierTranslationMode to scoped enumNoel Grandin
Change-Id: I17f7a2f8f89166c5a51be4ee15986d21f1cb24b3
2016-02-11[API CHANGE] add operator==/!= to UNO structsNoel Grandin
this is useful now that we are storing UNO structs in std::vector Change-Id: Ic558bcd669bd2b3cdf9eb8393269eb906ac52369 Reviewed-on: https://gerrit.libreoffice.org/22257 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-09convert to range-based for loops in codemaker/Noel Grandin
Change-Id: Ifa521f34a8d9565bb61743c4a996bcba37e95ec2
2016-02-09rename dumpHFile to dumpHdlFileNoel Grandin
since we create .hdl files, not .h files Change-Id: I0faf0eda459c5353c9ebf1417fd65a17748dc591
2016-02-09rename dumpHxxFile to dumpHppFileNoel Grandin
since we generate .hpp files, not .hxx files Change-Id: I694364c9b0e7c78777201a031435c40b10cfd1ed
2015-12-01Reduce space needed for string literalsStephan Bergmann
...as had been done in 68ba6ddef50ec4aa92f55fa610c84c9f0d134e67 "codemaker: Allow compiler to share these generated strings" and 2188a7ac2eb37aee89f8f305bdf99db9b05b20bf "Reduce the amount of strings in the release builds," and then undone in 759eb79d886b70c7e7ab86b48e63d1b627b7dc44 "give useful details in non-debug mode too" Change-Id: Ic888d6c47449da3b3a084f863a7e0526f201a967
2015-11-27give useful details in non-debug mode tooCaolán McNamara
Change-Id: I5a3be096ad4417735254abb387b21029e636f5b8
2015-11-26mark UNO structs as SAL_WARN_UNUSED, where possibleNoel Grandin
Change-Id: Ie3de518f60c9f1313c68df54dbdc1fb2804f1f0d
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: Ic33cbe3feed8aec9f7578aea2cbd809169d9b8c8
2015-11-02tdf#94269: Replace "n" prefix for bool variables with "b"Benjamin Ni
Change-Id: I178545792c7354a362658ac7ef8b1d4cf0865797 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2015-10-30UNO: no need to use OUString constructor when calling createInstanceNoel Grandin
Change-Id: I37da28539b94706574116d0fff5f008aabfb5526 Reviewed-on: https://gerrit.libreoffice.org/19682 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-20loplugin:defaultparamsStephan Bergmann
Change-Id: I3d9d96d1ce91471b7c0e73df848a4893152cd637