623 Commits

Author SHA1 Message Date
Caolán McNamara
30d28cb883 coverity#704593 Dereference after null check
Change-Id: I5426cb2e8ca1e8fd2e9f38419ffe6d6e148a7cba
2017-01-07 21:57:00 +00:00
Noel Grandin
d15b4e2045 teach sallogareas plugin to catch inconsistencies
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a
Reviewed-on: https://gerrit.libreoffice.org/32004
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-15 06:45:14 +00:00
Noel Grandin
c3586b684c OSL_TRACE->SAL in chart2..oox
Change-Id: I133a6441824bfbefcfcda130119b5c5d706f86b2
Reviewed-on: https://gerrit.libreoffice.org/31907
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-13 06:12:00 +00:00
John Paul Adrian Glaubitz
d5d6ee3b3e uno: Add support for targets with 16-bit alignment
Despite being a 32-bit architecture, m68k has a basic
alignment of 16-bit for historic reasons. On m68k,
SAL_TYPES_ALIGNMENT8 is therefore equal to 2 and we
need to cover this case in the static asserts as well.

Change-Id: I4c756af25d57e5d49209697f6e678ef71a5845aa
Reviewed-on: https://gerrit.libreoffice.org/31878
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-12-12 12:24:11 +00:00
Stephan Bergmann
de5a8470ca Prevent self-join in ThreadAdmin::join
Depending on timing, it can apparently happen at least during
JunitTest_unordf_complex that a cppu_threadpool::ORequestThread having executed
a binaryurp::IncomingRequest holds the last binaryurp::Bridge reference:

> #2  0x00007fac4ad6bf97 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x7fac4b4e8c22 "false", file=file@entry=0x7fac4b4eaec7 "sal/osl/unx/thread.cxx", line=line@entry=443, function=function@entry=0x7fac4b4eaefd "void osl_joinWithThread(oslThread)") at assert.c:92
> #3  0x00007fac4ad6c042 in __GI___assert_fail (assertion=0x7fac4b4e8c22 "false", file=0x7fac4b4eaec7 "sal/osl/unx/thread.cxx", line=443, function=0x7fac4b4eaefd "void osl_joinWithThread(oslThread)") at assert.c:101
> #4  0x00007fac4b4d5258 in osl_joinWithThread(oslThread) (Thread=0x7fabfc0011d0) at sal/osl/unx/thread.cxx:443
> #5  0x00007fac47fbdde5 in cppu_threadpool::ThreadAdmin::join() (this=0x7fac1c0069e0) at cppu/source/threadpool/thread.cxx:89
> #6  0x00007fac47fc23af in cppu_threadpool::ThreadPool::joinWorkers() (this=<optimized out>) at cppu/source/threadpool/threadpool.cxx:179
> #7  0x00007fac47fc35b7 in uno_threadpool_destroy(uno_ThreadPool) (hPool=<optimized out>) at cppu/source/threadpool/threadpool.cxx:499
> #8  0x00007fac25b03b5c in binaryurp::Bridge::terminate(bool) (this=0x7fac24117078, final=true) at binaryurp/source/bridge.cxx:277
> #9  0x00007fac25b0794e in binaryurp::Bridge::dispose() (this=0x7fac24117078) at binaryurp/source/bridge.cxx:904
> #10 0x00007fac25b07215 in binaryurp::Bridge::~Bridge() (this=0x7fac24117078) at binaryurp/source/bridge.cxx:847
> #11 0x00007fac25b07409 in binaryurp::Bridge::~Bridge() (this=0x7fac24117078) at binaryurp/source/bridge.cxx:838
> #12 0x00007fac25b39ee1 in std::default_delete<binaryurp::IncomingRequest>::operator()(binaryurp::IncomingRequest*) const (this=<optimized out>, __ptr=0x7fabfc00ba50) at /usr/lib/gcc/x86_64-redhat-linux/6.2.1/../../../../include/c++/6.2.1/bits/unique_ptr.h:76
> #13 0x00007fac25b38fa8 in std::unique_ptr<binaryurp::IncomingRequest, std::default_delete<binaryurp::IncomingRequest> >::~unique_ptr() (this=0x7fac0bb74ac0) at /usr/lib/gcc/x86_64-redhat-linux/6.2.1/../../../../include/c++/6.2.1/bits/unique_ptr.h:236
> #14 0x00007fac25b36d71 in request(void*) (pThreadSpecificData=<optimized out>) at binaryurp/source/reader.cxx:83
> #15 0x00007fac47fbaa95 in cppu_threadpool::JobQueue::enter(long, bool) (this=<optimized out>, nDisposeId=<optimized out>, bReturnWhenNoJob=<optimized out>) at cppu/source/threadpool/jobqueue.cxx:107
> #16 0x00007fac47fbe1f9 in cppu_threadpool::ORequestThread::run() (this=0x7fabfc001160) at cppu/source/threadpool/thread.cxx:165
> #17 0x00007fac47fbf9ca in threadFunc(void*) (param=0x7fabfc001170) at include/osl/thread.hxx:185
> #18 0x00007fac4b4d5a3c in osl_thread_start_Impl(void*) (pData=0x7fabfc0011d0) at sal/osl/unx/thread.cxx:240
> #19 0x00007fac4ab2a5ca in start_thread (arg=0x7fac0bb75700) at pthread_create.c:333
> #20 0x00007fac4ae420ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

