Closed Bug 736887 Opened 9 years ago Closed 9 years ago

nsHttpChannel.cpp: warning C4244: 'argument' : conversion from 'double' to 'PRTime', possible loss of data

Categories

(Core :: Networking: HTTP, defect)

All
Windows 7
defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: briansmith, Assigned: briansmith)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #576006 +++

MSVC2010 complains with the warning in the summary. The code is:

  #define IMPL_TIMING_ATTR(name)                               \
  NS_IMETHODIMP                                                \
  nsHttpChannel::Get##name##Time(PRTime* _retval) {            \
    mozilla::TimeStamp stamp;                                  \
    Get##name(&stamp);                                         \
    if (stamp.IsNull()) {                                      \
        *_retval = 0;                                          \
        return NS_OK;                                          \
    }                                                          \
    *_retval = mChannelCreationTime +                          \
        (stamp - mChannelCreationTimestamp).ToSeconds() * 1e6; \
    return NS_OK;                                              \
  }

AFAICT, the simplest way to avoid the warning is to explicitly cast the expression ((stamp - mChannelCreationTimestamp).ToSeconds() * 1e6) to PRTime.
Assignee: nobody → bsmith
Status: NEW → ASSIGNED
Attachment #607027 - Flags: review?(cbiesinger)
Attachment #607027 - Flags: review?(cbiesinger) → review+
http://hg.mozilla.org/mozilla-central/rev/497086b1463c
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.