Some improvements/simplifications in strnatcmp() function.
This commit is contained in:
parent
df103af706
commit
6d6f0ee943
@ -26,11 +26,12 @@ a:visited { color: #0000EE; }
|
||||
<li>Updated MediaInfo to v0.7.64 (2013-07-05), compiled with ICL 13.1 and MSVC 10.0
|
||||
<li>Updated GnuPG to v1.4.14 (2013-07-25), compiled with GCC 4.8.1
|
||||
<li>Updated GNU Wget binary to v1.13.4 (2011-09-17)
|
||||
<li>Updated language files (big thank-you to all contributors !!!)
|
||||
<li>Fixed a potential deadlock during startup when %TMP% points to an invalid folder
|
||||
<li>Fixed a superfluous "beep" sound that appeared on application startup
|
||||
<li>Fixed the Ogg Vorbis quality modes "-1" and "-2" (those were clipped to "0" before)
|
||||
<li>Fixed a bug that could cause the output directory to be reset mistakenly
|
||||
<li>Implemented "natural ordering" for sorting input files, using strnatcmp() by Martin Pool
|
||||
<li>Implemented "natural order" string comparison/sorting, using strnatcmp() by Martin Pool
|
||||
</ul><br>
|
||||
|
||||
<a name="4.07"></a>Changes between v4.06 and v4.07 [2013-04-28]:<br><ul>
|
||||
|
@ -59,6 +59,7 @@ static inline nat_char nat_isdecpoint(nat_char a)
|
||||
{
|
||||
return (a == L'.') || (a == L',');
|
||||
}
|
||||
|
||||
static inline nat_char nat_toupper(nat_char a)
|
||||
{
|
||||
return towupper(a);
|
||||
@ -123,12 +124,12 @@ static int strnatcmp0(nat_char const *a, nat_char const *b, const bool fold_case
|
||||
int ai, bi;
|
||||
nat_char ca, cb;
|
||||
int result;
|
||||
bool fractional, skip_zeros;
|
||||
bool fractional;
|
||||
int sa, sb;
|
||||
|
||||
assert(a && b);
|
||||
ai = bi = 0;
|
||||
skip_zeros = true;
|
||||
fractional = false;
|
||||
|
||||
while (1)
|
||||
{
|
||||
@ -146,13 +147,17 @@ static int strnatcmp0(nat_char const *a, nat_char const *b, const bool fold_case
|
||||
{
|
||||
sa = sb = 0;
|
||||
|
||||
if(skip_zeros)
|
||||
if(!fractional)
|
||||
{
|
||||
while (ca == L'0') { ca = a[++ai]; sa++; }
|
||||
while (cb == L'0') { cb = b[++bi]; sb++; }
|
||||
while (ca == L'0')
|
||||
{
|
||||
ca = a[++ai]; sa++;
|
||||
}
|
||||
while (cb == L'0')
|
||||
{
|
||||
cb = b[++bi]; sb++;
|
||||
}
|
||||
}
|
||||
|
||||
fractional = (ca == L'0' || cb == L'0');
|
||||
|
||||
if (fractional)
|
||||
{
|
||||
@ -191,7 +196,7 @@ static int strnatcmp0(nat_char const *a, nat_char const *b, const bool fold_case
|
||||
return +1;
|
||||
|
||||
/* skipp leading zero's, unless previously seen char was a decimal point */
|
||||
skip_zeros = (!nat_isdecpoint(ca)) || (!nat_isdecpoint(cb));
|
||||
fractional = nat_isdecpoint(ca) && nat_isdecpoint(cb);
|
||||
|
||||
++ai; ++bi;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
#define VER_LAMEXP_MINOR_LO 8
|
||||
#define VER_LAMEXP_TYPE RC
|
||||
#define VER_LAMEXP_PATCH 2
|
||||
#define VER_LAMEXP_BUILD 1333
|
||||
#define VER_LAMEXP_BUILD 1336
|
||||
#define VER_LAMEXP_CONFG 1288
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user