Use cork_container_of instead

This commit is contained in:
Max Lv
2016-12-08 15:06:42 +08:00
parent 65843154cf
commit 25cc062e5d
6 changed files with 6 additions and 10 deletions
+2 -1
View File
@@ -745,7 +745,8 @@ static void
remote_timeout_cb(EV_P_ ev_timer *watcher, int revents)
{
remote_ctx_t *remote_ctx
= (remote_ctx_t *)container_of(watcher, remote_ctx_t, watcher);
= cork_container_of(watcher, remote_ctx_t, watcher);
remote_t *remote = remote_ctx->remote;
server_t *server = remote->server;
+1 -1
View File
@@ -329,7 +329,7 @@ static void
remote_timeout_cb(EV_P_ ev_timer *watcher, int revents)
{
remote_ctx_t *remote_ctx
= (remote_ctx_t *)container_of(watcher, remote_ctx_t, watcher);
= cork_container_of(watcher, remote_ctx_t, watcher);
remote_t *remote = remote_ctx->remote;
server_t *server = remote->server;
+1 -1
View File
@@ -1050,7 +1050,7 @@ static void
server_timeout_cb(EV_P_ ev_timer *watcher, int revents)
{
server_ctx_t *server_ctx
= (server_ctx_t *)container_of(watcher, server_ctx_t, watcher);
= cork_container_of(watcher, server_ctx_t, watcher);
server_t *server = server_ctx->server;
remote_t *remote = server->remote;
+1 -1
View File
@@ -285,7 +285,7 @@ static void
remote_timeout_cb(EV_P_ ev_timer *watcher, int revents)
{
remote_ctx_t *remote_ctx
= (remote_ctx_t *)container_of(watcher, remote_ctx_t, watcher);
= cork_container_of(watcher, remote_ctx_t, watcher);
remote_t *remote = remote_ctx->remote;
server_t *server = remote->server;
+1 -1
View File
@@ -550,7 +550,7 @@ static void
remote_timeout_cb(EV_P_ ev_timer *watcher, int revents)
{
remote_ctx_t *remote_ctx
= (remote_ctx_t *)container_of(watcher, remote_ctx_t, watcher);
= cork_container_of(watcher, remote_ctx_t, watcher);
if (verbose) {
LOGI("[udp] connection timeout");
-5
View File
@@ -229,9 +229,4 @@ void *ss_realloc(void *ptr, size_t new_size);
ptr = NULL; \
} while (0)
#ifndef container_of
#define container_of(ptr, type, member) \
((type *) ((char *)(ptr) - offsetof(type, member)))
#endif
#endif // _UTILS_H