Hi,

* Ivan Skytte Jørgensen wrote (2007-10-13 13:54):
>I gave the I also gave it a spin with Flexelint 8.0w. It complains a lot, and 
>I have included the most interesting warnings. Nedit is partially excused 
>because it has to support a few odd and old platforms, so I have filtered out 
>the ones I think related to legacy platforms / compiler bugs.

Good work! I went through your list and found a number of open issues.
Please have a look at the patch at SF bug #1860273:
    
https://sourceforge.net/tracker/index.php?func=detail&aid=1860273&group_id=11005&atid=111005

Thank you for your help!


>source/preferences.h :
>SetPrefOpenInTab(), GetPrefOpenInTab() and GetPrefOverrideVirtKeyBindings() 
>are declared multiple times in preferences.h.  Probably a copy-paste error.

Done.


>WindowInfo->fileFormat is declared int, but its content are the enum 
>fileFormats from util/fileUtils.h  This could be done in a nicer way.

What do you suggest?


>The switch in file.c: 634 (IncludeFile()) does not have a default.
>Even though it works now, it would be better for documentations purposes that 
>it has a no-op default.

So true, I added a no-op for Unix.


>file.c: line ~1184, writeBckVersion()
>A plain int is used for file size. It should have been an off_t, otherwise 
>2GB+ files will not be handled properly.

Done, and some more casting.


>file.c: 1198: The casts in:
>        if ((int)(strlen(fullname) + 5) > (int)MAXPATHLEN)
>look weird. It should be:
>        if ((strlen(fullname) + 5) > (size_t)MAXPATHLEN)

Done.


>file.c: 1594/1609:
>The variable lastCheckWindow is not initialized and tested for in the if.

NULLed.


>highlightData.c:
>member "recogW" in HSDialog structure is not used at all.

Deleted.


>selection.c:95-110
>    char *endptr;
>    ...
>    if (isdigit((unsigned char) *endptr ) ...
>Why the cast?

To clear things up? I changed it into (int).


>Header file source/textBuf.h not used in source/server_common.c

Removed.


>shell.c: DoShellMenuCmd(): 438
>'left' and 'right' may not have been initialized in the call to issueCommand()

Set to 0. <shrug/>


>tags.c: findAllMatches(): line 1222:
>The "return -1;" will lead to a memory leak for dupTagsList

Added a free().


>tags.c: rcs_strdup(): line 1600
>  unchecked call to malloc()

Checked it a bit. The function (and its only caller) is not really
robust, so I'm at a loss what to do except to exit().


>text.c:
>indentation error after if() inside forwardCharacterAP() and 
>backwardCharacterAP()

Fixed, and added curlies.


>source/textDisp.c: 3806: TextDSetupBGClasses():
>    if (class_no) {
>Boolean within 'if' always evaluates to True [Reference: 
>file ./source/textDisp.c: line 3768]

I removed the if.


>source/textDisp.c:
>The macros TOP_MARGIN, BOTTOM_MARGIN, LEFT_MARGIN and RIGHT_MARGIN are not 
>used.

Gone.


>source/textSel.c:
>N_CLIP_TARGETS not used.
>window.c: ClosePane():
>'totalHeight' is not used.

Gone.


>The following global functions are not used:
>  HighlightBackgroundColorOfCode,
>  HighlightCodeIsBold,
>  HighlightCodeIsItalic
>  HighlightColorOfCode
>  DisableUnmodified
>  SetFloatLabel
>  SetFloatText
>  GetSelection
>  SetWrapMargin
>  BufGetHighlightText
>  BufGetLineText
>  GetDefaultTranslations
>  GetTextRange
>  SetIntLabel
>  TextDGetBuffer
>  TextStopHandlingSelections
>  AddMenuSeparator
>  EnableCountingQuantifier
>  Max
>  Min3
>  Max3
>  PasswordText
>  RangesetGetColorName
>  RangesetSetMaxpos
>  SetPrefGeometry
>  SetPrefMapDelete
>  SetPrefStdOpenDialog
>  SetPrefStickyCaseSenseBtn
>  SetPrefTagFile
>  RedrawCalltip
>  MakeSortedWindowArray

All gone.


>global struct member '_WindowInfo::showTabBarItem' (line 357, file 
>source/nedit.h) not referenced
>global struct member 'Href::target' (line 59, file source/help.h) not 
>referenced

Both gone.


>global typedef 'TextWidgetClass' (line 123, file source/text.h) not referenced

Removed.


Thorsten                                          Kristin Hersh: Your Ghost
-- 
Quidquid latine dicitur, altum videtur.

Attachment: pgpBhSs28Y9v8.pgp
Description: PGP signature

-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to