Browse code

fixed compile time warnings

- init vars and remove unused ones

Daniel-Constantin Mierla authored on 16/04/2012 11:46:40
Showing 4 changed files
... ...
@@ -346,7 +346,7 @@ unsigned int read_cfg_var(struct cfg_read_handle *read_handle, void **val)
346 346
 int read_cfg_var_int(struct cfg_read_handle *read_handle, int *val)
347 347
 {
348 348
 	unsigned int	type;
349
-	void		*v1, *v2;
349
+	void		*v1=NULL, *v2=NULL;
350 350
 
351 351
 	if ((type = read_cfg_var(read_handle, &v1)) == 0)
352 352
 		return -1;
... ...
@@ -364,7 +364,7 @@ int read_cfg_var_int(struct cfg_read_handle *read_handle, int *val)
364 364
 int read_cfg_var_str(struct cfg_read_handle *read_handle, str *val)
365 365
 {
366 366
 	unsigned int	type;
367
-	void		*v1, *v2;
367
+	void		*v1=NULL, *v2=NULL;
368 368
 
369 369
 	if ((type = read_cfg_var(read_handle, &v1)) == 0)
370 370
 		return -1;
... ...
@@ -139,7 +139,6 @@ void my_con_disconnect(db_con_t* con)
139 139
 int my_con(db_con_t* con)
140 140
 {
141 141
 	struct my_con* ptr;
142
-	struct my_uri* uri;
143 142
 
144 143
 	/* First try to lookup the connection in the connection pool and
145 144
 	 * re-use it if a match is found
... ...
@@ -167,7 +166,6 @@ int my_con(db_con_t* con)
167 166
 	}
168 167
 	mysql_init(ptr->con);
169 168
 
170
-	uri = DB_GET_PAYLOAD(con->uri);
171 169
 	DBG("mysql: Creating new connection to: %.*s:%.*s\n",
172 170
 		con->uri->scheme.len, ZSW(con->uri->scheme.s),
173 171
 		con->uri->body.len, ZSW(con->uri->body.s));
... ...
@@ -100,6 +100,7 @@ int lookup(struct sip_msg* _m, udomain_t* _d, str* _uri)
100 100
 	str inst = {0};
101 101
 	unsigned int ahash = 0;
102 102
 
103
+	ret = -1;
103 104
 
104 105
 	if (_m->new_uri.s) uri = _m->new_uri;
105 106
 	else uri = _m->first_line.u.request.uri;
... ...
@@ -643,7 +643,6 @@ urecord_t* db_load_urecord_by_ruid(db1_con_t* _c, udomain_t* _d, str *_ruid)
643 643
 	str aor;
644 644
 	char aorbuf[512];
645 645
 	str domain;
646
-	int i;
647 646
 
648 647
 	urecord_t* r;
649 648
 	ucontact_t* c;
... ...
@@ -699,7 +698,7 @@ urecord_t* db_load_urecord_by_ruid(db1_con_t* _c, udomain_t* _d, str *_ruid)
699 698
 	/* use first row - shouldn't be more */
700 699
 	row = RES_ROWS(res);
701 700
 
702
-	ci = dbrow2info(  ROW_VALUES(RES_ROWS(res) + i), &contact);
701
+	ci = dbrow2info(  ROW_VALUES(RES_ROWS(res)), &contact);
703 702
 	if (ci==0) {
704 703
 		LM_ERR("skipping record for %.*s in table %s\n",
705 704
 				_ruid->len, _ruid->s, _d->name->s);