Simplify and abstract C func arg access

PUBLISHED_FROM=c174439a2d22794497dc35fd46ceb1f6c4e553a2
This commit is contained in:
Marko Mikulicic 2015-10-06 18:47:54 +02:00 committed by Sergey Lyubka
parent a941687db0
commit b50c183c19

View File

@ -1890,9 +1890,9 @@ void mg_mgr_init(struct mg_mgr *m, void *user_data) {
} }
#ifdef MG_ENABLE_JAVASCRIPT #ifdef MG_ENABLE_JAVASCRIPT
static v7_val_t mg_send_js(struct v7 *v7, v7_val_t args) { static v7_val_t mg_send_js(struct v7 *v7) {
v7_val_t arg0 = v7_array_get(v7, args, 0); v7_val_t arg0 = v7_arg(v7, 0);
v7_val_t arg1 = v7_array_get(v7, args, 1); v7_val_t arg1 = v7_arg(v7, 1);
struct mg_connection *c = (struct mg_connection *) v7_to_foreign(arg0); struct mg_connection *c = (struct mg_connection *) v7_to_foreign(arg0);
size_t len = 0; size_t len = 0;