From: Russell Bryant Date: Sat, 20 Mar 2010 18:14:31 +0000 (+0000) Subject: Merged revisions 253536-253538,253540 via svnmerge from X-Git-Tag: 1.6.0.27-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d18064d8bd43ed7a8e168b70a90758fac82d3c03;p=thirdparty%2Fasterisk.git Merged revisions 253536-253538,253540 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r253536 | russell | 2010-03-20 06:33:30 -0500 (Sat, 20 Mar 2010) | 4 lines Use SHRT_MAX instead of MAXSHORT. These changes fix build issues I had with this module on FreeBSD. ........ r253537 | russell | 2010-03-20 06:39:39 -0500 (Sat, 20 Mar 2010) | 2 lines Resolve a compiler warning on FreeBSD. ........ r253538 | russell | 2010-03-20 06:43:08 -0500 (Sat, 20 Mar 2010) | 2 lines Resolve compiler warnings on FreeBSD. ........ r253540 | russell | 2010-03-20 07:03:07 -0500 (Sat, 20 Mar 2010) | 2 lines Resolve more compiler warnings on FreeBSD. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@253626 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_dial.c b/apps/app_dial.c index 228524cb64..3b9a612447 100644 --- a/apps/app_dial.c +++ b/apps/app_dial.c @@ -1274,12 +1274,12 @@ static void end_bridge_callback(void *data) ast_channel_lock(chan); if (chan->cdr->answer.tv_sec) { - snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->answer.tv_sec); + snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->answer.tv_sec); pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf); } if (chan->cdr->start.tv_sec) { - snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->start.tv_sec); + snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->start.tv_sec); pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf); } ast_channel_unlock(chan); diff --git a/apps/app_followme.c b/apps/app_followme.c index 21e5c549a7..8f982f197a 100644 --- a/apps/app_followme.c +++ b/apps/app_followme.c @@ -889,12 +889,12 @@ static void end_bridge_callback(void *data) ast_channel_lock(chan); if (chan->cdr->answer.tv_sec) { - snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->answer.tv_sec); + snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->answer.tv_sec); pbx_builtin_setvar_helper(chan, "ANSWEREDTIME", buf); } if (chan->cdr->start.tv_sec) { - snprintf(buf, sizeof(buf), "%ld", end - chan->cdr->start.tv_sec); + snprintf(buf, sizeof(buf), "%ld", (long) end - chan->cdr->start.tv_sec); pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf); } ast_channel_unlock(chan); diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c index e9bc7c0718..c3a12c0e3d 100644 --- a/cdr/cdr_pgsql.c +++ b/cdr/cdr_pgsql.c @@ -171,7 +171,7 @@ static int pgsql_log(struct ast_cdr *cdr) if (strcmp(cur->name, "start") == 0 || strcmp(cur->name, "calldate") == 0) { if (strncmp(cur->type, "int", 3) == 0) { LENGTHEN_BUF2(12); - lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%ld", cdr->start.tv_sec); + lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%ld", (long) cdr->start.tv_sec); } else if (strncmp(cur->type, "float", 5) == 0) { LENGTHEN_BUF2(30); lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%f", (double)cdr->start.tv_sec + (double)cdr->start.tv_usec / 1000000.0); @@ -184,7 +184,7 @@ static int pgsql_log(struct ast_cdr *cdr) } else if (strcmp(cur->name, "answer") == 0) { if (strncmp(cur->type, "int", 3) == 0) { LENGTHEN_BUF2(12); - lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%ld", cdr->answer.tv_sec); + lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%ld", (long) cdr->answer.tv_sec); } else if (strncmp(cur->type, "float", 5) == 0) { LENGTHEN_BUF2(30); lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%f", (double)cdr->answer.tv_sec + (double)cdr->answer.tv_usec / 1000000.0); @@ -197,7 +197,7 @@ static int pgsql_log(struct ast_cdr *cdr) } else if (strcmp(cur->name, "end") == 0) { if (strncmp(cur->type, "int", 3) == 0) { LENGTHEN_BUF2(12); - lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%ld", cdr->end.tv_sec); + lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%ld", (long) cdr->end.tv_sec); } else if (strncmp(cur->type, "float", 5) == 0) { LENGTHEN_BUF2(30); lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%f", (double)cdr->end.tv_sec + (double)cdr->end.tv_usec / 1000000.0); diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index a1249edc14..e5adb979b2 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -49,7 +49,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") -#ifdef __NetBSD__ +#if defined(__NetBSD__) || defined(__FreeBSD__) #include #include #else diff --git a/main/features.c b/main/features.c index 7625a58755..ea072b2827 100644 --- a/main/features.c +++ b/main/features.c @@ -30,6 +30,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/_private.h" #include +#include #include #include #include diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c index b25b8ab144..74c441049f 100644 --- a/main/stdtime/localtime.c +++ b/main/stdtime/localtime.c @@ -48,6 +48,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +#include #include #include #include diff --git a/main/tcptls.c b/main/tcptls.c index f0c8be13d6..0a45151ed8 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -33,6 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include #endif +#include #include #include "asterisk/compat.h" diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 2428d5b28b..85b7f6b59e 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -40,6 +40,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__) #include #include +#include #endif #include "asterisk/file.h"