<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18725">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pbx_lua: Remove compiler warnings<br><br>Improved variable definitions (specified correct type) for avoiding<br>compiler warnings.<br><br>ASTERISK-30117 #close<br><br>Change-Id: I3b00c1befb658ee9379ddabd9a9132765ca9201a<br>---<br>M pbx/pbx_lua.c<br>1 file changed, 9 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c</span><br><span>index f6c0656..67b4317 100644</span><br><span>--- a/pbx/pbx_lua.c</span><br><span>+++ b/pbx/pbx_lua.c</span><br><span>@@ -45,8 +45,8 @@</span><br><span> #include <lauxlib.h></span><br><span> #include <lualib.h></span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static char *config = "extensions.lua";</span><br><span style="color: hsl(0, 100%, 40%);">-static char *registrar = "pbx_lua";</span><br><span style="color: hsl(120, 100%, 40%);">+static const char *config = "extensions.lua";</span><br><span style="color: hsl(120, 100%, 40%);">+static const char *registrar = "pbx_lua";</span><br><span> </span><br><span> #ifdef LOW_MEMORY</span><br><span> #define LUA_EXT_DATA_SIZE 256</span><br><span>@@ -60,7 +60,7 @@</span><br><span>  * applications might return */</span><br><span> #define LUA_GOTO_DETECTED 5</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static char *lua_read_extensions_file(lua_State *L, long *size, int *file_not_openable);</span><br><span style="color: hsl(120, 100%, 40%);">+static char *lua_read_extensions_file(lua_State *L, size_t *size, int *file_not_openable);</span><br><span> static int lua_load_extensions(lua_State *L, struct ast_channel *chan);</span><br><span> static int lua_reload_extensions(lua_State *L);</span><br><span> static void lua_free_extensions(void);</span><br><span>@@ -105,7 +105,7 @@</span><br><span> </span><br><span> AST_MUTEX_DEFINE_STATIC(config_file_lock);</span><br><span> static char *config_file_data = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-static long config_file_size = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+static size_t config_file_size = 0;</span><br><span> </span><br><span> static struct ast_context *local_contexts = NULL;</span><br><span> static struct ast_hashtab *local_table = NULL;</span><br><span>@@ -1093,7 +1093,7 @@</span><br><span>  *</span><br><span>  * \return a pointer to the buffer</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-static char *lua_read_extensions_file(lua_State *L, long *size, int *file_not_openable)</span><br><span style="color: hsl(120, 100%, 40%);">+static char *lua_read_extensions_file(lua_State *L, size_t *size, int *file_not_openable)</span><br><span> {</span><br><span>    FILE *f;</span><br><span>     int error_func;</span><br><span>@@ -1217,7 +1217,7 @@</span><br><span>  */</span><br><span> static int lua_reload_extensions(lua_State *L)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-   long size = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+        size_t size = 0;</span><br><span>     char *data = NULL;</span><br><span>   int file_not_openable = 0;</span><br><span> </span><br><span>@@ -1497,7 +1497,8 @@</span><br><span>  */</span><br><span> static int lua_find_extension(lua_State *L, const char *context, const char *exten, int priority, ast_switch_f *func, int push_func)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-      int context_table, context_order_table, i;</span><br><span style="color: hsl(120, 100%, 40%);">+    int context_table, context_order_table;</span><br><span style="color: hsl(120, 100%, 40%);">+       size_t i;</span><br><span> </span><br><span>        ast_debug(2, "Looking up %s@%s:%i\n", exten, context, priority);</span><br><span>   if (priority != 1)</span><br><span>@@ -1690,7 +1691,7 @@</span><br><span>           return res;</span><br><span> </span><br><span>      if (ast_register_switch(&lua_switch)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             ast_log(LOG_ERROR, "Unable to register LUA PBX switch\n");</span><br><span style="color: hsl(120, 100%, 40%);">+          ast_log(LOG_ERROR, "Unable to register Lua PBX switch\n");</span><br><span>                 return AST_MODULE_LOAD_FAILURE;</span><br><span>      }</span><br><span> </span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18725">change 18725</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/+/18725"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I3b00c1befb658ee9379ddabd9a9132765ca9201a </div>
<div style="display:none"> Gerrit-Change-Number: 18725 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Boris P. Korzun <drtr0jan@yandex.ru> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </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-MessageType: merged </div>