GTime and g_date_set_time

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GTime and g_date_set_time

Chris Shoemaker

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
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: GTime and g_date_set_time

David Hampton-2
On Tue, 2005-12-27 at 12:42 -0500, Chris Shoemaker wrote:
>         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()?  

Derek already poked me about this on IRC.  I've got a fix in the works.

David


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel