Commit Graph

106 Commits

Author SHA1 Message Date
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
Stephan Bergmann
41e2f34548 clang-analyzer-deadcode.DeadStores
The code had been like this ever since 16cba77220
"#112673# initial checkin of HWP filter."  Assuming that the second line should
rather read

  angle = 1800 - angle * 10;

instead of

  angle = 1800 - prop->angle * 10;

does not look too plausible:  It would keep mapping

   -1  ->  181
    0  ->  180
    1  ->  179
       :
  179  ->    1

but then would discontinuously map

  180  ->  180
  181  ->  179
       :

instead of continuously mapping

  180  ->    0
  181  ->   -1
       :

Change-Id: I8cf97eeb53409b18bda6777b09a20331f3c8132a
2015-10-07 11:32:43 +02:00
Caolán McNamara
22b80ac8e2 boost->std
Change-Id: I3fd9e1599c5ad812879a58cf1dabbcd393105e1c
Reviewed-on: https://gerrit.libreoffice.org/18564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-14 12:54:25 +00:00
Stephan Bergmann
42e379a542 clang-tidy clang-analyzer-deadcode.DeadStores
...ever since its inception in 16cba77220
"#112673# initial checkin of HWP filter" (but curr is needed as a local scratch
pad in the STARTT macro)

Change-Id: I7233bf99b7d6f9ac0d3d3384ba4508f84ba8fa38
2015-09-03 11:43:57 +02:00
Caolán McNamara
5684fbce64 add hwp to fftester
Change-Id: Ibf819307905295580cb6a813f6d003a7dabc86b5
2015-08-21 16:17:26 +01:00
Jihui Choi
188208d93a tdf#91067: Translate Korean comments
Change-Id: Idbee9cb5a1745bb2cc3c4cb1238773da7ff2a0a3
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
2015-07-16 05:35:30 -05:00
Stephan Bergmann
3c7a66a031 loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I8a8ba86dd78e30146f7b9dd7071f5641d496a67a
2015-06-08 16:25:38 +02:00
Stephan Bergmann
e58fccdadb More loplugin:simplifybool
Change-Id: I64ec8a0525b935d12455f7ed236ffd367f47c070
2015-04-27 15:30:57 +02:00
Stephan Bergmann
33815ec449 Clean up C-style casts from pointers to void
Change-Id: Ifbdbd2bb8a21afa76271728c46f88c11a887fc5a
2015-03-28 19:09:21 +01:00
Noel Grandin
c3dc467232 loplugin:constantfunction: hwpfilter
Change-Id: I2504291e2167cbc4be91e01de654ca63f89dbd2a
2015-03-24 10:31:18 +02:00
Caolán McNamara
ab86a53623 V805: Decreased performance
Change-Id: I822c5ebc321ebda87c238a1781a31793c1623e34
2015-03-02 14:21:52 +00:00
Stephan Bergmann
552efce640 Some more loplugin:cstylecast: hwpfilter
Change-Id: I0ba3fe95ab6ef317166b286531a718287308f62f
2015-01-20 09:06:48 +01:00
Michael Weghorn
e31657a1ea fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.

Change-Id: I9812658e8a96dd35d686c7ae7a8b829267c5c8bc
Reviewed-on: https://gerrit.libreoffice.org/13499
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-17 07:32:56 +00:00
Stephan Bergmann
73441b0b65 hwpfilter: Use appropriate OUString functions on string constants
Change-Id: I4e6b8077fd564be9508e5a08f2eb66032f5f3f40
2014-12-15 10:13:08 +01:00
Michael Stahl
6a0fe37dec sal: clean up public headers with include-what-you-use
Sadly cannot forward declare "struct {...} TimeValue;".

rtl/(u)?string.hxx still include sal/log.hxx but removing osl/diagnose.h
was painful enough for now...

Change-Id: Id41e17f3870c4f24c53ce7b11f2c40a3d14d1f05
2014-11-17 11:06:53 +01:00
Noel Grandin
e27ac011c3 loplugin: cstylecast
Change-Id: I9fca98995131358b3b112b11e0b28feb1a3267d1
2014-10-01 13:08:43 +02:00
Stephan Bergmann
9703cc63ce Remove o3tl/heap_ptr.hxx, use std::unique_ptr instead
Change-Id: Iac70c9be13892a36bfb5975f62e5345b88d4f144
2014-09-24 14:54:51 +02:00
Julien Nabet
8088aeabe4 cppcheck: Logical conjunction always evaluates to false
I don't know how to check it's ok, I just took example above
It seems there was a wrong mix between header and footer test

Change-Id: Ia5bb838e92306f3bb160069a7c62707e365e8ab2
2014-08-31 11:18:47 +02:00
Stephan Bergmann
2617def8d1 Fix (harmless) stack-use-after-return
...as reported by -fsanitize=address CppunitTest_hwpfilter_test_hwpfilter, where
stack-local HStream stream from HwpReader::filter is still referenced from
HStreamIODev in

  HStreamIODev::close
  HStreamIODev::~HStreamIODev
  HWPFile::~HWPFile
  HwpReader::~HwpReader

which is only harmless because HStream::closeInput is a nop.

Change-Id: Idbc5539ab5f463ec6d5d72f428ce60327ebdb063
2014-07-03 13:11:58 +02:00