while the main thread is already shutting down:

> #19 0x00007fac4b14100f in desktop::Desktop::doShutdown() (this=0x7fff8a6149d0) at desktop/source/app/app.cxx:1783
> #20 0x00007fac4b13f505 in desktop::Desktop::Main() (this=0x7fff8a6149d0) at desktop/source/app/app.cxx:1716
> #21 0x00007fac419a0f79 in ImplSVMain() () at vcl/source/app/svmain.cxx:185
> #22 0x00007fac419a1c14 in SVMain() () at vcl/source/app/svmain.cxx:223
> #23 0x00007fac4b17c773 in soffice_main() () at desktop/source/app/sofficemain.cxx:166
> #24 0x0000000000400916 in sal_main () at desktop/source/app/main.c:48
> #25 0x00000000004008fb in main (argc=<optimized out>, argv=<optimized out>) at desktop/source/app/main.c:47

Change-Id: I34beac40e89f6d522af49f9dcdb3ed2fc1259c4b
2016-12-07 12:39:36 +01:00
Stephan Bergmann
3b4a32972e Use OUString ctor instead of rtl_uString_newFromAscii
Change-Id: I84ea23c4de5c631fe7d0104944b0b8f0f13abb26
2016-10-28 08:52:45 +02:00
Stephan Bergmann
954699acbd cppu/source/uno/EnvDcp.c -> cppu/source/uno/EnvDcp.cxx
Change-Id: Ic02d217efef970a365a584f2558c41561e4c6e3d
2016-10-28 08:52:45 +02:00
Stephan Bergmann
11aa8ac4e3 cid#1371314: Add move semantics
Change-Id: I995cbdb2b6adc707abe5f1a179e94251641120bc
2016-09-20 18:22:32 +02: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
Stephan Bergmann
91dd2db17b loplugin:override: No more need for the "MSVC dtor override" workaround
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.

(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to

  OOO_DLLPUBLIC_CHARTTOOLS    virtual ~CloseableLifeTimeManager();

in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro.  Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)

Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-09-13 13:19:22 +02:00
Noel Grandin
f651ea26ea std::list<sal_Int64> -> std::deque
Change-Id: Ib34d6bf97fc97ea1c30c184a7de4ace7f533065f
2016-09-01 11:05:21 +02:00
Noel Grandin
29285b3e9c ::std::list < sal_Int64 > -> std::vector
Change-Id: Ia3c3b8dd1fc3c5865ad0642cfa93430b95fae9d2
2016-09-01 11:05:21 +02:00
Stephan Bergmann
8b1752eb78 icopyConstructFromElements's nAlloc is never negative
follow-up to 7fa183cb1a04120b37069c63166182065c3d975c
"loplugin:countusersofdefaultparams in chart2..desktop"

Change-Id: I099229ac4a3670e26570b083e3b0a4a92984f663
2016-08-23 17:34:55 +02:00
Noel Grandin
7fa183cb1a loplugin:countusersofdefaultparams in chart2..desktop
Change-Id: Iaca94acd6ef91f07ed0c0085390500c418099dee
Reviewed-on: https://gerrit.libreoffice.org/27896
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-05 10:28:25 +00:00
nadith
efef273e2c tdf#100726: Improve readability of OUString concatenation
this bug fixed in the modules between canvas - cppu

