Changeset 776

Show
Ignore:
Timestamp:
07/01/08 02:55:31 (4 months ago)
Author:
Don Clugston
Message:

After a trivial change (which I don't really understand), all the unit tests pass.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/phobos/std/bigint.d

    r773 r776  
    8080    void opAssign(uint n) 
    8181    { 
    82         static if(BIG_ENDIAN) { auto a = [ cast(Digit)0, n ]; } 
    83         else                  { auto a = [ cast(Digit)n, 0 ]; } 
     82        static if(BIG_ENDIAN) { Digits a = [ cast(Digit)0, n ]; } 
     83        else                  { Digits a = [ cast(Digit)n, 0 ]; } 
    8484        Big b = bigInt(a); 
    8585        digits = b.digits; 
     
    8989    void opAssign(long n) 
    9090    { 
    91         static if(BIG_ENDIAN) { auto a = [ cast(Digit)(n>>32), cast(Digit)n ]; } 
    92         else                  { auto a = [ cast(Digit)n, cast(Digit)(n>>32) ]; } 
     91        static if(BIG_ENDIAN) { Digits a = [ cast(Digit)(n>>32), cast(Digit)n ]; } 
     92        else                  { Digits a = [ cast(Digit)n, cast(Digit)(n>>32) ]; } 
    9393        Big b = bigInt(a); 
    9494        digits = b.digits; 
     
    9898    void opAssign(ulong n) 
    9999    { 
    100         static if(BIG_ENDIAN) { auto a = [ cast(Digit)0, cast(Digit)(n>>32), cast(Digit)n ]; } 
    101         else                  { auto a = [ cast(Digit)n, cast(Digit)(n>>32), cast(Digit)0 ]; } 
     100        static if(BIG_ENDIAN) { Digits a = [ cast(Digit)0, cast(Digit)(n>>32), cast(Digit)n ]; } 
     101        else                  { Digits a = [ cast(Digit)n, cast(Digit)(n>>32), cast(Digit)0 ]; } 
    102102        Big b = bigInt(a); 
    103103        digits = b.digits; 
     
    623623// to run in reverse endianness. (And they still pass). 
    624624 
    625 version(BigEndian) { enum bool BIG_ENDIAN = true;
     625version(BigEndian) { enum bool BIG_ENDIAN = true;
    626626else               { enum bool BIG_ENDIAN = false; } 
    627627 
     
    686686 
    687687        case 'a','b','c','d','e','f': 
    688             r = (r << 4) + (c - 'A' + 10); 
     688            r = (r << 4) + (c - 'a' + 10); 
    689689            invalid = false; 
    690690            break; 
     
    18991899        r.opAssign(z); 
    19001900        assert(z.digits == r.digits, hex(r)); 
    1901 /+            // 
     1901            // 
    19021902        r.opAssign( cast(int)100 ); 
    19031903        assert(z.digits == r.digits, hex(r)); 
     
    19241924        Big z = makeBig( 0x00000000, 0xFEDCBA98, 0x76543210 ); 
    19251925        assert(z.digits == r.digits, hex(r)); 
    1926 +/         
    1927     } 
    1928 /+ 
     1926         
     1927    } 
     1928 
    19291929    // This block of unittests demonstrates that static opCall works 
    19301930    { 
     
    19561956        assert(z.digits == r.digits, hex(r)); 
    19571957    } 
    1958 +/ 
    19591958 
    19601959    // This block of unittests demonstrates that castTo works 
     
    21642163        a %= i; 
    21652164    } 
    2166 /+ 
     2165 
    21672166    // This block of unittests demonstrates that opAnd works 
    21682167    { 
     
    21982197        assert(x == 0x66666666); 
    21992198    } 
    2200 +/ 
    22012199 
    22022200    // This block of unittests demonstrates that opShl works