[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue with ls -v / sort -V and strverscmp() usage

From: Kamil Dudka
Subject: Re: Issue with ls -v / sort -V and strverscmp() usage
Date: Thu, 18 Sep 2008 12:39:30 +0200
User-agent: KMail/1.9.9

On Wednesday 17 September 2008 13:13:03 you wrote:
>   - Fix the obvious bugs, for example, you need to cast 'char' values to
>     'unsigned char' before passing them to <ctype.h> functions.
>   - Streamline the operation: Can't you get rid of copying the two strings?
>     For example, by changing verrevcmp to take 4 arguments
>     (str1, len1, str2, len2) instead of NUL terminated arguments (str1,
>     str2)?
>   - Remove unnecessary casts, for example, if match_suffix took 'char *'
>     arguments and returned a 'char *', no casts would be necessary.
>   - GNU coding style: space between function name and opening parenthesis,
>     write 'const char *', not 'const char*', etc
New version of filevercmp.c is attached, now without copying of the input 
strings. I've also made a simple performance test - the speed was about 7-8x 
slower than original glibc strverscmp function, but the glibc's result is 
mostly wrong.


Attachment: filevercmp.c
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]