# HG changeset patch # User Sebastien Decugis # Date 1420304157 -28800 # Node ID 38e4a7c318ac98d319e53ac4140cfada567f2b58 # Parent f09f16f432e60397e894bbbbb3b487b196bf8bff Fix a number of compilation warnings diff -r f09f16f432e6 -r 38e4a7c318ac extensions/rt_busypeers/rtbusy.c --- 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 */ diff -r f09f16f432e6 -r 38e4a7c318ac extensions/rt_ignore_dh/rt_ignore_dh.c --- 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)); diff -r f09f16f432e6 -r 38e4a7c318ac extensions/rt_load_balance/rt_load_balance.c --- 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); } diff -r f09f16f432e6 -r 38e4a7c318ac extensions/rt_randomize/rt_randomize.c --- 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 -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; } diff -r f09f16f432e6 -r 38e4a7c318ac libfdcore/CMakeLists.txt --- 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) diff -r f09f16f432e6 -r 38e4a7c318ac libfdproto/CMakeLists.txt --- 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 diff -r f09f16f432e6 -r 38e4a7c318ac libfdproto/dictionary_functions.c --- 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);