Resolve more compiler warnings on FreeBSD.
authorRussell Bryant <russell@russellbryant.com>
Sat, 20 Mar 2010 12:03:07 +0000 (12:03 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 20 Mar 2010 12:03:07 +0000 (12:03 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253540 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_pgsql.c
cel/cel_pgsql.c
main/cel.c
main/features.c
main/manager.c
main/stdtime/localtime.c
main/tcptls.c
main/test.c

index c3f17d4..eae0926 100644 (file)
@@ -163,7 +163,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(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 @@ static int pgsql_log(struct ast_cdr *cdr)
                        } 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 @@ static int pgsql_log(struct ast_cdr *cdr)
                        } 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);
index cdb1d2a..1765487 100644 (file)
@@ -166,7 +166,7 @@ static void pgsql_log(const struct ast_event *event, void *userdata)
                        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",
index 9fe9993..0e08e95 100644 (file)
@@ -421,7 +421,7 @@ struct ast_channel *ast_cel_fabricate_channel_from_event(const struct ast_event
        }
 
        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;
index 5a2bb02..44daf37 100644 (file)
@@ -30,6 +30,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/_private.h"
 
 #include <pthread.h>
+#include <signal.h>
 #include <sys/time.h>
 #include <sys/signal.h>
 #include <netinet/in.h>
index fdcf2bb..f811987 100644 (file)
@@ -2159,7 +2159,7 @@ static int action_ping(struct mansession *s, const struct message *m)
                "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;
 }
 
index 4440a55..836ed21 100644 (file)
@@ -48,6 +48,7 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
+#include <signal.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <float.h>
index 5c419c4..8c95502 100644 (file)
@@ -33,6 +33,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <fcntl.h>
 #endif
 
+#include <signal.h>
 #include <sys/signal.h>
 
 #include "asterisk/compat.h"
index c5223e6..766775c 100644 (file)
@@ -848,7 +848,7 @@ static char *test_cli_generate_results(struct ast_cli_entry *e, int cmd, struct
                        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);
                }