Browse code

core: remove unused variables + coding style

Andrei Pelinescu-Onciul authored on 11/06/2011 09:24:05
Showing 1 changed files
... ...
@@ -302,6 +302,8 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
302 302
 	unsigned short port;
303 303
 	str* dst_host;
304 304
 	int i, flags;
305
+	avp_t* avp;
306
+	struct search_state st;
305 307
 	struct switch_cond_table* sct;
306 308
 	struct switch_jmp_table*  sjt;
307 309
 	struct rval_expr* rve;
... ...
@@ -618,15 +620,16 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
618 618
 			break;
619 619
 		/* jku - end : flag processing */
620 620
 
621
-		case AVPFLAG_OPER_T:  {
622
-			struct search_state st;
623
-			avp_t* avp;
624
-			int flag;
621
+		case AVPFLAG_OPER_T:
625 622
 			ret = 0;
626
-			flag = a->val[1].u.number;
627
-			if ((a->val[0].u.attr->type & AVP_INDEX_ALL) == AVP_INDEX_ALL || (a->val[0].u.attr->type & AVP_NAME_RE)!=0) {
628
-				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)) {
629
-					switch (a->val[2].u.number) {   /* oper: 0..reset, 1..set, -1..no change */
623
+			if ((a->val[0].u.attr->type & AVP_INDEX_ALL) == AVP_INDEX_ALL ||
624
+					(a->val[0].u.attr->type & AVP_NAME_RE)!=0) {
625
+				for (avp=search_first_avp(a->val[0].u.attr->type,
626
+							a->val[0].u.attr->name, NULL, &st);
627
+						avp;
628
+						avp = search_next_avp(&st, NULL)) {
629
+					switch (a->val[2].u.number) {
630
+						/* oper: 0..reset, 1..set, -1..no change */
630 631
 						case 0:
631 632
 							avp->flags &= ~(avp_flags_t)a->val[1].u.number;
632 633
 							break;
... ...
@@ -635,13 +638,16 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
635 635
 							break;
636 636
 						default:;
637 637
 					}
638
-					ret = ret || ((avp->flags & (avp_flags_t)a->val[1].u.number) != 0);
638
+					ret = ret ||
639
+						((avp->flags & (avp_flags_t)a->val[1].u.number) != 0);
639 640
 				}
640
-			}
641
-			else {
642
-				avp = search_avp_by_index(a->val[0].u.attr->type, a->val[0].u.attr->name, NULL, a->val[0].u.attr->index);
641
+			} else {
642
+				avp = search_avp_by_index(a->val[0].u.attr->type,
643
+											a->val[0].u.attr->name, NULL,
644
+											a->val[0].u.attr->index);
643 645
 				if (avp) {
644
-					switch (a->val[2].u.number) {   /* oper: 0..reset, 1..set, -1..no change */
646
+					switch (a->val[2].u.number) {
647
+						/* oper: 0..reset, 1..set, -1..no change */
645 648
 						case 0:
646 649
 							avp->flags &= ~(avp_flags_t)a->val[1].u.number;
647 650
 							break;
... ...
@@ -656,7 +662,6 @@ int do_action(struct run_act_ctx* h, struct action* a, struct sip_msg* msg)
656 656
 			if (ret==0)
657 657
 				ret = -1;
658 658
 			break;
659
-		}
660 659
 		case ERROR_T:
661 660
 			if ((a->val[0].type!=STRING_ST)|(a->val[1].type!=STRING_ST)){
662 661
 				LOG(L_CRIT, "BUG: do_action: bad error() types %d, %d\n",