diff options
| author | jhurst <jhurst@cinecert.com> | 2009-10-08 15:58:16 +0000 |
|---|---|---|
| committer | jhurst <> | 2009-10-08 15:58:16 +0000 |
| commit | 19bd80c074e1dec35404fd85607a2a68c791b2d9 (patch) | |
| tree | b0ca75276663bca2a7beb64bf3bf5ceac01abeea /src/KM_util.cpp | |
| parent | 99ff2799c6926419c049d7d307b7f558505283ab (diff) | |
FIPS 186-2 fixes
Diffstat (limited to 'src/KM_util.cpp')
| -rwxr-xr-x | src/KM_util.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/KM_util.cpp b/src/KM_util.cpp index 7fcd6e3..b155362 100755 --- a/src/KM_util.cpp +++ b/src/KM_util.cpp @@ -774,6 +774,26 @@ Kumu::Timestamp::AddMinutes(i32_t minutes) } } +// +void +Kumu::Timestamp::AddSeconds(i32_t seconds) +{ + SYSTEMTIME current_st; + FILETIME current_ft; + ULARGE_INTEGER current_ul; + + if ( minutes != 0 ) + { + TIMESTAMP_TO_SYSTIME(*this, ¤t_st); + SystemTimeToFileTime(¤t_st, ¤t_ft); + memcpy(¤t_ul, ¤t_ft, sizeof(current_ul)); + current_ul.QuadPart += ( seconds_to_ns100(1) * (i64_t)seconds ); + memcpy(¤t_ft, ¤t_ul, sizeof(current_ft)); + FileTimeToSystemTime(¤t_ft, ¤t_st); + SYSTIME_TO_TIMESTAMP(¤t_st, *this); + } +} + #else // KM_WIN32 #include <time.h> @@ -889,6 +909,23 @@ Kumu::Timestamp::AddMinutes(i32_t minutes) } } +// +void +Kumu::Timestamp::AddSeconds(i32_t seconds) +{ + Kumu::TAI::caltime ct; + Kumu::TAI::tai t; + + if ( seconds != 0 ) + { + TIMESTAMP_TO_CALTIME(*this, &ct) + t = ct; + t.add_seconds(seconds); + ct = t; + CALTIME_TO_TIMESTAMP(&ct, *this) + } +} + #endif // KM_WIN32 |
