From 5bb54b0c4b100fee18d5247bf8db3eb4c7554f96 Mon Sep 17 00:00:00 2001 From: Stanislav Abramenkov Date: Thu, 9 Nov 2023 16:34:28 +0200 Subject: [PATCH] Fix warnings --- pjlib-util/src/pjlib-util/stun_simple_client.c | 2 +- pjlib/src/pj/hash.c | 2 +- pjlib/src/pj/pool.c | 14 +++++++------- pjlib/src/pj/pool_caching.c | 4 ++-- pjlib/src/pj/timer.c | 2 +- pjsip/src/pjsip/sip_endpoint.c | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pjlib-util/src/pjlib-util/stun_simple_client.c b/pjlib-util/src/pjlib-util/stun_simple_client.c index 3d3f2eda36..78b1eb5f88 100644 --- a/pjlib-util/src/pjlib-util/stun_simple_client.c +++ b/pjlib-util/src/pjlib-util/stun_simple_client.c @@ -345,7 +345,7 @@ PJ_DEF(pj_status_t) pjstun_get_mapped_addr2(pj_pool_factory *pf, } } - TRACE_((THIS_FILE, " Pool usage=%d of %d", pj_pool_get_used_size(pool), + TRACE_((THIS_FILE, " Pool usage=%ld of %ld", pj_pool_get_used_size(pool), pj_pool_get_capacity(pool))); pj_pool_release(pool); diff --git a/pjlib/src/pj/hash.c b/pjlib/src/pj/hash.c index f87bddf2bc..70226f7fa2 100644 --- a/pjlib/src/pj/hash.c +++ b/pjlib/src/pj/hash.c @@ -187,7 +187,7 @@ static pj_hash_entry **find_entry( pj_pool_t *pool, pj_hash_table_t *ht, entry = PJ_POOL_ALLOC_T(pool, pj_hash_entry); PJ_LOG(6, ("hashtbl", - "%p: New p_entry %p created, pool used=%u, cap=%u", + "%p: New p_entry %p created, pool used=%lu, cap=%lu", ht, entry, pj_pool_get_used_size(pool), pj_pool_get_capacity(pool))); } diff --git a/pjlib/src/pj/pool.c b/pjlib/src/pj/pool.c index d9b62d66e8..5615931592 100644 --- a/pjlib/src/pj/pool.c +++ b/pjlib/src/pj/pool.c @@ -52,7 +52,7 @@ static pj_pool_block *pj_pool_create_block( pj_pool_t *pool, pj_size_t size) PJ_CHECK_STACK(); pj_assert(size >= sizeof(pj_pool_block)); - LOG((pool->obj_name, "create_block(sz=%u), cur.cap=%u, cur.used=%u", + LOG((pool->obj_name, "create_block(sz=%lu), cur.cap=%lu, cur.used=%lu", size, pool->capacity, pj_pool_get_used_size(pool))); /* Request memory from allocator. */ @@ -116,8 +116,8 @@ PJ_DEF(void*) pj_pool_allocate_find(pj_pool_t *pool, pj_size_t size) /* If pool is configured NOT to expand, return error. */ if (pool->increment_size == 0) { - LOG((pool->obj_name, "Can't expand pool to allocate %u bytes " - "(used=%u, cap=%u)", + LOG((pool->obj_name, "Can't expand pool to allocate %lu bytes " + "(used=%lu, cap=%lu)", size, pj_pool_get_used_size(pool), pool->capacity)); (*pool->callback)(pool, size); return NULL; @@ -142,7 +142,7 @@ PJ_DEF(void*) pj_pool_allocate_find(pj_pool_t *pool, pj_size_t size) } LOG((pool->obj_name, - "%u bytes requested, resizing pool by %u bytes (used=%u, cap=%u)", + "%lu bytes requested, resizing pool by %lu bytes (used=%lu, cap=%lu)", size, block_size, pj_pool_get_used_size(pool), pool->capacity)); block = pj_pool_create_block(pool, block_size); @@ -233,7 +233,7 @@ PJ_DEF(pj_pool_t*) pj_pool_create_int( pj_pool_factory *f, const char *name, /* Pool initial capacity and used size */ pool->capacity = initial_size; - LOG((pool->obj_name, "pool created, size=%u", pool->capacity)); + LOG((pool->obj_name, "pool created, size=%lu", pool->capacity)); return pool; } @@ -278,7 +278,7 @@ static void reset_pool(pj_pool_t *pool) */ PJ_DEF(void) pj_pool_reset(pj_pool_t *pool) { - LOG((pool->obj_name, "reset(): cap=%d, used=%d(%d%%)", + LOG((pool->obj_name, "reset(): cap=%ld, used=%ld(%ld%%)", pool->capacity, pj_pool_get_used_size(pool), pj_pool_get_used_size(pool)*100/pool->capacity)); @@ -292,7 +292,7 @@ PJ_DEF(void) pj_pool_destroy_int(pj_pool_t *pool) { pj_size_t initial_size; - LOG((pool->obj_name, "destroy(): cap=%d, used=%d(%d%%), block0=%p-%p", + LOG((pool->obj_name, "destroy(): cap=%ld, used=%ld(%ld%%), block0=%p-%p", pool->capacity, pj_pool_get_used_size(pool), pj_pool_get_used_size(pool)*100/pool->capacity, ((pj_pool_block*)pool->block_list.next)->buf, diff --git a/pjlib/src/pj/pool_caching.c b/pjlib/src/pj/pool_caching.c index 0d55e1dfb4..cb8896b488 100644 --- a/pjlib/src/pj/pool_caching.c +++ b/pjlib/src/pj/pool_caching.c @@ -188,7 +188,7 @@ static pj_pool_t* cpool_create_pool(pj_pool_factory *pf, cp->capacity = 0; } - PJ_LOG(6, (pool->obj_name, "pool reused, size=%u", pool->capacity)); + PJ_LOG(6, (pool->obj_name, "pool reused, size=%lu", pool->capacity)); } /* Put in used list. */ @@ -245,7 +245,7 @@ static void cpool_release_pool( pj_pool_factory *pf, pj_pool_t *pool) } /* Reset pool. */ - PJ_LOG(6, (pool->obj_name, "recycle(): cap=%d, used=%d(%d%%)", + PJ_LOG(6, (pool->obj_name, "recycle(): cap=%ld, used=%ld(%ld%%)", pool_capacity, pj_pool_get_used_size(pool), pj_pool_get_used_size(pool)*100/pool_capacity)); pj_pool_reset(pool); diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c index bcf1e058ea..f902dbc6e6 100644 --- a/pjlib/src/pj/timer.c +++ b/pjlib/src/pj/timer.c @@ -381,7 +381,7 @@ static pj_status_t grow_heap(pj_timer_heap_t *ht) pj_timer_entry_dup *new_dup; #endif - PJ_LOG(6,(THIS_FILE, "Growing heap size from %d to %d", + PJ_LOG(6,(THIS_FILE, "Growing heap size from %ld to %ld", ht->max_size, new_size)); // First grow the heap itself. diff --git a/pjsip/src/pjsip/sip_endpoint.c b/pjsip/src/pjsip/sip_endpoint.c index 873b1da150..62c6f2b9ea 100644 --- a/pjsip/src/pjsip/sip_endpoint.c +++ b/pjsip/src/pjsip/sip_endpoint.c @@ -787,7 +787,7 @@ PJ_DEF(pj_status_t) pjsip_endpt_schedule_timer_dbg(pjsip_endpoint *endpt, const char *src_file, int src_line) { - PJ_LOG(6, (THIS_FILE, "pjsip_endpt_schedule_timer(entry=%p, delay=%u.%u)", + PJ_LOG(6, (THIS_FILE, "pjsip_endpt_schedule_timer(entry=%p, delay=%lu.%lu)", entry, delay->sec, delay->msec)); return pj_timer_heap_schedule_dbg(endpt->timer_heap, entry, delay, src_file, src_line); @@ -817,7 +817,7 @@ PJ_DEF(pj_status_t) pjsip_endpt_schedule_timer_w_grp_lock_dbg( int src_line) { PJ_LOG(6, (THIS_FILE, "pjsip_endpt_schedule_timer_w_grp_lock" - "(entry=%p, delay=%u.%u, grp_lock=%p)", + "(entry=%p, delay=%ld.%ld, grp_lock=%p)", entry, delay->sec, delay->msec, grp_lock)); return pj_timer_heap_schedule_w_grp_lock_dbg(endpt->timer_heap, entry, delay, id_val, grp_lock,