Changeset 9360 for branches


Ignore:
Timestamp:
Oct 22, 2009, 2:33:03 AM (13 years ago)
Author:
charles
Message:

(1.7x) backports for 1.76: r9177 #2379 infinite ratio shows as "nan" on optware

Location:
branches/1.7x
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.7x/NEWS

    r9359 r9360  
    55==== Daemon ====
    66  * Fix ratio-limit bug on some uClibc systems
     7  * Fix invalid JSON "nan" error on optware
    78==== GTK+ ====
    89  * Fix broken SIGINT (ctrl-c) handling
  • branches/1.7x/libtransmission/utils.c

    r8904 r9360  
    13291329tr_truncd( double x, int decimal_places )
    13301330{
    1331     const int i = (int) pow( 10, decimal_places );
    1332     double x2 = (int)(x*i);
     1331    static const int multiplier[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000 };
     1332    const int64_t i = multiplier[decimal_places];
     1333    double x2 = (int64_t)(x*i);
    13331334    return x2 / i;
    13341335}
Note: See TracChangeset for help on using the changeset viewer.