Commit Graph

124 Commits

Author SHA1 Message Date
Noel Grandin
c4558e4b7b loplugin:useuniqueptr in HStreamIODev
Change-Id: I81ab91bce2a83603b25922593c1fd764b5c0b003
Reviewed-on: https://gerrit.libreoffice.org/59358
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-21 12:11:18 +02:00
Noel Grandin
e593b623da loplugin:stringloop in various
Change-Id: Ic2436c6d94729211cd5bc72fee18af228381e4a3
Reviewed-on: https://gerrit.libreoffice.org/58250
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-29 12:14:22 +02:00
Jochen Nitschke
8ddca0648a tdf#42949 remove unused compheler includes ..
and fix the fallout

Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e
Reviewed-on: https://gerrit.libreoffice.org/54882
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-05 10:56:36 +02:00
Stephan Bergmann
7ab34b51f2 loplugin:redundantcast improvements for floating-integer conversions
Change-Id: I63dbf18f144a792ae775fe6706da81657f790016
Reviewed-on: https://gerrit.libreoffice.org/54416
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-05-17 08:22:14 +02:00
Gökhan Gurbetoğlu
0f166ef524 cppcheck - fix variableScope in some files
Reduced the scope of some variables in source.

Change-Id: Ib3b521ca5df8b9b254b51eab5f1d7040d6cfd846
Reviewed-on: https://gerrit.libreoffice.org/52974
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-17 08:14:56 +02:00
Stephan Bergmann
9af8f190ed More loplugin:cstylecast on Windows
Automatic rewrite (of loplugin:cstylecast and loplugin:unnecessaryparen) after
cab0427cad "Enable loplugin:cstylecast for some
more cases" and a409d32e7f "More
loplugin:cstylecast"

Change-Id: Ib3355159dd08333e1b7a8d091caf2069cdcc7862
Reviewed-on: https://gerrit.libreoffice.org/48317
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-23 07:54:51 +01:00
Noel Grandin
96c85e7d10 loplugin:useuniqueptr in hwpfilter
Change-Id: Id276015425ea7de3cf55b9ef21b4e7ce54c2ce47
2018-01-19 08:58:46 +02:00
Stephan Bergmann
faf01b8d54 More loplugin:cstylecast: hwpfilter
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I463894b6c99fe1ebb56895c4aca8bd05a13b7c25
2018-01-12 20:23:07 +01:00
Noel Grandin
3af500580b loplugin:salcall fix functions
since cdecl is the default calling convention on Windows for
such functions, the annotation is redundant.

Change-Id: I1a85fa27e5ac65ce0e04a19bde74c90800ffaa2d
Reviewed-on: https://gerrit.libreoffice.org/46164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-11 12:13:46 +01:00
Noel Grandin
0d50804e1c loplugin:constparams in various(2)
Change-Id: I533a7eb724b15e168a28dc92cd5962a39bc96e7c
Reviewed-on: https://gerrit.libreoffice.org/44313
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-06 07:13:42 +01:00
Noel Grandin
b462fa972e use std::unique_ptr in hwpfilter
Change-Id: I3aa6e1342f975420b19e9e21058a0331ed2d71e0
Reviewed-on: https://gerrit.libreoffice.org/43525
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-19 11:21:10 +02:00
Julien Nabet
a05bb7bf71 Replace some lists by vectors in hwpfilter
+ simplify some parts

Change-Id: I340d6b6d17f591a58c405965367c15be674103d0
Reviewed-on: https://gerrit.libreoffice.org/43439
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-18 08:44:00 +02:00
Mike Kaganski
362a21d3a1 Use explicit function names for fooA/fooW WinAPI; prefer fooW
We should only use generic foo function name when it takes params
that are also dependent on UNICODE define, like
LoadCursor( nullptr, IDC_ARROW )
where IDC_ARROW is defined in MSVC headers synchronised with
LoadCursor definition.

