[sr-dev] git:master: core: avoid warning of using bitwise operator with boolean result

Daniel-Constantin Mierla miconda at gmail.com
Tue Jan 28 19:00:52 CET 2014


Module: sip-router
Branch: master
Commit: cfb815e440804c2870126c1c098362d5a117f97c
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cfb815e440804c2870126c1c098362d5a117f97c

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Jan 28 18:54:50 2014 +0100

core: avoid warning of using bitwise operator with boolean result

- on a report generated by cppcheck sent by David Binderman

---

 tcp_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tcp_main.c b/tcp_main.c
index 0c5a333..6444074 100644
--- a/tcp_main.c
+++ b/tcp_main.c
@@ -4404,7 +4404,7 @@ static ticks_t tcpconn_main_timeout(ticks_t t, struct timer_ln* tl, void* data)
 			c->wbuf_q.queued);
 	
 	tcp_async=cfg_get(tcp, tcp_cfg, async);
-	if (likely(TICKS_LT(t, c->timeout) && ( !tcp_async | _wbufq_empty(c) |
+	if (likely(TICKS_LT(t, c->timeout) && ( !tcp_async || _wbufq_empty(c) ||
 					TICKS_LT(t, c->wbuf_q.wr_timeout)) )){
 		if (unlikely(tcp_async && _wbufq_non_empty(c)))
 			return (ticks_t)MIN_unsigned(c->timeout-t, c->wbuf_q.wr_timeout-t);




More information about the sr-dev mailing list