[asterisk-commits] eliel: branch group/data_api_gsoc2009 r253708 - in /team/group/data_api_gsoc2...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 21 17:49:33 CDT 2010


Author: eliel
Date: Sun Mar 21 17:49:24 2010
New Revision: 253708

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=253708
Log:
Merged revisions 253536-253540,253579 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r253536 | russell | 2010-03-20 07:33:30 -0400 (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 07:39:39 -0400 (Sat, 20 Mar 2010) | 2 lines
  
  Resolve a compiler warning on FreeBSD.
........
  r253538 | russell | 2010-03-20 07:43:08 -0400 (Sat, 20 Mar 2010) | 2 lines
  
  Resolve compiler warnings on FreeBSD.
........
  r253539 | russell | 2010-03-20 07:47:40 -0400 (Sat, 20 Mar 2010) | 2 lines
  
  Include sys/wait.h on FreeBSD to get the WEXITSTATUS() macro.
........
  r253540 | russell | 2010-03-20 08:03:07 -0400 (Sat, 20 Mar 2010) | 2 lines
  
  Resolve more compiler warnings on FreeBSD.
........
  r253579 | russell | 2010-03-20 12:50:38 -0400 (Sat, 20 Mar 2010) | 5 lines
  
  Fix memory corruption found by unit tests.
  
  ast_str_reset() was being called on a potentially uninitialized pointer.
  Valgrind is my hero, once again.
........

Modified:
    team/group/data_api_gsoc2009/   (props changed)
    team/group/data_api_gsoc2009/apps/app_dial.c
    team/group/data_api_gsoc2009/apps/app_followme.c
    team/group/data_api_gsoc2009/apps/app_voicemail.c
    team/group/data_api_gsoc2009/cdr/cdr_pgsql.c
    team/group/data_api_gsoc2009/cel/cel_pgsql.c
    team/group/data_api_gsoc2009/channels/chan_dahdi.c
    team/group/data_api_gsoc2009/funcs/func_strings.c
    team/group/data_api_gsoc2009/main/cel.c
    team/group/data_api_gsoc2009/main/features.c
    team/group/data_api_gsoc2009/main/manager.c
    team/group/data_api_gsoc2009/main/stdtime/localtime.c
    team/group/data_api_gsoc2009/main/tcptls.c
    team/group/data_api_gsoc2009/main/test.c
    team/group/data_api_gsoc2009/pbx/pbx_dundi.c

Propchange: team/group/data_api_gsoc2009/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Mar 21 17:49:24 2010
@@ -1,1 +1,1 @@
-/trunk:1-253530
+/trunk:1-253707

Modified: team/group/data_api_gsoc2009/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/apps/app_dial.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/apps/app_dial.c (original)
+++ team/group/data_api_gsoc2009/apps/app_dial.c Sun Mar 21 17:49:24 2010
@@ -1570,12 +1570,12 @@
 
 	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);

Modified: team/group/data_api_gsoc2009/apps/app_followme.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/apps/app_followme.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/apps/app_followme.c (original)
+++ team/group/data_api_gsoc2009/apps/app_followme.c Sun Mar 21 17:49:24 2010
@@ -990,12 +990,12 @@
 
 	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);

Modified: team/group/data_api_gsoc2009/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/apps/app_voicemail.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/apps/app_voicemail.c (original)
+++ team/group/data_api_gsoc2009/apps/app_voicemail.c Sun Mar 21 17:49:24 2010
@@ -94,6 +94,9 @@
 #include <sys/mman.h>
 #include <time.h>
 #include <dirent.h>
+#if defined(__FreeBSD__)
+#include <sys/wait.h>
+#endif
 
 #include "asterisk/logger.h"
 #include "asterisk/lock.h"