We should always use Unicode API for any file paths operations,
because otherwise we will get "?" for any character in path that
is not in current non-unicode codepage, which will result in failed
file operations.

Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633
Reviewed-on: https://gerrit.libreoffice.org/42935
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-09-30 11:23:41 +02:00
Noel Grandin
3ccaa4d9e9 loplugin:constparams in scaddins,hwpfilter
Change-Id: I91b3559b9c3f5d8837d182cf9406fad9aeee78b3
Reviewed-on: https://gerrit.libreoffice.org/40049
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18 08:19:46 +02:00
Caolán McNamara
ecae068bef ofz#2668 fix oom
Change-Id: Ie30b24a0ad6395d59afa2f2c96b48f98a33f18a8
Reviewed-on: https://gerrit.libreoffice.org/40064
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-17 17:25:58 +02:00
Caolán McNamara
8e63f09967 ofz#2452 use shared_ptr for cshape
Change-Id: Icf576c08b3502ea3e24fa4b3685b55f794e844db
Reviewed-on: https://gerrit.libreoffice.org/39650
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-13 17:38:59 +02:00
Noel Grandin
7e73c033a1 loplugin:useuniqueptr in hwpfilter
Change-Id: Id271fdb59cb0dedf2f180879d2116d11e45d68b3
Reviewed-on: https://gerrit.libreoffice.org/39739
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10 11:31:17 +02:00
Noel Grandin
4250b25c6a teach unnecessaryparen loplugin about identifiers
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-07-10 09:57:24 +02:00
Noel Grandin
a006f60b6a loplugin:oncevar in helpcompiler..jvmfwk
Change-Id: Ia9b20a8ca95684cbeb21e3425972c43ba50df3cd
Reviewed-on: https://gerrit.libreoffice.org/39187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-25 17:19:36 +02:00
Stephan Bergmann
aed9c37e5a Improved loplugin:cstylecast to reference types: hwpfilter
Change-Id: Iab9d3845556b66341ca3298d6929502f50863f60
2017-06-05 21:18:08 +02:00
Noel Grandin
9297aa2c08 loplugin:checkunusedparams in hwpfilter..lotuswordpro
Change-Id: I4925a95cc74571c2e0ffd413d7ac8bc162c247d7
Reviewed-on: https://gerrit.libreoffice.org/37143
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-02 12:16:54 +02:00
Caolán McNamara
3b9b4ca5d3 ofz#1062 ensure cshape lifecycle matches expectations
Change-Id: I586e9b3546516a0f05d86b2f7dd93e7c292a6795
Reviewed-on: https://gerrit.libreoffice.org/36298
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-04-13 09:53:04 +02:00
Michael Stahl
fa73f77401 hwpfilter: remove write-only variable
Change-Id: I03e29b1a3761fcafc70168b04d788dbf3e1584eb
2017-04-12 15:51:39 +02:00
Noel Grandin
7662e92c64 loplugin:redundantcast find cstyle double casts
Change-Id: I5507be190dac781e5cdb545a60acf3d50056c9f8
Reviewed-on: https://gerrit.libreoffice.org/36187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 07:47:30 +00:00
Caolán McNamara
2ee7ad0151 Resolves: ofz#820 an exception is an acceptable outcome
Change-Id: Ifc5be483387202c371596fd52f1e2ce682151ca8
2017-03-20 15:51:38 +00:00
Caolán McNamara
681b6361f2 ofz#725 fix hwp leak
Change-Id: I09088981ca63b297781307590092725bc1cbed1b
2017-03-03 11:26:14 +00:00
Caolán McNamara
86463ec54d ofz#711: direct leak
Change-Id: I65ec47b4290d845f1803b20b93f149d35d9a60ea
2017-03-01 11:41:17 +00:00
Caolán McNamara
40e55cf24d add hwp fuzzer
Change-Id: I07fe351a182328f9ef98cb9866529637a6688c64
Reviewed-on: https://gerrit.libreoffice.org/34570
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-02-24 14:04:58 +00:00
Noel Grandin
2489000d3f loplugin:useuniqueptr extend to check local vars
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-02-01 12:15:22 +00:00
Stephan Bergmann
e57ca02849 Remove dynamic exception specifications
...(for now, from LIBO_INTERNAL_CODE only).  See the mail thread starting at
<https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html>
"Dynamic Exception Specifications" for details.

Most changes have been done automatically by the rewriting loplugin:dynexcspec
(after enabling the rewriting mode, to be committed shortly).  The way it only
removes exception specs from declarations if it also sees a definition, it
identified some dead declarations-w/o-definitions (that have been removed
manually) and some cases where a definition appeared in multiple include files
(which have also been cleaned up manually).  There's also been cases of macro
paramters (that were used to abstract over exception specs) that have become
unused now (and been removed).

