Re: [Libreoffice] cppcheck duplicate if expressions in bulmaper.cxx (sd part)

2011-09-14 Thread Kevin Hunter
At 2:19am -0400 Fri, 09 Sep 2011, Stephan Bergmann wrote: On 09/08/2011 10:47 PM, julien2412 wrote: Here is the pb : if( 0 )--- Found duplicate if expressions. { [...code...] } else if( 0 ) { [...code...] } I checked the history, it's there since 16/11/2000 (commit

Re: [Libreoffice] cppcheck duplicate if expressions in bulmaper.cxx (sd part)

2011-09-14 Thread Kevin Hunter
At 12:45pm -0400 Wed, 14 Sep 2011, Kevin Hunter wrote: At 2:19am -0400 Fri, 09 Sep 2011, Stephan Bergmann wrote: On 09/08/2011 10:47 PM, julien2412 wrote: Here is the pb : if( 0 )--- Found duplicate if expressions. { [...code...] } else if( 0 ) { [...code...] } I checked the history, it's

Re: [Libreoffice] Cppcheck defect when @ is present

2011-09-12 Thread Stephan Bergmann
On 09/11/2011 01:27 PM, Pierre-André Jacquod wrote: What's the best thing to do : - to keep objective C++ parts ? - to replace objective C++ by plain (with or without boost) C++ ? for me there are already too many languages and flavour of languages. I would stay with plain C++, not adding

Re: [Libreoffice] Cppcheck defect when @ is present

2011-09-11 Thread julien2412
Hello, I got this comment of a cppcheck developper : is this objective c++? Can the code be replaced in the tokenizer with plain C++ somehow? He seems to be right about objective C++. Then I made a opengrok research, 4 files use @try. Perhaps, there are other files which use @ expression, since

Re: [Libreoffice] Cppcheck defect when @ is present

2011-09-11 Thread Pierre-André Jacquod
Hello, What's the best thing to do : - to keep objective C++ parts ? - to replace objective C++ by plain (with or without boost) C++ ? for me there are already too many languages and flavour of languages. I would stay with plain C++, not adding objective C++ on top Just my feelings

Re: [Libreoffice] cppcheck duplicate if expressions in bulmaper.cxx (sd part)

