Module: kamailio Branch: master Commit: 459a323e2712c29ebd455be325f14cd63b1a3605 URL: https://github.com/kamailio/kamailio/commit/459a323e2712c29ebd455be325f14cd6...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2015-07-30T12:41:08+02:00
rr: reformatted code to fit 80 chars line
- wrapped conditions to avoid misinterpretation on loosely compilers
---
Modified: modules/rr/record.c
---
Diff: https://github.com/kamailio/kamailio/commit/459a323e2712c29ebd455be325f14cd6... Patch: https://github.com/kamailio/kamailio/commit/459a323e2712c29ebd455be325f14cd6...
---
diff --git a/modules/rr/record.c b/modules/rr/record.c index 9fdd157..3af771d 100644 --- a/modules/rr/record.c +++ b/modules/rr/record.c @@ -283,7 +283,8 @@ static inline int build_rr(struct lump* _l, struct lump* _l2, str* user, if (_l ==0 ) goto lump_err; if (enable_double_rr) { - if (!(_l = insert_cond_lump_after(_l, enable_double_rr == 2 ? COND_TRUE : COND_IF_DIFF_REALMS, 0))) + if (!(_l = insert_cond_lump_after(_l, + (enable_double_rr == 2) ? COND_TRUE : COND_IF_DIFF_REALMS, 0))) goto lump_err; if (!(_l = insert_new_lump_after(_l, r2, RR_R2_LEN, 0))) goto lump_err; @@ -429,8 +430,10 @@ int record_route(struct sip_msg* _m, str *params) ret = -5; goto error; } - l = insert_cond_lump_after(l, enable_double_rr == 2 ? COND_TRUE : COND_IF_DIFF_REALMS, 0); - l2 = insert_cond_lump_before(l2, enable_double_rr == 2 ? COND_TRUE : COND_IF_DIFF_REALMS, 0); + l = insert_cond_lump_after(l, + (enable_double_rr == 2) ? COND_TRUE : COND_IF_DIFF_REALMS, 0); + l2 = insert_cond_lump_before(l2, + (enable_double_rr == 2) ? COND_TRUE : COND_IF_DIFF_REALMS, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); ret = -6; @@ -706,14 +709,16 @@ static inline int build_advertised_rr(struct lump* _l, struct lump* _l2, str *_d goto lump_err; } hdr = NULL; - if (!(_l = insert_cond_lump_after(_l, enable_double_rr == 2 ? COND_TRUE : COND_IF_DIFF_PROTO, 0))) + if (!(_l = insert_cond_lump_after(_l, + (enable_double_rr == 2) ? COND_TRUE : COND_IF_DIFF_PROTO, 0))) goto lump_err; if (!(_l = insert_new_lump_after(_l, trans, RR_TRANS_LEN, 0))) goto lump_err; if (!(_l = insert_subst_lump_after(_l, _inbound?SUBST_RCV_PROTO:SUBST_SND_PROTO, 0))) goto lump_err; if (enable_double_rr) { - if (!(_l = insert_cond_lump_after(_l, enable_double_rr == 2 ? COND_TRUE : COND_IF_DIFF_REALMS, 0))) + if (!(_l = insert_cond_lump_after(_l, + (enable_double_rr == 2) ? COND_TRUE : COND_IF_DIFF_REALMS, 0))) goto lump_err; if (!(_l = insert_new_lump_after(_l, r2, RR_R2_LEN, 0))) goto lump_err; @@ -790,8 +795,10 @@ int record_route_advertised_address(struct sip_msg* _m, str* _data) ret = -3; goto error; } - l = insert_cond_lump_after(l, enable_double_rr == 2 ? COND_TRUE : COND_IF_DIFF_PROTO, 0); - l2 = insert_cond_lump_before(l2, enable_double_rr == 2 ? COND_TRUE : COND_IF_DIFF_PROTO, 0); + l = insert_cond_lump_after(l, + (enable_double_rr == 2) ? COND_TRUE : COND_IF_DIFF_PROTO, 0); + l2 = insert_cond_lump_before(l2, + (enable_double_rr == 2) ? COND_TRUE : COND_IF_DIFF_PROTO, 0); if (!l || !l2) { LM_ERR("failed to insert conditional lump\n"); ret = -4;