aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-24 22:52:21 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-24 22:52:21 +0100
commit6b01b71e8370c58787318d5fca06db2074f95c55 (patch)
tree1f2fff69f5004a6fe66872434e1a25827588f1a7 /coreutils
parent9f93d621925966c22ee51fdcb5def8e131596f9b (diff)
downloadbusybox-w32-6b01b71e8370c58787318d5fca06db2074f95c55.tar.gz
busybox-w32-6b01b71e8370c58787318d5fca06db2074f95c55.tar.bz2
busybox-w32-6b01b71e8370c58787318d5fca06db2074f95c55.zip
randomconfig fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/ls.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index e7544474b..6c898b793 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -509,15 +509,10 @@ static int sortcmp(const void *a, const void *b)
509 509
510 /* Make dif fit into an int */ 510 /* Make dif fit into an int */
511 if (sizeof(dif) > sizeof(int)) { 511 if (sizeof(dif) > sizeof(int)) {
512 if (sizeof(dif) == sizeof(int)*2) { 512 enum { BITS_TO_SHIFT = 8 * (sizeof(dif) - sizeof(int)) };
513 /* typical on many arches */ 513 /* shift leaving only "int" worth of bits */
514 if (dif != 0) { 514 if (dif != 0) {
515 dif = 1 | (int)((uoff_t)dif >> (sizeof(int)*8)); 515 dif = 1 | (int)((uoff_t)dif >> BITS_TO_SHIFT);
516 }
517 } else {
518 while ((dif & ~(off_t)INT_MAX) != 0) {
519 dif >>= (sizeof(int)*8 / 2);
520 }
521 } 516 }
522 } 517 }
523 518