# # # patch "dates.cc" # from [ba11e025ca1a3524f6797956db69b89aba1655a5] # to [95704e8b4d56a9525176971a3a493d9ead67fa69] # # patch "dates.hh" # from [cc5126b4615d16165892a528031bb42f6993474f] # to [429afbf7ce48b67c356620618a860fa8eabba671] # # patch "rcs_import.cc" # from [295ce31bb7a349f1c0a6b534c2285017ee4cc805] # to [171d54de883512ffef7a85310126c19411313f0a] # ============================================================ --- dates.cc ba11e025ca1a3524f6797956db69b89aba1655a5 +++ dates.cc 95704e8b4d56a9525176971a3a493d9ead67fa69 @@ -21,8 +21,8 @@ using std::string; // cannot be used directly, so we have to resort to #ifdef chains on the old // skool C limits macros. BOOST_STATIC_ASSERT is defined in a way that // doesn't let us use std::numeric_limits::max(), so we have to -// postpone checking it until runtime (date_t::from_unix_epoch), bleah. -// However, the check will be optimized out, and the unit tests exercise it. +// postpone checking it until runtime (date_t::gmtime), bleah. However, the +// check will be optimized out, and the unit tests exercise it. #if defined ULONG_MAX && ULONG_MAX > UINT_MAX #define PROBABLE_U64_MAX ULONG_MAX #define u64_C(x) x##UL @@ -139,12 +139,6 @@ secs_in_year(unsigned int year) return is_leap_year(year) ? LEAP : YEAR; } -date_t -date_t::from_unix_epoch(u64 t) -{ - return date_t(t); -} - string date_t::as_iso_8601_extended() const { @@ -536,8 +530,8 @@ UNIT_TEST(date, from_unix_epoch) UNIT_TEST(date, from_unix_epoch) { #define OK(x,y) do { \ - string s_ = date_t::from_unix_epoch(x).as_iso_8601_extended(); \ - L(FL("from_unix_epoch: %lu -> %s") % (x) % s_); \ + string s_ = date_t(x).as_iso_8601_extended(); \ + L(FL("date_t: %lu -> %s") % (x) % s_); \ UNIT_TEST_CHECK(s_ == (y)); \ } while (0) ============================================================ --- dates.hh cc5126b4615d16165892a528031bb42f6993474f +++ dates.hh 429afbf7ce48b67c356620618a860fa8eabba671 @@ -32,10 +32,6 @@ struct date_t // Return the local system's idea of the current date. static date_t now(); - // Return the date corresponding to an unsigned 64-bit count of seconds - // since the Unix epoch (1970-01-01T00:00:00). - static date_t from_unix_epoch(u64); - // Return the date corresponding to a string. Presently this recognizes // only ISO 8601 "basic" and "extended" time formats. static date_t from_string(std::string const &); ============================================================ --- rcs_import.cc 295ce31bb7a349f1c0a6b534c2285017ee4cc805 +++ rcs_import.cc 171d54de883512ffef7a85310126c19411313f0a @@ -1368,7 +1368,7 @@ cluster_consumer::store_auxiliary_certs( project.put_standard_certs(keys, p.rid, branch_name(branchname), utf8(cvs.changelog_interner.lookup(p.changelog)), - date_t::from_unix_epoch(p.time), + date_t(p.time), cvs.author_interner.lookup(p.author)); }