Timespecs & GDates

Phil Longstaff plongstaff at rogers.com
Sun Dec 23 12:48:53 EST 2007


Derek Atkins wrote:
> Phil Longstaff <plongstaff at rogers.com> writes:
>
>   
>> Two questions:
>>
>> 1) Can anyone tell me why gnc_price_set_time() takes a Timespec passed 
>> by value but the routines in Transaction.h which take Timespecs are 
>> passed by reference?  It would simplify the gda backend if they were 
>> always passed the same way (either by value or by reference, but not both).
>>     
>
> My guess is that there are different methods due in part to
> whether the API was written to be wrapped by g-wrap.  In g-wrap
> we had a wrapper around Timespec so that you could use it
> directly (instead of as a pointer), which required APIs to
> pass in/out by value, not reference.   But yes, it should be
> done consistently.   Does it matter to you which way?
>   
It doesn't matter to me which way it is as long as it is consistent.

Phil



More information about the gnucash-devel mailing list