From d6ad4ecc56865ca2dfcd66a07b70e58812730372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sz=C3=B3kov=C3=A1cs=20R=C3=B3bert?= Date: Wed, 24 Feb 2016 12:26:19 +0100 Subject: [PATCH 1/2] fixed some warnings --- resip/dum/ClientInviteSession.cxx | 1 - resip/dum/ClientRegistration.cxx | 2 +- resip/dum/Dialog.cxx | 1 - rutil/dns/AresDns.cxx | 2 +- rutil/dns/ares/ares_init.c | 4 ++++ rutil/stun/Stun.cxx | 10 +--------- 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/resip/dum/ClientInviteSession.cxx b/resip/dum/ClientInviteSession.cxx index 48b8798869..9bb2882d20 100644 --- a/resip/dum/ClientInviteSession.cxx +++ b/resip/dum/ClientInviteSession.cxx @@ -1424,7 +1424,6 @@ ClientInviteSession::dispatchSentUpdateEarlyGlare (const SipMessage& msg) void ClientInviteSession::dispatchReceivedUpdateEarly(const SipMessage& msg) { - InviteSessionHandler* handler = mDum.mInviteSessionHandler; std::auto_ptr offerAnswer = InviteSession::getOfferAnswer(msg); switch (toEvent(msg, offerAnswer.get())) diff --git a/resip/dum/ClientRegistration.cxx b/resip/dum/ClientRegistration.cxx index c7034ec959..e166585b04 100644 --- a/resip/dum/ClientRegistration.cxx +++ b/resip/dum/ClientRegistration.cxx @@ -21,7 +21,7 @@ using namespace resip; -static const int UnreasonablyLowExpirationThreshold = 7; // The threshold before which we consider a contacts expiry to be unreasonably low +static const UInt32 UnreasonablyLowExpirationThreshold = 7; // The threshold before which we consider a contacts expiry to be unreasonably low ClientRegistrationHandle ClientRegistration::getHandle() diff --git a/resip/dum/Dialog.cxx b/resip/dum/Dialog.cxx index 08648b45da..7988e752b6 100644 --- a/resip/dum/Dialog.cxx +++ b/resip/dum/Dialog.cxx @@ -747,7 +747,6 @@ Dialog::dispatch(const SipMessage& msg) case SUBSCRIBE: { - int code = response.header(h_StatusLine).statusCode(); ClientSubscription* client = findMatchingClientSub(response); if (client) { diff --git a/rutil/dns/AresDns.cxx b/rutil/dns/AresDns.cxx index 871f72b540..1d1779b5a8 100644 --- a/rutil/dns/AresDns.cxx +++ b/rutil/dns/AresDns.cxx @@ -71,8 +71,8 @@ class AresDnsPollItem : public FdPollItemBase AresDns& mAres; ares_channel mChannel; int mFd; - int mServerIdx; int mUsingTcp; + int mServerIdx; static void socket_poll_cb(void *cb_data, ares_channel channel, int server_idx, diff --git a/rutil/dns/ares/ares_init.c b/rutil/dns/ares/ares_init.c index 44ef5ab084..47a11b85e3 100644 --- a/rutil/dns/ares/ares_init.c +++ b/rutil/dns/ares/ares_init.c @@ -74,10 +74,12 @@ static char *try_config(char *s, char *opt); static const char *try_option(const char *p, const char *q, const char *opt); static int ip_addr(const char *s, int len, struct in_addr *addr); static void natural_mask(struct apattern *pat); +#ifdef WIN32 static int find_server(struct server_state *servers, int nservers, struct in_addr addr); #ifdef USE_IPV6 static int find_server6(struct server_state *servers, int nservers, struct in6_addr addr); #endif +#endif static int inet_pton4(const char *src, u_char *dst); #ifdef USE_IPV6 @@ -1176,6 +1178,7 @@ static void natural_mask(struct apattern *pat) pat->mask.s_addr = htonl(IN_CLASSC_NET); } +#ifdef WIN32 /* * Finds a V4 addr in list of servers. * return: @@ -1227,6 +1230,7 @@ static int find_server6(struct server_state *servers, int nservers, struct in6_a return (i < nservers ? i : -1); } #endif +#endif #define NS_INT16SZ 2 #define NS_INADDRSZ 4 diff --git a/rutil/stun/Stun.cxx b/rutil/stun/Stun.cxx index 9d8f6dd4e4..1d5085d8c8 100644 --- a/rutil/stun/Stun.cxx +++ b/rutil/stun/Stun.cxx @@ -1960,11 +1960,11 @@ stunSendTest( resip::Socket myFd, StunAddress4& dest, bool changePort=false; bool changeIP=false; - bool discard=false; switch (testNum) { case 1: + case 5: case 10: case 11: break; @@ -1978,9 +1978,6 @@ stunSendTest( resip::Socket myFd, StunAddress4& dest, case 4: changeIP=true; break; - case 5: - discard=true; - break; default: cerr << "Test " << testNum <<" is unknown\n"; resip_assert(0); @@ -2147,7 +2144,6 @@ stunNatType( StunAddress4& dest, bool respTestI=false; bool isNat=true; - StunAddress4 testIchangedAddr; StunAddress4 testImappedAddr; bool respTestI2=false; bool mappedIpSame = true; @@ -2287,8 +2283,6 @@ stunNatType( StunAddress4& dest, if ( !respTestI ) { - testIchangedAddr.addr = resp.changedAddress.ipv4.addr; - testIchangedAddr.port = resp.changedAddress.ipv4.port; testImappedAddr.addr = resp.mappedAddress.ipv4.addr; testImappedAddr.port = resp.mappedAddress.ipv4.port; @@ -2536,7 +2530,6 @@ stunOpenSocket( StunAddress4& dest, StunAddress4* mapAddr, } StunAddress4 mappedAddr = resp.mappedAddress.ipv4; - StunAddress4 changedAddr = resp.changedAddress.ipv4; //clog << "--- stunOpenSocket --- " << endl; //clog << "\treq id=" << req.id << endl; @@ -2631,7 +2624,6 @@ stunOpenSocketPair( StunAddress4& dest, StunAddress4* mapAddr, } mappedAddr[i] = resp.mappedAddress.ipv4; - StunAddress4 changedAddr = resp.changedAddress.ipv4; } if (verbose) From 4989488decdf1cde134663cbb1bb0d619658c4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sz=C3=B3kov=C3=A1cs=20R=C3=B3bert?= Date: Wed, 24 Feb 2016 12:31:25 +0100 Subject: [PATCH 2/2] fixed warning: left-hand operand of comma expression has no effect --- rutil/dns/ares/ares_local.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rutil/dns/ares/ares_local.c b/rutil/dns/ares/ares_local.c index d0e51572bc..b617a8c99f 100644 --- a/rutil/dns/ares/ares_local.c +++ b/rutil/dns/ares/ares_local.c @@ -6,21 +6,21 @@ int ares_local_gethostbyname(ares_channel channel, const char *name, int family, ares_host_callback callback, void *arg) { - (void)(channel,name,family,callback,arg); + (void)(channel);(void)(name);(void)(family);(void)(callback);(void)(arg); return 0; } int ares_local_gethostbyaddr(ares_channel channel, const char *addr, int addrlen, int family, ares_host_callback callback, void*arg) { - (void)(channel,addr,addrlen,family,callback,arg); + (void)(channel);(void)(addr);(void)(addrlen);(void)(family);(void)(callback);(void)(arg); return 0; } int ares_local_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg) { - (void)(channel,name,dnsclass,type,callback,arg); + (void)(channel);(void)(name);(void)(dnsclass);(void)(type);(void)(callback);(void)(arg); return 0; }