Index: funcs/func_strings.c --- funcs/func_strings.c.orig 2006-03-21 18:45:56 +0100 +++ funcs/func_strings.c 2006-09-09 19:30:57 +0200 @@ -169,7 +169,7 @@ epochi = tv.tv_sec; } - ast_localtime(&epochi, &time, timezone); + { time_t t = (time_t)epochi; ast_localtime(&t, &time, timezone); } if (!format) { format = "%c"; Index: res/res_features.c --- res/res_features.c.orig 2006-08-02 01:07:06 +0200 +++ res/res_features.c 2006-09-09 19:28:53 +0200 @@ -505,13 +505,13 @@ if (touch_monitor) { len = strlen(touch_monitor) + 50; args = alloca(len); - snprintf(args, len, "%s|auto-%ld-%s|m", (touch_format) ? touch_format : "wav", time(NULL), touch_monitor); + snprintf(args, len, "%s|auto-%ld-%s|m", (touch_format) ? touch_format : "wav", (long)time(NULL), touch_monitor); } else { caller_chan_id = ast_strdupa(caller_chan->cid.cid_num ? caller_chan->cid.cid_num : caller_chan->name); callee_chan_id = ast_strdupa(callee_chan->cid.cid_num ? callee_chan->cid.cid_num : callee_chan->name); len = strlen(caller_chan_id) + strlen(callee_chan_id) + 50; args = alloca(len); - snprintf(args, len, "%s|auto-%ld-%s-%s|m", (touch_format) ? touch_format : "wav", time(NULL), caller_chan_id, callee_chan_id); + snprintf(args, len, "%s|auto-%ld-%s-%s|m", (touch_format) ? touch_format : "wav", (long)time(NULL), caller_chan_id, callee_chan_id); } for( x = 0; x < strlen(args); x++) Index: say.c --- say.c.orig 2005-11-29 19:24:39 +0100 +++ say.c 2006-09-09 19:28:53 +0200 @@ -3133,7 +3133,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3156,7 +3156,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3332,7 +3332,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3355,7 +3355,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3524,7 +3524,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3547,7 +3547,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3727,7 +3727,7 @@ char todo = format[offset]; /* The letter to format*/ gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3883,7 +3883,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -3906,7 +3906,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4101,7 +4101,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4124,7 +4124,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4303,7 +4303,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4326,7 +4326,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4528,7 +4528,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4551,7 +4551,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4740,7 +4740,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -4763,7 +4763,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -5010,7 +5010,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -5033,7 +5033,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -6043,7 +6043,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); @@ -6066,7 +6066,7 @@ time_t beg_today; gettimeofday(&now,NULL); - ast_localtime(&now.tv_sec,&tmnow,timezone); + { time_t t = (time_t)now.tv_sec; ast_localtime(&t,&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); Index: channels/chan_iax2.c --- channels/chan_iax2.c.orig 2006-09-06 17:55:20 +0200 +++ channels/chan_iax2.c 2006-09-09 19:28:53 +0200 @@ -2606,7 +2606,7 @@ struct ast_variable *var; struct ast_variable *tmp; struct iax2_peer *peer=NULL; - time_t regseconds, nowtime; + time_t regseconds = 0, nowtime; int dynamic=0; if (peername) @@ -2647,8 +2647,10 @@ break; } } else if (!strcasecmp(tmp->name, "regseconds")) { - if (sscanf(tmp->value, "%ld", (time_t *)®seconds) != 1) - regseconds = 0; + long s; + if (sscanf(tmp->value, "%ld", &s) != 1) + s = 0; + regseconds = s; } else if (!strcasecmp(tmp->name, "ipaddr")) { inet_aton(tmp->value, &(peer->addr.sin_addr)); } else if (!strcasecmp(tmp->name, "port")) { Index: channels/chan_sip.c --- channels/chan_sip.c.orig 2006-09-04 17:46:07 +0200 +++ channels/chan_sip.c 2006-09-09 19:28:53 +0200 @@ -12252,7 +12252,7 @@ int obproxyfound=0; int found=0; int format=0; /* Ama flags */ - time_t regseconds; + time_t regseconds = 0; char *varname = NULL, *varval = NULL; struct ast_variable *tmpvar = NULL; struct ast_flags peerflags = {(0)}; @@ -12335,8 +12335,10 @@ } if (realtime && !strcasecmp(v->name, "regseconds")) { - if (sscanf(v->value, "%ld", (time_t *)®seconds) != 1) - regseconds = 0; + long s; + if (sscanf(v->value, "%ld", &s) != 1) + s = 0; + regseconds = (time_t)s; } else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) { inet_aton(v->value, &(peer->addr.sin_addr)); } else if (realtime && !strcasecmp(v->name, "name"))