diff -urp /usr/ports/distfiles/ast-curr/asterisk/apps/app_alarmreceiver.c work/asterisk-current/apps/app_alarmreceiver.c --- /usr/ports/distfiles/ast-curr/asterisk/apps/app_alarmreceiver.c Wed Oct 26 21:48:14 2005 +++ work/asterisk-current/apps/app_alarmreceiver.c Sat Nov 5 18:07:33 2005 @@ -328,7 +328,7 @@ static int write_metadata( FILE *logfile /* Get the current time */ time(&t); - ast_localtime(&t, &now, NULL); + ast_localtime(t, &now, NULL); /* Format the time */ diff -urp /usr/ports/distfiles/ast-curr/asterisk/apps/app_voicemail.c work/asterisk-current/apps/app_voicemail.c --- /usr/ports/distfiles/ast-curr/asterisk/apps/app_voicemail.c Fri Nov 4 16:09:03 2005 +++ work/asterisk-current/apps/app_voicemail.c Sat Nov 5 18:07:33 2005 @@ -1654,9 +1654,9 @@ static int sendmail(char *srcemail, stru } if (the_zone) - ast_localtime(&t,&tm,the_zone->timezone); + ast_localtime(t,&tm,the_zone->timezone); else - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm); fprintf(p, "Date: %s\n", date); @@ -1807,9 +1807,9 @@ static int sendpage(char *srcemail, char } if (the_zone) - ast_localtime(&t,&tm,the_zone->timezone); + ast_localtime(t,&tm,the_zone->timezone); else - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", &tm); fprintf(p, "Date: %s\n", date); diff -urp /usr/ports/distfiles/ast-curr/asterisk/funcs/func_strings.c work/asterisk-current/funcs/func_strings.c --- /usr/ports/distfiles/ast-curr/asterisk/funcs/func_strings.c Mon Oct 24 22:12:06 2005 +++ work/asterisk-current/funcs/func_strings.c Sat Nov 5 18:07:33 2005 @@ -165,7 +165,7 @@ static char *acf_strftime(struct ast_cha epochi = tv.tv_sec; } - ast_localtime(&epochi, &time, timezone); + ast_localtime(epochi, &time, timezone); if (!format) { format = "%c"; diff -urp /usr/ports/distfiles/ast-curr/asterisk/include/asterisk/localtime.h work/asterisk-current/include/asterisk/localtime.h --- /usr/ports/distfiles/ast-curr/asterisk/include/asterisk/localtime.h Mon Oct 24 22:12:06 2005 +++ work/asterisk-current/include/asterisk/localtime.h Sat Nov 5 18:07:33 2005 @@ -26,7 +26,7 @@ extern int ast_tzsetwall(void); extern void ast_tzset(const char *name); -extern struct tm *ast_localtime(const time_t *timep, struct tm *p_tm, const char *zone); +extern struct tm *ast_localtime(time_t timep, struct tm *p_tm, const char *zone); extern time_t ast_mktime(struct tm * const tmp, const char *zone); extern char *ast_ctime(const time_t * const timep); extern char *ast_ctime_r(const time_t * const timep, char *buf); diff -urp /usr/ports/distfiles/ast-curr/asterisk/say.c work/asterisk-current/say.c --- /usr/ports/distfiles/ast-curr/asterisk/say.c Thu Oct 27 01:11:36 2005 +++ work/asterisk-current/say.c Sat Nov 5 18:07:33 2005 @@ -2737,7 +2737,7 @@ int ast_say_date_en(struct ast_channel * struct tm tm; char fn[256]; int res = 0; - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); res = ast_streamfile(chan, fn, lang); @@ -2765,7 +2765,7 @@ int ast_say_date_da(struct ast_channel * struct tm tm; char fn[256]; int res = 0; - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); res = ast_streamfile(chan, fn, lang); @@ -2813,7 +2813,7 @@ int ast_say_date_de(struct ast_channel * struct tm tm; char fn[256]; int res = 0; - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); res = ast_streamfile(chan, fn, lang); @@ -2862,7 +2862,7 @@ int ast_say_date_fr(struct ast_channel * struct tm tm; char fn[256]; int res = 0; - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); res = ast_streamfile(chan, fn, lang); @@ -2890,7 +2890,7 @@ int ast_say_date_nl(struct ast_channel * struct tm tm; char fn[256]; int res = 0; - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); res = ast_streamfile(chan, fn, lang); @@ -2918,7 +2918,7 @@ int ast_say_date_pt(struct ast_channel * struct tm tm; char fn[256]; int res = 0; - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); localtime_r(&t,&tm); snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); if (!res) @@ -2975,7 +2975,7 @@ int ast_say_date_with_format_en(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -3126,7 +3126,7 @@ int ast_say_date_with_format_en(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3149,7 +3149,7 @@ int ast_say_date_with_format_en(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3210,7 +3210,7 @@ int ast_say_date_with_format_da(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -3323,7 +3323,7 @@ int ast_say_date_with_format_da(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3346,7 +3346,7 @@ int ast_say_date_with_format_da(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3402,7 +3402,7 @@ int ast_say_date_with_format_de(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -3515,7 +3515,7 @@ int ast_say_date_with_format_de(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3538,7 +3538,7 @@ int ast_say_date_with_format_de(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3621,7 +3621,7 @@ int ast_say_date_with_format_he(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -3718,7 +3718,7 @@ int ast_say_date_with_format_he(struct a char todo = format[offset]; /* The letter to format*/ gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3796,7 +3796,7 @@ int ast_say_date_with_format_es(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -3874,7 +3874,7 @@ int ast_say_date_with_format_es(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3897,7 +3897,7 @@ int ast_say_date_with_format_es(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -3975,7 +3975,7 @@ int ast_say_date_with_format_fr(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -4092,7 +4092,7 @@ int ast_say_date_with_format_fr(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4115,7 +4115,7 @@ int ast_say_date_with_format_fr(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4167,7 +4167,7 @@ int ast_say_date_with_format_it(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -4294,7 +4294,7 @@ int ast_say_date_with_format_it(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4317,7 +4317,7 @@ int ast_say_date_with_format_it(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4392,7 +4392,7 @@ int ast_say_date_with_format_nl(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -4519,7 +4519,7 @@ int ast_say_date_with_format_nl(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4542,7 +4542,7 @@ int ast_say_date_with_format_nl(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4617,7 +4617,7 @@ int ast_say_date_with_format_pt(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -4731,7 +4731,7 @@ int ast_say_date_with_format_pt(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4754,7 +4754,7 @@ int ast_say_date_with_format_pt(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -4829,7 +4829,7 @@ int ast_say_date_with_format_tw(struct a int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -5001,7 +5001,7 @@ int ast_say_date_with_format_tw(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -5024,7 +5024,7 @@ int ast_say_date_with_format_tw(struct a time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -5829,7 +5829,7 @@ static int ast_say_date_gr(struct ast_ch int res = 0; - ast_localtime(&t,&tm,NULL); + ast_localtime(t,&tm,NULL); /* W E E K - D A Y */ if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); @@ -5949,7 +5949,7 @@ static int ast_say_date_with_format_gr(s int res=0, offset, sndoffset; char sndfile[256], nextmsg[256]; - ast_localtime(&time,&tm,timezone); + ast_localtime(time,&tm,timezone); for (offset=0 ; format[offset] != '\0' ; offset++) { ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format); @@ -6034,7 +6034,7 @@ static int ast_say_date_with_format_gr(s time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); @@ -6057,7 +6057,7 @@ static int ast_say_date_with_format_gr(s time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + ast_localtime(now.tv_sec,&tmnow,timezone); /* This might be slightly off, if we transcend a leap second, but never more off than 1 second */ /* In any case, it saves not having to do ast_mktime() */ beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec); diff -urp /usr/ports/distfiles/ast-curr/asterisk/stdtime/localtime.c work/asterisk-current/stdtime/localtime.c --- /usr/ports/distfiles/ast-curr/asterisk/stdtime/localtime.c Fri Nov 4 16:09:10 2005 +++ work/asterisk-current/stdtime/localtime.c Sat Nov 5 18:07:33 2005 @@ -1062,16 +1062,13 @@ const char * const zone; } struct tm * -ast_localtime(timep, p_tm, zone) -const time_t * const timep; -struct tm *p_tm; -const char * const zone; +ast_localtime(time_t timep, struct tm *p_tm, const char * const zone) { #ifdef _THREAD_SAFE ast_mutex_lock(&lcl_mutex); #endif ast_tzset(zone); - localsub(timep, 0L, p_tm, zone); + localsub(&timep, 0L, p_tm, zone); #ifdef _THREAD_SAFE ast_mutex_unlock(&lcl_mutex); #endif