[sr-dev] git:4.0: core: fixed several clang compiler warnings

Daniel-Constantin Mierla miconda at gmail.com
Fri Dec 20 12:24:55 CET 2013


Module: sip-router
Branch: 4.0
Commit: b4f7f2e8a0cf1178b31ed7a7a84725fd25b36940
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b4f7f2e8a0cf1178b31ed7a7a84725fd25b36940

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Dec  6 17:16:25 2013 +0100

core: fixed several clang compiler warnings

(cherry picked from commit f0fb6f1e9fbb2f7f0c2bed5ba0d50a56cf5cf444)
(cherry picked from commit 90681624c54f0ec0b1259e205bcc0274316b4549)

Conflicts:
	parser/parse_fline.c

---

 dset.c               |    4 ++--
 flags.c              |    2 +-
 msg_translator.c     |    2 +-
 parser/parse_fline.c |    4 ++--
 select_buf.c         |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dset.c b/dset.c
index 31b8b38..61c30a5 100644
--- a/dset.c
+++ b/dset.c
@@ -89,7 +89,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;
 	}
@@ -108,7 +108,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)
diff --git a/flags.c b/flags.c
index 1523d0b..becb569 100644
--- a/flags.c
+++ b/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;
diff --git a/msg_translator.c b/msg_translator.c
index fa7834f..c39188b 100644
--- a/msg_translator.c
+++ b/msg_translator.c
@@ -1580,7 +1580,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
diff --git a/parser/parse_fline.c b/parser/parse_fline.c
index 25ab944..926ddc6 100644
--- a/parser/parse_fline.c
+++ b/parser/parse_fline.c
@@ -233,8 +233,8 @@ error:
 	if (prn) {
 		for (t=0; t<offset; t++)
 			if (*(buffer+t)) *(prn+t)=*(buffer+t);
-			else *(prn+t)='°';
-		LOG(L_INFO, "ERROR: parsed so far: %.*s\n", offset, ZSW(prn) );
+			else *(prn+t)=176; /* '°' */
+		LOG(L_DBG, "parsed so far: %.*s\n", offset, ZSW(prn) );
 		pkg_free( prn );
 	};
 error1:
diff --git a/select_buf.c b/select_buf.c
index b3463a8..7277d48 100644
--- a/select_buf.c
+++ b/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] = '-';	




More information about the sr-dev mailing list