Skip to content

Commit e8fd986

Browse files
committed
add inttypes format for i686 architectures
(cherry picked from commit feccfa6)
1 parent 1e0b871 commit e8fd986

7 files changed

Lines changed: 18 additions & 17 deletions

File tree

modules/cachedb_dynamodb/cachedb_dynamodb_dbase.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
*
2020
*/
2121

22+
#include <inttypes.h>
23+
2224
#include "cachedb_dynamodb_dbase.h"
2325

2426

@@ -304,7 +306,7 @@ int dynamodb_map_set(cachedb_con *connection, const str *key, const str *keyset,
304306
LM_ERR("No more pkg mem\n");
305307
return -1;
306308
}
307-
sprintf(attribute_value_int, "%ld", pair->val.val.i64);
309+
sprintf(attribute_value_int, "%" PRId64, pair->val.val.i64);
308310
init_str(&attribute_value, attribute_value_int);
309311
break;
310312

modules/emergency/post_curl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ size_t write_data(char *ptr, size_t size, size_t nmemb, void *stream) {
5252
data->size += (size * nmemb);
5353

5454
#ifdef DEBUG
55-
fprintf(stderr, "data at %p size=%ld nmemb=%ld\n", ptr, size, nmemb);
55+
fprintf(stderr, "data at %p size=%zu nmemb=%zu\n", ptr, size, nmemb);
5656
#endif
5757
tmp = realloc(data->data, data->size + 1); /* +1 for '\0' */
5858

modules/http2d/server.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ static int on_request_recv(nghttp2_session *session,
584584
rc = pthread_cond_timedwait(&ng_h2_response->cond,
585585
&ng_h2_response->mutex, &wait_until);
586586
diff_ns = get_clock_diff(&begin);
587-
LM_DBG("waited %lld ns in total\n", diff_ns);
587+
LM_DBG("waited %llu ns in total\n", diff_ns);
588588
if (rc != 0) {
589589
pthread_mutex_unlock(&ng_h2_response->mutex);
590590

@@ -1049,4 +1049,3 @@ void http2_server(int rank)
10491049
run(int2str(h2_port, NULL), h2_tls_key.s, h2_tls_cert.s);
10501050
LM_ERR("HTTP2 server exiting!\n");
10511051
}
1052-

modules/janus/ws_common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ static int janus_connection_read_data(janus_connection *sock, struct janus_ws_re
483483
size=req->tcp.pos-req->tcp.parsed;
484484

485485
if (size) {
486-
LM_DBG("We still have %lu bytes, keeping connection \n", size);
486+
LM_DBG("We still have %ld bytes, keeping connection \n", size);
487487
}
488488

489489
if (handle_janus_json_request(sock, req->body) <0) {
@@ -613,7 +613,7 @@ static int janus_connection_handler_id(janus_connection *sock, struct janus_ws_r
613613
size=req->tcp.pos-req->tcp.parsed;
614614

615615
if (size) {
616-
LM_DBG("We still have %lu bytes, keeping connection \n", size);
616+
LM_DBG("We still have %ld bytes, keeping connection \n", size);
617617
}
618618

619619
if (populate_janus_handler_id(sock, req->body) <0) {

modules/lua/sipmysql.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static int l_sipmysql_escape(lua_State *L)
301301
to = pkg_malloc(2 * len + 1);
302302
if (!to)
303303
{
304-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n", 2 * len + 1);
304+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n", 2 * len + 1);
305305
lua_pushnil(L);
306306
return 1;
307307
}
@@ -369,7 +369,7 @@ static int l_sipmysql_prepare(lua_State *L)
369369
o_stmt->bind = pkg_malloc(o_stmt->param_count * sizeof(MYSQL_BIND));
370370
if (!o_stmt->bind)
371371
{
372-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n",
372+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n",
373373
o_stmt->param_count * sizeof(MYSQL_BIND));
374374
lua_remove(L, -1);
375375
lua_pushnil(L);
@@ -379,7 +379,7 @@ static int l_sipmysql_prepare(lua_State *L)
379379
o_stmt->is_null = pkg_malloc(o_stmt->param_count * sizeof(my_bool));
380380
if (!o_stmt->is_null)
381381
{
382-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n",
382+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n",
383383
o_stmt->param_count * sizeof(my_bool));
384384
lua_remove(L, -1);
385385
lua_pushnil(L);
@@ -389,7 +389,7 @@ static int l_sipmysql_prepare(lua_State *L)
389389
o_stmt->length = pkg_malloc(o_stmt->param_count * sizeof(unsigned long));
390390
if (!o_stmt->length)
391391
{
392-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n",
392+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n",
393393
o_stmt->param_count * sizeof(unsigned long));
394394
lua_remove(L, -1);
395395
lua_pushnil(L);
@@ -411,7 +411,7 @@ static int l_sipmysql_prepare(lua_State *L)
411411
o_stmt->result = pkg_malloc(o_stmt->num_fields * sizeof(MYSQL_BIND));
412412
if (!o_stmt->result)
413413
{
414-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n",
414+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n",
415415
o_stmt->num_fields * sizeof(MYSQL_BIND));
416416
lua_remove(L, -1);
417417
lua_pushnil(L);
@@ -421,7 +421,7 @@ static int l_sipmysql_prepare(lua_State *L)
421421
o_stmt->real_length = pkg_malloc(o_stmt->num_fields * sizeof(unsigned long));
422422
if (!o_stmt->real_length)
423423
{
424-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n",
424+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n",
425425
o_stmt->num_fields * sizeof(unsigned long));
426426
lua_remove(L, -1);
427427
lua_pushnil(L);
@@ -578,7 +578,7 @@ static int sipmysql_stmt_bind(struct sipmysql_stmt *o, lua_State *L, int n, int
578578
o->bind[n].buffer = pkg_malloc(sizeof(number));
579579
if (!o->bind[n].buffer)
580580
{
581-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n", sizeof(number));
581+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n", sizeof(number));
582582
lua_pushnil(L);
583583
return 1;
584584
}
@@ -597,7 +597,7 @@ static int sipmysql_stmt_bind(struct sipmysql_stmt *o, lua_State *L, int n, int
597597
o->bind[n].buffer = pkg_malloc(len);
598598
if (!o->bind[n].buffer)
599599
{
600-
siplua_log(L_CRIT, "malloc of %lu bytes failed\n", len);
600+
siplua_log(L_CRIT, "malloc of %zu bytes failed\n", len);
601601
lua_pushnil(L);
602602
return 1;
603603
}

modules/rest_client/rest_cb.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ size_t write_func(char *ptr, size_t size, size_t nmemb, void *body)
4343
str *buff = (str *)body;
4444

4545
#ifdef EXTRA_DEBUG
46-
LM_DBG("got body piece! bs: %lu, blocks: %lu\n", size, nmemb);
46+
LM_DBG("got body piece! bs: %zu, blocks: %zu\n", size, nmemb);
4747
#endif
4848

4949
if (len == 0)
@@ -108,4 +108,3 @@ size_t header_func(char *ptr, size_t size, size_t nmemb, void *userdata)
108108

109109
return len;
110110
}
111-

modules/usrloc/ul_mi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include <string.h>
3434
#include <stdio.h>
35+
#include <inttypes.h>
3536
#include "../../mi/mi.h"
3637
#include "../../dprint.h"
3738
#include "../../ut.h"
@@ -115,7 +116,7 @@ static inline int mi_add_aor_node(mi_item_t *aor_item, urecord_t* r,
115116
if (add_mi_string(ct_item, MI_SSTR("Contact"), c->c.s, c->c.len) < 0)
116117
return -1;
117118

118-
if (add_mi_string_fmt(ct_item, MI_SSTR("ContactID"), "%lu", c->contact_id) < 0)
119+
if (add_mi_string_fmt(ct_item, MI_SSTR("ContactID"), "%" PRIu64, c->contact_id) < 0)
119120
return -1;
120121

121122
if (c->expires == 0) {

0 commit comments

Comments
 (0)