Source

pecl-event / classes / event.c

Diff from to

classes/event.c

 static void timer_cb(evutil_socket_t fd, short what, void *arg)
 {
 	php_event_t *e = (php_event_t *) arg;
+	zend_fcall_info     *pfci;
+	zval                *arg_data;
+	zval               **args[1];
+	zval                *retval_ptr;
+	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(e);
 	PHP_EVENT_ASSERT(what & EV_TIMEOUT);
 	PHP_EVENT_ASSERT(e->fci && e->fcc);
 
-	zend_fcall_info     *pfci       = e->fci;
-	zval                *arg_data   = e->data;
-	zval               **args[1];
-	zval                *retval_ptr;
+	pfci     = e->fci;
+	arg_data = e->data;
 
-	TSRMLS_FETCH_FROM_CTX(e->thread_ctx);
+	PHP_EVENT_TSRMLS_FETCH_FROM_CTX(e->thread_ctx);
 
 	if (ZEND_FCI_INITIALIZED(*pfci)) {
 		/* Setup callback arg */
 static void event_cb(evutil_socket_t fd, short what, void *arg)
 {
 	php_event_t *e = (php_event_t *) arg;
-
-	PHP_EVENT_ASSERT(e);
-	PHP_EVENT_ASSERT(e->fci && e->fcc);
-
-	zend_fcall_info     *pfci       = e->fci;
-	zval                *arg_data   = e->data;
+	zend_fcall_info     *pfci;
+	zval                *arg_data;
 	zval                *arg_fd;
 	zval                *arg_what;
 	zval               **args[3];
 	zval                *retval_ptr;
+	PHP_EVENT_TSRM_DECL
+
+	PHP_EVENT_ASSERT(e);
+	PHP_EVENT_ASSERT(e->fci && e->fcc);
+
+	pfci       = e->fci;
+	arg_data   = e->data;
 
-	TSRMLS_FETCH_FROM_CTX(e->thread_ctx);
+	PHP_EVENT_TSRMLS_FETCH_FROM_CTX(e->thread_ctx);
 
 	if (ZEND_FCI_INITIALIZED(*pfci)) {
 		/* Setup callback arguments */
 static void signal_cb(evutil_socket_t signum, short what, void *arg)
 {
 	php_event_t *e = (php_event_t *) arg;
+	zend_fcall_info     *pfci;
+	zval                *arg_data;
+	zval                *arg_signum;
+	zval               **args[2];
+	zval                *retval_ptr;
+	PHP_EVENT_TSRM_DECL
 
 	PHP_EVENT_ASSERT(e);
 	PHP_EVENT_ASSERT(what & EV_SIGNAL);
 	PHP_EVENT_ASSERT(e->fci && e->fcc);
 
-	zend_fcall_info     *pfci       = e->fci;
-	zval                *arg_data   = e->data;
-	zval                *arg_signum;
-	zval               **args[2];
-	zval                *retval_ptr;
+	pfci     = e->fci;
+	arg_data = e->data;
 
-	TSRMLS_FETCH_FROM_CTX(e->thread_ctx);
+	PHP_EVENT_TSRMLS_FETCH_FROM_CTX(e->thread_ctx);
 
 	if (ZEND_FCI_INITIALIZED(*pfci)) {
 		/* Setup callback args */