@@ -205,7 +205,7 @@ impl Operator<'_> {
205205 self ,
206206 SUPPORT_POLL_ADD ,
207207 PollAdd ,
208- PollAdd :: new( Fd ( fd) , flags as u32 )
208+ PollAdd :: new( Fd ( fd) , flags. try_into ( ) . expect ( "flags overflow" ) )
209209 . build( )
210210 . user_data( user_data as u64 )
211211 )
@@ -458,10 +458,14 @@ impl Operator<'_> {
458458 self ,
459459 SUPPORT_RECV ,
460460 Recv ,
461- Recv :: new( Fd ( fd) , buf. cast:: <u8 >( ) , len as u32 )
462- . flags( flags)
463- . build( )
464- . user_data( user_data as u64 )
461+ Recv :: new(
462+ Fd ( fd) ,
463+ buf. cast:: <u8 >( ) ,
464+ len. try_into( ) . expect( "len overflow" )
465+ )
466+ . flags( flags)
467+ . build( )
468+ . user_data( user_data as u64 )
465469 )
466470 }
467471
@@ -476,9 +480,13 @@ impl Operator<'_> {
476480 self ,
477481 SUPPORT_READ ,
478482 Read ,
479- Read :: new( Fd ( fd) , buf. cast:: <u8 >( ) , count as u32 )
480- . build( )
481- . user_data( user_data as u64 )
483+ Read :: new(
484+ Fd ( fd) ,
485+ buf. cast:: <u8 >( ) ,
486+ count. try_into( ) . expect( "count overflow" )
487+ )
488+ . build( )
489+ . user_data( user_data as u64 )
482490 )
483491 }
484492
@@ -494,10 +502,14 @@ impl Operator<'_> {
494502 self ,
495503 SUPPORT_READ ,
496504 Read ,
497- Read :: new( Fd ( fd) , buf. cast:: <u8 >( ) , count as u32 )
498- . offset( offset as u64 )
499- . build( )
500- . user_data( user_data as u64 )
505+ Read :: new(
506+ Fd ( fd) ,
507+ buf. cast:: <u8 >( ) ,
508+ count. try_into( ) . expect( "count overflow" )
509+ )
510+ . offset( offset. try_into( ) . expect( "offset overflow" ) )
511+ . build( )
512+ . user_data( user_data as u64 )
501513 )
502514 }
503515
@@ -512,7 +524,7 @@ impl Operator<'_> {
512524 self ,
513525 SUPPORT_READV ,
514526 Readv ,
515- Readv :: new( Fd ( fd) , iov, iovcnt as u32 )
527+ Readv :: new( Fd ( fd) , iov, iovcnt. try_into ( ) . expect ( "iovcnt overflow" ) )
516528 . build( )
517529 . user_data( user_data as u64 )
518530 )
@@ -530,8 +542,8 @@ impl Operator<'_> {
530542 self ,
531543 SUPPORT_READV ,
532544 Readv ,
533- Readv :: new( Fd ( fd) , iov, iovcnt as u32 )
534- . offset( offset as u64 )
545+ Readv :: new( Fd ( fd) , iov, iovcnt. try_into ( ) . expect ( "iovcnt overflow" ) )
546+ . offset( offset. try_into ( ) . expect ( "offset overflow" ) )
535547 . build( )
536548 . user_data( user_data as u64 )
537549 )
@@ -549,7 +561,7 @@ impl Operator<'_> {
549561 SUPPORT_RECVMSG ,
550562 RecvMsg ,
551563 RecvMsg :: new( Fd ( fd) , msg)
552- . flags( flags as u32 )
564+ . flags( flags. try_into ( ) . expect ( "flags overflow" ) )
553565 . build( )
554566 . user_data( user_data as u64 )
555567 )
@@ -567,10 +579,14 @@ impl Operator<'_> {
567579 self ,
568580 SUPPORT_SEND ,
569581 Send ,
570- Send :: new( Fd ( fd) , buf. cast:: <u8 >( ) , len as u32 )
571- . flags( flags)
572- . build( )
573- . user_data( user_data as u64 )
582+ Send :: new(
583+ Fd ( fd) ,
584+ buf. cast:: <u8 >( ) ,
585+ len. try_into( ) . expect( "len overflow" )
586+ )
587+ . flags( flags)
588+ . build( )
589+ . user_data( user_data as u64 )
574590 )
575591 }
576592
@@ -588,12 +604,16 @@ impl Operator<'_> {
588604 self ,
589605 SUPPORT_SEND_ZC ,
590606 SendZc ,
591- SendZc :: new( Fd ( fd) , buf. cast:: <u8 >( ) , len as u32 )
592- . flags( flags)
593- . dest_addr( addr)
594- . dest_addr_len( addrlen)
595- . build( )
596- . user_data( user_data as u64 )
607+ SendZc :: new(
608+ Fd ( fd) ,
609+ buf. cast:: <u8 >( ) ,
610+ len. try_into( ) . expect( "len overflow" )
611+ )
612+ . flags( flags)
613+ . dest_addr( addr)
614+ . dest_addr_len( addrlen)
615+ . build( )
616+ . user_data( user_data as u64 )
597617 )
598618 }
599619
@@ -608,9 +628,13 @@ impl Operator<'_> {
608628 self ,
609629 SUPPORT_WRITE ,
610630 Write ,
611- Write :: new( Fd ( fd) , buf. cast:: <u8 >( ) , count as u32 )
612- . build( )
613- . user_data( user_data as u64 )
631+ Write :: new(
632+ Fd ( fd) ,
633+ buf. cast:: <u8 >( ) ,
634+ count. try_into( ) . expect( "count overflow" )
635+ )
636+ . build( )
637+ . user_data( user_data as u64 )
614638 )
615639 }
616640
@@ -626,10 +650,14 @@ impl Operator<'_> {
626650 self ,
627651 SUPPORT_WRITE ,
628652 Write ,
629- Write :: new( Fd ( fd) , buf. cast:: <u8 >( ) , count as u32 )
630- . offset( offset as u64 )
631- . build( )
632- . user_data( user_data as u64 )
653+ Write :: new(
654+ Fd ( fd) ,
655+ buf. cast:: <u8 >( ) ,
656+ count. try_into( ) . expect( "count overflow" )
657+ )
658+ . offset( offset. try_into( ) . expect( "offset overflow" ) )
659+ . build( )
660+ . user_data( user_data as u64 )
633661 )
634662 }
635663
@@ -644,7 +672,7 @@ impl Operator<'_> {
644672 self ,
645673 SUPPORT_WRITEV ,
646674 Writev ,
647- Writev :: new( Fd ( fd) , iov, iovcnt as u32 )
675+ Writev :: new( Fd ( fd) , iov, iovcnt. try_into ( ) . expect ( "iovcnt overflow" ) )
648676 . build( )
649677 . user_data( user_data as u64 )
650678 )
@@ -662,8 +690,8 @@ impl Operator<'_> {
662690 self ,
663691 SUPPORT_WRITEV ,
664692 Writev ,
665- Writev :: new( Fd ( fd) , iov, iovcnt as u32 )
666- . offset( offset as u64 )
693+ Writev :: new( Fd ( fd) , iov, iovcnt. try_into ( ) . expect ( "iovcnt overflow" ) )
694+ . offset( offset. try_into ( ) . expect ( "offset overflow" ) )
667695 . build( )
668696 . user_data( user_data as u64 )
669697 )
@@ -681,7 +709,7 @@ impl Operator<'_> {
681709 SUPPORT_SENDMSG ,
682710 SendMsg ,
683711 SendMsg :: new( Fd ( fd) , msg)
684- . flags( flags as u32 )
712+ . flags( flags. try_into ( ) . expect ( "flags overflow" ) )
685713 . build( )
686714 . user_data( user_data as u64 )
687715 )
0 commit comments