[Asterisk-Dev] ast_flags question

Kevin P. Fleming kpfleming at starnetworks.us
Sat Jan 8 21:57:01 MST 2005


Russell Bryant wrote:

> You think that ...
> 
> peer->flags.alreadygone = 1;
> 
> would be easier to read than ...
> 
> ast_set_flag(peer, SIP_ALREADYGONE);

Actually, yes I do :-) But more importantly, I think that

peer->flags.alreadygone = ast_true(v->value)

is easier to read than

ast_set2_flag(peer, ast_true(v->value), SIP_ALREADYGONE)

and that

if (peer->flags.alreadygone && peer->flags.needdestroy)

is easier than

if (ast_test_flag(peer, SIP_ALREADYGONE | SIP_NEEDDESTROY))



More information about the asterisk-dev mailing list