Module: kamailio
Branch: master
Commit: f018b88bfe0620f22e6c76a388eeb7e3408a4496
URL: 
https://github.com/kamailio/kamailio/commit/f018b88bfe0620f22e6c76a388eeb7e3408a4496

Author: Victor Seva <linuxman...@torreviejawireless.org>
Committer: Victor Seva <linuxman...@torreviejawireless.org>
Date: 2017-01-13T11:43:05+01:00

ims_registrar_scscf: fix compiler warnings

> xdx_avp.c: In function 'cxdx_get_auth_data_item_answer':
> cxdx_avp.c:655:26: warning: comparison of constant '4' with boolean 
> expression is always false [-Wbool-compare]
>   if (!avp||!avp->data.len==4) *item_number=0;
>                           ^~

> cxdx_callbacks.c: In function 'cxdx_process_rtr':
> cxdx_callbacks.c:55:9: warning: unused variable 'i' [-Wunused-variable]
>      int i = 0;
>          ^

> lookup.c: In function 'term_impu_has_contact':
> lookup.c:303:9: warning: unused variable 'i' [-Wunused-variable]
>      int i = 0;
>          ^

> reg_rpc.c: In function 'reg_rpc_dereg_impu':
> reg_rpc.c:35:7: warning: unused variable 'i' [-Wunused-variable]
>    int i;
>        ^

> reply.c: In function 'calc_buf_len':
> reply.c:95:9: warning: unused variable 'i' [-Wunused-variable]
>      int i=0;
>          ^
> reply.c: In function 'build_contact':
> reply.c:434:9: warning: unused variable 'i' [-Wunused-variable]
>      int i=0;
>          ^

> registrar_notify.c: In function 'get_reginfo_partial':
> registrar_notify.c:1791:9: warning: unused variable 'i' [-Wunused-variable]
>      int i;
>          ^

> save.c: In function 'get_number_of_valid_contacts':
> save.c:674:9: warning: unused variable 'i' [-Wunused-variable]
>      int i;
>          ^
> save.c: In function 'update_contacts_helper.part.1':
> save.c:110:6: warning: 'r' may be used uninitialized in this function 
> [-Wmaybe-uninitialized]
>   int r;
>       ^
> save.c: In function 'update_contacts':
> save.c:110:6: warning: 'r' may be used uninitialized in this function 
> [-Wmaybe-uninitialized]
> save.c:110:6: warning: 'r' may be used uninitialized in this function 
> [-Wmaybe-uninitialized]

---

Modified: src/modules/ims_registrar_scscf/cxdx_avp.c
Modified: src/modules/ims_registrar_scscf/cxdx_callbacks.c
Modified: src/modules/ims_registrar_scscf/lookup.c
Modified: src/modules/ims_registrar_scscf/reg_rpc.c
Modified: src/modules/ims_registrar_scscf/registrar_notify.c
Modified: src/modules/ims_registrar_scscf/reply.c
Modified: src/modules/ims_registrar_scscf/save.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f018b88bfe0620f22e6c76a388eeb7e3408a4496.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f018b88bfe0620f22e6c76a388eeb7e3408a4496.patch

---

diff --git a/src/modules/ims_registrar_scscf/cxdx_avp.c 
b/src/modules/ims_registrar_scscf/cxdx_avp.c
index ab9490a..9fa122b 100644
--- a/src/modules/ims_registrar_scscf/cxdx_avp.c
+++ b/src/modules/ims_registrar_scscf/cxdx_avp.c
@@ -652,7 +652,7 @@ int cxdx_get_auth_data_item_answer(AAAMessage *msg, AAA_AVP 
**auth_data,
 
        avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Item_Number,
                IMS_vendor_id_3GPP,0);
-       if (!avp||!avp->data.len==4) *item_number=0;
+       if (!avp||avp->data.len!=4) *item_number=0;
        else *item_number = get_4bytes(avp->data.s);
        
        avp = 
cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Authentication_Scheme,
diff --git a/src/modules/ims_registrar_scscf/cxdx_callbacks.c 
b/src/modules/ims_registrar_scscf/cxdx_callbacks.c
index d21b1d3..8fc5142 100644
--- a/src/modules/ims_registrar_scscf/cxdx_callbacks.c
+++ b/src/modules/ims_registrar_scscf/cxdx_callbacks.c
@@ -52,7 +52,6 @@ AAAMessage* cxdx_process_rtr(AAAMessage *rtr) {
     AAA_AVP* avp;
     str public_id;
     impurecord_t* r;
-    int i = 0;
     int res = 0;
     udomain_t* udomain;
        impu_contact_t *impucontact;
diff --git a/src/modules/ims_registrar_scscf/lookup.c 
b/src/modules/ims_registrar_scscf/lookup.c
index 2855efc..6652bab 100644
--- a/src/modules/ims_registrar_scscf/lookup.c
+++ b/src/modules/ims_registrar_scscf/lookup.c
@@ -300,7 +300,7 @@ int term_impu_has_contact(struct sip_msg* _m, udomain_t* 
_d, char* _s) {
     ucontact_t* ptr = 0;
     int res;
     int ret;
-    int i = 0;
+
        impu_contact_t *impucontact;
 
     if (_m->new_uri.s) uri = _m->new_uri;
diff --git a/src/modules/ims_registrar_scscf/reg_rpc.c 
b/src/modules/ims_registrar_scscf/reg_rpc.c
index 66d4262..40c6e73 100644
--- a/src/modules/ims_registrar_scscf/reg_rpc.c
+++ b/src/modules/ims_registrar_scscf/reg_rpc.c
@@ -32,7 +32,6 @@ extern usrloc_api_t ul;
 
 static void reg_rpc_dereg_impu(rpc_t* rpc, void* ctx)
 {
-               int i;
                str impu;
                int res;
                udomain_t* domain;
diff --git a/src/modules/ims_registrar_scscf/registrar_notify.c 
b/src/modules/ims_registrar_scscf/registrar_notify.c
index 7ab41ac..61e1430 100644
--- a/src/modules/ims_registrar_scscf/registrar_notify.c
+++ b/src/modules/ims_registrar_scscf/registrar_notify.c
@@ -1788,7 +1788,6 @@ str generate_reginfo_full(udomain_t* _t, str* impu_list, 
int num_impus, str *exp
 
 str get_reginfo_partial(impurecord_t *r, ucontact_t *c, int event_type) {
     str x = {0, 0};
-    int i;
     str buf, pad;
     char bufc[MAX_REGINFO_SIZE], padc[MAX_REGINFO_SIZE];
     int expires = -1;
diff --git a/src/modules/ims_registrar_scscf/reply.c 
b/src/modules/ims_registrar_scscf/reply.c
index 559135a..0b99b7f 100644
--- a/src/modules/ims_registrar_scscf/reply.c
+++ b/src/modules/ims_registrar_scscf/reply.c
@@ -92,7 +92,6 @@ static struct {
 static inline unsigned int calc_buf_len(impurecord_t* impurec) {
     unsigned int len;
     int qlen;
-    int i=0;
     ucontact_t* c;
     param_t *tmp;
        impu_contact_t *impucontact;
@@ -431,7 +430,6 @@ int build_contact(impurecord_t* impurec, 
contact_for_header_t** contact_header)
     ucontact_t* c;
     param_t* tmp;
     *contact_header = 0;
-    int i=0;
        impu_contact_t *impucontact;
 
     contact_for_header_t* tmp_contact_header = shm_malloc(sizeof 
(contact_for_header_t));
diff --git a/src/modules/ims_registrar_scscf/save.c 
b/src/modules/ims_registrar_scscf/save.c
index e5c06f5..83d6cce 100644
--- a/src/modules/ims_registrar_scscf/save.c
+++ b/src/modules/ims_registrar_scscf/save.c
@@ -107,7 +107,7 @@ static inline int randomize_expires(int expires, int range) 
{
  *    the default value
  */
 static inline int calc_contact_expires(contact_t *c, int expires_hdr, int 
sos_reg) {
-       int r;
+       int r = 0;
        if(c && c->expires)
                str2int(&(c->expires->body), (unsigned int*) &r);
        else if (expires_hdr >= 0)
@@ -671,7 +671,6 @@ static inline int unregister_contact(contact_t* chi, 
contact_state_t state) {
  * @return 
  */
 int get_number_of_valid_contacts(impurecord_t* impu) {
-    int i;
     int ret = 0;
        impu_contact_t *impucontact;
     get_act_time();


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to