summaryrefslogtreecommitdiff
path: root/src/node_zlib.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-05-27 23:31:31 +0200
committerFedor Indutny <fedor@indutny.com>2014-05-30 11:45:37 +0100
commit820aaf5b3d2728d900ba0ff8903d343840766912 (patch)
tree7d92e15e13be35090b64746efe5e05fc9e3aa735 /src/node_zlib.cc
parentc7b02034ef80313564c50c59c63a5b640c24e234 (diff)
downloadnode-new-820aaf5b3d2728d900ba0ff8903d343840766912.tar.gz
src: replace CONTAINER_OF with type-safe function
Replace the CONTAINER_OF macro with a template function that is as type-safe as a reinterpret_cast<> of an arbitrary pointer can be made. Signed-off-by: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'src/node_zlib.cc')
-rw-r--r--src/node_zlib.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_zlib.cc b/src/node_zlib.cc
index 4453d82b44..4f0c938998 100644
--- a/src/node_zlib.cc
+++ b/src/node_zlib.cc
@@ -246,7 +246,7 @@ class ZCtx : public AsyncWrap {
// for a single write() call, until all of the input bytes have
// been consumed.
static void Process(uv_work_t* work_req) {
- ZCtx *ctx = CONTAINER_OF(work_req, ZCtx, work_req_);
+ ZCtx *ctx = ContainerOf(&ZCtx::work_req_, work_req);
// If the avail_out is left at 0, then it means that it ran out
// of room. If there was avail_out left over, then it means
@@ -320,7 +320,7 @@ class ZCtx : public AsyncWrap {
static void After(uv_work_t* work_req, int status) {
assert(status == 0);
- ZCtx* ctx = CONTAINER_OF(work_req, ZCtx, work_req_);
+ ZCtx* ctx = ContainerOf(&ZCtx::work_req_, work_req);
Environment* env = ctx->env();
HandleScope handle_scope(env->isolate());