Commit 549fb778 authored by Sebastien Decugis's avatar Sebastien Decugis

Fix a number of compilation warnings

parent 3578bbca
......@@ -113,7 +113,7 @@ int rt_busy_process_busy(struct msg ** pmsg, int is_req, DiamId_t sentto, size_t
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 @@ int rt_busy_process_busy(struct msg ** pmsg, int is_req, DiamId_t sentto, size_t
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 */
......
......@@ -137,7 +137,7 @@ static int stow_destination_host(struct msg **msg) {
/* 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));
......
......@@ -68,6 +68,7 @@ static int rt_load_balancing(void * cbdata, struct msg ** pmsg, struct fd_list *
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);
}
......
......@@ -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 @@ static int rt_randomize_entry(char * conffile)
{
/* 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;
}
......
# 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)
......
# 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
......
......@@ -202,7 +202,7 @@ DECLARE_FD_DUMP_PROTOTYPE(fd_dictfct_Address_dump, union avp_value * avp_value)
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment