Changeset 4569c93


Ignore:
Timestamp:
06/12/08 11:28:40 (13 years ago)
Author:
Perry Lorier <perry@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
ece036a
Parents:
ce7c7af
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rcdcaef6 r4569c93  
    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;
Note: See TracChangeset for help on using the changeset viewer.