[CLEANUP] replace a few occurrences of (flags & X) && !(flags & Y)

This construct collapses into ((flags & (X|Y)) == X) when X is a
single-bit flag. This provides a noticeable code shrink and the
output code results in less conditional jumps.
diff --git a/src/session.c b/src/session.c
index 3443c46..aacde92 100644
--- a/src/session.c
+++ b/src/session.c
@@ -184,7 +184,7 @@
 	if (unlikely((req->flags & BF_SHUTW_NOW) ||
 		     (rep->flags & BF_SHUTW) ||
 		     ((req->flags & BF_SHUTR) && /* FIXME: this should not prevent a connection from establishing */
-		      ((req->flags & BF_EMPTY && !(req->flags & BF_WRITE_ACTIVITY)) ||
+		      (((req->flags & (BF_EMPTY|BF_WRITE_ACTIVITY)) == BF_EMPTY) ||
 		       s->be->options & PR_O_ABRT_CLOSE)))) {
 		/* give up */
 		si->shutw(si);
diff --git a/src/stream_sock.c b/src/stream_sock.c
index 59fc3e6..3d0845c 100644
--- a/src/stream_sock.c
+++ b/src/stream_sock.c
@@ -241,16 +241,17 @@
 		goto out_skip_wakeup;
  out_wakeup:
 	/* the consumer might be waiting for data */
-	if (b->cons->flags & SI_FL_WAIT_DATA && (b->flags & BF_READ_PARTIAL) && !(b->flags & BF_EMPTY))
+	if (likely((b->flags & (BF_READ_PARTIAL|BF_EMPTY)) == BF_READ_PARTIAL &&
+		   (b->cons->flags & SI_FL_WAIT_DATA)))
 		b->cons->chk_snd(b->cons);
 
 	/* we have to wake up if there is a special event or if we don't have
 	 * any more data to forward.
 	 */
-	if ((b->flags & (BF_READ_NULL|BF_READ_ERROR|BF_SHUTR)) ||
-	    !b->to_forward ||
-	    si->state != SI_ST_EST ||
-	    b->cons->state != SI_ST_EST)
+	if (likely((b->flags & (BF_READ_NULL|BF_READ_ERROR|BF_SHUTR)) ||
+		   !b->to_forward ||
+		   si->state != SI_ST_EST ||
+		   b->cons->state != SI_ST_EST))
 		task_wakeup(si->owner, TASK_WOKEN_IO);
 
  out_skip_wakeup:
@@ -461,16 +462,17 @@
 		goto out_skip_wakeup;
  out_wakeup:
 	/* the producer might be waiting for more room to store data */
-	if ((b->prod->flags & SI_FL_WAIT_ROOM) && (b->flags & BF_WRITE_PARTIAL) && !(b->flags & BF_FULL))
+	if (likely((b->flags & (BF_WRITE_PARTIAL|BF_FULL)) == BF_WRITE_PARTIAL &&
+		   (b->prod->flags & SI_FL_WAIT_ROOM)))
 		b->prod->chk_rcv(b->prod);
 
 	/* we have to wake up if there is a special event or if we don't have
 	 * any more data to forward and it's not planned to send any more.
 	 */
-	if ((b->flags & (BF_WRITE_NULL|BF_WRITE_ERROR|BF_SHUTW)) ||
-	    (!b->to_forward && !b->send_max && !b->splice_len) ||
-	    si->state != SI_ST_EST ||
-	    b->prod->state != SI_ST_EST)
+	if (likely((b->flags & (BF_WRITE_NULL|BF_WRITE_ERROR|BF_SHUTW)) ||
+		   (!b->to_forward && !b->send_max && !b->splice_len) ||
+		   si->state != SI_ST_EST ||
+		   b->prod->state != SI_ST_EST))
 		task_wakeup(si->owner, TASK_WOKEN_IO);
 
  out_skip_wakeup: