Browse code

core: fixed several clang compiler warnings

Daniel-Constantin Mierla authored on 06/12/2013 16:16:25
Showing 5 changed files
... ...
@@ -90,7 +90,7 @@ branch_t *get_sip_branch(int idx)
90 90
 		return NULL;
91 91
 	if(idx<0)
92 92
 	{
93
-		if(nr_branches + idx >= 0)
93
+		if((int)nr_branches + idx >= 0)
94 94
 			return &branches[nr_branches+idx];
95 95
 		return NULL;
96 96
 	}
... ...
@@ -109,7 +109,7 @@ int drop_sip_branch(int idx)
109 109
 {
110 110
 	if(nr_branches==0 || idx>=nr_branches)
111 111
 		return 0;
112
-	if(idx<0 && nr_branches+idx<0)
112
+	if(idx<0 && (int)nr_branches+idx<0)
113 113
 		return 0;
114 114
 	/* last branch */
115 115
 	if(idx==nr_branches-1)
... ...
@@ -74,7 +74,7 @@ int flag_in_range( flag_t flag ) {
74 74
 			flag, MAX_FLAG );
75 75
 		return 0;
76 76
 	}
77
-	if (flag<0) {
77
+	if ((int)flag<0) {
78 78
 		LOG(L_ERR, "ERROR: message flag (%d) must be in range %d..%d\n",
79 79
 			flag, 0, MAX_FLAG );
80 80
 		return 0;
... ...
@@ -1575,7 +1575,7 @@ static inline int adjust_clen(struct sip_msg* msg, int body_delta, int proto)
1575 1575
 		 */
1576 1576
 		/* no need for Content-Length if it's and UDP packet and
1577 1577
 		 * it hasn't Content-Length already */
1578
-		if ((msg->content_length==0)){
1578
+		if (msg->content_length==0){
1579 1579
 		    /* content-length doesn't exist, append it */
1580 1580
 			/* msg->unparsed should point just before the final crlf
1581 1581
 			 * - whole message was parsed by the above parse_headers
... ...
@@ -233,7 +233,7 @@ error:
233 233
 	if (prn) {
234 234
 		for (t=0; t<offset; t++)
235 235
 			if (*(buffer+t)) *(prn+t)=*(buffer+t);
236
-			else *(prn+t)='�';
236
+			else *(prn+t)=176; /* '�' */
237 237
 		LOG(L_DBG, "parsed so far: %.*s\n", offset, ZSW(prn) );
238 238
 		pkg_free( prn );
239 239
 	};
... ...
@@ -162,7 +162,7 @@ int int_to_static_buffer(str* res, int val)
162 162
 {
163 163
 	char *c;
164 164
 	c = int2str(abs(val), &res->len);
165
-	res->s = get_static_buffer(res->len+(val<0)?1:0);
165
+	res->s = get_static_buffer(res->len+((val<0)?1:0));
166 166
 	if (!res->s) return -1;
167 167
 	if (val < 0) {
168 168
 		res->s[0] = '-';