@@ -367,7 +367,8 @@ MaybeLocal<Promise> FileHandle::ClosePromise() {
367
367
Isolate* isolate = close ->env ()->isolate ();
368
368
if (req->result < 0 ) {
369
369
HandleScope handle_scope (isolate);
370
- close ->Reject (UVException (isolate, req->result , " close" ));
370
+ close ->Reject (
371
+ UVException (isolate, static_cast <int >(req->result ), " close" ));
371
372
} else {
372
373
close ->Resolve ();
373
374
}
@@ -491,7 +492,7 @@ int FileHandle::ReadStart() {
491
492
BaseObjectPtr<FileHandleReadWrap> read_wrap =
492
493
std::move (handle->current_read_ );
493
494
494
- int result = req->result ;
495
+ ssize_t result = req->result ;
495
496
uv_buf_t buffer = read_wrap->buffer_ ;
496
497
497
498
uv_fs_req_cleanup (req);
@@ -555,7 +556,7 @@ int FileHandle::DoShutdown(ShutdownWrap* req_wrap) {
555
556
FileHandle* handle = static_cast <FileHandle*>(wrap->stream ());
556
557
handle->AfterClose ();
557
558
558
- int result = req->result ;
559
+ int result = static_cast < int >( req->result ) ;
559
560
uv_fs_req_cleanup (req);
560
561
wrap->Done (result);
561
562
}});
@@ -623,13 +624,12 @@ void FSReqAfterScope::Clear() {
623
624
// in JS for more flexibility.
624
625
void FSReqAfterScope::Reject (uv_fs_t * req) {
625
626
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 ());
633
633
Clear ();
634
634
wrap->Reject (exception );
635
635
}
@@ -663,19 +663,21 @@ void AfterInteger(uv_fs_t* req) {
663
663
FSReqBase* req_wrap = FSReqBase::from_req (req);
664
664
FSReqAfterScope after (req_wrap, req);
665
665
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);
668
669
669
670
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));
671
672
}
672
673
673
674
void AfterOpenFileHandle (uv_fs_t * req) {
674
675
FSReqBase* req_wrap = FSReqBase::from_req (req);
675
676
FSReqAfterScope after (req_wrap, req);
676
677
677
678
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 ));
679
681
if (fd == nullptr ) return ;
680
682
req_wrap->Resolve (fd->object ());
681
683
}
@@ -1430,7 +1432,7 @@ int MKDirpAsync(uv_loop_t* loop,
1430
1432
Environment* env = req_wrap->env ();
1431
1433
uv_loop_t * loop = env->event_loop ();
1432
1434
std::string path = req->path ;
1433
- int err = req->result ;
1435
+ int err = static_cast < int >( req->result ) ;
1434
1436
1435
1437
while (true ) {
1436
1438
switch (err) {
@@ -1476,7 +1478,7 @@ int MKDirpAsync(uv_loop_t* loop,
1476
1478
int err = uv_fs_stat (loop, req, path.c_str (),
1477
1479
uv_fs_callback_t {[](uv_fs_t * req) {
1478
1480
FSReqBase* req_wrap = FSReqBase::from_req (req);
1479
- int err = req->result ;
1481
+ int err = static_cast < int >( req->result ) ;
1480
1482
if (reinterpret_cast <intptr_t >(req->data ) == UV_EEXIST &&
1481
1483
req_wrap->continuation_data ()->paths ().size () > 0 ) {
1482
1484
if (err == 0 && S_ISDIR (req->statbuf .st_mode )) {
0 commit comments