Change-Id: I2022b022897dafde20251352376e3facdb9b8d75
Reviewed-on: https://gerrit.libreoffice.org/27663
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-01 06:12:30 +00:00
Stephan Bergmann
a88cfade08 int -> bool
Change-Id: I8e8bedcc510a895cda90c9979bf75afca0ea9071
2016-07-11 17:25:42 +02:00
Otto Kekäläinen
428e23f4f7 Fix some spelling errors in comments and strings
Change-Id: Iecd6b5e13d6be14651f77d8e37f01117ba15a11e
Reviewed-on: https://gerrit.libreoffice.org/26883
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
2016-07-04 06:11:36 +00:00
Noel Grandin
d96c114171 clang-tidy modernize-make-shared
Change-Id: I3fa866bfb3093fc876474a9d9db29fe05dc2af3a
Reviewed-on: https://gerrit.libreoffice.org/25056
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-18 06:58:44 +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
Stephan Bergmann
0f3ac23d73 Insert explicit "break" when falling through to empty next case
...which itself only contains a "break" (or nothing at all at the end of the
"switch"), as otherwise Clang -Wimplicit-fallthrough would warn about these.

Change-Id: I25c1cf2ca74dfeba7ca0385ca8f1c1bf30bbf91b
2016-05-10 14:57:26 +02:00
tymyjan
3acbc64869 tdf#97499 Fixed containers parameters clearing #8
Change-Id: I82ca89ac483e9742be0d38a3c6882a240c7c38d8
Reviewed-on: https://gerrit.libreoffice.org/24499
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-01 10:09:11 +00:00
Stephan Bergmann
783419657c loplugin:salbool: sal_Bool[] -> bool[]
Change-Id: I3c5bf7a53c9ae173f8fce885ecf022f092aa43a9
2016-04-21 17:29:40 +02:00
Noel Grandin
e1af7f0c43 clang-tidy modernize-loop-convert in c*
Change-Id: I77d2548f8be97792660761e6156cd24734a95aaf
2016-04-21 11:03:55 +02:00
Stephan Bergmann
e7f330fa4a loplugin:salbool: Automatic rewrite of sal_False/True
Change-Id: I47acc5590a935c7f9089231efbb1319664942f16
2016-04-20 17:25:37 +02:00
Stephan Bergmann
a3858ed3a7 Use cast to bool to normalize sal_Bool values
Change-Id: I8a886f752d2a16ec4c10656bcd0b3631647971b2
2016-04-20 17:25:31 +02:00
Jochen Nitschke
150ac9cf05 clean-up: unused using declarations and includes
Searched source for using declarations.
Checked if those symbols reappear in the source file,
even in comments or dead code but not in #include statements.
If they don't reappear, remove the declaration.
Remove includes whose symbol got removed.

Change-Id: Ibb77163f63c1120070e9518e3dc0a78c6c59fab0
Reviewed-on: https://gerrit.libreoffice.org/24148
Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-18 07:25:24 +00:00
tymyjan
c20cc7e79b tdf#97499 Fixed containers parameters clearing #4
Change-Id: I7c96181399f4d7e62d4aceca404b22d68f903513
Reviewed-on: https://gerrit.libreoffice.org/23754
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-04 05:49:06 +00:00
Wastack
62d1632498 tdf#97966 Drop 'static' keywords
Including no keywords from extern "C" blocks

Change-Id: I18ddafbf3d41f6779fb43e36ba1f1c48b37757a0
Reviewed-on: https://gerrit.libreoffice.org/23671
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-04-01 06:44:18 +00:00
Stephan Bergmann
0de40868b4 loplugin:staticanonymous
Change-Id: I1a96ef6bff7a99ab46f7c88722426cba48b46c81
2016-04-01 08:43:14 +02:00
Douglas Mencken
3e48e0ed71 uno/check.cxx: use alignment calculated at runtime instead of hardcode
Change-Id: I0f9a48ef01bee4153cd9231bdef4b5a763b6bda2
Reviewed-on: https://gerrit.libreoffice.org/23283
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-29 08:28:07 +00:00
Christian Lohmaier
449cededd7 android version can also be compiled for x86
and x86 has smaller alignment than arm or a x86_64 host,
so needs the MAX_ALIGNMENT_4 to not trigger the static_asserts

Change-Id: I5643a33e4975e7bad20693f99fb8bbd5248c7c1c
2016-03-22 14:44:53 +01:00
Gurkaran
d27e3eca2c tdf#84323: Make osl::Condition::wait more readable
It is to improve the readability of calls to osl::Condition::wait.

