Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3114

Show
Ignore:
Timestamp:
01/22/08 17:38:58 (7 months ago)
Author:
larsivi
Message:

Compile workaround for Bugzilla 617 on 64 bit arches

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/time/ISO8601.d

    r3042 r3114  
    8383        T* p2 = p; 
    8484 
    85         int i = parseIntMax(p, 3u); 
     85        int i = parseIntMax(p, cast(size_t)3); 
    8686 
    8787        if (i) if (p - p2 == 2) { 
     
    131131            if (!( 
    132132                demand(p, '-') && 
    133                 (date.day = parseIntMax(p, 2u)) != 0 && date.day <= daysPerMonth(date.month, date.year) 
     133                (date.day = parseIntMax(p, cast(size_t)2)) != 0 && date.day <= daysPerMonth(date.month, date.year) 
    134134            )) { 
    135135                date.day = 0; 
     
    269269        accept(p, 'T'); 
    270270 
    271     if (parseInt(p, 2u, time.hours) != 2 || time.hours > 24) 
     271    if (parseInt(p, cast(size_t)2, time.hours) != 2 || time.hours > 24) 
    272272        return (time.hours = 0); 
    273273 
     
    302302        !checkColon() || 
    303303 
    304         parseInt(p, 2u, time.minutes) != 2 || time.minutes > 59 || 
     304        parseInt(p, cast(size_t)2, time.minutes) != 2 || time.minutes > 59 || 
    305305 
    306306        // hour 24 is only for 24:00:00 
     
    343343    if ( 
    344344        !checkColon() || 
    345          parseInt(p, 2u, time.seconds) != 2 || time.seconds > 60 || 
     345         parseInt(p, cast(size_t)2, time.seconds) != 2 || time.seconds > 60 || 
    346346        (time.hours == 24 && time.seconds  != 0) || 
    347347        (time.seconds  == 60 && time.hours != 23 && time.minutes != 59) 
     
    396396 
    397397    if ( 
    398         doIso8601Date(p, src, date, 0u, sep) && 
     398        doIso8601Date(p, src, date, cast(size_t)0, sep) && 
    399399        date.year && date.month && date.day && 
    400400 
     
    645645        scope(exit) time.hours = cast(uint)realhour; 
    646646        scope(exit) time.minutes = cast(uint)realminute; 
    647     if (parseInt(p, 2u, hour) != 2 || hour > 12 || (hour == 0 && factor == 1)) 
     647    if (parseInt(p, cast(size_t)2, hour) != 2 || hour > 12 || (hour == 0 && factor == 1)) 
    648648        return BAD; 
    649649 
     
    694694 
    695695    int minute; 
    696     if (parseInt(p, 2u, minute) != 2) 
     696    if (parseInt(p, cast(size_t)2, minute) != 2) 
    697697        return BAD; 
    698698 
     
    764764// note: ISO 8601 code relies on these values always being positive, failing if *p == '-' 
    765765 
    766 private uint parseIntMax(T) (ref T* p) { 
    767     uint value = 0; 
     766private size_t parseIntMax(T) (ref T* p) { 
     767    size_t value = 0; 
    768768    while (*p >= '0' && *p <= '9') 
    769769        value = value * 10 + *p++ - '0'; 
     
    773773// ... but accept no more than max digits 
    774774 
    775 private uint parseIntMax(T)(ref T* p, uint max) { 
     775private size_t parseIntMax(T)(ref T* p, size_t max) { 
    776776    size_t i = 0; 
    777     uint value = 0; 
     777    size_t value = 0; 
    778778    while (p[i] >= '0' && p[i] <= '9' && i < max) 
    779779        value = value * 10 + p[i++] - '0'; 
     
    790790} 
    791791 
    792 private size_t parseInt(T, U)(ref T* p, uint max, out U i) { 
     792private size_t parseInt(T, U)(ref T* p, size_t max, out U i) { 
    793793    T* p2 = p; 
    794794    i = cast(U)parseIntMax(p, max);