Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Weird code in r22153 (changes to strnatcmp.c)

Weird code in r22153 (changes to strnatcmp.c)

From: Al Le <al.le_at_gmx.de>
Date: Wed, 12 Aug 2009 00:27:22 +0200

Hello.

IMO the r22153 introduced a weirdly looking code:

static inline int
nat_toupper(int a)
{
     return tolower(a);
}

This makes the question arise (to a new code reader) as to why "tolower"
is called inside the function when the function itself is named
"nat_toupper"

Besides, I don't quite understand why this change should fix the problem
mentioned in the commit message ("improper sorting of names with
underscores when Interpret numbers when sorting is used"). Should the
old code work correctly if toupper is implemented correctly? If the
commit really fixes something, shouldn't the real cause be fixed
(something in toupper IMO)?

Just some thoughts by a casual code reader.
Received on 2009-08-12


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa