131 Commits
Author SHA1 Message Date
Michael Stahl 6e9c3fb2be opencl,sc: convert callers of rtl_digest_MD5 to comphelper::Hash
Signed-off-by: Michael Stahl <michael.stahl@collabora.com>
Change-Id: Ib507b0e73fce064a7dbd2426849d9bf32bb95295
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/4672
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
(cherry picked from commit abd6c2a86dfc250ba9110afa48f10cb2d149bafb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207204
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-24 00:07:03 +02:00
Caolán McNamara 79c3a09385 cid#1660333 Variable copied when it could be moved
and

cid#1660326 Variable copied when it could be moved
cid#1660325 Variable copied when it could be moved
cid#1660324 Variable copied when it could be moved
cid#1660321 Variable copied when it could be moved
cid#1660320 Variable copied when it could be moved
cid#1660316 Variable copied when it could be moved
cid#1660313 Variable copied when it could be moved
cid#1660307 Variable copied when it could be moved

Change-Id: I9fe4fa56693f8e3a1efd47294ecb7e0e5588b9b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188851
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-08-03 12:18:39 +02:00
Caolán McNamara e4780ac521 cid#1660797 Variable copied when it could be moved
and

cid#1660561 Variable copied when it could be moved
cid#1660555 Variable copied when it could be moved
cid#1660552 Variable copied when it could be moved
cid#1660549 Variable copied when it could be moved
cid#1660548 Variable copied when it could be moved
cid#1660444 Variable copied when it could be moved
cid#1659838 Variable copied when it could be moved
cid#1659835 Variable copied when it could be moved
cid#1555526 Variable copied when it could be moved

Change-Id: Ic3f69bc789861d06d33a7b23e7ed0d519df94ab7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188589
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-07-30 18:14:14 +02:00
Mike Kaganski 4a09777d8f Windows 10 is the baseline, drop checks for older versions
Change-Id: I78c3b1e6efc73095cd11cecc4ffc30acba02f943
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178089
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-08 16:31:23 +01:00
Christian Lohmaier bba1193359 workaround segfault in compiler on macos-clang-intel
XCode 14 seems to be allergic to the string-literal in this lambda
expression

Change-Id: I1de59883923352c7aa83cc81adafb0218432381a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169030
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2024-07-25 15:03:36 +02:00
Noel Grandin d573e2ae17 loplugin:ostr in various
Change-Id: I9f399b3752da9df930e0647536ffcd4e82beb1ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-20 22:09:56 +02:00
Stephan Bergmann 235ae98ae6 Extended loplugin:ostr: opencl
Change-Id: I126ed9e9fca6d1ab8d4e42ec0fe1ffb33a5f8ae8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159689
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-19 22:35:12 +01:00
Mike Kaganski 5fe96b6dce Drop SvStream::WriteCharPtr
WriteOString is a better replacement

Change-Id: Ic431b9aeb98d19fe61cff71360eee555105cc2bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150192
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-10 23:13:32 +02:00
Noel Grandin 7f91e4a982 loplugin:stringadd in oox..pyuno
after my patch to merge the bufferadd loplugin into stringadd

Change-Id: I5fdc0a33923fe00e7b588f4576607515a93e5c13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149579
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-27 11:04:46 +00:00
Ilmari Lauhakangas c544f9ea78 Use raw string literal in opencl to keep PMD static analyser happy
Change-Id: Ibf2bd12b79c6e7c7eae59fc516e75c1bda971a7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146502
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-02-03 07:13:52 +00:00
Michael Meeks 4140154fe7 opencl: no need for unhelpful nullptr OUString * case.
Change-Id: I0b3cad2247706901e1a6b9c3df7fbbc9f23ff987
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136816
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2022-07-06 10:29:45 +02:00
Noel Grandin fdfd517a6f loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents

Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-13 08:38:53 +02:00
Noel Grandin 85c2ed8dc7 loplugin:stringview add check for getToken().toInt32
where we can convert that to
    o3tl::toInt32(o3tl::getToken(
and avoid the heap allocation of a temporary string

Change-Id: Ib11c19c6e6cdc0de3e551affd3578d181e292de4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132810
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-11 14:45:38 +02:00
Gabor Kelemen 7b5193e2ae Recheck modules [o-r]* with IWYU
See tdf#42949 for motivation

Change-Id: I6b4b05a5e59b256653c4caf5297fffd601b45083
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128845
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-01-30 16:10:57 +01:00
Mike Kaganski 9a66812925 Prepare for removal of non-const operator[] from Sequence in opencl
Change-Id: Id58484eb9b955948a8edb48000b86cec3b721060
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124377
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-30 21:55:44 +02:00
Noel Grandin 283a9790bf loplugin:indentation check for indent inside block
look for places where the statements inside a block are
not indented

Change-Id: I0cbfa7e0b6fb194b2aff6fa7e070fb907d70ca2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123885
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-20 15:39:38 +02:00
Julien Nabet 10ad9560fb drop 'using namespace std' in o* r* x*
Change-Id: I15d56d133cf464a3cb6483be785b1259c7f35b43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123120
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-10-05 23:09:56 +02:00
Stephan Bergmann 2bc1a0431b New loplugin:unusedcapturedefault
In sc/qa/unit/ucalc_formula.cxx, dropping the capture-default from the
lExpectedinF lambda revealed that MSVC in C++17 mode (i.e., when building
without --with-latest-c++) requires ROW_RANGE (a local const int variable from
the enclosing TestFormula::testTdf97369) to be captured, even though all uses of
that variable within the lambda body are constant expressions.  That is still
true at least for the latest Visual Studio 2019 version 16.11.1.  (This is not
an issue for the lExpectedinH and lExpectedinI lambdas a few lines further down,
as they, in addition to using that ROW_RANGE, also use the local const double
variables SHIFT1 and SHIFT2, whose uses are not constant expressions, so
they are implicitly captured and loplugin:unusedcapturedefault does not suggest
dropping those lambdas' capture-defaults in the first place.)

Change-Id: Iee7efb485187cbe8eba6a2d470afca4993eb1816
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120693
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-08-20 14:25:38 +02:00
Noel Grandin 18f2020116 loplugin:constparams
Change-Id: Ic7410f836e584df45101e78e345c8b3c8d355e09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120680
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-18 21:18:29 +02:00
Noel Grandin 62f6d6ee8b use more string_view in tools/stream
Change-Id: I2a957cd72d71fea717734488cdb3670e0bcdd6f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114657
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-27 09:27:44 +02:00
Ilmari Lauhakangas 03b070a717 Update OpenCL denylist and allowlist
Add bad Intel driver reported by a new developer.
Remove superfluous AMD allowlist entry.

Change-Id: Ide5092dab7e0fa7f40ee512ba2dc9283bd9e95be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110749
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-02-11 10:02:21 +01:00
Noel 9430608363 simplify code, use more subView()
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28 17:32:18 +01:00
Stephan Bergmann 042033f1e6 loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-29 16:42:33 +01:00
Stephan Bergmann 35e471bb4d Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY.  These had been missed by
1b43cceaea "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).

This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).

The improvement to loplugin:stringadd became necessary to fix

> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
>   File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.

Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-11 21:25:10 +01:00
Noel bb06f51308 loplugin:stringviewparam extend to comparison operators
which means that some call sites have to change to use
unicode string literals i.e. u"foo" instead of "foo"

Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-24 09:45:04 +01:00
Philipp Hofer 4d4e95be17 tdf#123936 Formatting files in module opencl with clang-format
Change-Id: I16a00ceee4c2b772ec9ed6b1b349253114b22239
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105695
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2020-11-19 19:23:02 +01:00
Noel 941f2c866a convert more long -> tools::Long
found by grepping and changed by hand.

Change-Id: I3c720859dba430fde3abc76c6c5cb58269efaf4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105512
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-11 11:25:43 +01:00
Stephan Bergmann 2e21240f23 Goodbye O[U]StringView, welcome O[U]String::Concat
O[U]StringView had an odd mixture of uses.  For one, it was used like
std::[u16]string_view, for which directly using the latter std types is clearly
the better alternative.  For another, it was used in concatenation sequences,
when neither of the two leading terms were of our rtl string-related types.

For that second use case introduce O[U]String::Concat (as std::[u16]string_view
can obviously not be used, those not being one of our rtl string-related types).
Also, O[U]StringLiteral is occasionally used for this, but the planned changes
outlined in the 33ecd0d5c4 "Change OUStringLiteral
from char[] to char16_t[]" commit message will make that no longer work, so
O[U]String::Concat will be the preferred solution in such use cases going
forward, too.

O[U]StringView was also occasionally used to include O[U]StringBuffer values in
concatenation sequences, for which a more obvious alternative is to make
O[U]StringBuffer participate directly in the ToStringHelper/O[U]StringConcat
machinery.

Change-Id: I1f0e8d836796c9ae01c45f32c518be5f52976622
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101586
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-30 20:42:56 +02:00
Thorsten Behrens abb6c01519 replace usage of whitelist with allowlist
Background and motivation:
  https://tools.ietf.org/html/draft-knodel-terminology-02

[API CHANGE] officecfg::Office::Common::Misc::OpenCLWhiteList -> OpenCLAllowList

Change-Id: I65636b19b13e4af1e4851f70e78053f3443d6bb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98181
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10 01:36:07 +02:00
Thorsten Behrens 493ae7a6bb replace usage of blacklist with denylist
.. and a few cases of instead doing blacklist->excludelist where that
made more sense.

Background and motivation:
  https://tools.ietf.org/html/draft-knodel-terminology-02

[API CHANGE] officecfg::Office::Canvas::DeviceBlacklist -> DeviceDenylist
[API CHANGE] officecfg::Office::Canvas::BlacklistCurrentDevice -> DenylistCurrentDevice
[API CHANGE] officecfg::Office::Common::Misc::OpenCLBlackList -> OpenCLDenyList

Change-Id: Ia35e25496bf0cc0692d5de4cb66bfc232d3a869e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98180
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10 01:34:54 +02:00
Noel Grandin 1511c73aa4 loplugin:flatten in opencl
Change-Id: I9f45510eddb022013af751d232d4704432717ef6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-03 12:39:43 +02:00
Luboš Luňák 397ad713cf merge OpenGLZone and OpenCLZone into one generic code
To be used also by Skia code to detect problems with Vulkan drivers.
The watchdog does not handle OpenCL because neither did the original
code, but also because OpenCLZone::hardDisable() called from it
would deadlock on SolarMutex for some reason.

Change-Id: I483d8cb0b11a4e1e65c564f4e4c29ab68843ff71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88008
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-07 09:11:32 +01:00
Stephan Bergmann aef7feb3e6 New loplugin:unsignedcompare
"Find explicit casts from signed to unsigned integer in comparison against
unsigned integer, where the cast is presumably used to avoid warnings about
signed vs. unsigned comparisons, and could thus be replaced with
o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx)

o3tl::make_unsigned requires its argument to be non-negative, and there is a
chance that some original code like

  static_cast<sal_uInt32>(n) >= c

used the explicit cast to actually force a (potentially negative) value of
sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the
cast to avoid a false "signed vs. unsigned comparison" warning in a case where
n is known to be non-negative.  It appears that restricting this plugin to non-
equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=)
is a useful heuristic to avoid such false positives.  The only remainging false
positive I found was 0288c8ffec "Rephrase cast
from sal_Int32 to sal_uInt32".

But which of course does not mean that there were no further false positivies
that I missed.  So this commit may accidentally introduce some false hits of the
assert in o3tl::make_unsigned.  At least, it passed a full (Linux ASan+UBSan
--enable-dbgutil) `make check && make screenshot`.

It is by design that o3tl::make_unsigned only accepts signed integer parameter
types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses
which would in general be suspicious.  But the STATIC_ARRAY_SELECT macro in
include/oox/helper/helper.hxx is used with both signed and unsigned types, so
needs a little oox::detail::make_unsigned helper function for now.  (The
ultimate fix being to get rid of the macro in the first place.)

Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-28 07:42:15 +01:00
Caolán McNamara ef8674a488 pickBestDevice return is ignored
so might as well return the BestDeviceIndex instead of passing
it by ref

Change-Id: Ic92fa3b5bfe3d319ff9fcb61b7f5404b5a624be5
Reviewed-on: https://gerrit.libreoffice.org/84971
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-11 21:13:51 +01:00
Caolán McNamara c544432c04 ensure cache dir is created
Change-Id: I708efa3dc4d9d145b1000d24cea4a4ff02628178
Reviewed-on: https://gerrit.libreoffice.org/84970
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-11 21:13:39 +01:00
Stephan Bergmann 928c854f7d Remove unused OpenCLEnv::mpOclCmdQueue
unused since 4eea4af892 "tdf#103204 opencl:
initialize command queue on demand"

(found by upcoming loplugin:unusedmember)

Change-Id: Ic8ab914699d5a99338abdfc315001603a8255e1b
2019-11-26 19:46:06 +01:00
Stephan Bergmann 8169c04711 Directly use OUStringBuffer::append overload taking a single sal_Unicode
Change-Id: Ibccde3ec84b0ea4e4af74122013229a1793f5ca5
Reviewed-on: https://gerrit.libreoffice.org/81128
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-19 15:37:03 +02:00
Mike Kaganski d51db77c8d Remove some memset calls
Replace them with default initialization or calloc

Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1
Reviewed-on: https://gerrit.libreoffice.org/80805
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17 09:53:42 +02:00
Stephan Bergmann 8b4719c29f Rename OUStringLiteral1 to OUStringChar
It started out as a wrapper around character literals, but has by now become a
wrapper around arbitrary single characters.  Besides updating the documentation,
this change is a mechanical

  for i in $(git grep -Fl OUStringLiteral1); do sed -i -e s/OUStringLiteral1/OUStringChar/g "$i"; done

Change-Id: I1b9eaa4b3fbc9025ce4a4bffea3db1c16188b76f
Reviewed-on: https://gerrit.libreoffice.org/80892
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-17 07:28:49 +02:00
Stephan Bergmann 35e6ada726 Fix misuse of OStringLiteral
...(which got introduced with 9b5dad13b5
"loplugin:stringadd look for unnecessary temporaries", and had reportedly
broken CppunitTest_sc_ucalc on tml's Windows build by hitting the
"strlen( str ) == N - 1" assert at include/rtl/string.hxx:1867), by introducing
rtl::OStringView (and rtl::OUStringView, for consistency).

Change-Id: I766b600274302ded66a6bffc91be189b20ed1ac3
Reviewed-on: https://gerrit.libreoffice.org/80778
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-14 17:27:32 +02:00
Noel Grandin 9b5dad13b5 loplugin:stringadd look for unnecessary temporaries
which defeat the *StringConcat optimisation.
Also make StringConcat conversions treat a nullptr as an empty string,
to match the O*String(char*) constructors.

Change-Id: If45f5b4b6a535c97bfeeacd9ec472a7603a52e5b
Reviewed-on: https://gerrit.libreoffice.org/80724
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-14 08:26:14 +02:00
Stephan Bergmann 33d922ea07 -Werror=volatile in OpenCLZone
Recent GCC 10 trunk in C++20 mode reports issues like

> include/opencl/OpenCLZone.hxx:27:9: error: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Werror=volatile]
>    27 |         gnEnterCount++;
>       |         ^~~~~~~~~~~~

