Browse Source

core: fixed several clang compiler warnings

Daniel-Constantin Mierla 11 years ago
parent
commit
f0fb6f1e9f
5 changed files with 6 additions and 6 deletions
  1. 2 2
      dset.c
  2. 1 1
      flags.c
  3. 1 1
      msg_translator.c
  4. 1 1
      parser/parse_fline.c
  5. 1 1
      select_buf.c

+ 2 - 2
dset.c

@@ -90,7 +90,7 @@ branch_t *get_sip_branch(int idx)
 		return NULL;
 	if(idx<0)
 	{
-		if(nr_branches + idx >= 0)
+		if((int)nr_branches + idx >= 0)
 			return &branches[nr_branches+idx];
 		return NULL;
 	}
@@ -109,7 +109,7 @@ int drop_sip_branch(int idx)
 {
 	if(nr_branches==0 || idx>=nr_branches)
 		return 0;
-	if(idx<0 && nr_branches+idx<0)
+	if(idx<0 && (int)nr_branches+idx<0)
 		return 0;
 	/* last branch */
 	if(idx==nr_branches-1)

+ 1 - 1
flags.c

@@ -74,7 +74,7 @@ int flag_in_range( flag_t flag ) {
 			flag, MAX_FLAG );
 		return 0;
 	}
-	if (flag<0) {
+	if ((int)flag<0) {
 		LOG(L_ERR, "ERROR: message flag (%d) must be in range %d..%d\n",
 			flag, 0, MAX_FLAG );
 		return 0;

+ 1 - 1
msg_translator.c

@@ -1575,7 +1575,7 @@ static inline int adjust_clen(struct sip_msg* msg, int body_delta, int proto)
 		 */
 		/* no need for Content-Length if it's and UDP packet and
 		 * it hasn't Content-Length already */
-		if ((msg->content_length==0)){
+		if (msg->content_length==0){
 		    /* content-length doesn't exist, append it */
 			/* msg->unparsed should point just before the final crlf
 			 * - whole message was parsed by the above parse_headers

+ 1 - 1
parser/parse_fline.c

@@ -233,7 +233,7 @@ error:
 	if (prn) {
 		for (t=0; t<offset; t++)
 			if (*(buffer+t)) *(prn+t)=*(buffer+t);
-			else *(prn+t)='°';
+			else *(prn+t)=176; /* '°' */
 		LOG(L_DBG, "parsed so far: %.*s\n", offset, ZSW(prn) );
 		pkg_free( prn );
 	};

+ 1 - 1
select_buf.c

@@ -162,7 +162,7 @@ int int_to_static_buffer(str* res, int val)
 {
 	char *c;
 	c = int2str(abs(val), &res->len);
-	res->s = get_static_buffer(res->len+(val<0)?1:0);
+	res->s = get_static_buffer(res->len+((val<0)?1:0));
 	if (!res->s) return -1;
 	if (val < 0) {
 		res->s[0] = '-';