implemeent a reduction approach, which is good at finding virtual
methods that only themselves or their virtual partners.
The accessibility GetVisArea stuff is dead since
commit 891e41fac81fbd8d5cdb277b26639abfd25a7143
Date: Wed Apr 4 11:23:22 2018 +0200
dead code in AccessibleTextHelper_Impl::UpdateVisibleChildren
Change-Id: I78d9d8bca585ecec8394f2c3fe2baa93db0e58f5
Reviewed-on: https://gerrit.libreoffice.org/60912
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Including:
* expanding STDAPI to its definition (as per
<https://msdn.microsoft.com/library/ms686631(vs.85).aspx> "STDAPI"), to add
__declspec(dllexport) into its middle, in
extensions/source/activex/so_activex.cxx; as discussed in the comments at
<https://gerrit.libreoffice.org/#/c/60691/> "Get rid of Windows .def files in
setup_native, use __declspec(dllexport)", having a function both listed in a
.def file EXPORTS and marking it dllexport is OK, and the latter helps the
heuristics of loplugin:external; however, the relevant functions in
extensions/source/activex/so_activex.cxx probably don't even need to be
exported in the first place?
* follow-up loplugin:salcall in sal/osl/w32/file-impl.hxx
Change-Id: Ida6e17eba19cfa3d7e5c72dda57409005c0a0191
Reviewed-on: https://gerrit.libreoffice.org/60938
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
bdade7e3fc33c1832c6f6a472443fca8238738d2 "tdf#105444 DOCX import: don't put
extra paragraphs in comments" caused
> /home/sbergman/lo2/core/writerfilter/source/dmapper/DomainMapper_Impl.cxx:441:22: error: expression always evaluates to zero, lhs=0 rhs=unknown [loplugin:expressionalwayszero]
> (sizeof(SAL_NEWLINE_STRING)-1 == 2 && xCursor->getString() == "\n"))
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
now with sufficiently new Clang, and the code looks reasonable, and there's no
apparent way to avoid such false positives in the plugin. (It could check for a
sub-expression of the problematic expression being an object-like macro, but
SAL_NEWLINE_STRING could just as well be a variable instead of a macro. That
variable would need to be defined in some #if to have different values on
different platforms, so the plugin could theoretically check for such
conditional inclusion, but it's not clear whether that's worth it and would even
be a useful heuristic to not produce neither too many false positives nor too
many false negatives.) So just disable the plugin for good.
Change-Id: I85dc8573735ccac4e19be20ab7443cbaa85a3164
Reviewed-on: https://gerrit.libreoffice.org/60907
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
look for closed cycles of methods i.e. unused code that would not
otherwise be found by the unusedmethods loplugin
Change-Id: I3fb052132d97aabca573bb8e9fc424201b1e2042
Reviewed-on: https://gerrit.libreoffice.org/60875
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
look for collection-like fields that are never added to, and are
therefore effectively unused
Change-Id: Id52c5500ea5e3d2436fb5915aebb86278bf2d925
Reviewed-on: https://gerrit.libreoffice.org/60661
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
...warning about (for now only) functions and variables with external linkage
that likely don't need it.
The problems with moving entities into unnamed namespacs and breaking ADL
(as alluded to in comments in compilerplugins/clang/external.cxx) are
illustrated by the fact that while
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
struct S2: S1 { int f() { return 1; } };
int f(S2 s) { return s.f(); }
}
int main() { return f(N::S2()); }
returns 1, both moving just the struct S2 into an nunnamed namespace,
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
namespace { struct S2: S1 { int f() { return 1; } }; }
int f(S2 s) { return s.f(); }
}
int main() { return f(N::S2()); }
as well as moving just the function f overload into an unnamed namespace,
struct S1 { int f() { return 0; } };
int f(S1 s) { return s.f(); }
namespace N {
struct S2: S1 { int f() { return 1; } };
namespace { int f(S2 s) { return s.f(); } }
}
int main() { return f(N::S2()); }
would each change the program to return 0 instead.
Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c
Reviewed-on: https://gerrit.libreoffice.org/60539
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
in preparation for making it more general
Change-Id: I2fc8d0f99140dc7ef72341f8cbf28d6536ebd61f
Reviewed-on: https://gerrit.libreoffice.org/60525
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
no need to init smart pointers with nullptr, they all have default
constructors that do this already
Change-Id: Ief20c060daa0def8c1aa82f1cf8dc4bc696761e9
Reviewed-on: https://gerrit.libreoffice.org/59818
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
look for fields which are only assigned to in the constructor, so they
can be made const
Change-Id: I0b76817c2181227b04f6a29d6a808f5e31999765
Reviewed-on: https://gerrit.libreoffice.org/60393
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
revert the part of
commit 9f4d23c15115d64febd6bf01f870cc157badd350
Date: Mon Aug 13 17:24:26 2018 +0200
filter out some of the AST in the plugins
that applied to this plugin. Turns out it really needs to see __all__
the code in order to produce good results.
Change-Id: If580a701049d2570f2a833327b2189641090079b
Reviewed-on: https://gerrit.libreoffice.org/60279
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
look for places where we are appending the temporary result of adding
strings together, to an OUStringBuffer, where we could rather call
append repeatedly and avoid the temporary creation
Change-Id: I481435124291ac7fb54b91a78344a9fe5b379a82
Reviewed-on: https://gerrit.libreoffice.org/59708
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
I seem to have missed quite a few in
commit 9f4d23c15115d64febd6bf01f870cc157badd350
filter out some of the AST in the plugins
This nets me another 14% improvement
Change-Id: I39b980b49ced560f768045dbedd3ddfef29306c1
Reviewed-on: https://gerrit.libreoffice.org/59501
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Look for const string fields which can be static, and
mostly convert them to OUStringLiteral
And add a getLength() method to OUStringLiteral to make
the transition easier.
Remove dead code in XclExpRoot::GenerateDefaultEncryptionData,
default password is never empty.
Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091
Reviewed-on: https://gerrit.libreoffice.org/59204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
find more patterns of deleting member data
Change-Id: I8913e364200dad8405bac30dd8cab2a68c8bee8f
Reviewed-on: https://gerrit.libreoffice.org/59233
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This was a good idea from mike kaganski as a consequence of
https://gerrit.libreoffice.org/55359
Unfortunately, clang/llvm is not yet up to the job of doing floating
point evaluation, I get tons of crashes all over the evaluate
infrastruction inside clang, so this will need to wait until clang's
code matures.
So park it in store for now
Change-Id: I5ba4de8323e462b4fd4db301e4d116a81fd56ed3
Reviewed-on: https://gerrit.libreoffice.org/59254
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
to find more stuff, and return less false positives
Change-Id: I24cacbb825c1f7484fd568230051b1a57dbc663f
Reviewed-on: https://gerrit.libreoffice.org/59137
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
...where it produced false positive
> /Users/stephan/Software/lo2/core/UnoControls/source/controls/progressmonitor.cxx:245:21: error: do not call operator== on a std container containing a unique_ptr const class std::__1::__wrap_iter<class std::__1::unique_ptr<struct unocontrols::IMPL_TextlistItem, struct std::__1::default_delete<struct unocontrols::IMPL_TextlistItem> > *> [loplugin:ptrvector]
> if (itr != maTextlist_Top.end())
> ^
Change-Id: I8a8b6f30145e6aff2caa03c03f0fd20af0ba42b5
Reviewed-on: https://gerrit.libreoffice.org/59181
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
by checking if the current namespace decl is in our code, so we have to
scan less stuff, which results in a 10% perf improvement for me
Change-Id: Idf0e30d57b6d0dcd13daa9ed679c28b9d233d387
Reviewed-on: https://gerrit.libreoffice.org/58942
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
and just use SvxColorItem in its stead, all of it's special
functionality has been removed over time
Change-Id: I61a4d1fb92d9dccbdfc5bbb6d1a41692b83eb320
Reviewed-on: https://gerrit.libreoffice.org/58938
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
I assume the "0 == " around columnStringValue.equalsIgnoreAsciiCase in
ODatabaseMetaData::getSchemas (mysqlc/source/mysqlc_databasemetadata.cxx) was
just a thinko, as the latter already returns sal_Bool, not a <0 / 0 / >0 integer
value.
(Rebased atop ce24919c01d1ab77f962137ff04a31dd5ec944af "loplugin, various in
mysqlc", which covered the same warnings, but didn't consider the negated call
to equalsIgnoreAsciiCase to be an accident as I do here (see above), and
accidentally reversed the logic of OResultSetMetaData::isNullable in
mysqlc/source/mysqlc_resultsetmetadata.cxx, I think.)
Change-Id: Ie89cc8ef7c7638d28307a4b240930d387d75b8f2
Reviewed-on: https://gerrit.libreoffice.org/58908
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
...which first added alternative names to and then deprecated getLocBegin/End
Change-Id: Iaefb8ce259057abfa6cd20f0b63c0ef2949a96b2
Reviewed-on: https://gerrit.libreoffice.org/58820
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>