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

Author: Andrei Pelinescu-Onciul <[email protected]>
Committer: Andrei Pelinescu-Onciul <[email protected]>
Date:   Thu Oct  1 01:09:39 2009 +0200

tm: gcc-2.9x warning fixes (%zd)

- %zd is not supported in the format string for gcc < 3.0
- fixed %.*s with non int length warnings (gcc 2.9x)

---

 modules/tm/t_msgbuilder.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/modules/tm/t_msgbuilder.c b/modules/tm/t_msgbuilder.c
index a76c3db..c0160b9 100644
--- a/modules/tm/t_msgbuilder.c
+++ b/modules/tm/t_msgbuilder.c
@@ -514,8 +514,9 @@ static inline int get_uac_rs(sip_msg_t *msg, int is_req, 
struct rte **rtset)
                        
                p = (rr_t*)ptr->parsed;
                while(p) {
-                       if (! (t = (struct rte*)pkg_malloc(sizeof(struct 
rte)))) {
-                               ERR("out of pkg mem (asked for: %zd).\n", 
sizeof(struct rte));
+                       if (! (t = pkg_malloc(sizeof(struct rte)))) {
+                               ERR("out of pkg mem (asked for: %d).\n",
+                                               (int)sizeof(struct rte));
                                goto err;
                        }
                        if (is_req) {
@@ -763,10 +764,10 @@ static int eval_uac_routing(sip_msg_t *rpl, const struct 
retr_buf *inv_rb,
        orig_inv.buf = inv_rb->buffer;
        orig_inv.len = inv_rb->buffer_len;
        DEBUG("reparsing retransmission buffer of original INVITE:\n%.*s\n",
-                       orig_inv.len, orig_inv.buf);
+                       (int)orig_inv.len, orig_inv.buf);
        if (parse_msg(orig_inv.buf, orig_inv.len, &orig_inv) != 0) {
-               ERR("failed to parse retr buffer (weird!): \n%.*s\n", 
orig_inv.len,
-                               orig_inv.buf);
+               ERR("failed to parse retr buffer (weird!): \n%.*s\n",
+                               (int)orig_inv.len, orig_inv.buf);
                return -1;
        }
 
@@ -774,14 +775,14 @@ static int eval_uac_routing(sip_msg_t *rpl, const struct 
retr_buf *inv_rb,
        if ((parse_headers(&orig_inv, HDR_TO_F, 0) < 0) || (! orig_inv.to)) {
                /* the bug is at message assembly */
                BUG("failed to parse INVITE retr. buffer and/or extract 'To' 
HF:"
-                               "\n%.*s\n", orig_inv.len, orig_inv.buf);
+                               "\n%.*s\n", (int)orig_inv.len, orig_inv.buf);
                goto end;
        }
        if (((struct to_body *)orig_inv.to->parsed)->tag_value.len) {
                DEBUG("building ACK for in-dialog INVITE (using RS in orig. 
INV.)\n");
                if (parse_headers(&orig_inv, HDR_EOH_F, 0) < 0) {
                        BUG("failed to parse INVITE retr. buffer to EOH:"
-                                       "\n%.*s\n", orig_inv.len, orig_inv.buf);
+                                       "\n%.*s\n", (int)orig_inv.len, 
orig_inv.buf);
                        goto end;
                }
                sipmsg = &orig_inv;
@@ -863,8 +864,8 @@ eval_flags:
                                 * it can be done along with rte chunk, 
independent of Route
                                 * header parser's allocator (using pkg/shm) */
                                chklen = sizeof(struct rte) + sizeof(rr_t);
-                               if (! (t = (struct rte *)pkg_malloc(chklen))) {
-                                       ERR("out of pkg memory (%zd 
required)\n", chklen);
+                               if (! (t = pkg_malloc(chklen))) {
+                                       ERR("out of pkg memory (%d 
required)\n", (int)chklen);
                                        goto end;
                                }
                                /* this way, .free_rr is also set to 0 (!!!) */


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to