]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix compilations errors on 64-bit OpenBSD systems
authorMatthew Jordan <mjordan@digium.com>
Sun, 22 Mar 2015 23:55:25 +0000 (23:55 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 22 Mar 2015 23:55:25 +0000 (23:55 +0000)
In versiong 5.5, OpenBSD went to 64-bit time values. This requires a cast to
(long) when printing members of certain time structs.

Review: https://reviewboard.asterisk.org/r/4507

ASTERISK-24879 #close
Reported by: snuffy
Tested by: snuffy
patches:
  openbsd-time64.diff uploaded by snuffy (License 5024)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433268 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 9a08e204181c886c1f9baf1df0c35f4b931fd208..d61a8fd19e28c4a12c42e5fd33017fd687a47b58 100644 (file)
@@ -4816,7 +4816,7 @@ static int wait_our_turn(struct queue_ent *qe, int ringing, enum queue_result *r
 
                        if ((status = get_member_status(qe->parent, qe->max_penalty, qe->min_penalty, qe->parent->leavewhenempty, 0))) {
                                *reason = QUEUE_LEAVEEMPTY;
-                               ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
+                               ast_queue_log(qe->parent->name, ast_channel_uniqueid(qe->chan), "NONE", "EXITEMPTY", "%d|%d|%ld", qe->pos, qe->opos, (long) (time(NULL) - qe->start));
                                leave_queue(qe);
                                break;
                        }
@@ -5624,7 +5624,7 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char *
                        } else if (ast_check_hangup(qe->chan)) {
                                /* Caller must have hung up just before being connected */
                                ast_log(LOG_NOTICE, "Caller was about to talk to agent on %s but the caller hungup.\n", ast_channel_name(peer));
-                               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) time(NULL) - qe->start);
+                               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "ABANDON", "%d|%d|%ld", qe->pos, qe->opos, (long) (time(NULL) - qe->start));
                                record_abandoned(qe);
                                ast_autoservice_chan_hangup_peer(qe->chan, peer);
                                ao2_ref(member, -1);
@@ -5674,7 +5674,7 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char *
                /* use  pbx_builtin_setvar to set a load of variables with one call */
                if (qe->parent->setqueueentryvar) {
                        snprintf(interfacevar, sizeof(interfacevar), "QEHOLDTIME=%ld,QEORIGINALPOS=%d",
-                               (long) time(NULL) - qe->start, qe->opos);
+                               (long) (time(NULL) - qe->start), qe->opos);
                        pbx_builtin_setvar_multiple(qe->chan, interfacevar);
                        pbx_builtin_setvar_multiple(peer, interfacevar);
                }
@@ -5891,7 +5891,7 @@ static int try_calling(struct queue_ent *qe, const struct ast_flags opts, char *
                        }
                }
                qe->handled++;
-               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, ast_channel_uniqueid(peer),
+               ast_queue_log(queuename, ast_channel_uniqueid(qe->chan), member->membername, "CONNECT", "%ld|%s|%ld", (long) (time(NULL) - qe->start), ast_channel_uniqueid(peer),
                                                                                                        (long)(orig - to > 0 ? (orig - to) / 1000 : 0));
 
                if (ast_channel_cdr(qe->chan)) {
@@ -7178,7 +7178,7 @@ check_turns:
                        reason = QUEUE_TIMEOUT;
                        res = 0;
                        ast_queue_log(args.queuename, ast_channel_uniqueid(chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld",
-                               qe.pos, qe.opos, (long) time(NULL) - qe.start);
+                               qe.pos, qe.opos, (long) (time(NULL) - qe.start));
                        break;
                }
 
@@ -7244,7 +7244,7 @@ check_turns:
                        record_abandoned(&qe);
                        reason = QUEUE_TIMEOUT;
                        res = 0;
-                       ast_queue_log(qe.parent->name, ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) time(NULL) - qe.start);
+                       ast_queue_log(qe.parent->name, ast_channel_uniqueid(qe.chan),"NONE", "EXITWITHTIMEOUT", "%d|%d|%ld", qe.pos, qe.opos, (long) (time(NULL) - qe.start));
                        break;
                }
 
@@ -7273,7 +7273,7 @@ stop:
                                record_abandoned(&qe);
                                ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "ABANDON",
                                        "%d|%d|%ld", qe.pos, qe.opos,
-                                       (long) time(NULL) - qe.start);
+                                       (long) (time(NULL) - qe.start));
                                res = -1;
                        } else if (qcontinue) {
                                reason = QUEUE_CONTINUE;
@@ -7281,7 +7281,7 @@ stop:
                        }
                } else if (qe.valid_digits) {
                        ast_queue_log(args.queuename, ast_channel_uniqueid(chan), "NONE", "EXITWITHKEY",
-                               "%s|%d|%d|%ld", qe.digits, qe.pos, qe.opos, (long) time(NULL) - qe.start);
+                               "%s|%d|%d|%ld", qe.digits, qe.pos, qe.opos, (long) (time(NULL) - qe.start));
                }
        }