Module: sip-router
Branch: master
Commit: 8a90dd3515bddb189b411672555688427612cf31
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8a90dd3515bddb189b411672555688427612cf31

Author: Andrei Pelinescu-Onciul <[email protected]>
Committer: Andrei Pelinescu-Onciul <[email protected]>
Date:   Sat Jun 11 11:24:05 2011 +0200

core: remove unused variables + coding style

---

 action.c |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/action.c b/action.c
index 268b3f5..8ca143a 100644
--- a/action.c
+++ b/action.c
@@ -302,6 +302,8 @@ int do_action(struct run_act_ctx* h, struct action* a, 
struct sip_msg* msg)
        unsigned short port;
        str* dst_host;
        int i, flags;
+       avp_t* avp;
+       struct search_state st;
        struct switch_cond_table* sct;
        struct switch_jmp_table*  sjt;
        struct rval_expr* rve;
@@ -618,15 +620,16 @@ int do_action(struct run_act_ctx* h, struct action* a, 
struct sip_msg* msg)
                        break;
                /* jku - end : flag processing */
 
-               case AVPFLAG_OPER_T:  {
-                       struct search_state st;
-                       avp_t* avp;
-                       int flag;
+               case AVPFLAG_OPER_T:
                        ret = 0;
-                       flag = a->val[1].u.number;
-                       if ((a->val[0].u.attr->type & AVP_INDEX_ALL) == 
AVP_INDEX_ALL || (a->val[0].u.attr->type & AVP_NAME_RE)!=0) {
-                               for 
(avp=search_first_avp(a->val[0].u.attr->type, a->val[0].u.attr->name, NULL, 
&st); avp; avp = search_next_avp(&st, NULL)) {
-                                       switch (a->val[2].u.number) {   /* 
oper: 0..reset, 1..set, -1..no change */
+                       if ((a->val[0].u.attr->type & AVP_INDEX_ALL) == 
AVP_INDEX_ALL ||
+                                       (a->val[0].u.attr->type & 
AVP_NAME_RE)!=0) {
+                               for 
(avp=search_first_avp(a->val[0].u.attr->type,
+                                                       a->val[0].u.attr->name, 
NULL, &st);
+                                               avp;
+                                               avp = search_next_avp(&st, 
NULL)) {
+                                       switch (a->val[2].u.number) {
+                                               /* oper: 0..reset, 1..set, 
-1..no change */
                                                case 0:
                                                        avp->flags &= 
~(avp_flags_t)a->val[1].u.number;
                                                        break;
@@ -635,13 +638,16 @@ int do_action(struct run_act_ctx* h, struct action* a, 
struct sip_msg* msg)
                                                        break;
                                                default:;
                                        }
-                                       ret = ret || ((avp->flags & 
(avp_flags_t)a->val[1].u.number) != 0);
+                                       ret = ret ||
+                                               ((avp->flags & 
(avp_flags_t)a->val[1].u.number) != 0);
                                }
-                       }
-                       else {
-                               avp = 
search_avp_by_index(a->val[0].u.attr->type, a->val[0].u.attr->name, NULL, 
a->val[0].u.attr->index);
+                       } else {
+                               avp = 
search_avp_by_index(a->val[0].u.attr->type,
+                                                                               
        a->val[0].u.attr->name, NULL,
+                                                                               
        a->val[0].u.attr->index);
                                if (avp) {
-                                       switch (a->val[2].u.number) {   /* 
oper: 0..reset, 1..set, -1..no change */
+                                       switch (a->val[2].u.number) {
+                                               /* oper: 0..reset, 1..set, 
-1..no change */
                                                case 0:
                                                        avp->flags &= 
~(avp_flags_t)a->val[1].u.number;
                                                        break;
@@ -656,7 +662,6 @@ int do_action(struct run_act_ctx* h, struct action* a, 
struct sip_msg* msg)
                        if (ret==0)
                                ret = -1;
                        break;
-               }
                case ERROR_T:
                        if 
((a->val[0].type!=STRING_ST)|(a->val[1].type!=STRING_ST)){
                                LOG(L_CRIT, "BUG: do_action: bad error() types 
%d, %d\n",


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to