aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/strategies
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/strategies')
-rw-r--r--hicn-light/src/strategies/loadBalancer.c6
-rw-r--r--hicn-light/src/strategies/loadBalancerWithPD.c10
-rw-r--r--hicn-light/src/strategies/rnd.c8
-rw-r--r--hicn-light/src/strategies/rndSegment.c8
4 files changed, 16 insertions, 16 deletions
diff --git a/hicn-light/src/strategies/loadBalancer.c b/hicn-light/src/strategies/loadBalancer.c
index 14e907770..5be6a0182 100644
--- a/hicn-light/src/strategies/loadBalancer.c
+++ b/hicn-light/src/strategies/loadBalancer.c
@@ -78,7 +78,7 @@ StrategyImpl *strategyLoadBalancer_Create() {
strategy->weights_sum = 0.0;
strategy->strategy_state = parcHashMap_Create();
strategy->nexthops = numberSet_Create();
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
StrategyImpl *impl = parcMemory_AllocateAndClear(sizeof(StrategyImpl));
parcAssertNotNull(impl, "parcMemory_AllocateAndClear(%zu) returned NULL",
@@ -170,7 +170,7 @@ static NumberSet *_strategyLoadBalancer_LookupNexthop(
unsigned in_connection = message_GetIngressConnectionId(interestMessage);
PARCUnsigned *in = parcUnsigned_Create(in_connection);
- unsigned mapSize = parcHashMap_Size(lb->strategy_state);
+ unsigned mapSize = (unsigned)parcHashMap_Size(lb->strategy_state);
NumberSet *outList = numberSet_Create();
if ((mapSize == 0) ||
@@ -211,7 +211,7 @@ static NumberSet *_strategyLoadBalancer_ReturnNexthops(StrategyImpl *strategy) {
unsigned _strategyLoadBalancer_CountNexthops(StrategyImpl *strategy) {
StrategyLoadBalancer *lb = (StrategyLoadBalancer *)strategy->context;
- return numberSet_Length(lb->nexthops);
+ return (unsigned)numberSet_Length(lb->nexthops);
}
static void _strategyLoadBalancer_resetState(StrategyImpl *strategy) {
diff --git a/hicn-light/src/strategies/loadBalancerWithPD.c b/hicn-light/src/strategies/loadBalancerWithPD.c
index 1aad8fd89..c9c1479a2 100644
--- a/hicn-light/src/strategies/loadBalancerWithPD.c
+++ b/hicn-light/src/strategies/loadBalancerWithPD.c
@@ -88,7 +88,7 @@ StrategyImpl *strategyLoadBalancerWithPD_Create() {
strategy->min_delay = INT_MAX;
strategy->strategy_state = parcHashMap_Create();
strategy->nexthops = numberSet_Create();
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
StrategyImpl *impl = parcMemory_AllocateAndClear(sizeof(StrategyImpl));
parcAssertNotNull(impl, "parcMemory_AllocateAndClear(%zu) returned NULL",
@@ -128,14 +128,14 @@ static void _update_Stats(StrategyLoadBalancerWithPD *strategy,
}
static void _sendProbes(StrategyLoadBalancerWithPD *strategy) {
- unsigned size = numberSet_Length(strategy->nexthops);
+ unsigned size = (unsigned)numberSet_Length(strategy->nexthops);
for (unsigned i = 0; i < size; i++) {
unsigned nhop = numberSet_GetItem(strategy->nexthops, i);
Connection *conn =
(Connection *)connectionTable_FindById(strategy->connTable, nhop);
if (conn != NULL) {
connection_Probe(conn);
- unsigned delay = connection_GetDelay(conn);
+ unsigned delay = (unsigned)connection_GetDelay(conn);
PARCUnsigned *cid = parcUnsigned_Create(nhop);
StrategyNexthopStateWithPD *elem =
(StrategyNexthopStateWithPD *)parcHashMap_Get(
@@ -249,7 +249,7 @@ static NumberSet *_strategyLoadBalancerWithPD_LookupNexthop(
unsigned in_connection = message_GetIngressConnectionId(interestMessage);
PARCUnsigned *in = parcUnsigned_Create(in_connection);
- unsigned mapSize = parcHashMap_Size(lb->strategy_state);
+ unsigned mapSize = (unsigned)parcHashMap_Size(lb->strategy_state);
NumberSet *outList = numberSet_Create();
if ((mapSize == 0) ||
@@ -294,7 +294,7 @@ static NumberSet *_strategyLoadBalancerWithPD_ReturnNexthops(
unsigned _strategyLoadBalancerWithPD_CountNexthops(StrategyImpl *strategy) {
StrategyLoadBalancerWithPD *lb =
(StrategyLoadBalancerWithPD *)strategy->context;
- return numberSet_Length(lb->nexthops);
+ return (unsigned)numberSet_Length(lb->nexthops);
}
static void _strategyLoadBalancerWithPD_resetState(StrategyImpl *strategy) {
diff --git a/hicn-light/src/strategies/rnd.c b/hicn-light/src/strategies/rnd.c
index 37f3f6f30..35b9e87c6 100644
--- a/hicn-light/src/strategies/rnd.c
+++ b/hicn-light/src/strategies/rnd.c
@@ -68,7 +68,7 @@ StrategyImpl *strategyRnd_Create() {
sizeof(StrategyRnd));
strategy->nexthops = numberSet_Create();
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
StrategyImpl *impl = parcMemory_AllocateAndClear(sizeof(StrategyImpl));
parcAssertNotNull(impl, "parcMemory_AllocateAndClear(%zu) returned NULL",
@@ -86,7 +86,7 @@ strategy_type _strategyRnd_GetStrategy(StrategyImpl *strategy) {
}
static int _select_Nexthop(StrategyRnd *strategy) {
- unsigned len = numberSet_Length(strategy->nexthops);
+ unsigned len = (unsigned)numberSet_Length(strategy->nexthops);
if (len == 0) {
return -1;
}
@@ -108,7 +108,7 @@ static NumberSet *_strategyRnd_LookupNexthop(StrategyImpl *strategy,
StrategyRnd *srnd = (StrategyRnd *)strategy->context;
unsigned in_connection = message_GetIngressConnectionId(interestMessage);
- unsigned nexthopSize = numberSet_Length(srnd->nexthops);
+ unsigned nexthopSize = (unsigned)numberSet_Length(srnd->nexthops);
NumberSet *out = numberSet_Create();
if ((nexthopSize == 0) ||
@@ -139,7 +139,7 @@ static NumberSet *_strategyRnd_ReturnNexthops(StrategyImpl *strategy) {
unsigned _strategyRnd_CountNexthops(StrategyImpl *strategy) {
StrategyRnd *srnd = (StrategyRnd *)strategy->context;
- return numberSet_Length(srnd->nexthops);
+ return (unsigned)numberSet_Length(srnd->nexthops);
}
static void _strategyRnd_AddNexthop(StrategyImpl *strategy,
diff --git a/hicn-light/src/strategies/rndSegment.c b/hicn-light/src/strategies/rndSegment.c
index 2000ed7b7..5ed9bf1a9 100644
--- a/hicn-light/src/strategies/rndSegment.c
+++ b/hicn-light/src/strategies/rndSegment.c
@@ -74,7 +74,7 @@ StrategyImpl *strategyRndSegment_Create() {
strategy->nexthops = numberSet_Create();
strategy->segmentName = NULL;
strategy->last_used_face = 0;
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
StrategyImpl *impl = parcMemory_AllocateAndClear(sizeof(StrategyImpl));
parcAssertNotNull(impl, "parcMemory_AllocateAndClear(%zu) returned NULL",
@@ -93,7 +93,7 @@ strategy_type _strategyRndSegment_GetStrategy(StrategyImpl *strategy) {
}
static int _select_Nexthop(StrategyRndSegment *strategy) {
- unsigned len = numberSet_Length(strategy->nexthops);
+ unsigned len = (unsigned)numberSet_Length(strategy->nexthops);
if (len == 0) {
return -1;
}
@@ -115,7 +115,7 @@ static NumberSet *_strategyRndSegment_LookupNexthop(
StrategyRndSegment *srnd = (StrategyRndSegment *)strategy->context;
unsigned in_connection = message_GetIngressConnectionId(interestMessage);
- unsigned nexthopSize = numberSet_Length(srnd->nexthops);
+ unsigned nexthopSize = (unsigned)numberSet_Length(srnd->nexthops);
NumberSet *out = numberSet_Create();
if ((nexthopSize == 0) ||
@@ -168,7 +168,7 @@ static NumberSet *_strategyRndSegment_ReturnNexthops(StrategyImpl *strategy) {
unsigned _strategyRndSegment_CountNexthops(StrategyImpl *strategy) {
StrategyRndSegment *srnd = (StrategyRndSegment *)strategy->context;
- return numberSet_Length(srnd->nexthops);
+ return (unsigned)numberSet_Length(srnd->nexthops);
}
static void _strategyRndSegment_AddNexthop(StrategyImpl *strategy,