--- EV-Glib/Glib.xs 2007/12/08 02:49:42 1.1 +++ EV-Glib/Glib.xs 2007/12/08 02:59:43 1.2 @@ -31,13 +31,13 @@ }; static void -timer_cb (ev_timer *w, int revents) +timer_cb (EV_P_ ev_timer *w, int revents) { /* nop */ } static void -io_cb (ev_io *w, int revents) +io_cb (EV_P_ ev_io *w, int revents) { GPollFD *pfd = (GPollFD *)w->data; @@ -47,13 +47,13 @@ } static void -cleanup (struct econtext *ctx) +cleanup (EV_P_ struct econtext *ctx) { int i; for (i = 0; i < ctx->nfd; ++i) { - ev_ref (); + ev_ref (EV_A); ev_io_stop (EV_A_ ctx->iow + i); } @@ -61,19 +61,19 @@ if (ev_is_active (&ctx->tw)) { - ev_ref (); + ev_ref (EV_A); ev_timer_stop (EV_A_ &ctx->tw); } } static void -prepare_cb (ev_prepare *w, int revents) +prepare_cb (EV_P_ ev_prepare *w, int revents) { struct econtext *ctx = (struct econtext *)(((char *)w) - offsetof (struct econtext, pw)); gint timeout; int n; - cleanup (ctx); + cleanup (EV_A_ ctx); g_main_context_prepare (ctx->gc, &ctx->maxpri); @@ -112,22 +112,23 @@ ); iow->data = (void *)pfd; ev_io_start (EV_A_ iow); - ev_unref (); + ev_unref (EV_A); } if (timeout >= 0) { ev_timer_set (&ctx->tw, timeout * 1e-3, 0.); ev_timer_start (EV_A_ &ctx->tw); + ev_unref (EV_A); } } static void -check_cb (ev_check *w, int revents) +check_cb (EV_P_ ev_check *w, int revents) { struct econtext *ctx = (struct econtext *)(((char *)w) - offsetof (struct econtext, cw)); - cleanup (ctx); + cleanup (EV_A_ ctx); g_main_context_check (ctx->gc, ctx->maxpri, ctx->pfd, ctx->nfd); g_main_context_dispatch (ctx->gc);