<div dir="ltr">Well, I agree with you about the api name.<div><br></div><div>And, since we have done this, the "fd:cancel" should be renamed to "fd:delete" too.</div><div><br></div><div>The code is:</div>
<div><br></div><div><div> static const luaL_Reg ufd_m[] = {</div><div><span class="" style="white-space:pre"> </span>{ "cancel", ul_ufd_delete },</div><div><span class="" style="white-space:pre"> </span>{ NULL, NULL }</div>
<div> };</div><div><br></div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 20, 2014 at 7:40 PM, John Crispin <span dir="ltr"><<a href="mailto:john@phrozen.org" target="_blank">john@phrozen.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
<br>
On 20/06/2014 13:31, <a href="mailto:xfguo@credosemi.com">xfguo@credosemi.com</a> wrote:<br>
> The static variable `state` in `lua/uloop.c` should be clean after<br>
> every callback.<br>
><br>
> Signed-off-by: Xiongfei(Alex) Guo <<a href="mailto:xfguo@credosemi.com">xfguo@credosemi.com</a>> ---<br>
<br>
<br>
</div>Hi,<br>
<br>
just had a quick browse over the patches. looks good, the only nipick<br>
i have is this<br>
<br>
+static int ul_cancel(lua_State *L)<br>
+{<br>
+ uloop_end();<br>
+ return 1;<br>
+}<br>
<br>
can we rename is to ul_end() and then also fix up {"cancel",<br>
ul_cancel} to use end instead of cancel. that way the apis have the<br>
same names in lua and c. apart from that thanks for the patches, i<br>
will give them a try later on and then merge them into the git.<br>
<br>
John<br>
<div class=""><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
> lua/uloop.c | 2 ++ 1 file changed, 2 insertions(+)<br>
><br>
> diff --git a/lua/uloop.c b/lua/uloop.c index 51f53c2..5922e04<br>
> 100644 --- a/lua/uloop.c +++ b/lua/uloop.c @@ -43,6 +43,7 @@ static<br>
> void ul_timer_cb(struct uloop_timeout *t)<br>
><br>
> lua_getglobal(state, "__uloop_cb"); lua_rawgeti(state, -1,<br>
> tout->r); + lua_remove(state, -2); lua_call(state, 0, 0); }<br>
><br>
> @@ -133,6 +134,7 @@ static void ul_process_cb(struct uloop_process<br>
> *p, int ret) lua_getglobal(state, "__uloop_cb"); lua_rawgeti(state,<br>
> -1, proc->r); luaL_unref(state, -2, proc->r); + lua_remove(state,<br>
> -2); lua_pushinteger(state, ret >> 8); lua_call(state, 1, 0); }<br>
><br>
</div>_______________________________________________<br>
openwrt-devel mailing list<br>
<a href="mailto:openwrt-devel@lists.openwrt.org">openwrt-devel@lists.openwrt.org</a><br>
<a href="https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel" target="_blank">https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel</a><br>
</blockquote></div><br></div>