<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19418">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tests: Fix compilation errors on 32-bit.<br><br>Fix compilation errors caused by using size_t<br>instead of uintmax_t and non-portable format<br>specifiers.<br><br>ASTERISK-30273 #close<br><br>Change-Id: I363e6057ef84d54b88af80d23ad6147eef9216ee<br>---<br>M res/res_pjsip_outbound_authenticator_digest.c<br>M tests/test_mwi.c<br>M tests/test_stasis.c<br>M tests/test_stasis_state.c<br>4 files changed, 27 insertions(+), 6 deletions(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c</span><br><span>index 4821082..aee4afc 100644</span><br><span>--- a/res/res_pjsip_outbound_authenticator_digest.c</span><br><span>+++ b/res/res_pjsip_outbound_authenticator_digest.c</span><br><span>@@ -384,9 +384,9 @@</span><br><span> res = pjsip_auth_clt_set_credentials(auth_sess, cred_count, creds_array);</span><br><span> ast_free(creds_array);</span><br><span> if (res == PJ_SUCCESS) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(3, "Set %"PRIu64" credentials in auth session\n", cred_count);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(3, "Set %zu credentials in auth session\n", cred_count);</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_ERROR, "Failed to set %"PRIu64" credentials in auth session\n", cred_count);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_ERROR, "Failed to set %zu credentials in auth session\n", cred_count);</span><br><span> }</span><br><span> </span><br><span> cleanup:</span><br><span>diff --git a/tests/test_mwi.c b/tests/test_mwi.c</span><br><span>index 3f633b3..c999963 100644</span><br><span>--- a/tests/test_mwi.c</span><br><span>+++ b/tests/test_mwi.c</span><br><span>@@ -63,6 +63,7 @@</span><br><span> </span><br><span> static int mailbox_to_num(const char *mailbox, size_t *num)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+ uintmax_t tmp;</span><br><span> const char *p = strchr(mailbox, '~');</span><br><span> </span><br><span> if (!p) {</span><br><span>@@ -70,10 +71,11 @@</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_str_to_umax(++p, num)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_str_to_umax(++p, &tmp)) {</span><br><span> ast_log(LOG_ERROR, "Unable to convert mailbox '%s' to numeric\n", mailbox);</span><br><span> return -1;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ *num = (size_t) tmp;</span><br><span> </span><br><span> return 0;</span><br><span> }</span><br><span>diff --git a/tests/test_stasis.c b/tests/test_stasis.c</span><br><span>index 5efb1ec..71026a6 100644</span><br><span>--- a/tests/test_stasis.c</span><br><span>+++ b/tests/test_stasis.c</span><br><span>@@ -2195,7 +2195,7 @@</span><br><span> int i;</span><br><span> struct stasis_subscription_change *data;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_test_status_update(test, "Messages received: %ld Final? %s\n", cts->consumer->messages_rxed_len,</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_test_status_update(test, "Messages received: %zu Final? %s\n", cts->consumer->messages_rxed_len,</span><br><span> cts->consumer->complete ? "yes" : "no");</span><br><span> for (i = 0; i < cts->consumer->messages_rxed_len; i++) {</span><br><span> data = stasis_message_data(cts->consumer->messages_rxed[i]);</span><br><span>diff --git a/tests/test_stasis_state.c b/tests/test_stasis_state.c</span><br><span>index 3ad450d..3dc5334 100644</span><br><span>--- a/tests/test_stasis_state.c</span><br><span>+++ b/tests/test_stasis_state.c</span><br><span>@@ -63,11 +63,13 @@</span><br><span> static int validate_data(const char *id, struct foo_data *foo)</span><br><span> {</span><br><span> size_t num;</span><br><span style="color: hsl(120, 100%, 40%);">+ uintmax_t tmp;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_str_to_umax(id, &num)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_str_to_umax(id, &tmp)) {</span><br><span> ast_log(LOG_ERROR, "Unable to convert the state's id '%s' to numeric\n", id);</span><br><span> return -1;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ num = (size_t) tmp;</span><br><span> </span><br><span> running_total += num;</span><br><span> </span><br><span>@@ -247,6 +249,7 @@</span><br><span> {</span><br><span> struct stasis_message *msg;</span><br><span> struct foo_data *foo;</span><br><span style="color: hsl(120, 100%, 40%);">+ uintmax_t tmp;</span><br><span> </span><br><span> foo = ao2_alloc(sizeof(*foo), NULL);</span><br><span> if (!foo) {</span><br><span>@@ -254,11 +257,12 @@</span><br><span> return NULL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_str_to_umax(id, &foo->bar)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_str_to_umax(id, &tmp)) {</span><br><span> ast_log(LOG_ERROR, "Unable to convert the state's id '%s' to numeric\n", id);</span><br><span> ao2_ref(foo, -1);</span><br><span> return NULL;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+ foo->bar = (size_t) tmp;</span><br><span> </span><br><span> msg = stasis_message_create_full(foo_type(), foo, NULL);</span><br><span> if (!msg) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19418">change 19418</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19418"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I363e6057ef84d54b88af80d23ad6147eef9216ee </div>
<div style="display:none"> Gerrit-Change-Number: 19418 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>