@@ -367,7 +367,8 @@ MaybeLocal<Promise> FileHandle::ClosePromise() {
367367 Isolate* isolate = close->env ()->isolate ();
368368 if (req->result < 0 ) {
369369 HandleScope handle_scope (isolate);
370- close->Reject (UVException (isolate, req->result , " close" ));
370+ close->Reject (
371+ UVException (isolate, static_cast <int >(req->result ), " close" ));
371372 } else {
372373 close->Resolve ();
373374 }
@@ -491,7 +492,7 @@ int FileHandle::ReadStart() {
491492 BaseObjectPtr<FileHandleReadWrap> read_wrap =
492493 std::move (handle->current_read_ );
493494
494- int result = req->result ;
495+ ssize_t result = req->result ;
495496 uv_buf_t buffer = read_wrap->buffer_ ;
496497
497498 uv_fs_req_cleanup (req);
@@ -555,7 +556,7 @@ int FileHandle::DoShutdown(ShutdownWrap* req_wrap) {
555556 FileHandle* handle = static_cast <FileHandle*>(wrap->stream ());
556557 handle->AfterClose ();
557558
558- int result = req->result ;
559+ int result = static_cast < int >( req->result ) ;
559560 uv_fs_req_cleanup (req);
560561 wrap->Done (result);
561562 }});
@@ -623,13 +624,12 @@ void FSReqAfterScope::Clear() {
623624// in JS for more flexibility.
624625void FSReqAfterScope::Reject (uv_fs_t * req) {
625626 BaseObjectPtr<FSReqBase> wrap { wrap_ };
626- Local<Value> exception =
627- UVException (wrap_->env ()->isolate (),
628- req->result ,
629- wrap_->syscall (),
630- nullptr ,
631- req->path ,
632- wrap_->data ());
627+ Local<Value> exception = UVException (wrap_->env ()->isolate (),
628+ static_cast <int >(req->result ),
629+ wrap_->syscall (),
630+ nullptr ,
631+ req->path ,
632+ wrap_->data ());
633633 Clear ();
634634 wrap->Reject (exception);
635635}
@@ -663,19 +663,21 @@ void AfterInteger(uv_fs_t* req) {
663663 FSReqBase* req_wrap = FSReqBase::from_req (req);
664664 FSReqAfterScope after (req_wrap, req);
665665
666- if (req->result >= 0 && req_wrap->is_plain_open ())
667- req_wrap->env ()->AddUnmanagedFd (req->result );
666+ int result = static_cast <int >(req->result );
667+ if (result >= 0 && req_wrap->is_plain_open ())
668+ req_wrap->env ()->AddUnmanagedFd (result);
668669
669670 if (after.Proceed ())
670- req_wrap->Resolve (Integer::New (req_wrap->env ()->isolate (), req-> result ));
671+ req_wrap->Resolve (Integer::New (req_wrap->env ()->isolate (), result));
671672}
672673
673674void AfterOpenFileHandle (uv_fs_t * req) {
674675 FSReqBase* req_wrap = FSReqBase::from_req (req);
675676 FSReqAfterScope after (req_wrap, req);
676677
677678 if (after.Proceed ()) {
678- FileHandle* fd = FileHandle::New (req_wrap->binding_data (), req->result );
679+ FileHandle* fd = FileHandle::New (req_wrap->binding_data (),
680+ static_cast <int >(req->result ));
679681 if (fd == nullptr ) return ;
680682 req_wrap->Resolve (fd->object ());
681683 }
@@ -1430,7 +1432,7 @@ int MKDirpAsync(uv_loop_t* loop,
14301432 Environment* env = req_wrap->env ();
14311433 uv_loop_t * loop = env->event_loop ();
14321434 std::string path = req->path ;
1433- int err = req->result ;
1435+ int err = static_cast < int >( req->result ) ;
14341436
14351437 while (true ) {
14361438 switch (err) {
@@ -1476,7 +1478,7 @@ int MKDirpAsync(uv_loop_t* loop,
14761478 int err = uv_fs_stat (loop, req, path.c_str (),
14771479 uv_fs_callback_t {[](uv_fs_t * req) {
14781480 FSReqBase* req_wrap = FSReqBase::from_req (req);
1479- int err = req->result ;
1481+ int err = static_cast < int >( req->result ) ;
14801482 if (reinterpret_cast <intptr_t >(req->data ) == UV_EEXIST &&
14811483 req_wrap->continuation_data ()->paths ().size () > 0 ) {
14821484 if (err == 0 && S_ISDIR (req->statbuf .st_mode )) {
0 commit comments