* [B.A.T.M.A.N.] [PATCH] batman-adv: properly convert flag into a boolean value
@ 2012-08-27 7:35 Antonio Quartulli
2012-09-02 8:44 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Antonio Quartulli @ 2012-08-27 7:35 UTC (permalink / raw)
To: b.a.t.m.a.n
In order to properly convert a bitwise AND to a boolean value, the whole
expression must be prepended by "!!".
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
---
translation-table.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/translation-table.c b/translation-table.c
index 1d53a06..a570d95 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -2439,7 +2439,7 @@ bool batadv_tt_global_client_is_roaming(struct batadv_priv *bat_priv,
if (!tt_global_entry)
goto out;
- ret = tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM;
+ ret = !!(tt_global_entry->common.flags & BATADV_TT_CLIENT_ROAM);
batadv_tt_global_entry_free_ref(tt_global_entry);
out:
return ret;
--
1.7.12
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-02 8:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 7:35 [B.A.T.M.A.N.] [PATCH] batman-adv: properly convert flag into a boolean value Antonio Quartulli
2012-09-02 8:44 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox