summaryrefslogtreecommitdiff
path: root/src/env-inl.h
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/env-inl.h
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/env-inl.h')
-rw-r--r--src/env-inl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/env-inl.h b/src/env-inl.h
index 890ddd2305..90fc77c624 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -276,7 +276,7 @@ inline bool Environment::in_domain() const {
inline Environment* Environment::from_immediate_check_handle(
uv_check_t* handle) {
- return CONTAINER_OF(handle, Environment, immediate_check_handle_);
+ return ContainerOf(&Environment::immediate_check_handle_, handle);
}
inline uv_check_t* Environment::immediate_check_handle() {
@@ -289,7 +289,7 @@ inline uv_idle_t* Environment::immediate_idle_handle() {
inline Environment* Environment::from_idle_prepare_handle(
uv_prepare_t* handle) {
- return CONTAINER_OF(handle, Environment, idle_prepare_handle_);
+ return ContainerOf(&Environment::idle_prepare_handle_, handle);
}
inline uv_prepare_t* Environment::idle_prepare_handle() {
@@ -297,7 +297,7 @@ inline uv_prepare_t* Environment::idle_prepare_handle() {
}
inline Environment* Environment::from_idle_check_handle(uv_check_t* handle) {
- return CONTAINER_OF(handle, Environment, idle_check_handle_);
+ return ContainerOf(&Environment::idle_check_handle_, handle);
}
inline uv_check_t* Environment::idle_check_handle() {
@@ -345,7 +345,7 @@ inline void Environment::set_printed_error(bool value) {
}
inline Environment* Environment::from_cares_timer_handle(uv_timer_t* handle) {
- return CONTAINER_OF(handle, Environment, cares_timer_handle_);
+ return ContainerOf(&Environment::cares_timer_handle_, handle);
}
inline uv_timer_t* Environment::cares_timer_handle() {