changeset 1284:38e4a7c318ac

Fix a number of compilation warnings
author Sebastien Decugis <sdecugis@freediameter.net>
date Sun, 04 Jan 2015 00:55:57 +0800
parents f09f16f432e6
children 1e893500dc72
files extensions/rt_busypeers/rtbusy.c extensions/rt_ignore_dh/rt_ignore_dh.c extensions/rt_load_balance/rt_load_balance.c extensions/rt_randomize/rt_randomize.c libfdcore/CMakeLists.txt libfdproto/CMakeLists.txt libfdproto/dictionary_functions.c
diffstat 7 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/rt_busypeers/rtbusy.c	Fri Jan 02 20:37:31 2015 +0100
+++ b/extensions/rt_busypeers/rtbusy.c	Sun Jan 04 00:55:57 2015 +0800
@@ -113,7 +113,7 @@
 			expire.tv_sec += rtbusy_conf.RelayTimeout/1000 + ((expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) / 1000000000LL);
 			expire.tv_nsec = (expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) % 1000000000LL;
 			CHECK_MALLOC_DO( fd_msg_dump_full(&buf, &len, NULL, *pmsg, fd_g_config->cnf_dict, 0, 1), /* nothing */);
-			TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), re-sending: %s", senttolen, sentto,
+			TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), re-sending: %s", (int)senttolen, sentto,
 				     rtbusy_conf.RelayTimeout, buf);
 			free(buf);
 			CHECK_FCT( fd_msg_send_timeout( pmsg, NULL, NULL, rtbusy_expirecb, &expire ) );
@@ -127,7 +127,7 @@
 			size_t len;
 
 			CHECK_MALLOC_DO( fd_msg_dump_full(&buf, &len, NULL, *pmsg, fd_g_config->cnf_dict, 0, 1), /* nothing */);
-			TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), giving up and sending error reply: %s", senttolen, sentto,
+			TRACE_ERROR( "No answer received for message from peer '%.*s' before timeout (%dms), giving up and sending error reply: %s", (int)senttolen, sentto,
 				     rtbusy_conf.RelayTimeout, buf);
 			free(buf);
 			/* We must create an answer */
--- a/extensions/rt_ignore_dh/rt_ignore_dh.c	Fri Jan 02 20:37:31 2015 +0100
+++ b/extensions/rt_ignore_dh/rt_ignore_dh.c	Sun Jan 04 00:55:57 2015 +0800
@@ -137,7 +137,7 @@
 			/* add Proxy-Info->{Proxy-Host, Proxy-State} using Destination-Host information */
 			CHECK_FCT(fd_msg_avp_new(ph_avp_do, 0, &ph_avp));
 			memset(&val, 0, sizeof(val));
-                        val.os.data = fd_g_config->cnf_diamid;
+                        val.os.data = (uint8_t *)(fd_g_config->cnf_diamid);
 			val.os.len = fd_g_config->cnf_diamid_len;
 			CHECK_FCT(fd_msg_avp_setvalue(ph_avp, &val));
 
--- a/extensions/rt_load_balance/rt_load_balance.c	Fri Jan 02 20:37:31 2015 +0100
+++ b/extensions/rt_load_balance/rt_load_balance.c	Sun Jan 04 00:55:57 2015 +0800
@@ -68,6 +68,7 @@
                     load_log++;
                     load /= 2;
                 }
+		score = cand->score;
 		cand->score -= load_log;
 		TRACE_DEBUG(FULL, "evaluated peer `%.*s', score was %d, now %d", (int)cand->diamidlen, cand->diamid, score, cand->score);
 	}
--- a/extensions/rt_randomize/rt_randomize.c	Fri Jan 02 20:37:31 2015 +0100
+++ b/extensions/rt_randomize/rt_randomize.c	Sun Jan 04 00:55:57 2015 +0800
@@ -38,7 +38,7 @@
 
 #include <stdlib.h>
 
-static int seed;
+static unsigned int seed;
 
 static int rt_randomizing(void * cbdata, struct msg ** pmsg, struct fd_list * candidates)
 {
@@ -95,7 +95,7 @@
 {
 	/* Register the callback */
 	CHECK_FCT(fd_rt_out_register(rt_randomizing, NULL, 4, &rt_randomizing_hdl));
-	seed = (int)time(NULL);
+	seed = (unsigned int)time(NULL);
 	TRACE_DEBUG(INFO, "Extension 'Randomizing' initialized");
 	return 0;
 }
--- a/libfdcore/CMakeLists.txt	Fri Jan 02 20:37:31 2015 +0100
+++ b/libfdcore/CMakeLists.txt	Sun Jan 04 00:55:57 2015 +0800
@@ -1,6 +1,9 @@
 # The subproject name
 Project("freeDiameter core library" C)
 
+# Configuration for newer cmake
+cmake_policy(SET CMP0022 OLD)
+
 # Configuration parser
 BISON_FILE(fdd.y)
 FLEX_FILE(fdd.l)
--- a/libfdproto/CMakeLists.txt	Fri Jan 02 20:37:31 2015 +0100
+++ b/libfdproto/CMakeLists.txt	Sun Jan 04 00:55:57 2015 +0800
@@ -1,6 +1,8 @@
 # Name of the subproject
 Project("libfdproto" C)
 
+# Configuration for newer cmake
+cmake_policy(SET CMP0022 OLD)
 
 # List of source files for the library
 SET(LFDPROTO_SRC
--- a/libfdproto/dictionary_functions.c	Fri Jan 02 20:37:31 2015 +0100
+++ b/libfdproto/dictionary_functions.c	Sun Jan 04 00:55:57 2015 +0800
@@ -202,7 +202,7 @@
 			break;
 		case 8:
 			/* E.164 */
-			CHECK_MALLOC_DO( fd_dump_extend(FD_DUMP_STD_PARAMS, "%.*s", avp_value->os.len-2, avp_value->os.data+2), return NULL);
+			CHECK_MALLOC_DO( fd_dump_extend(FD_DUMP_STD_PARAMS, "%.*s", (int)(avp_value->os.len-2), avp_value->os.data+2), return NULL);
 			return *buf;
 		default:
 			CHECK_MALLOC_DO( fd_dump_extend(FD_DUMP_STD_PARAMS, "[unsupported family: 0x%hx]", fam), return NULL);
"Welcome to our mercurial repository"