r22688 - gnucash/trunk/src/libqof/qof - Fix gnc_difftime so it is the same as difftime, which it replaces.

Mike Alexander mta at code.gnucash.org
Mon Dec 31 19:10:08 EST 2012


Author: mta
Date: 2012-12-31 19:10:07 -0500 (Mon, 31 Dec 2012)
New Revision: 22688
Trac: http://svn.gnucash.org/trac/changeset/22688

Modified:
   gnucash/trunk/src/libqof/qof/gnc-date.c
   gnucash/trunk/src/libqof/qof/gnc-date.h
Log:
Fix gnc_difftime so it is the same as difftime, which it replaces.
It was computing the negative of the expected value.  The most obvious
effect of this was that the reconcile interval became negative when you
reconciled an account so each reconciliation was earlier than the previous.

Modified: gnucash/trunk/src/libqof/qof/gnc-date.c
===================================================================
--- gnucash/trunk/src/libqof/qof/gnc-date.c	2012-12-22 18:21:03 UTC (rev 22687)
+++ gnucash/trunk/src/libqof/qof/gnc-date.c	2013-01-01 00:10:07 UTC (rev 22688)
@@ -462,7 +462,7 @@
 gdouble
 gnc_difftime (const time64 secs1, const time64 secs2)
 {
-     return (double)secs2 - (double)secs1;
+     return (double)secs1 - (double)secs2;
 }
 
 /****************************************************************************/

Modified: gnucash/trunk/src/libqof/qof/gnc-date.h
===================================================================
--- gnucash/trunk/src/libqof/qof/gnc-date.h	2012-12-22 18:21:03 UTC (rev 22687)
+++ gnucash/trunk/src/libqof/qof/gnc-date.h	2013-01-01 00:10:07 UTC (rev 22688)
@@ -229,8 +229,8 @@
  * 00:00:01 UTC 01 January 1970 (negative values are seconds before that moment)
  *  \param secs2: The second time value, in Seconds since
  * 00:00:01 UTC 01 January 1970 (negative values are seconds before that moment)
- *  \return The difference in seconds between secs1 and secs2. If secs1 is
- * later than secs2 the value will be negative.
+ *  \return The difference in seconds between secs1 and secs2. If secs2 is
+ * later than secs1 the value will be negative.
  */
 gdouble gnc_difftime (const time64 secs1, const time64 secs2);
 



More information about the gnucash-changes mailing list