[Asterisk-Dev] ast_localtime() weird interface.

Luigi Rizzo rizzo at icir.org
Tue Oct 11 23:37:41 MST 2005


hi,
i am trying to compile asterisk-current with -Werror to clean up
compile errors, and amomg other things i hit a number of inconsistencies
on the first argument of ast_localtime() (this on FreeBSD-6, but
the problem may exist elsewhere depending on how time_t is defined).

Looking it up, i notice that ast_localtime has this interface:

	struct tm *
	ast_localtime(timep, p_tm, zone)
	const time_t * const    timep;
	struct tm *p_tm;
	const char * const      zone;

and i wonder why the first argument is passed by name rather than
by value.
I see no reason for that, and i'd like to change it, so that
it is much easier to deal with the different definitions of time_t
on the various platforms.

(there are also some printf format issues with time_t which are
also not completely clear to me, but i will deal with that separately)

comments ?

	cheers
	luigi



More information about the asterisk-dev mailing list