<p>Kevin Harwell <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13816">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">addons/res_config_mysql: silense warnings about printf format errors.<br><br>Warnings without this:<br><br>res_config_mysql.c: In function 'update2_mysql':<br>res_config_mysql.c:741:15: warning: format '%llu' expects argument of type<br> 'long long unsigned int', but argument 6 has type 'my_ulonglong'<br> {aka 'long unsigned int'} [-Wformat=]<br>ast_debug(1, "MySQL RealTime: Updated %llu rows on table: %s\n",<br> numrows, tablename);<br><br>(reformatted for readability within line-wrap)<br><br>Change-Id: I2af4d419a37c1a7eeee750cf9ae4a9a2b3a37fd3<br>---<br>M addons/res_config_mysql.c<br>1 file changed, 8 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/addons/res_config_mysql.c b/addons/res_config_mysql.c</span><br><span>index edd9385..359158b 100644</span><br><span>--- a/addons/res_config_mysql.c</span><br><span>+++ b/addons/res_config_mysql.c</span><br><span>@@ -554,7 +554,7 @@</span><br><span> static int update_mysql(const char *database, const char *tablename, const char *keyfield, const char *lookup, const struct ast_variable *rt_fields)</span><br><span> {</span><br><span> struct mysql_conn *dbh;</span><br><span style="color: hsl(0, 100%, 40%);">- my_ulonglong numrows;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint64_t numrows;</span><br><span> const struct ast_variable *field = rt_fields;</span><br><span> struct ast_str *sql = ast_str_thread_get(&sql_buf, 100), *buf = ast_str_thread_get(&scratch_buf, 100);</span><br><span> struct tables *table;</span><br><span>@@ -641,7 +641,7 @@</span><br><span> release_table(table);</span><br><span> release_database(dbh);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "MySQL RealTime: Updated %llu rows on table: %s\n", numrows, tablename);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(1, "MySQL RealTime: Updated %" PRIu64 " rows on table: %s\n", numrows, tablename);</span><br><span> </span><br><span> /* From http://dev.mysql.com/doc/mysql/en/mysql-affected-rows.html</span><br><span> * An integer greater than zero indicates the number of rows affected</span><br><span>@@ -655,7 +655,7 @@</span><br><span> static int update2_mysql(const char *database, const char *tablename, const struct ast_variable *lookup_fields, const struct ast_variable *update_fields)</span><br><span> {</span><br><span> struct mysql_conn *dbh;</span><br><span style="color: hsl(0, 100%, 40%);">- my_ulonglong numrows;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint64_t numrows;</span><br><span> int first;</span><br><span> const struct ast_variable *field;</span><br><span> struct ast_str *sql = ast_str_thread_get(&sql_buf, 100), *buf = ast_str_thread_get(&scratch_buf, 100);</span><br><span>@@ -738,7 +738,7 @@</span><br><span> numrows = mysql_affected_rows(&dbh->handle);</span><br><span> release_database(dbh);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "MySQL RealTime: Updated %llu rows on table: %s\n", numrows, tablename);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(1, "MySQL RealTime: Updated %" PRIu64 " rows on table: %s\n", numrows, tablename);</span><br><span> </span><br><span> /* From http://dev.mysql.com/doc/mysql/en/mysql-affected-rows.html</span><br><span> * An integer greater than zero indicates the number of rows affected</span><br><span>@@ -810,7 +810,7 @@</span><br><span> static int destroy_mysql(const char *database, const char *table, const char *keyfield, const char *lookup, const struct ast_variable *rt_fields)</span><br><span> {</span><br><span> struct mysql_conn *dbh;</span><br><span style="color: hsl(0, 100%, 40%);">- my_ulonglong numrows;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint64_t numrows;</span><br><span> struct ast_str *sql = ast_str_thread_get(&sql_buf, 16);</span><br><span> struct ast_str *buf = ast_str_thread_get(&scratch_buf, 16);</span><br><span> const struct ast_variable *field;</span><br><span>@@ -862,7 +862,7 @@</span><br><span> numrows = mysql_affected_rows(&dbh->handle);</span><br><span> release_database(dbh);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "MySQL RealTime: Deleted %llu rows on table: %s\n", numrows, table);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(1, "MySQL RealTime: Deleted %" PRIu64 " rows on table: %s\n", numrows, table);</span><br><span> </span><br><span> /* >From http://dev.mysql.com/doc/mysql/en/mysql-affected-rows.html</span><br><span> * An integer greater than zero indicates the number of rows affected</span><br><span>@@ -878,7 +878,7 @@</span><br><span> struct mysql_conn *dbh;</span><br><span> MYSQL_RES *result;</span><br><span> MYSQL_ROW row;</span><br><span style="color: hsl(0, 100%, 40%);">- my_ulonglong num_rows;</span><br><span style="color: hsl(120, 100%, 40%);">+ uint64_t num_rows;</span><br><span> struct ast_variable *new_v;</span><br><span> struct ast_category *cur_cat = NULL;</span><br><span> struct ast_str *sql = ast_str_thread_get(&sql_buf, 200);</span><br><span>@@ -916,7 +916,7 @@</span><br><span> </span><br><span> if ((result = mysql_store_result(&dbh->handle))) {</span><br><span> num_rows = mysql_num_rows(result);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_debug(1, "MySQL RealTime: Found %llu rows.\n", num_rows);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_debug(1, "MySQL RealTime: Found %" PRIu64 " rows.\n", num_rows);</span><br><span> </span><br><span> /* There might exist a better way to access the column names other than counting,</span><br><span> * but I believe that would require another loop that we don't need. */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13816">change 13816</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/+/13816"/><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: I2af4d419a37c1a7eeee750cf9ae4a9a2b3a37fd3 </div>
<div style="display:none"> Gerrit-Change-Number: 13816 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Jaco Kroon <jaco@uls.co.za> </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-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-CC: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>