Silenced several benign warnings.

git-svn-id: http://yate.null.ro/svn/yate/trunk@1600 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2008-01-08 13:05:34 +00:00
parent dabd23216d
commit 85a2f72b07
13 changed files with 23 additions and 23 deletions

View File

@ -338,7 +338,7 @@ IAXTransaction* IAXTransaction::sendMedia(const DataBlock& data, u_int32_t forma
if (m_trunkFrame) if (m_trunkFrame)
m_trunkFrame->add(localCallNo(),data,m_lastMiniFrameOut); m_trunkFrame->add(localCallNo(),data,m_lastMiniFrameOut);
else { else {
unsigned char b[4] = {localCallNo() >> 8,localCallNo(),m_lastMiniFrameOut >> 8,m_lastMiniFrameOut}; unsigned char b[4] = {localCallNo() >> 8,localCallNo() & 0xff,m_lastMiniFrameOut >> 8,m_lastMiniFrameOut & 0xff};
DataBlock buf(b,4); DataBlock buf(b,4);
buf += data; buf += data;
m_engine->writeSocket(buf.data(),buf.length(),remoteAddr()); m_engine->writeSocket(buf.data(),buf.length(),remoteAddr());

View File

@ -719,7 +719,7 @@ bool JBComponentStream::addEventNotify(JBEvent::Type type,
{ {
Lock lock(this); Lock lock(this);
XMLElement* e = 0; XMLElement* e = 0;
bool raise = (element->id()); bool raise = !element->id().null();
if (raise) { if (raise) {
e = element->release(); e = element->release();
JBEvent* ev = new JBEvent(type,this,e,&(element->id())); JBEvent* ev = new JBEvent(type,this,e,&(element->id()));

View File

@ -454,7 +454,7 @@ JGEvent* JGSession::processEvent(JBEvent* jbev, u_int64_t time)
JGEvent* event = 0; JGEvent* event = 0;
// Process state Ending // Process state Ending
if (state() == Ending) { if (state() == Ending) {
bool response = isResponse(jbev); bool response = isResponse(jbev) != 0;
if (response || time > m_timeout) { if (response || time > m_timeout) {
DDebug(m_engine,DebugAll, DDebug(m_engine,DebugAll,
"Session. Terminated in state Ending. Reason: '%s'. [%p]", "Session. Terminated in state Ending. Reason: '%s'. [%p]",

View File

@ -1443,7 +1443,7 @@ public:
* @return True if the resource has the required capability. * @return True if the resource has the required capability.
*/ */
inline bool hasCap(Capability capability) const inline bool hasCap(Capability capability) const
{ return (m_capability & capability); } { return (m_capability & capability) != 0; }
/** /**
* Update resource from a presence element. * Update resource from a presence element.
@ -1658,14 +1658,14 @@ public:
* @return True if the local user is subscribed to the remote one. * @return True if the local user is subscribed to the remote one.
*/ */
inline bool subscribedTo() const inline bool subscribedTo() const
{ return (m_subscription & To); } { return (m_subscription & To) != 0; }
/** /**
* Check if the remote user is subscribed to the local one. * Check if the remote user is subscribed to the local one.
* @return True if the remote user is subscribed to the local one. * @return True if the remote user is subscribed to the local one.
*/ */
inline bool subscribedFrom() const inline bool subscribedFrom() const
{ return (m_subscription & From); } { return (m_subscription & From) != 0; }
/** /**
* Process received error elements. * Process received error elements.

View File

@ -178,7 +178,7 @@ static inline bool skipBlanks(const char*& buffer, unsigned int& len)
{ {
for (; len && isBlank(*buffer); buffer++, len--) for (; len && isBlank(*buffer); buffer++, len--)
; ;
return len; return (len != 0);
} }
// Get a line from a buffer until the first valid end-of-line or end of buffer was reached, // Get a line from a buffer until the first valid end-of-line or end of buffer was reached,

View File

@ -828,7 +828,7 @@ public:
* @return True if the given command is known by this engine * @return True if the given command is known by this engine
*/ */
inline bool knownCommand(const char* cmd) inline bool knownCommand(const char* cmd)
{ Lock lock(this); return m_knownCommands.find(cmd); } { Lock lock(this); return (m_knownCommands.find(cmd) != 0); }
/** /**
* Add a command to the list of known commands * Add a command to the list of known commands

View File

@ -172,7 +172,7 @@ bool SignallingEngine::find(const SignallingComponent* component)
if (!component) if (!component)
return false; return false;
Lock lock(this); Lock lock(this);
return m_components.find(component); return m_components.find(component) != 0;
} }
void SignallingEngine::insert(SignallingComponent* component) void SignallingEngine::insert(SignallingComponent* component)
@ -445,7 +445,7 @@ bool SignallingUtils::hasFlag(const NamedList& list, const char* param, const ch
{ {
String s = list.getValue(param); String s = list.getValue(param);
ObjList* obj = list.split(',',false); ObjList* obj = list.split(',',false);
bool found = obj->find(flag); bool found = (obj->find(flag) != 0);
TelEngine::destruct(obj); TelEngine::destruct(obj);
return found; return found;
} }

View File

@ -302,7 +302,7 @@ void SS7Layer3::removeRoutes(SS7Layer3* network)
void SS7Layer3::printRoutes() void SS7Layer3::printRoutes()
{ {
String s; String s;
bool router = getObject("SS7Router"); bool router = getObject("SS7Router") != 0;
for (unsigned int i = 0; i < YSS7_PCTYPE_COUNT; i++) { for (unsigned int i = 0; i < YSS7_PCTYPE_COUNT; i++) {
ObjList* o = m_route[i].skipNull(); ObjList* o = m_route[i].skipNull();
if (!o) if (!o)

View File

@ -111,7 +111,7 @@ public:
return tmp; return tmp;
} }
inline bool addBoolParam(NamedList* dest, u_int8_t data, bool toggle) const { inline bool addBoolParam(NamedList* dest, u_int8_t data, bool toggle) const {
bool result = (bool)(toggle ? !(data & mask) : data & mask); bool result = (bool)toggle ? !(data & mask) : (data & mask);
dest->addParam(name,String::boolText(result)); dest->addParam(name,String::boolText(result));
return result; return result;
} }
@ -3478,7 +3478,7 @@ ISDNQ931Message* ISDNQ931Message::parse(ISDNQ931ParserData& parserData,
#define Q931_MSG_PROTOQ931 0x08 // Q.931 protocol discriminator #define Q931_MSG_PROTOQ931 0x08 // Q.931 protocol discriminator
// Get bit 7 to check if the current byte is extended to the next one // Get bit 7 to check if the current byte is extended to the next one
// Used to parse message IE // Used to parse message IE
#define Q931_EXT_FINAL(val) ((bool)(val & 0x80)) #define Q931_EXT_FINAL(val) ((val & 0x80) != 0)
// Max values for some IEs // Max values for some IEs
#define Q931_MAX_BEARERCAPS_LEN 12 #define Q931_MAX_BEARERCAPS_LEN 12
@ -4310,7 +4310,7 @@ bool Q931Parser::createMessage(u_int8_t* data, u_int32_t len)
// Call id length: bits 0-3 of the 2nd byte // Call id length: bits 0-3 of the 2nd byte
callRefLen = data[1] & 0x0f; callRefLen = data[1] & 0x0f;
// Initiator flag: bit 7 of the 3rd byte - 0: From initiator. 1: To initiator // Initiator flag: bit 7 of the 3rd byte - 0: From initiator. 1: To initiator
initiator = !(bool)(data[2] & 0x80); initiator = (data[2] & 0x80) == 0;
// We should have at least (callRefLen + 3) bytes: // We should have at least (callRefLen + 3) bytes:
// 1 for protocol discriminator, 1 for call reference length, // 1 for protocol discriminator, 1 for call reference length,
// 1 for message type and the call reference // 1 for message type and the call reference
@ -4651,7 +4651,7 @@ ISDNQ931IE* Q931Parser::decodeChannelID(ISDNQ931IE* ie, const u_int8_t* data,
s_ie_ieChannelID[4].addParam(ie,data[0]); // Channel select for PRI interface s_ie_ieChannelID[4].addParam(ie,data[0]); // Channel select for PRI interface
// Optional Byte 1: Interface identifier if present // Optional Byte 1: Interface identifier if present
u_int8_t crt = 1; u_int8_t crt = 1;
bool interfaceIDExplicit = (bool)(data[0] & 0x40); bool interfaceIDExplicit = (data[0] & 0x40) != 0;
if (interfaceIDExplicit) { if (interfaceIDExplicit) {
if (len == 1) if (len == 1)
return errorParseIE(ie,s_errorWrongData,0,0); return errorParseIE(ie,s_errorWrongData,0,0);

View File

@ -1289,7 +1289,7 @@ void ModuleGroup::buildGroup(ModuleGroup* group, ObjList& spanList, String& erro
*/ */
// Incoming: msg=0. Outgoing: msg is the call execute message // Incoming: msg=0. Outgoing: msg is the call execute message
AnalogChannel::AnalogChannel(ModuleLine* line, Message* msg) AnalogChannel::AnalogChannel(ModuleLine* line, Message* msg)
: Channel(&plugin,0,msg), : Channel(&plugin,0,(msg != 0)),
m_line(line), m_line(line),
m_hungup(false), m_hungup(false),
m_routeOnSecondRing(false), m_routeOnSecondRing(false),
@ -1904,7 +1904,7 @@ bool AnalogChannel::setAudio(bool in)
else else
Debug(this,DebugNote,"Failed to set data %s%s [%p]", Debug(this,DebugNote,"Failed to set data %s%s [%p]",
in?"source":"consumer",cic?"":". Circuit is missing",this); in?"source":"consumer",cic?"":". Circuit is missing",this);
return (bool)res; return res != 0;
} }
// Set call status // Set call status

View File

@ -216,10 +216,10 @@ int DbConn::queryDbInternal()
do { do {
MYSQL_RES* res = mysql_store_result(m_conn); MYSQL_RES* res = mysql_store_result(m_conn);
warns += mysql_warning_count(m_conn); warns += mysql_warning_count(m_conn);
affected += mysql_affected_rows(m_conn); affected += (unsigned int)mysql_affected_rows(m_conn);
if (res) { if (res) {
unsigned int cols = mysql_num_fields(res); unsigned int cols = mysql_num_fields(res);
unsigned int rows = mysql_num_rows(res); unsigned int rows = (unsigned int)mysql_num_rows(res);
Debug(&module,DebugAll,"Got result set %p rows=%u cols=%u",res,rows,cols); Debug(&module,DebugAll,"Got result set %p rows=%u cols=%u",res,rows,cols);
total += rows; total += rows;
if (m_msg) { if (m_msg) {

View File

@ -995,7 +995,7 @@ bool SigDriver::msgExecute(Message& msg, String& dest)
} }
// Create channel // Create channel
SigChannel* sigCh = new SigChannel(msg,msg.getValue("caller"),dest,link); SigChannel* sigCh = new SigChannel(msg,msg.getValue("caller"),dest,link);
bool ok = sigCh->call(); bool ok = sigCh->call() != 0;
if (ok) { if (ok) {
if (sigCh->connect(peer,msg.getValue("reason"))) { if (sigCh->connect(peer,msg.getValue("reason"))) {
msg.setParam("peerid",sigCh->id()); msg.setParam("peerid",sigCh->id());
@ -2297,7 +2297,7 @@ bool SigIsdnCallRecord::update(SignallingEvent* event)
default: ; default: ;
} }
SignallingMessage* msg = event->message(); SignallingMessage* msg = event->message();
bool chg = msg->params().getValue("circuit-change"); bool chg = (msg->params().getValue("circuit-change") != 0);
String format = msg->params().getValue("format"); String format = msg->params().getValue("format");
if (format) if (format)
format = "2*" + format; format = "2*" + format;

View File

@ -50,7 +50,7 @@
Optimization="2" Optimization="2"
InlineFunctionExpansion="1" InlineFunctionExpansion="1"
AdditionalIncludeDirectories=".,.." AdditionalIncludeDirectories=".,.."
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL" PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
@ -144,7 +144,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".,.." AdditionalIncludeDirectories=".,.."
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL" PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"