GTime and g_date_set_time
Chris Shoemaker
c.shoemaker at cox.net
Tue Dec 27 12:42:32 EST 2005
Quoted for example:
On Tue, Dec 27, 2005 at 12:20:21PM -0500, David Hampton wrote:
> Modified: gnucash/trunk/src/engine/Recurrence.c
> ===================================================================
> --- gnucash/trunk/src/engine/Recurrence.c 2005-12-27 15:41:07 UTC (rev 12184)
> +++ gnucash/trunk/src/engine/Recurrence.c 2005-12-27 17:20:19 UTC (rev 12185)
> @@ -63,10 +63,15 @@
> r->ptype = VALID_PERIOD_TYPE(pt) ? pt : PERIOD_MONTH;
> r->mult = (pt == PERIOD_ONCE) ? 0 : (mult > 0 ? mult : 1);
>
> - if (_start && g_date_valid(_start))
> + if (_start && g_date_valid(_start)) {
> r->start = *_start;
> - else
> + } else {
> +#ifdef HAVE_GLIB29
> + g_date_set_time_t(&r->start, time(NULL));
> +#else
> g_date_set_time(&r->start, time(NULL));
> +#endif
> + }
>
> /* Some of the unusual period types also specify phase. For those
> types, we ensure that the start date agrees with that phase. */
>
David,
Would it be ok for me to s/GTime/time_t/ everywhere and then
say in some global header, like maybe config.h:
#ifndef HAVE_GLIB29
#define g_date_set_time_t g_date_set_time
#endif
and then just convert all uses of g_date_set_time() to the newer
g_date_set_time_t()?
-chris
More information about the gnucash-devel
mailing list