Fixed more warnings on different platforms.

git-svn-id: http://voip.null.ro/svn/yate@2726 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-06-19 11:58:33 +00:00
parent 86ab316486
commit d095227d30
4 changed files with 26 additions and 14 deletions

View File

@ -1480,7 +1480,7 @@ bool Socket::canSelect(SOCKET handle)
return false;
#ifdef FD_SETSIZE
#ifndef _WINDOWS
if (handle >= FD_SETSIZE)
if (handle >= (SOCKET)FD_SETSIZE)
return false;
#endif
#endif
@ -1494,7 +1494,7 @@ bool Socket::select(bool* readok, bool* writeok, bool* except, struct timeval* t
#ifdef FD_SETSIZE
#ifndef _WINDOWS
static bool localFail = true;
if (m_handle >= FD_SETSIZE) {
if (m_handle >= (SOCKET)FD_SETSIZE) {
if (localFail) {
localFail = false;
Debug(DebugGoOn,"Socket::select: handle %d larger than compiled in maximum %d",

View File

@ -148,14 +148,18 @@ IAXTransaction* IAXEngine::addFrame(const SocketAddr& addr, IAXFrame* frame)
return 0;
case IAXControl::FwDownl:
default:
#ifdef DEBUG
if (frame->fullFrame()) {
if (frame->fullFrame()->destCallNo())
XDebug(this,DebugAll,"Unmatched Frame(%u,%u) for (%u,%u)",
frame->type(),frame->fullFrame()->subclass(),frame->fullFrame()->destCallNo(),frame->fullFrame()->sourceCallNo());
else
DDebug(this,DebugAll,"Unsupported incoming transaction Frame(%u,%u). Source call no: %u",
if (frame->fullFrame()->destCallNo() == 0)
Debug(this,DebugAll,"Unsupported incoming transaction Frame(%u,%u). Source call no: %u",
frame->type(),frame->fullFrame()->subclass(),frame->fullFrame()->sourceCallNo());
#ifdef XDEBUG
else
Debug(this,DebugAll,"Unmatched Frame(%u,%u) for (%u,%u)",
frame->type(),frame->fullFrame()->subclass(),frame->fullFrame()->destCallNo(),frame->fullFrame()->sourceCallNo());
#endif
}
#endif
return 0;
}
// Generate local number
@ -239,9 +243,11 @@ bool IAXEngine::writeSocket(const void* buf, int len, const SocketAddr& addr, IA
if (!m_socket.canRetry())
Debug(this,DebugWarn,"Socket write error: %s (%d)",
::strerror(m_socket.error()),m_socket.error());
#ifdef DEBUG
else
DDebug(this,DebugMild,"Socket temporary unavailable: %s (%d)",
Debug(this,DebugMild,"Socket temporary unavailable: %s (%d)",
::strerror(m_socket.error()),m_socket.error());
#endif
return false;
}
return true;
@ -432,11 +438,13 @@ bool IAXEngine::acceptFormatAndCapability(IAXTransaction* trans)
Debug(this,DebugAll,"acceptFormatAndCapability. Received: Format: %u(%s). Capabilities: '%s'.",
format,IAXFormat::audioText(format),rec.c_str());
}
#endif //XDEBUG
#endif
// Valid capability ?
if (!capability) {
#ifdef DEBUG
if (!trans->outgoing())
XDebug(this,DebugAll,"acceptFormatAndCapability. No capabilities received.");
Debug(this,DebugNote,"acceptFormatAndCapability. No capabilities received.");
#endif
return false;
}
for (;;) {
@ -457,10 +465,10 @@ bool IAXEngine::acceptFormatAndCapability(IAXTransaction* trans)
format = IAXFormat::audioData[i].value;
break;
}
XDebug(this,DebugAll,"acceptFormatAndCapability. Unable to choose a format.");
DDebug(this,DebugNote,"acceptFormatAndCapability. Unable to choose a format.");
return false;
}
XDebug(this,DebugAll,"acceptFormatAndCapability. Format %u: '%s'.",
DDebug(this,DebugAll,"acceptFormatAndCapability. Format %u: '%s'.",
format,IAXFormat::audioText(format));
trans->m_format = format;
trans->m_capability = capability;

View File

@ -327,9 +327,11 @@ IAXTransaction* IAXTransaction::sendMedia(const DataBlock& data, u_int32_t forma
format,m_formatOut,this);
m_formatOut = format;
}
#ifdef DEBUG
else
DDebug(m_engine,DebugNote,"Transaction(%u,%u) Time to send VOICE: ts=%u last=%u [%p]",
Debug(m_engine,DebugNote,"Transaction(%u,%u) Time to send VOICE: ts=%u last=%u [%p]",
localCallNo(),remoteCallNo(),ts,m_lastMiniFrameOut,this);
#endif
m_lastMiniFrameOut = (u_int16_t)ts;
postFrame(IAXFrame::Voice,m_formatOut,data.data(),data.length(),ts,true);
return this;

View File

@ -1605,8 +1605,10 @@ void YIAXConnection::handleEvent(IAXEvent* event)
event->getList().getString(IAXInfoElement::CAUSE,m_reason);
DDebug(this,DebugCall,"REJECT/HANGUP: '%s' [%p]",m_reason.c_str(),this);
}
#ifdef DEBUG
else
DDebug(this,DebugCall,"REJECT/HANGUP [%p]",this);
Debug(this,DebugCall,"REJECT/HANGUP [%p]",this);
#endif
break;
case IAXEvent::Timeout:
DDebug(this,DebugNote,"TIMEOUT. Transaction: %u,%u, Frame: %u,%u [%p]",