Fixed several issues exposed by the Microsoft compiler.

git-svn-id: http://yate.null.ro/svn/yate/trunk@6459 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2021-02-09 14:08:19 +00:00
parent b6e3dc4304
commit 51b6cf6bfa
8 changed files with 16 additions and 10 deletions

View File

@ -327,7 +327,7 @@ bool UChar::decode(DataBlock& buff, Endianness order, uint32_t maxChar)
len = len >> 1;
if (!decode(in,len,order,maxChar))
return false;
buff.cut(-(buff.length() - len * 2));
buff.cut(-(int)(buff.length() - len * 2));
return true;
}

View File

@ -638,7 +638,7 @@ bool RTPSender::sendEventData(unsigned int timestamp)
if (m_debugEvent)
TraceDebug(m_traceId,dbg(),m_debugDataLevel,
"RTP send event=%d ts=%u event_ts=%u duration=%u ev_duration=%u ev_seq=%u end=%s [%p]",
m_evNum,timestamp,m_evTs,duration,m_evTime,m_evSeq,String::boolText(end),this);
m_evNum,timestamp,m_evTs,duration,m_evTime,m_evSeq,String::boolText(0 != end),this);
if (end)
duration = m_evTime;
char buf[4];

View File

@ -388,7 +388,11 @@ bool ExpEvaluator::getNumber(ParsePoint& expr)
#undef DLONG_MAX
expr += str.length();
ExpOperation* op = addOpcode(str);
#ifdef _WINDOWS
op->m_number = (int64_t)((val >= 0) ? (val + 0.5) : (val - 0.5));
#else
op->m_number = ::round(val);
#endif
op->m_isNumber = true;
DDebug(this,DebugAll,"Fake float %s ~ " FMT64,str.safe(),op->m_number);
return true;

View File

@ -3438,9 +3438,11 @@ unsigned int JsRunner::currentLineNo() const
const String& JsRunner::currentFileName(bool wholePath) const
{
static const String s_unk("???");
const ExpOperation* o = getCurrentOpCode();
if (!(o && code()))
return YSTRING("???");
return s_unk;
return (static_cast<const JsCode*>(code()))->getFileName(o->lineNumber(),wholePath);
}

View File

@ -194,7 +194,7 @@ static void dumpRecursiveObj(const GenObject* obj, String& buf, unsigned int dep
if (depth && !isProto && ((isFunc && (0 == (flags & JsObject::DumpFunc))) ||
(!isFunc && (0 == (flags & JsObject::DumpProp)))))
return;
bool dumpType = flags & JsObject::DumpType;
bool dumpType = 0 != (flags & JsObject::DumpType);
if (nstr) {
str << "'" << nstr->name() << "'";
// Nicely dump property value if dumping props only and type is not shown

View File

@ -84,7 +84,7 @@ bool SDPMedia::sameAs(const SDPMedia* other, bool ignorePort, bool checkStarted)
// Check format
ObjList* lst = m.formats().split(',',false);
bool found = lst->find(m_format);
bool found = (0 != lst->find(m_format));
TelEngine::destruct(lst);
if (!found) {
XDebug(DebugAll,"SDPMedia::sameAs(%p) format='%s' other_formats='%s': not found [%p]",

View File

@ -6385,7 +6385,7 @@ YateSIPConnection::YateSIPConnection(Message& msg, const String& uri, const char
m_uri = tmp;
m_uri.parse();
sips(m_uri.getProtocol() == YSTRING("sips"));
if (!setParty(msg,false,"o",m_uri.getHost(),m_uri.getPort(),this) && line) {
if (!setParty(msg,false,"o",m_uri.getHost(),m_uri.getPort(),true) && line) {
SIPParty* party = line->party();
setParty(party);
TelEngine::destruct(party);
@ -6393,7 +6393,7 @@ YateSIPConnection::YateSIPConnection(Message& msg, const String& uri, const char
// No party for SIPS and we don't have transport related params
// Force party creation: this will force used protocol to TLS
if (!m_party && sips() && !haveTransParams(msg,"o"))
setParty(msg,true,"o",m_uri.getHost(),m_uri.getPort(),this);
setParty(msg,true,"o",m_uri.getHost(),m_uri.getPort(),true);
SIPMessage* m = new SIPMessage("INVITE",m_uri);
m->dontSend(m_stopOCall);
m->msgTraceId = m_traceId;
@ -8195,7 +8195,7 @@ bool YateSIPConnection::callPrerouted(Message& msg, bool handled)
bool ok = Channel::callPrerouted(msg,handled);
m_autoChangeParty = msg.getBoolValue(YSTRING("iautochangeparty"),m_autoChangeParty);
if (msg.getBoolValue(YSTRING("ioutbound_party")))
ok = setParty(msg,true,"i",String::empty(),0,this) && ok;
ok = setParty(msg,true,"i",String::empty(),0,true) && ok;
return ok;
}

View File

@ -43,7 +43,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".,..,..\libs\yscript,..\libs\yasn"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;LIBYSCRIPT_EXPORTS;LIBYASN_EXPORTS"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CRT_SECURE_NO_DEPRECATE;LIBYSCRIPT_EXPORTS;LIBYASN_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -130,7 +130,7 @@
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories=".,..,..\libs\yscript,..\libs\yasn"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;LIBYSCRIPT_EXPORTS;LIBYASN_EXPORTS"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CRT_SECURE_NO_DEPRECATE;LIBYSCRIPT_EXPORTS;LIBYASN_EXPORTS"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"