Changeset 1357

Show
Ignore:
Timestamp:
12/06/08 11:28:40 (7 months ago)
Author:
perry
Message:

Fix problem with trace_get_erf_timestamp() on some platforms where UINT_MAX ends
up being signed. (reported by yuri from isi)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/trace.c

    r1347 r1357  
    856856                /* timeval -> timestamp */ 
    857857                ts = packet->trace->format->get_timeval(packet); 
    858                 timestamp = ((((uint64_t)ts.tv_sec) << 32) + \ 
    859                                 (((uint64_t)ts.tv_usec * UINT_MAX)/1000000)); 
     858                timestamp = ((((uint64_t)ts.tv_sec) << 32) + 
     859                                (((uint64_t)ts.tv_usec << 32)/1000000)); 
    860860        } else if (packet->trace->format->get_seconds) { 
    861861                /* seconds -> timestamp */ 
    862862                seconds = packet->trace->format->get_seconds(packet); 
    863                 timestamp = ((uint64_t)((uint32_t)seconds) << 32) + \ 
    864                       (uint64_t)(( seconds - (uint32_t)seconds   ) * UINT_MAX); 
     863                timestamp = (((uint64_t)seconds)<<32) 
     864                          + (uint64_t)((seconds-(uint64_t)seconds)*UINT_MAX); 
     865                       
    865866        } 
    866867        return timestamp;