[asterisk-commits] mjordan: branch 13 r433269 - in /branches/13: ./ apps/ funcs/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 22 18:58:26 CDT 2015


Author: mjordan
Date: Sun Mar 22 18:58:23 2015
New Revision: 433269

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=433269
Log:
Fix compilations errors on 64-bit OpenBSD systems

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)
........

Merged revisions 433268 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    branches/13/   (props changed)
    branches/13/apps/app_queue.c
    branches/13/funcs/func_cdr.c
    branches/13/main/cdr.c
    branches/13/main/cli.c
    branches/13/main/manager.c
    branches/13/main/rtp_engine.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/13/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/apps/app_queue.c?view=diff&rev=433269&r1=433268&r2=433269
==============================================================================
--- branches/13/apps/app_queue.c (original)
+++ branches/13/apps/app_queue.c Sun Mar 22 18:58:23 2015
@@ -5243,7 +5243,7 @@
 
 			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;
 			}
@@ -5661,8 +5661,8 @@
 
 	ast_queue_log(queue_data->queue->name, caller->uniqueid, queue_data->member->membername, "ATTENDEDTRANSFER", "%s|%ld|%ld|%d",
 			ast_str_buffer(transfer_str),
-			(long) queue_data->starttime - queue_data->holdstart,
-			(long) time(NULL) - queue_data->starttime, queue_data->caller_pos);
+			(long) (queue_data->starttime - queue_data->holdstart),
+			(long) (time(NULL) - queue_data->starttime), queue_data->caller_pos);
 }
 
 /*!
@@ -5748,8 +5748,8 @@
 	ast_queue_log(queue_data->queue->name, caller_snapshot->uniqueid, queue_data->member->membername,
 			"BLINDTRANSFER", "%s|%s|%ld|%ld|%d",
 			exten, context,
-			(long) queue_data->starttime - queue_data->holdstart,
-			(long) time(NULL) - queue_data->starttime, queue_data->caller_pos);
+			(long) (queue_data->starttime - queue_data->holdstart),
+			(long) (time(NULL) - queue_data->starttime), queue_data->caller_pos);
 
 	send_agent_complete(queue_data->queue->name, caller_snapshot, member_snapshot, queue_data->member,
 			queue_data->holdstart, queue_data->starttime, TRANSFER);
@@ -6616,7 +6616,7 @@
 			} 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_channel_publish_dial(qe->chan, peer, member->interface, ast_hangup_cause_to_dial_status(ast_channel_hangupcause(peer)));
 				ast_autoservice_chan_hangup_peer(qe->chan, peer);
@@ -6664,7 +6664,7 @@
 		/* 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);
 		}
@@ -6790,14 +6790,14 @@
 			}
 		}
 		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));
 
 		blob = ast_json_pack("{s: s, s: s, s: s, s: i, s: i}",
 				     "Queue", queuename,
 				     "Interface", member->interface,
 				     "MemberName", member->membername,
-				     "HoldTime", (long) time(NULL) - qe->start,
+				     "HoldTime", (long) (time(NULL) - qe->start),
 				     "RingTime", (long)(orig - to > 0 ? (orig - to) / 1000 : 0));
 		queue_publish_multi_channel_blob(qe->chan, peer, queue_agent_connect_type(), blob);
 
@@ -7857,7 +7857,7 @@
 			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;
 		}
 
@@ -7923,7 +7923,7 @@
 			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;
 		}
 
@@ -7952,7 +7952,7 @@
 				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;
@@ -7960,7 +7960,7 @@
 			}
 		} 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));
 		}
 	}
 

Modified: branches/13/funcs/func_cdr.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/funcs/func_cdr.c?view=diff&rev=433269&r1=433268&r2=433269
==============================================================================
--- branches/13/funcs/func_cdr.c (original)
+++ branches/13/funcs/func_cdr.c Sun Mar 22 18:58:23 2015
@@ -284,14 +284,16 @@
 			struct timeval fmt_time;
 			struct ast_tm tm;
 			/* tv_usec is suseconds_t, which could be int or long */
+			long int tv_sec;
 			long int tv_usec;
 