Modified: team/group/data_api_gsoc2009/cdr/cdr_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/cdr/cdr_pgsql.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/cdr/cdr_pgsql.c (original)
+++ team/group/data_api_gsoc2009/cdr/cdr_pgsql.c Sun Mar 21 17:49:24 2010
@@ -163,7 +163,7 @@
 			if (strcmp(cur->name, "start") == 0 || strcmp(cur->name, "calldate") == 0) {
 				if (strncmp(cur->type, "int", 3) == 0) {
 					LENGTHEN_BUF2(13);
-					ast_str_append(&sql2, 0, "%s%ld", first ? "" : ",", cdr->start.tv_sec);
+					ast_str_append(&sql2, 0, "%s%ld", first ? "" : ",", (long) cdr->start.tv_sec);
 				} else if (strncmp(cur->type, "float", 5) == 0) {
 					LENGTHEN_BUF2(31);
 					ast_str_append(&sql2, 0, "%s%f", first ? "" : ",", (double)cdr->start.tv_sec + (double)cdr->start.tv_usec / 1000000.0);
@@ -177,7 +177,7 @@
 			} else if (strcmp(cur->name, "answer") == 0) {
 				if (strncmp(cur->type, "int", 3) == 0) {
 					LENGTHEN_BUF2(13);
-					ast_str_append(&sql2, 0, "%s%ld", first ? "" : ",", cdr->answer.tv_sec);
+					ast_str_append(&sql2, 0, "%s%ld", first ? "" : ",", (long) cdr->answer.tv_sec);
 				} else if (strncmp(cur->type, "float", 5) == 0) {
 					LENGTHEN_BUF2(31);
 					ast_str_append(&sql2, 0, "%s%f", first ? "" : ",", (double)cdr->answer.tv_sec + (double)cdr->answer.tv_usec / 1000000.0);
@@ -191,7 +191,7 @@
 			} else if (strcmp(cur->name, "end") == 0) {
 				if (strncmp(cur->type, "int", 3) == 0) {
 					LENGTHEN_BUF2(13);
-					ast_str_append(&sql2, 0, "%s%ld", first ? "" : ",", cdr->end.tv_sec);
+					ast_str_append(&sql2, 0, "%s%ld", first ? "" : ",", (long) cdr->end.tv_sec);
 				} else if (strncmp(cur->type, "float", 5) == 0) {
 					LENGTHEN_BUF2(31);
 					ast_str_append(&sql2, 0, "%s%f", first ? "" : ",", (double)cdr->end.tv_sec + (double)cdr->end.tv_usec / 1000000.0);

Modified: team/group/data_api_gsoc2009/cel/cel_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/cel/cel_pgsql.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/cel/cel_pgsql.c (original)
+++ team/group/data_api_gsoc2009/cel/cel_pgsql.c Sun Mar 21 17:49:24 2010
@@ -166,7 +166,7 @@
 			if (strcmp(cur->name, "eventtime") == 0) {
 				if (strncmp(cur->type, "int", 3) == 0) {
 					LENGTHEN_BUF2(13);
-					ast_str_append(&sql2, 0, "%s%ld", SEP, record.event_time.tv_sec);
+					ast_str_append(&sql2, 0, "%s%ld", SEP, (long) record.event_time.tv_sec);
 				} else if (strncmp(cur->type, "float", 5) == 0) {
 					LENGTHEN_BUF2(31);
 					ast_str_append(&sql2, 0, "%s%f",

Modified: team/group/data_api_gsoc2009/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/channels/chan_dahdi.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/channels/chan_dahdi.c (original)
+++ team/group/data_api_gsoc2009/channels/chan_dahdi.c Sun Mar 21 17:49:24 2010
@@ -50,8 +50,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
-#include <values.h>
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__FreeBSD__)
 #include <pthread.h>
 #include <signal.h>
 #else
@@ -4203,7 +4202,7 @@
 {
 	float neg;
 	float shallow, steep;
-	float max = MAXSHORT;
+	float max = SHRT_MAX;
 	
 	neg = (sample < 0 ? -1 : 1);
 	steep = drc*sample;

Modified: team/group/data_api_gsoc2009/funcs/func_strings.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/funcs/func_strings.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/funcs/func_strings.c (original)
+++ team/group/data_api_gsoc2009/funcs/func_strings.c Sun Mar 21 17:49:24 2010
@@ -525,7 +525,7 @@
 
 	flen = strlen(args.fieldvalue);
 
-	ast_str_reset(result);
+	ast_str_reset(*result_ptr);
 	/* Enough space for any result */
 	if (len > -1) {
 		ast_str_make_space(result_ptr, len ? len : ast_str_strlen(orig_list) + 1);

Modified: team/group/data_api_gsoc2009/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/main/cel.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/main/cel.c (original)
+++ team/group/data_api_gsoc2009/main/cel.c Sun Mar 21 17:49:24 2010
@@ -421,7 +421,7 @@
 	}
 
 	if (ast_strlen_zero(cel_dateformat)) {
-		snprintf(timebuf, sizeof(timebuf), "%ld.%06ld", record.event_time.tv_sec,
+		snprintf(timebuf, sizeof(timebuf), "%ld.%06ld", (long) record.event_time.tv_sec,
 				(long) record.event_time.tv_usec);
 	} else {
 		struct ast_tm tm;

Modified: team/group/data_api_gsoc2009/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/main/features.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/main/features.c (original)
+++ team/group/data_api_gsoc2009/main/features.c Sun Mar 21 17:49:24 2010
@@ -30,6 +30,7 @@
 #include "asterisk/_private.h"
 
 #include <pthread.h>
+#include <signal.h>
 #include <sys/time.h>
 #include <sys/signal.h>
 #include <netinet/in.h>

Modified: team/group/data_api_gsoc2009/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/main/manager.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/main/manager.c (original)
+++ team/group/data_api_gsoc2009/main/manager.c Sun Mar 21 17:49:24 2010
@@ -2159,7 +2159,7 @@
 		"Ping: Pong\r\n"
 		"Timestamp: %ld.%06lu\r\n"
 		"\r\n",
-		now.tv_sec, (unsigned long) now.tv_usec);
+		(long) now.tv_sec, (unsigned long) now.tv_usec);
 	return 0;
 }
 

Modified: team/group/data_api_gsoc2009/main/stdtime/localtime.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/main/stdtime/localtime.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/main/stdtime/localtime.c (original)
+++ team/group/data_api_gsoc2009/main/stdtime/localtime.c Sun Mar 21 17:49:24 2010
@@ -48,6 +48,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
+#include <signal.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <float.h>

Modified: team/group/data_api_gsoc2009/main/tcptls.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/main/tcptls.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/main/tcptls.c (original)
+++ team/group/data_api_gsoc2009/main/tcptls.c Sun Mar 21 17:49:24 2010
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 #endif
 
+#include <signal.h>
 #include <sys/signal.h>
 
 #include "asterisk/compat.h"

Modified: team/group/data_api_gsoc2009/main/test.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/main/test.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/main/test.c (original)
+++ team/group/data_api_gsoc2009/main/test.c Sun Mar 21 17:49:24 2010
@@ -848,7 +848,7 @@
 			if (!(buf = ast_str_create(256))) {
 				return NULL;
 			}
-			ast_str_set(&buf, 0, "%s/asterisk_test_results-%ld.%s", ast_config_AST_LOG_DIR, time.tv_sec, type);
+			ast_str_set(&buf, 0, "%s/asterisk_test_results-%ld.%s", ast_config_AST_LOG_DIR, (long) time.tv_sec, type);
 
 			file = ast_str_buffer(buf);
 		}

Modified: team/group/data_api_gsoc2009/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/team/group/data_api_gsoc2009/pbx/pbx_dundi.c?view=diff&rev=253708&r1=253707&r2=253708
==============================================================================
--- team/group/data_api_gsoc2009/pbx/pbx_dundi.c (original)
+++ team/group/data_api_gsoc2009/pbx/pbx_dundi.c Sun Mar 21 17:49:24 2010
@@ -40,6 +40,7 @@
 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__)
 #include <net/if_dl.h>
 #include <ifaddrs.h>
+#include <signal.h>
 #endif
 
 #include "asterisk/file.h"




More information about the asterisk-commits mailing list