Changeset 219 for trunk/lib/regfi.c
- Timestamp:
- 03/31/11 00:29:09 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/regfi.c
r215 r219 3649 3649 converts this to real GMT. 3650 3650 ****************************************************************************/ 3651 time_tregfi_nt2unix_time(const REGFI_NTTIME* nt)3652 { 3653 double d;3654 time_t ret; 3651 double regfi_nt2unix_time(const REGFI_NTTIME* nt) 3652 { 3653 double ret_val; 3654 3655 3655 /* The next two lines are a fix needed for the 3656 3656 broken SCO compiler. JRA. */ … … 3661 3661 return(0); 3662 3662 3663 d= ((double)nt->high)*4.0*(double)(1<<30);3664 d += (nt->low&0xFFF00000);3665 d*= 1.0e-7;3663 ret_val = ((double)nt->high)*4.0*(double)(1<<30); 3664 ret_val += nt->low; 3665 ret_val *= 1.0e-7; 3666 3666 3667 3667 /* now adjust by 369 years to make the secs since 1970 */ 3668 d -= TIME_FIXUP_CONSTANT; 3669 3670 if (d <= l_time_min) 3668 ret_val -= TIME_FIXUP_CONSTANT; 3669 3670 /* XXX: should these sanity checks be removed? */ 3671 if (ret_val <= l_time_min) 3671 3672 return (l_time_min); 3672 3673 3673 if ( d>= l_time_max)3674 if (ret_val >= l_time_max) 3674 3675 return (l_time_max); 3675 3676 ret = (time_t)(d+0.5);3677 3676 3678 3677 /* this takes us from kludge-GMT to real GMT */ … … 3686 3685 */ 3687 3686 3688 return (ret);3687 return ret_val; 3689 3688 } 3690 3689
Note: See TracChangeset
for help on using the changeset viewer.