But unlike in the case of ec17c8ec52
"-Werror=volatile in OpenGLZone",

* it looks like there are no multi-threading issues here, and the counters are
  just accessed (via OpenCLZone::isInZone) from the VCLExceptionSignal_impl
  signal handler in addition to being modified (via OpenCLZone RAII objects)
  from mainline code; and

* from the usage pattern of gnEnterCount and gnLeaveCount it appears that they
  can be combined into a single counter.
  (f41eb66302 "opencl: OpenCLZone, detect CL
  device change and disable CL on crash" presumably modelled OpenCLZone naively
  after OpenGLZone, without simplifying it where possible.)  One minor advantage
  of having two monotonically increasing counters is that when they overflow,
  the implementation of isInZone (comparing them for equality) still gives
  ~useful results (assuming that a false "match" of non-overflown gnEnterCount
  against overflown gnLeaveCount is highly unlikely).  But instances of
  OpenCLZone RAII objects are presumably never nested very deeply (if at all),
  so that the newly added "TODO: overflow" comment (which would even cause UB if
  std::sig_atomic_t is signed) is probably of no practical concern.

Change-Id: I92e1f2c46ca996a0a86bacabcda2accba5eb6298
Reviewed-on: https://gerrit.libreoffice.org/79106
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-18 20:28:29 +02:00
Noel Grandin 07f9223daa loplugin:constvars in i18npool..opencl
Change-Id: I82738a18ff116fdc78f07b453c93b1b631632caf
Reviewed-on: https://gerrit.libreoffice.org/77775
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-20 12:04:41 +02:00
Andrea Gelmini 650a836d00 Fix typos
Change-Id: Iea3bd498b1c8934f37085bdf6df71b073e4a871c
Reviewed-on: https://gerrit.libreoffice.org/76203
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2019-07-23 22:19:26 +02:00
Gabor Kelemen 61b7525869 tdf#42949 Fix IWYU warnings in opencl/
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I0aedc40c49c8cb1382f45571f54873d6017ec62c
Reviewed-on: https://gerrit.libreoffice.org/72637
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-29 09:11:52 +02:00
Stephan Bergmann c18e2ea2a5 New loplugin:data
...following up on 1453c2c8f1 "prefer vector::data
to &vector[0]"

