Mercurial > libpst
comparison src/timeconv.c @ 46:b2a7f2e0926a
more fixes for 64 bit format
author | carl |
---|---|
date | Sat, 12 Jan 2008 15:20:53 -0800 |
parents | c508ee15dfca |
children | 7d5c637aaafb |
comparison
equal
deleted
inserted
replaced
45:b961bcdadd0e | 46:b2a7f2e0926a |
---|---|
12 */ | 12 */ |
13 | 13 |
14 #include <time.h> | 14 #include <time.h> |
15 #include "common.h" | 15 #include "common.h" |
16 #include "timeconv.h" | 16 #include "timeconv.h" |
17 | |
18 time_t fileTimeToUnixTime( const FILETIME *filetime, DWORD *remainder ); | |
19 char * fileTimeToAscii (const FILETIME *filetime); | |
20 | 17 |
21 char * fileTimeToAscii (const FILETIME *filetime) { | 18 char * fileTimeToAscii (const FILETIME *filetime) { |
22 time_t t1; | 19 time_t t1; |
23 | 20 |
24 t1 = fileTimeToUnixTime(filetime,0); | 21 t1 = fileTimeToUnixTime(filetime,0); |
78 | 75 |
79 if (a1 >= 54590 + carry) a1 -= 54590 + carry, carry = 0; | 76 if (a1 >= 54590 + carry) a1 -= 54590 + carry, carry = 0; |
80 else a1 += (1 << 16) - 54590 - carry, carry = 1; | 77 else a1 += (1 << 16) - 54590 - carry, carry = 1; |
81 | 78 |
82 a2 -= 27111902 + carry; | 79 a2 -= 27111902 + carry; |
83 | 80 |
84 /* If a is negative, replace a by (-1-a) */ | 81 /* If a is negative, replace a by (-1-a) */ |
85 negative = (a2 >= ((UINT32)1) << 31); | 82 negative = (a2 >= ((UINT32)1) << 31); |
86 if (negative) | 83 if (negative) |
87 { | 84 { |
88 /* Set a to -a - 1 (a is a2/a1/a0) */ | 85 /* Set a to -a - 1 (a is a2/a1/a0) */ |