aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_waituntil.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-15 10:56:29 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-15 10:56:29 +0000
commitb19d55996cb433d6c33aaff4d0789fb3de77b0b6 (patch)
treefd6541cd8a4854ac1626ebbcb1eb20202e358260 /apps/app_waituntil.c
parent83a1c36bfe82c28e119e0a8c11079154cb1da5ea (diff)
Use casts or intermediate variables to remove a number
of platform/compiler-dependent warnings when handing struct timeval fields, both reading and printing them. It is a lost battle to handle the different ways struct timeval is handled on the various platforms and compilers, so try to be pragmatic and go through int/long which are universally supported. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@116557 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_waituntil.c')
-rw-r--r--apps/app_waituntil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_waituntil.c b/apps/app_waituntil.c
index 1334683ce..98345b141 100644
--- a/apps/app_waituntil.c
+++ b/apps/app_waituntil.c
@@ -48,6 +48,7 @@ static int waituntil_exec(struct ast_channel *chan, void *data)
{
int res;
double fraction;
+ long seconds;
struct timeval future = { 0, };
struct timeval tv = ast_tvnow();
int msec;
@@ -58,12 +59,13 @@ static int waituntil_exec(struct ast_channel *chan, void *data)
return 0;
}
- if (sscanf(data, "%ld%lf", (long *)&future.tv_sec, &fraction) == 0) {
+ if (sscanf(data, "%ld%lf", &seconds, &fraction) == 0) {
ast_log(LOG_WARNING, "WaitUntil called with non-numeric argument\n");
pbx_builtin_setvar_helper(chan, "WAITUNTILSTATUS", "FAILURE");
return 0;
}
+ future.tv_sec = seconds;
future.tv_usec = fraction * 1000000;
if ((msec = ast_tvdiff_ms(future, tv)) < 0) {