Furthermore, some code needed to be cleaned up manually
(avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no
configurations available that would actually build that code.  Missing @throws
documentation has not been applied in such manual clean-up.

Change-Id: I3408691256c9b0c12bc5332de976743626e13960
Reviewed-on: https://gerrit.libreoffice.org/33574
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-26 12:54:43 +00:00
Noel Grandin
98e4013c22 new loplugin useuniqueptr
Change-Id: Ic7a8b32887c968d86568e4cfad7ddd1f4da7c73f
Reviewed-on: https://gerrit.libreoffice.org/33339
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-23 06:59:17 +00:00
Noel Grandin
0bab51d8ad use rtl::Reference in HwpReader
instead of storing both a raw pointer and an uno::Reference

Change-Id: I02dd356d9693116f98ad2b96951570b3ba448b14
2017-01-18 14:22:26 +02:00
Noel Grandin
1ba4bb6397 loplugin:countusersofdefaultparams in editeng..rsc
Change-Id: I8a8d13faf228cbc934ae21d6763d92d370eb42ec
2016-11-11 12:12:22 +02:00
Stephan Bergmann
a217e0d012 clang-cl loplugin: hwpfilter
Change-Id: I63677cea6ee2cec0589bd853ca9b135931df63d4
Reviewed-on: https://gerrit.libreoffice.org/29863
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-16 14:19:09 +00:00
Michael Stahl
b647996a9b replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is
retained for compatibility, and where callers of rtl functions pass in
pointers that are incompatible on MSVC.

Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-15 12:01:11 +02:00
Noel Grandin
42486dde49 move #includes to top of file
instead of being randomly embedded somewhere deep inside the CXX code.

Found with:
  git grep -nP '^#include' -- *.cxx | sort -g -k 2 -t :

Change-Id: I9ee432d3b665ecb6ec600bd51cc4b735a1b1127a
Reviewed-on: https://gerrit.libreoffice.org/26764
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-06-29 14:49:19 +00:00
Michael Stahl
62d270116b tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a
Reviewed-on: https://gerrit.libreoffice.org/25972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06 18:09:11 +00:00
Stephan Bergmann
14cd5182c5 Replace fallthrough comments with new SAL_FALLTHROUGH macro
...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-10 16:42:16 +02:00
Noel Grandin
e8fd5a07ec update loplugin stylepolice to check local pointers vars
are actually pointer vars.

Also convert from regex to normal code, so we can enable this
plugin all the time.

Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1
Reviewed-on: https://gerrit.libreoffice.org/24391
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-26 10:55:58 +00:00
Stephan Bergmann
07b4791dc8 loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: Icfa6686ee96e4c9ddf23abc3ece6beae6521473a
2016-04-20 17:25:42 +02:00
Noel Grandin
5adde1bf69 loplugin:unuseddefaultparams various
Change-Id: Ibf8489c957b307156689de4c7cb8440ddd4e4546
Reviewed-on: https://gerrit.libreoffice.org/22852
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-03 11:39:56 +00:00
Noel Grandin
ce43d0ae92 use consistent #define checks for the Windows platform
stage 1 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

Change-Id: Iece73abdee530937e0737190b1aa97a46cd3075f
Reviewed-on: https://gerrit.libreoffice.org/22390
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-16 10:37:55 +00:00
Stephan Bergmann
bc2fe2249b Adapt to true wchar_t in clang-cl
Change-Id: Id127668e6786665b819b7c0b1c0cd424ebff96bf
2015-11-28 08:44:52 +01:00
Stephan Bergmann
708ef6a08d '#pragma setlocale("C")' is probably no longer necessary
...as in both files the direct use of non-ASCII characters in ordinary string
literals has since been changed to use \xXX escapes instead

Change-Id: Ic3e17a9849288a02dc69d7702782fefccb7026ee
Reviewed-on: https://gerrit.libreoffice.org/20148
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2015-11-24 15:44:26 +00:00
Stephan Bergmann
295c7827e0 Translate Korean comments
...via translate.google.com, to make file plain ASCII

Change-Id: Icbf25074bd92eb1f0fb453f9887b1f1f1ca82b57
2015-11-24 13:05:52 +01:00
Stephan Bergmann
41dbbdcc8b Remove non-ASCII U+0086 PARAGRAPH SIGN from comment
Change-Id: Ifcbb2a61c662f135badc01b7beaef10fa3d75515
2015-11-24 13:02:40 +01:00
Stephan Bergmann
f42d03f3e9 Replace non-ASCII content in ordinary string literals with UTF-8 bytes
Change-Id: Ib92221527550beb35e2263b150a509b3ef68545f
2015-11-24 13:01:10 +01:00
Stephan Bergmann
1acbdc6bbd Don't assume sal_Unicode is unsigned short
Change-Id: I72b0f9956e866afd22f7335a57d7dca0297e3b8a
2015-11-17 10:37:39 +01:00
Stephan Bergmann
c3dcdeb1d2 loplugin:nullptr (automatic rewrite)
Change-Id: Idec97093ca48c14b825c7b87ec050cc99aadc526
2015-11-10 10:31:27 +01:00
Noel Grandin
59b072e22b yyyyy
Change-Id: I9a947beefd2dfe21da8239e841ea3fb416bd1548
2015-11-04 14:10:44 +02:00