Browse code

- more sun cc warnings & error fixes - GET_RURI & GET_NEXT_HOP return now a str* (instead of str) -- sun cc does not like thinkgs like & ( (bloat)?foo:bar).

Andrei Pelinescu-Onciul authored on 09/05/2003 13:44:47
Showing 9 changed files
... ...
@@ -247,11 +247,11 @@ decode_contact_header (struct sip_msg *msg,char *unused1,char *unused2)
247 247
 
248 248
 #ifdef DEBUG
249 249
 	fprintf (stdout,"Using separator %c\n",separator);
250
-	str ruri;
250
+	str* ruri;
251 251
 	ruri = GET_RURI(msg);
252
-	fprintf (stdout,"[len = %d]New uri is->%*.s\n",ruri.len,ruri.len,ruri.s);
253
-	ruri = msg->first_line.u.request.uri;
254
-	fprintf (stdout, "INITIAL.s=[%.*s]\n", ruri.len, ruri.s);
252
+	fprintf (stdout,"[len = %d]New uri is->%*.s\n",ruri->len,ruri->len,ruri->s);
253
+	ruri = &msg->first_line.u.request.uri;
254
+	fprintf (stdout, "INITIAL.s=[%.*s]\n", ruri->len, ruri->s);
255 255
 #endif
256 256
 		
257 257
 	if (msg->contact->parsed == NULL) parse_contact (msg->contact);
... ...
@@ -494,8 +494,8 @@ timer(unsigned int ticks, void *param)
494 494
 		memcpy(&(c.len), cp, sizeof(c.len));
495 495
 		if (c.len == 0)
496 496
 			break;
