From 0bf41f28de028c14cc809fc61521b43a493078d2 Mon Sep 17 00:00:00 2001 From: nnposter Date: Sat, 23 Sep 2017 23:37:18 +0000 Subject: [PATCH] Adds explicit type casting to silence MSVC compiler warnings about "possible loss of data". Fixes #995 (together with r37008, r37009) --- FPEngine.cc | 2 +- lpeg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FPEngine.cc b/FPEngine.cc index 98aa44b41..775ea70a9 100644 --- a/FPEngine.cc +++ b/FPEngine.cc @@ -320,7 +320,7 @@ int FPNetworkControl::cc_report_drop() { value of ssthresh is held constant. */ int probes_outstanding = this->probes_sent - this->responses_recv - this->probes_timedout; - this->cc_ssthresh = MAX(probes_outstanding, OSSCAN_INITIAL_CWND); + this->cc_ssthresh = (float)MAX(probes_outstanding, OSSCAN_INITIAL_CWND); this->cc_cwnd = OSSCAN_INITIAL_CWND; return OP_SUCCESS; } diff --git a/lpeg.c b/lpeg.c index 2c34c6fe4..8cf871738 100644 --- a/lpeg.c +++ b/lpeg.c @@ -2178,7 +2178,7 @@ static void fixonecall (lua_State *L, int postable, TTree *g, TTree *t) { int n; lua_rawgeti(L, -1, t->key); /* get rule's name */ lua_gettable(L, postable); /* query name in position table */ - n = lua_tonumber(L, -1); /* get (absolute) position */ + n = (int)lua_tonumber(L, -1); /* get (absolute) position */ lua_pop(L, 1); /* remove position */ if (n == 0) { /* no position? */ lua_rawgeti(L, -1, t->key); /* get rule's name again */