Hi, next one: mtcp.c, about line 470:
unsigned int flags = MTP_NONE;
if (TUN_OUT(c))
flags |= MTP_TUN_OUT;
if (LINK_OUT(c))
flags |= MTP_LINK_OUT;
switch (flags)
{
case MTP_TUN_OUT|MTP_LINK_OUT:
case MTP_TUN_OUT:
newaction = TA_TUN_WRITE;
break;
case MTP_LINK_OUT:
newaction = TA_SOCKET_WRITE;
break;
case MTP_NONE:
if (mi && socket_read_residual (c->c2.link_socket))
newaction = TA_SOCKET_READ_RESIDUAL;
else
multi_tcp_set_global_rw_flags (m, mi);
break;
default:
{
struct gc_arena gc = gc_new ();
msg (M_FATAL, "MULTI TCP: multi_tcp_post bad state, mi=%s flags=%d",
multi_instance_string (mi, false, &gc),
flags);
gc_free (&gc);
break;
}
}
coverity is complaining that the "default:" clause can never be reached,
as all the possible values for "flags" are covered - and it's obviously
right. It's not something critical, more a "code cleanup" thing.
(The whole usage of switch/case here reeks a bit, given that I think the
code would be simpler by directly setting "newaction" depending on
"if (TUN_OUT(c))" etc., not bothering with "flags" in the first place)
Cleanup in 2.4?
gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]
fax: +49-89-35655025 [email protected]
pgpH1RfgWrXJS.pgp
Description: PGP signature