497
-		c.s = cp + sizeof(c.len);
498
-		cp += sizeof(c.len) + c.len;
497
+		c.s = (char*)cp + sizeof(c.len);
498
+		cp =  (char*)cp + sizeof(c.len) + c.len;
499 499
 		if (parse_uri(c.s, c.len, &curi) < 0) {
500 500
 			LOG(L_ERR, "ERROR: nathelper::timer: can't parse contact uri\n");
501 501
 			continue;
... ...
@@ -76,7 +76,7 @@ int get_body_len( struct sip_msg* msg)
76 76
 	/* if header is present, trim to get only the string containing numbers */
77 77
 	trim_len( foo.len , foo.s , msg->content_length->body );
78 78
 	/* convert from string to number */
79
-	x = str2s( (unsigned char*)foo.s,foo.len,&err);
79
+	x = str2s(foo.s,foo.len,&err);
80 80
 	if (err){
81 81
 		LOG(L_ERR, "ERROR: get_body_len:"
82 82
 			" unable to parse the Content_Length number !\n");
... ...
@@ -189,7 +189,7 @@ static inline int insert(struct sip_msg* _m, contact_t* _c, udomain_t* _d, str*
189 189
 		trim_trailing(&callid);
190 190
 		
191 191
 		     /* Get CSeq number of the message */
192
-		if (str2int(&get_cseq(_m)->number, &cseq) < 0) {
192
+		if (str2int(&get_cseq(_m)->number, (unsigned int*)&cseq) < 0) {
193 193
 			rerrno = R_INV_CSEQ;
194 194
 			LOG(L_ERR, "insert(): Error while converting cseq number\n");
195 195
 			ul_delete_urecord(_d, _a);
... ...
@@ -262,7 +262,8 @@ static inline int update(struct sip_msg* _m, urecord_t* _r, contact_t* _c)
262 262
 				trim_trailing(&callid);
263 263
 				
264 264
 				     /* Get CSeq number of the message */
265
-				if (str2int(&(((struct cseq_body*)_m->cseq->parsed)->number), &cseq) < 0) {
265
+				if (str2int(&(((struct cseq_body*)_m->cseq->parsed)->number), 
266
+								(unsigned int*) &cseq) < 0) {
266 267
 					rerrno = R_INV_CSEQ;
267 268
 					LOG(L_ERR, "update(): Error while converting cseq number\n");
268 269
 					return -3;
... ...
@@ -293,7 +294,8 @@ static inline int update(struct sip_msg* _m, urecord_t* _r, contact_t* _c)
293 293
 				trim_trailing(&callid);
294 294
 				
295 295
 				     /* Get CSeq number of the message */
296
-				if (str2int(&(((struct cseq_body*)_m->cseq->parsed)->number), &cseq) < 0) {
296
+				if (str2int(&(((struct cseq_body*)_m->cseq->parsed)->number), (unsigned int*)&cseq)
297
+							< 0) {
297 298
 					rerrno = R_INV_CSEQ;
298 299
 					LOG(L_ERR, "update(): Error while converting cseq number\n");
299 300
 					return -7;
... ...
@@ -224,7 +224,7 @@ int calc_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e)
224 224
 	if (!_ep || !_ep->body.len) {
225 225
 		*_e = get_expires_hf(_m);
226 226
 	} else {
227
-		if (str2int(&_ep->body, _e) < 0) {
227
+		if (str2int(&_ep->body, (unsigned int*)_e) < 0) {
228 228
 			*_e = 3600;
229 229
 			     /*
230 230
 			       rerrno = R_INV_EXP;
... ...
@@ -49,7 +49,7 @@ int append_fromtag = 1;
49 49
 int enable_double_rr = 1; /* Enable using of 2 RR by default */
50 50
 int enable_full_lr = 0;   /* Disabled by default */
51 51
 
52
-MODULE_VERSION;
52
+MODULE_VERSION
53 53
 
54 54
 static int mod_init(void);
55 55
 static int str_fixup(void** param, int param_no);
... ...
@@ -112,9 +112,9 @@ int get_all_ucontacts(void *buf, int len)
112 112
 					continue;
113 113
 				if (len >= (int)(sizeof(c->c.len) + c->c.len)) {
114 114
 					memcpy(cp, &c->c.len, sizeof(c->c.len));
115
-					cp += sizeof(c->c.len);
115
+					cp = (char*)cp + sizeof(c->c.len);
116 116
 					memcpy(cp, c->c.s, c->c.len);
117
-					cp += c->c.len;
117
+					cp = (char*)cp + c->c.len;
118 118
 					len -= sizeof(c->c.len) + c->c.len;
119 119
 				} else {
120 120
 					shortage += sizeof(c->c.len) + c->c.len;
... ...
@@ -204,7 +204,8 @@ void print_udomain(FILE* _f, udomain_t* _d)
204 204
 int preload_udomain(udomain_t* _d)
205 205
 {
206 206
 	char b[256];
207
-	db_key_t columns[9] = {user_col, contact_col, expires_col, q_col, callid_col, cseq_col, replicate_col, state_col, domain_col};
207
+	db_key_t columns[9] = {user_col, contact_col, expires_col, q_col, callid_col, cseq_col, 
208
+							replicate_col, state_col, domain_col};
208 209
 	db_res_t* res;
209 210
 	db_row_t* row;
210 211
 	int i, cseq, rep, state;
... ...
@@ -258,7 +258,7 @@ static int ul_add(FILE* pipe, char* response_file)
258 258
 	fifo_find_domain(&table, &d);
259 259
 	
260 260
 	if (d) {
261
-		if (str2int(&expires, &exp_i) < 0) {
261
+		if (str2int(&expires, (unsigned int*)&exp_i) < 0) {
262 262
 			fifo_reply(response_file, "400 Invalid expires format\n");
263 263
 			return 1;
264 264
 		}
... ...
@@ -268,7 +268,7 @@ static int ul_add(FILE* pipe, char* response_file)
268 268
 			return 1;
269 269
 		}
270 270
 
271
-		if (str2int(&rep, &rep_i) < 0) {
271
+		if (str2int(&rep, (unsigned int*)&rep_i) < 0) {
272 272
 			fifo_reply(response_file, "400 Invalid replicate format\n");
273 273
 			return 1;
274 274
 		}