std: change time::timeval to be {sec: i64, usec: i32}.

It's possible to have negative times if expressing time before 1970, so
we should use signed types. Other platforms can return times at a higher
resolution, so we should use 64 bits.
This commit is contained in:
Erick Tryzelaar
2012-04-02 20:38:43 -07:00
parent 12d3d4f125
commit 7aae7320db
3 changed files with 11 additions and 11 deletions

View File

@@ -408,7 +408,7 @@ rust_ptr_eq(type_desc *t, rust_box *a, rust_box *b) {
#if defined(__WIN32__)
extern "C" CDECL void
get_time(uint32_t *sec, uint32_t *usec) {
get_time(int64_t *sec, int32_t *usec) {
FILETIME fileTime;
GetSystemTimeAsFileTime(&fileTime);
@@ -427,7 +427,7 @@ get_time(uint32_t *sec, uint32_t *usec) {
}
#else
extern "C" CDECL void
get_time(uint32_t *sec, uint32_t *usec) {
get_time(int64_t *sec, int32_t *usec) {
struct timeval tv;
gettimeofday(&tv, NULL);
*sec = tv.tv_sec;