2
0
Эх сурвалжийг харах

ims_usrloc_scscf: fix compiler warnings

> ul_rpc.c:49:2: note: in expansion of macro 'LM_DBG'
>   LM_DBG("Dumping S-CSCF usrloc snapshot to file: [%.s]\n", filename.len, filename.s);
>   ^~~~~~

> ucontact.c: In function 'print_ucontact':
> ucontact.c:255:11: warning: unused variable 'st' [-Wunused-variable]
>      char* st = "";
>            ^~
> ucontact.c: In function 'new_ucontact':
> ucontact.c:143:17: warning: 'prev' may be used uninitialized in this function [-Wmaybe-uninitialized]
>       prev->next = curr;
>       ~~~~~~~~~~~^~~~~~

> impurecord.c:330:12: warning: 'rollback' defined but not used [-Wunused-variable]
>  static str rollback = str_init("ROLLBACK");
>             ^~~~~~~~
Victor Seva 8 жил өмнө
parent
commit
b5dd54e980

+ 1 - 1
src/modules/ims_usrloc_scscf/impurecord.c

@@ -327,7 +327,7 @@ static str autocommit_off = str_init("SET AUTOCOMMIT=0");
 static str fail_isolation_level = str_init("SET TRANSACTION ISOLATION LEVEL READ COMMITTED");
 static str fail_isolation_level = str_init("SET TRANSACTION ISOLATION LEVEL READ COMMITTED");
 static str start_transaction = str_init("START TRANSACTION");
 static str start_transaction = str_init("START TRANSACTION");
 static str commit = str_init("COMMIT");
 static str commit = str_init("COMMIT");
-static str rollback = str_init("ROLLBACK");
+/* static str rollback = str_init("ROLLBACK"); */
 static str autocommit_on = str_init("SET AUTOCOMMIT=1");
 static str autocommit_on = str_init("SET AUTOCOMMIT=1");
 
 
 static inline void start_dbtransaction() {
 static inline void start_dbtransaction() {

+ 2 - 2
src/modules/ims_usrloc_scscf/ucontact.c

@@ -82,7 +82,8 @@ extern int db_mode;
  */
  */
 ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _ci) {
 ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _ci) {
     ucontact_t *c;
     ucontact_t *c;
-    param_t *prev, *curr, *param;
+    param_t *prev = NULL;
+    param_t *curr, *param;
     int first = 1;
     int first = 1;
 
 
     c = (ucontact_t*) shm_malloc(sizeof (ucontact_t));
     c = (ucontact_t*) shm_malloc(sizeof (ucontact_t));
@@ -252,7 +253,6 @@ void free_ucontact(ucontact_t* _c) {
  */
  */
 void print_ucontact(FILE* _f, ucontact_t* _c) {
 void print_ucontact(FILE* _f, ucontact_t* _c) {
     time_t t = time(0);
     time_t t = time(0);
-    char* st = "";
     param_t * tmp;
     param_t * tmp;
     
     
     fprintf(_f, "\t~~~Contact(%p) (refcount: %d)~~~\n", _c, _c->ref_count);
     fprintf(_f, "\t~~~Contact(%p) (refcount: %d)~~~\n", _c, _c->ref_count);

+ 1 - 1
src/modules/ims_usrloc_scscf/ul_rpc.c

@@ -46,7 +46,7 @@ static void ul_rpc_snapshot(rpc_t* rpc, void *ctx) {
     }
     }
 	
 	
 	
 	
-	LM_DBG("Dumping S-CSCF usrloc snapshot to file: [%.s]\n", filename.len, filename.s);
+	LM_DBG("Dumping S-CSCF usrloc snapshot to file: [%.*s]\n", filename.len, filename.s);
 
 
 	current_time = time(NULL);
 	current_time = time(NULL);
 	t = localtime(&current_time);
 	t = localtime(&current_time);