Change-Id: I7c113747d92d144a521d49b89384dd8bf1215c01
Reviewed-on: https://gerrit.libreoffice.org/72765
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-05-22 16:35:20 +02:00
Luboš Luňák 101eea01c7 test in a separate helper process if OpenCL crashes (tdf#112252)
Some OpenCL implementations may be broken, e.g. pocl simply
asserts and aborts if it can't find Clang. In order to protect
against crashes caused by faulty OpenCL drivers, when testing OpenCL
functionality on OpenCL setup change, first do a simple test
in a separate helper.

Change-Id: I1cf328e731c48f47745b27c7130e7521254209f5
Reviewed-on: https://gerrit.libreoffice.org/71080
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-29 10:40:12 +02:00
Arkadiy Illarionov 9d7620613d Simplify containers iterations in oox, opencl, package
Use range-based loop or replace with STL functions

Change-Id: I91405920d91383bc6cf13b9497d262b1f6f0a84d
Reviewed-on: https://gerrit.libreoffice.org/67848
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-15 12:21:28 +01:00
Stephan Bergmann 70519a43e0 Replace OUStringBuffer::appendCopy with append(std::u16string_view)
...which is more general

Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7
Reviewed-on: https://gerrit.libreoffice.org/66155
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-11 13:55:14 +01:00
Noel Grandin 55e42805ea improve function-local statics in forms..reportdesign
Change-Id: I285e2e75c8d9cad35445c89f00ef68b155806ea2
Reviewed-on: https://gerrit.libreoffice.org/63703
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-21 13:00:02 +01:00