Explorar o código

fixed compile time warnings

- init vars and remove unused ones
Daniel-Constantin Mierla %!s(int64=13) %!d(string=hai) anos
pai
achega
b5d6bb38c3

+ 2 - 2
cfg/cfg_select.c

@@ -346,7 +346,7 @@ unsigned int read_cfg_var(struct cfg_read_handle *read_handle, void **val)
 int read_cfg_var_int(struct cfg_read_handle *read_handle, int *val)
 {
 	unsigned int	type;
-	void		*v1, *v2;
+	void		*v1=NULL, *v2=NULL;
 
 	if ((type = read_cfg_var(read_handle, &v1)) == 0)
 		return -1;
@@ -364,7 +364,7 @@ int read_cfg_var_int(struct cfg_read_handle *read_handle, int *val)
 int read_cfg_var_str(struct cfg_read_handle *read_handle, str *val)
 {
 	unsigned int	type;
-	void		*v1, *v2;
+	void		*v1=NULL, *v2=NULL;
 
 	if ((type = read_cfg_var(read_handle, &v1)) == 0)
 		return -1;

+ 0 - 2
modules/db_mysql/my_con.c

@@ -139,7 +139,6 @@ void my_con_disconnect(db_con_t* con)
 int my_con(db_con_t* con)
 {
 	struct my_con* ptr;
-	struct my_uri* uri;
 
 	/* First try to lookup the connection in the connection pool and
 	 * re-use it if a match is found
@@ -167,7 +166,6 @@ int my_con(db_con_t* con)
 	}
 	mysql_init(ptr->con);
 
-	uri = DB_GET_PAYLOAD(con->uri);
 	DBG("mysql: Creating new connection to: %.*s:%.*s\n",
 		con->uri->scheme.len, ZSW(con->uri->scheme.s),
 		con->uri->body.len, ZSW(con->uri->body.s));

+ 1 - 0
modules_k/registrar/lookup.c

@@ -100,6 +100,7 @@ int lookup(struct sip_msg* _m, udomain_t* _d, str* _uri)
 	str inst = {0};
 	unsigned int ahash = 0;
 
+	ret = -1;
 
 	if (_m->new_uri.s) uri = _m->new_uri;
 	else uri = _m->first_line.u.request.uri;

+ 1 - 2
modules_k/usrloc/udomain.c

@@ -643,7 +643,6 @@ urecord_t* db_load_urecord_by_ruid(db1_con_t* _c, udomain_t* _d, str *_ruid)
 	str aor;
 	char aorbuf[512];
 	str domain;
-	int i;
 
 	urecord_t* r;
 	ucontact_t* c;
@@ -699,7 +698,7 @@ urecord_t* db_load_urecord_by_ruid(db1_con_t* _c, udomain_t* _d, str *_ruid)
 	/* use first row - shouldn't be more */
 	row = RES_ROWS(res);
 
-	ci = dbrow2info(  ROW_VALUES(RES_ROWS(res) + i), &contact);
+	ci = dbrow2info(  ROW_VALUES(RES_ROWS(res)), &contact);
 	if (ci==0) {
 		LM_ERR("skipping record for %.*s in table %s\n",
 				_ruid->len, _ruid->s, _d->name->s);