mirror of https://github.com/nodejs/node.git
src: use static_cast for void-to-T casts
Code cleanup, replace a few uses of reinterpret_cast<T*>(void_ptr) with static_cast<T*>(void_ptr).pull/5010/head
parent
d4cc30f18c
commit
5383e75885
|
@ -770,8 +770,7 @@ static void QueryWithFamily(const FunctionCallbackInfo<Value>& args) {
|
|||
void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
GetAddrInfoReqWrap* req_wrap =
|
||||
reinterpret_cast<GetAddrInfoReqWrap*>(req->data);
|
||||
GetAddrInfoReqWrap* req_wrap = static_cast<GetAddrInfoReqWrap*>(req->data);
|
||||
|
||||
Local<Value> argv[] = {
|
||||
Integer::New(status, node_isolate),
|
||||
|
|
|
@ -98,7 +98,7 @@ static inline int IsInt64(double x) {
|
|||
static void After(uv_fs_t *req) {
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
FSReqWrap* req_wrap = reinterpret_cast<FSReqWrap*>(req->data);
|
||||
FSReqWrap* req_wrap = static_cast<FSReqWrap*>(req->data);
|
||||
assert(&req_wrap->req_ == req);
|
||||
|
||||
// check if data needs to be cleaned
|
||||
|
|
|
@ -221,8 +221,8 @@ void PipeWrap::OnConnection(uv_stream_t* handle, int status) {
|
|||
|
||||
// TODO(bnoordhuis) Maybe share this with TCPWrap?
|
||||
void PipeWrap::AfterConnect(uv_connect_t* req, int status) {
|
||||
ConnectWrap* req_wrap = reinterpret_cast<ConnectWrap*>(req->data);
|
||||
PipeWrap* wrap = reinterpret_cast<PipeWrap*>(req->handle->data);
|
||||
ConnectWrap* req_wrap = static_cast<ConnectWrap*>(req->data);
|
||||
PipeWrap* wrap = static_cast<PipeWrap*>(req->handle->data);
|
||||
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
|
|
|
@ -335,8 +335,8 @@ void TCPWrap::OnConnection(uv_stream_t* handle, int status) {
|
|||
|
||||
|
||||
void TCPWrap::AfterConnect(uv_connect_t* req, int status) {
|
||||
ConnectWrap* req_wrap = reinterpret_cast<ConnectWrap*>(req->data);
|
||||
TCPWrap* wrap = reinterpret_cast<TCPWrap*>(req->handle->data);
|
||||
ConnectWrap* req_wrap = static_cast<ConnectWrap*>(req->data);
|
||||
TCPWrap* wrap = static_cast<TCPWrap*>(req->handle->data);
|
||||
|
||||
HandleScope scope(node_isolate);
|
||||
|
||||
|
|
|
@ -334,8 +334,8 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
|
|||
|
||||
assert(req != NULL);
|
||||
|
||||
SendWrap* req_wrap = reinterpret_cast<SendWrap*>(req->data);
|
||||
UDPWrap* wrap = reinterpret_cast<UDPWrap*>(req->handle->data);
|
||||
SendWrap* req_wrap = static_cast<SendWrap*>(req->data);
|
||||
UDPWrap* wrap = static_cast<UDPWrap*>(req->handle->data);
|
||||
|
||||
assert(req_wrap->persistent().IsEmpty() == false);
|
||||
assert(wrap->persistent().IsEmpty() == false);
|
||||
|
@ -368,7 +368,7 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
|
|||
return;
|
||||
}
|
||||
|
||||
UDPWrap* wrap = reinterpret_cast<UDPWrap*>(handle->data);
|
||||
UDPWrap* wrap = static_cast<UDPWrap*>(handle->data);
|
||||
|
||||
HandleScope scope(node_isolate);
|
||||
Local<Object> wrap_obj = wrap->object();
|
||||
|
|
Loading…
Reference in New Issue