-			if (sscanf(tempbuf, "%ld.%ld", &fmt_time.tv_sec, &tv_usec) != 2) {
+			if (sscanf(tempbuf, "%ld.%ld", &tv_sec, &tv_usec) != 2) {
 				ast_log(AST_LOG_WARNING, "Unable to parse %s (%s) from the CDR for channel %s\n",
 					args.variable, tempbuf, ast_channel_name(payload->chan));
 				return;
 			}
-			if (fmt_time.tv_sec) {
+			if (tv_sec) {
+				fmt_time.tv_sec = tv_sec;
 				fmt_time.tv_usec = tv_usec;
 				ast_localtime(&fmt_time, &tm, NULL);
 				ast_strftime(tempbuf, sizeof(tempbuf), "%Y-%m-%d %T", &tm);

Modified: branches/13/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/cdr.c?view=diff&rev=433269&r1=433268&r2=433269
==============================================================================
--- branches/13/main/cdr.c (original)
+++ branches/13/main/cdr.c Sun Mar 22 18:58:23 2015
@@ -1257,11 +1257,11 @@
 	/* tv_usec is suseconds_t, which could be int or long */
 	ast_debug(1, "Finalized CDR for %s - start %ld.%06ld answer %ld.%06ld end %ld.%06ld dispo %s\n",
 			cdr->party_a.snapshot->name,
-			cdr->start.tv_sec,
+			(long)cdr->start.tv_sec,
 			(long)cdr->start.tv_usec,
-			cdr->answer.tv_sec,
+			(long)cdr->answer.tv_sec,
 			(long)cdr->answer.tv_usec,
-			cdr->end.tv_sec,
+			(long)cdr->end.tv_sec,
 			(long)cdr->end.tv_usec,
 			ast_cdr_disp2str(cdr->disposition));
 }
@@ -1296,7 +1296,7 @@
 		cdr->answer = ast_tvnow();
 		/* tv_usec is suseconds_t, which could be int or long */
 		CDR_DEBUG(mod_cfg, "%p - Set answered time to %ld.%06ld\n", cdr,
-			cdr->answer.tv_sec,
+			(long)cdr->answer.tv_sec,
 			(long)cdr->answer.tv_usec);
 	}
 }

Modified: branches/13/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/cli.c?view=diff&rev=433269&r1=433268&r2=433269
==============================================================================
--- branches/13/main/cli.c (original)
+++ branches/13/main/cli.c Sun Mar 22 18:58:23 2015
@@ -1645,7 +1645,7 @@
 		ast_str_buffer(write_transpath),
 		ast_str_strlen(read_transpath) ? "Yes" : "No",
 		ast_str_buffer(read_transpath),
-		ast_channel_whentohangup(chan)->tv_sec,
+		(long)ast_channel_whentohangup(chan)->tv_sec,
 		cdrtime,
 		bridge ? bridge->uniqueid : "(Not bridged)",
 		ast_channel_context(chan),

Modified: branches/13/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/manager.c?view=diff&rev=433269&r1=433268&r2=433269
==============================================================================
--- branches/13/main/manager.c (original)
+++ branches/13/main/manager.c Sun Mar 22 18:58:23 2015
@@ -4464,7 +4464,7 @@
 			S_OR(ast_channel_dialed(chan)->number.str, ""),
 			S_COR(ast_channel_connected_effective_id(chan).number.valid, ast_channel_connected_effective_id(chan).number.str, "<unknown>"),
 			S_COR(ast_channel_connected_effective_id(chan).name.valid, ast_channel_connected_effective_id(chan).name.str, "<unknown>"),
-			ast_channel_whentohangup(chan)->tv_sec,
+			(long)ast_channel_whentohangup(chan)->tv_sec,
 			bridge ? bridge->uniqueid : "",
 			ast_channel_linkedid(chan),
 			ast_channel_appl(chan),

Modified: branches/13/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/rtp_engine.c?view=diff&rev=433269&r1=433268&r2=433269
==============================================================================
--- branches/13/main/rtp_engine.c (original)
+++ branches/13/main/rtp_engine.c Sun Mar 22 18:58:23 2015
@@ -1947,7 +1947,7 @@
 	if (payload->report->type == AST_RTP_RTCP_SR) {
 		char sec[32];
 		char usec[32];
-		snprintf(sec, sizeof(sec), "%lu", payload->report->sender_information.ntp_timestamp.tv_sec);
+		snprintf(sec, sizeof(sec), "%lu", (unsigned long)payload->report->sender_information.ntp_timestamp.tv_sec);
 		snprintf(usec, sizeof(usec), "%lu", (unsigned long)payload->report->sender_information.ntp_timestamp.tv_usec);
 		json_rtcp_sender_info = ast_json_pack("{s: s, s: s, s: i, s: i, s: i}",
 				"ntp_timestamp_sec", sec,




More information about the asterisk-commits mailing list