From 6d605762ddcc99c93b58450634495d9c178498db Mon Sep 17 00:00:00 2001 From: John Ralls Date: Mon, 23 Jul 2018 12:00:54 -0700 Subject: [PATCH] Delete the last vestiges of timepair. --- libgnucash/engine/engine-helpers-guile.h | 3 --- libgnucash/engine/engine-helpers.c | 32 ------------------------ libgnucash/engine/gnc-date.h | 4 +-- libgnucash/engine/kvp-scm.cpp | 13 ---------- 4 files changed, 2 insertions(+), 50 deletions(-) diff --git a/libgnucash/engine/engine-helpers-guile.h b/libgnucash/engine/engine-helpers-guile.h index ad97e9c850..41fda9a02a 100644 --- a/libgnucash/engine/engine-helpers-guile.h +++ b/libgnucash/engine/engine-helpers-guile.h @@ -32,10 +32,7 @@ /* Helpers for various conversions to and from guile */ -SCM gnc_timespec2timepair(Timespec t); -Timespec gnc_timepair2timespec(SCM x); GDate gnc_time64_to_GDate(SCM x); -int gnc_timepair_p(SCM x); SCM gnc_guid2scm(GncGUID guid); GncGUID gnc_scm2guid(SCM guid_scm); diff --git a/libgnucash/engine/engine-helpers.c b/libgnucash/engine/engine-helpers.c index f646113393..f5893464c6 100644 --- a/libgnucash/engine/engine-helpers.c +++ b/libgnucash/engine/engine-helpers.c @@ -284,28 +284,6 @@ gnc_book_option_remove_cb (gchar *key, GncBOCb func, gpointer user_data) } } -SCM -gnc_timespec2timepair(Timespec t) -{ - SCM secs; - SCM nsecs; - - secs = scm_from_int64(t.tv_sec); - nsecs = scm_from_long (t.tv_nsec); - return(scm_cons(secs, nsecs)); -} - -Timespec -gnc_timepair2timespec(SCM x) -{ - Timespec result = {0, 0}; - if (gnc_timepair_p (x)) - { - result.tv_sec = scm_to_int64(SCM_CAR(x)); - result.tv_nsec = scm_to_long(SCM_CDR(x)); - } - return(result); -} GDate gnc_time64_to_GDate(SCM x) { @@ -313,14 +291,6 @@ GDate gnc_time64_to_GDate(SCM x) return time64_to_gdate(time); } -int -gnc_timepair_p(SCM x) -{ - return(scm_is_pair(x) && - (scm_is_signed_integer(SCM_CAR(x), INT64_MIN, INT64_MAX) && - scm_is_signed_integer(SCM_CDR(x), INT64_MIN, INT64_MAX))); -} - SCM gnc_guid2scm(GncGUID guid) { @@ -390,8 +360,6 @@ gnc_guid_p(SCM guid_scm) * Each OR term is a list of AND terms. * Each AND term is a list of one of the following forms: * - * ('pd-date pr-type sense-bool use-start-bool start-timepair - * use-end-bool use-end-timepair) * ('pd-amount pr-type sense-bool amt-match-how amt-match-sign amount) * ('pd-account pr-type sense-bool acct-match-how list-of-account-guids) * ('pd-string pr-type sense-bool case-sense-bool use-regexp-bool string) diff --git a/libgnucash/engine/gnc-date.h b/libgnucash/engine/gnc-date.h index f940817245..2b34ae308d 100644 --- a/libgnucash/engine/gnc-date.h +++ b/libgnucash/engine/gnc-date.h @@ -329,8 +329,8 @@ Timespec timespec_diff(const Timespec *ta, const Timespec *tb); /** absolute value, also normalized */ Timespec timespec_abs(const Timespec *t); -/** convert a timepair on a certain day (localtime) to - * the timepair representing midday on that day. Watch out - this is *not* the +/** convert a timespec on a certain day (localtime) to + * the timespec representing midday on that day. Watch out - this is *not* the * first second of the day, which is returned by various other functions * returning a Timespec. */ Timespec timespecCanonicalDayTime(Timespec t); diff --git a/libgnucash/engine/kvp-scm.cpp b/libgnucash/engine/kvp-scm.cpp index 07a7859742..ba7e785aff 100644 --- a/libgnucash/engine/kvp-scm.cpp +++ b/libgnucash/engine/kvp-scm.cpp @@ -56,11 +56,6 @@ gnc_scm_to_kvp_value_ptr(SCM val) auto tmpguid = guid_copy(&guid); return new KvpValue{tmpguid}; } - else if (gnc_timepair_p(val)) - { - Timespec ts = gnc_timepair2timespec(val); - return new KvpValue{ts}; - } else if (scm_is_string(val)) { return new KvpValue{gnc_scm_to_utf8_string(val)}; @@ -106,10 +101,6 @@ gnc_kvp_value_ptr_to_scm(KvpValue* val) return gnc_guid2scm(*tempguid); } break; - case KvpValue::Type::TIMESPEC: - return gnc_timespec2timepair(val->get()); - break; - case KvpValue::Type::FRAME: { auto frame = val->get(); @@ -117,10 +108,6 @@ gnc_kvp_value_ptr_to_scm(KvpValue* val) return SWIG_NewPointerObj(frame, SWIG_TypeQuery("_p_KvpFrame"), 0); } break; - case KvpValue::Type::GDATE: - return gnc_timespec2timepair(gdate_to_timespec(val->get())); - - /* FIXME: handle types below */ case KvpValue::Type::GLIST: default: break;