2011-09-09 Thread Stephan Bergmann
On 09/08/2011 10:47 PM, julien2412 wrote: Here is the pb : if( 0 )--- Found duplicate if expressions. { nFontID = EE_CHAR_FONTINFO_CJK; nFontHeightID = EE_CHAR_FONTHEIGHT_CJK; nWeightID = EE_CHAR_WEIGHT_CJK;

Re: [Libreoffice] cppcheck duplicate if expressions in bulmaper.cxx (sd part)

2011-09-09 Thread Caolán McNamara
On Fri, 2011-09-09 at 08:19 +0200, Stephan Bergmann wrote: On 09/08/2011 10:47 PM, julien2412 wrote: I checked the history, it's there since 16/11/2000 (commit 5dc708093d1ee179099abdcbf0c6f649b1c4deeb) could anyone explain to me the purpose of this ? Just a typo ? It's preceded by

[Libreoffice] Cppcheck defect when @ is present

2011-09-09 Thread julien2412
Hello, Following the pb cppcheck duplicateExpression, I found why the duplicateExpression wasn't detected on salframe.cxx from aqua part. It's due to the @ use, for example @try, @catch and other things like this. As soon as the @ parts are commented out, detection works. I created the ticket

[Libreoffice] cppcheck duplicateExpression

2011-09-08 Thread julien2412
Hello, Cppcheck has detected a duplicateExpression in vcl/ios/source/window/salframe.cxx, line 470 I checked on salframe.cxx of aqua, there's the same duplicate (line 631) Here is the line : if( pState-mnMask (SAL_FRAMESTATE_MASK_X | SAL_FRAMESTATE_MASK_X) ) I compared with gtk part and think

[Libreoffice] cppcheck duplicate if expressions in bulmaper.cxx (sd part)

2011-09-08 Thread julien2412
Hello, Here is the pb : if( 0 )--- Found duplicate if expressions. { nFontID = EE_CHAR_FONTINFO_CJK; nFontHeightID = EE_CHAR_FONTHEIGHT_CJK; nWeightID = EE_CHAR_WEIGHT_CJK; nPostureID = EE_CHAR_ITALIC_CJK;

Re: [Libreoffice] cppcheck git version

2011-09-06 Thread Jesse Adelman
On 09/06/11 13:03, serval2...@yahoo.fr wrote: Hello Jesse, Would it be possible before each cppcheck run to add this in the script : - cd cppcheck repo - git pull -r - make clean make ? The goal is obviously to run the last git version each time. The time of these few steps would be

Re: [Libreoffice] cppcheck detects division by 0 in sw/source/ui/vba/vbarows.cxx

2011-08-15 Thread Noel Power
On 13/08/11 09:38, Julien Nabet wrote: Hello, cppcheck detects division by 0 in sw/source/ui/vba/vbarows.cxx, line 266 I discussed this with Norbert on IRC, here what we propose to add before this line : if ((nNewWidth = 0) || (nWidth = 0)) { OSL_ASSERT(!((nNewWidth = 0) || (nWidth = 0)));

[Libreoffice] cppcheck detects division by 0 in sw/source/ui/vba/vbarows.cxx

2011-08-13 Thread Julien Nabet
Hello, cppcheck detects division by 0 in sw/source/ui/vba/vbarows.cxx, line 266 I discussed this with Norbert on IRC, here what we propose to add before this line : if ((nNewWidth = 0) || (nWidth = 0)) { OSL_ASSERT(!((nNewWidth = 0) || (nWidth = 0))); return; } (we supposed indent

Re: [Libreoffice] Cppcheck Same expression on both sides of ''

2011-05-17 Thread Michael Meeks
Hi Julien, On Mon, 2011-05-16 at 19:08 +0200, Julien Nabet wrote: Here a line I get in cppcheck (updated today) : [source/core/layout/flycnt.cxx:1194] - [source/core/layout/flycnt.cxx:1194]: (style) Same expression on both sides of ''. What fun :-) I checked the file git history,

Re: [Libreoffice] Cppcheck Same expression on both sides of ''

2011-05-17 Thread Julien Nabet
Le 17/05/2011 15:04, Michael Meeks a écrit : ... nDownLst nDownLst So - this is the guy. sal_Bool operator( const SwDistance rTwo ) { return nMain rTwo.nMain || ( So - we end up with: that equating to: nDownLst.nSub nDownLst.nSub nDownLst.nSub

[Libreoffice] Cppcheck Same expression on both sides of ''

2011-05-16 Thread Julien Nabet
Hello, Here a line I get in cppcheck (updated today) : [source/core/layout/flycnt.cxx:1194] - [source/core/layout/flycnt.cxx:1194]: (style) Same expression on both sides of ''. I checked the file git history, it's there since the beginning. while ( pDownFrm ( ( nDown.nMain

Re: [Libreoffice] cppcheck : Same expression on both sides of '!='

2011-05-13 Thread Korrawit Pruegsanusak
Hello all, Joop Kiefte wrote: Maybe worth it to look those places up in the version control history... I've annotated this file and found the added version since Sep 2010. Let's take a look from this link:

Re: [Libreoffice] cppcheck : Same expression on both sides of '!='

2011-05-13 Thread Kohei Yoshida
On Fri, 2011-05-13 at 23:54 +0700, Korrawit Pruegsanusak wrote: Hello all, Joop Kiefte wrote: Maybe worth it to look those places up in the version control history... I've annotated this file and found the added version since Sep 2010. Let's take a look from this link:

[Libreoffice] cppcheck : Found duplicate if expressions

2011-05-08 Thread Julien Nabet
IMPRESS: [sd/source/ui/func/bulmaper.cxx:86] - [sd/source/ui/func/bulmaper.cxx:79]: (style) Found duplicate if expressions if( 0 ) { nFontID = EE_CHAR_FONTINFO_CJK; nFontHeightID = EE_CHAR_FONTHEIGHT_CJK; nWeightID = EE_CHAR_WEIGHT_CJK; nPostureID = EE_CHAR_ITALIC_CJK; } else if( 0 ) { nFontID

[Libreoffice] cppcheck : Found duplicate if expressions

2011-05-08 Thread Julien Nabet
IMPRESS: [sd/source/ui/func/bulmaper.cxx:86] - [sd/source/ui/func/bulmaper.cxx:79]: (style) Found duplicate if expressions if( 0 ) { nFontID = EE_CHAR_FONTINFO_CJK; nFontHeightID = EE_CHAR_FONTHEIGHT_CJK; nWeightID = EE_CHAR_WEIGHT_CJK; nPostureID = EE_CHAR_ITALIC_CJK; } else if( 0 ) { nFontID

Re: [Libreoffice] cppcheck : Same expression on both sides of '!='

2011-05-08 Thread Julien Nabet
Le 07/05/2011 16:01, Julien Nabet a écrit : Hello, Here are 2 examples of Same expression on both sides of '!=' I found : [sc/source/core/tool/rangeutl.cxx:507] - [sc/source/core/tool/rangeutl.cxx:507]: (style) Same expression on both sides of '!=' [sc/source/core/tool/rangeutl.cxx:534] -

[Libreoffice] cppcheck : Same expression on both sides of '!='

2011-05-07 Thread Julien Nabet
Hello, Here are 2 examples of Same expression on both sides of '!=' I found : [sc/source/core/tool/rangeutl.cxx:507] - [sc/source/core/tool/rangeutl.cxx:507]: (style) Same expression on both sides of '!=' [sc/source/core/tool/rangeutl.cxx:534] - [sc/source/core/tool/rangeutl.cxx:534]: (style)

Re: [Libreoffice] cppcheck : Same expression on both sides of '!='

2011-05-07 Thread Rafael Dominguez
Well it does look weird, but its the same object getting compared on both sides, so i think theres a problem there, but better wait for someone with more experience in the code say something about it. On Sat, May 7, 2011 at 9:31 AM, Julien Nabet serval2...@yahoo.fr wrote: Hello, Here are 2

Re: [Libreoffice] cppcheck : Same expression on both sides of '!='

2011-05-07 Thread Joop Kiefte
Maybe worth it to look those places up in the version control history... 2011/5/7 Rafael Dominguez venccsra...@gmail.com: Well it does look weird, but its the same object getting compared on both sides, so i think theres a problem there, but better wait for someone with more experience in the

Re: [Libreoffice] cppcheck Found duplicate branches for if and else in libs-core

2011-04-28 Thread David Tardon
On Fri, Apr 22, 2011 at 02:06:54PM +0200, Julien Nabet wrote: Hello, Hi, many thanks for your hard work! I've runned a cppcheck last git version on libs-core (master branch updated today) and found this oddity : [basic/source/app/mybasic.cxx:265] - [basic/source/app/mybasic.cxx:260]:

[Libreoffice] cppcheck Found duplicate branches for if and else in libs-core

2011-04-22 Thread Julien Nabet
Hello, I've runned a cppcheck last git version on libs-core (master branch updated today) and found this oddity : [basic/source/app/mybasic.cxx:265] - [basic/source/app/mybasic.cxx:260]: (style) Found duplicate branches for if and else. [embeddedobj/source/msole/olepersist.cxx:1835] -

[Libreoffice] cppcheck inefficient checking for emptiness

2011-04-19 Thread Kayo Hamid
From cppcheck: Using .empty() instead of .size() can be faster. .size() can take linear time but .empty() is guaranteed to take constant time Sending for review. revol_diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx

[Libreoffice] cppcheck report service updates

2011-02-18 Thread someone
Howdy *, So, if you browse to http://libreoffice.boldandbusted.com/ to see the cppcheck run, you'll notice a few things: * Less CSS. * Sortable columns! Odd problems: * You may notice some blanks in the source code links, like this: http://libreoffice.boldandbusted.com/680.html#line-462 . I

Re: [Libreoffice] cppcheck headers problem? (was 'Question about cppcheck unused private')

2011-02-17 Thread Caolán McNamara
On Wed, 2011-02-16 at 20:09 -0800, some...@boldandbusted.com wrote: Hi Caolán, So cppcheck can't find the headers it needs? Is this a bug in cppcheck, or LO's construction of header file paths? And how many examples of cppcheck false positives due to this problem are present? Does a clear

Re: [Libreoffice] cppcheck headers problem? (was 'Question about cppcheck unused private')

2011-02-16 Thread someone
On 02/16/11 12:43, Caolán McNamara wrote: On Sat, 2011-02-12 at 13:26 +0100, Julien Nabet wrote: Hello With the last git version of cppcheck, I've got in the master branch writer/sw/source/ui/dbui this : [./dbmgr.cxx:222]: (style) Unused private function

[Libreoffice] cppcheck clean ups

2011-01-29 Thread Andy Holder
More simple cpp check clean ups. AndyFrom ddd64b735bc5dfecb8a7a2838072003e2b36bb26 Mon Sep 17 00:00:00 2001 From: Andy Holder andy.m.hol...@gmail.com Date: Sat, 29 Jan 2011 16:55:22 + Subject: [PATCH] cppcheck: Prefer prefix ++/-- operators --- vcl/win/source/gdi/salgdi3.cxx |2 +- 1

[Libreoffice] cppcheck patches

2011-01-24 Thread Andy Holder
Here are some patches removing unused variables found by cppcheck Andy From f4907a0cda8c414fe27c42c24a262c0a761daf2e Mon Sep 17 00:00:00 2001 From: Andy Holder andy.m.hol...@gmail.com Date: Sun, 23 Jan 2011 23:44:23 + Subject: [PATCH 1/5] cppcheck: Variables not used ---

[Libreoffice] cppcheck: ignore The class 'X' does not have a constructor

2011-01-11 Thread Caolán McNamara
Ignore those warnings for now, cppcheck 1.47 will fix (probably all/more of) them, see http://sourceforge.net/apps/trac/cppcheck/ticket/2307 for details. C. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org

[Libreoffice] cppcheck: Invalid Character errors fix

2010-12-23 Thread Andy Holder
I not sure if this fixes the Invalid number of character ({) when these macros are defined error from cppcheck but the start of a namespace declaration being inside a #if without it's closing } has to be wrong. AndyFrom f0146a90f638cac49ef2f6020515adde4da4b1ce Mon Sep 17 00:00:00 2001 From:

Re: [Libreoffice] cppcheck : snprintf size is out of bounds

2010-11-17 Thread Caolán McNamara
On Fri, 2010-11-12 at 12:44 +0100, Julien wrote: Hello, I'm currently running the last version of cppcheck (i updated with git this morning) and i get this error : I don't understand where's the pb with snprintf, pString has a size of 1024 and snprintf takes a size of 1024. Is this a

[Libreoffice] cppcheck : snprintf size is out of bounds

2010-11-12 Thread Julien
Hello, I'm currently running the last version of cppcheck (i updated with git this morning) and i get this error : snprintf size is out of bounds ex: [./libs-gui/vcl/unx/source/printergfx/common_gfx.cxx:542]: (error) snprintf size is out of bounds

Re: [Libreoffice] cppcheck : snprintf size is out of bounds

2010-11-12 Thread Norbert Thiebaud
On Nov 12, 2010, at 3:44, Julien jnabet2...@free.fr wrote: Hello, I'm currently running the last version of cppcheck (i updated with git this morning) and i get this error : snprintf size is out of bounds ex: [./libs-gui/vcl/unx/source/printergfx/common_gfx.cxx:542]: (error) snprintf

Re: [Libreoffice] cppcheck : snprintf size is out of bounds

2010-11-12 Thread Norbert Thiebaud
On Nov 12, 2010, at 7:16, Norbert Thiebaud nthieb...@gmail.com wrote: On Nov 12, 2010, at 3:44, Julien jnabet2...@free.fr wrote: Hello, I'm currently running the last version of cppcheck (i updated with git this morning) and i get this error : snprintf size is out of bounds ex:

[Libreoffice] Cppcheck

2010-10-28 Thread Gert Faller
Hi, I've been running 'Cppcheck 1.44' on the whole source 27/10/10 10 GTM (I have a slow machine) : I join the raw output sorted by 'Error Type'. I run it too with '--enable=unusedFunctions' : I got 3195 matches... looks enormous. I'll check part of this output. Do I send the file ? I've