Change-Id: I5945343c5a7e4729ab599380414d18280bd176fe
Signed-off-by: Gurkaran <gurkran@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/23417
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-22 06:57:20 +00:00
Miklos Vajna
6d42dc0e7c cppu: SAL_WARN_IF() -> SAL_INFO_IF() where it was dbglevel=2-specific before
As these fire already during the build.

Change-Id: I750ea04be317fffb8bc321a2b7b4da0447789c8f
2016-03-11 11:42:04 +01:00
Julien Nabet
05ff3d112b Let's use the iterator return by erase method of iterator list
and avoid to retrieve list->begin and loop from the first element

Change-Id: I536b7a03c4033b02a7226d25f64764c10c28bdd0
Reviewed-on: https://gerrit.libreoffice.org/23126
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-11 07:18:59 +00:00
Stephan Bergmann
0cc4e711d3 Remove unnecessary parentheses
Change-Id: I6815a02ae8f47c40c3b8cf5692126142de867480
2016-03-10 11:16:10 +01:00
rohan
5c4717416b Fixed minor negation bug in SAL_WARN_IF
I corrected the mistake that i did while converting OSL_ENSURE to
SAL_WARN_IF while submitting a patch regarding removing OSL_DEBUG_LEVEL > 1
conditionals. Thanks to Julien Nabet :)

Change-Id: I374373bf151a43b1ababf4c28b509da71068f755
Reviewed-on: https://gerrit.libreoffice.org/23112
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-10 10:14:03 +00:00
Stephan Bergmann
50bf3061e6 typo
Change-Id: Id990e76769c3b5e2e048f3faf754efbae2b41c3f
2016-03-09 09:26:37 +01:00
Stephan Bergmann
524ae3589c Use plain assert (to complement use of static_assert above)
Change-Id: Id4ac9e86a6af3fa84f7a9680051dfe2564f8c5c5
2016-03-09 09:17:23 +01:00
Stephan Bergmann
ea5bc30fbb Extract static_asserts out of OSL_DEBUG_LEVEL > 0
Change-Id: I604b41a5063728833d57e2589e6d3ec39eb67166
2016-03-08 21:37:42 +01:00
Stephan Bergmann
4f56db98af Clean up namespace
Change-Id: I8207f7906cb8914b6c272efaf8f136a1bce7e4b0
2016-03-08 21:37:42 +01:00
Stephan Bergmann
7024c86b17 Extract checking code to its own check.cxx
Change-Id: I9d5b14c374ce62ac7b970faa30c38a5a76568ed4
2016-03-08 21:37:42 +01:00
Stephan Bergmann
c94f5b0260 loplugin:cstylecast
Change-Id: I3771f84ec94c62988c075dd26ee1de17200af705
2016-03-08 18:16:18 +01:00
Stephan Bergmann
c2fe73d6a9 Remove redundant checks (that trigger loplugin:implicitboolconversion])
Change-Id: I86c0b56b7d330e3e3450a5806a89ca8fb7a1bfae
2016-03-08 18:15:52 +01:00
Rohan Kumar
05bca56923 tdf#91794: Remove OSL_DEBUG_LEVEL > 1 conditionals
Updates pointed by sberg

Change-Id: Ie12548dfa9ad3a6836efbfe64153bc075f138fc6
Reviewed-on: https://gerrit.libreoffice.org/22622
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-08 16:57:42 +00:00
Norbert Thiebaud
369b33903a WaE 0xdeadbeaf 32 bits litteral casting to 64 bits pointer
Change-Id: I9769a1d9707cc958329f1c05ccbed780983faf14
Reviewed-on: https://gerrit.libreoffice.org/22600
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2016-02-22 02:32:13 +00:00
Arnold Dumas
53bf3ea58e tdf#57950: Replace chained O(U)StringBuffer::append() with operator+
Change-Id: Ic76cf0130ebec4cf723b83d82f59ae45bfcb3ea1
Reviewed-on: https://gerrit.libreoffice.org/22350
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-15 07:38:21 +00:00
Chris Sherlock
a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Andrea Gelmini
64d624b651 Fix typos
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86
Reviewed-on: https://gerrit.libreoffice.org/21209
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-10 14:17:20 +00:00
Andrzej Hunt
4a8c0d3135 loplugin:implicitboolconversion
Change-Id: I2ef26c34a424e653d85597c85baa736c19004313
2016-01-03 17:42:10 -08:00
Caolán McNamara
5e9db55def cppcheck: allocaCalled
Change-Id: I4e2345cdf9fd8d088f3522d563263b65abedb7c9
2016-01-03 20:39:42 +00:00