98
98
import com .oracle .truffle .api .profiles .ConditionProfile ;
99
99
100
100
@ CoreFunctions (extendClasses = PythonBuiltinClassType .PSocket )
101
- @ SuppressWarnings ("unused" )
102
101
public class SocketBuiltins extends PythonBuiltins {
103
102
104
103
@ Override
@@ -342,7 +341,7 @@ Object listen(PSocket socket, int backlog) {
342
341
343
342
@ Specialization
344
343
@ TruffleBoundary
345
- Object listen (PSocket socket , PNone backlog ) {
344
+ Object listen (PSocket socket , @ SuppressWarnings ( "unused" ) PNone backlog ) {
346
345
return listen (socket , 50 );
347
346
}
348
347
}
@@ -354,7 +353,7 @@ Object listen(PSocket socket, PNone backlog) {
354
353
@ GenerateNodeFactory
355
354
abstract static class RecvNode extends PythonTernaryClinicBuiltinNode {
356
355
@ Specialization
357
- Object recv (VirtualFrame frame , PSocket socket , int bufsize , int flags ,
356
+ Object recv (VirtualFrame frame , PSocket socket , int bufsize , @ SuppressWarnings ( "unused" ) int flags ,
358
357
@ Cached GilNode gil ) {
359
358
if (socket .getSocket () == null ) {
360
359
throw raiseOSError (frame , OSErrorEnum .ENOTCONN );
@@ -385,11 +384,13 @@ protected ArgumentClinicProvider getArgumentClinic() {
385
384
@ Builtin (name = "recvfrom" , minNumOfPositionalArgs = 2 , maxNumOfPositionalArgs = 3 )
386
385
@ GenerateNodeFactory
387
386
abstract static class RecvFromNode extends PythonTernaryBuiltinNode {
387
+ @ SuppressWarnings ("unused" )
388
388
@ Specialization
389
389
Object recvFrom (PSocket socket , int bufsize , int flags ) {
390
390
return PNotImplemented .NOT_IMPLEMENTED ;
391
391
}
392
392
393
+ @ SuppressWarnings ("unused" )
393
394
@ Specialization
394
395
Object recvFrom (PSocket socket , int bufsize , PNone flags ) {
395
396
return PNotImplemented .NOT_IMPLEMENTED ;
@@ -405,8 +406,7 @@ protected static SequenceStorageNodes.SetItemNode createSetItem() {
405
406
}
406
407
407
408
@ Specialization
408
- Object recvInto (VirtualFrame frame , PSocket socket , PMemoryView buffer , Object flags ,
409
- @ Cached ConditionProfile byteStorage ,
409
+ Object recvInto (VirtualFrame frame , PSocket socket , PMemoryView buffer , @ SuppressWarnings ("unused" ) Object flags ,
410
410
@ Cached PyNumberAsSizeNode asSizeNode ,
411
411
@ Cached ("create(__LEN__)" ) LookupAndCallUnaryNode callLen ,
412
412
@ Cached ("create(__SETITEM__)" ) LookupAndCallTernaryNode setItem ) {
@@ -435,7 +435,7 @@ Object recvInto(VirtualFrame frame, PSocket socket, PMemoryView buffer, Object f
435
435
}
436
436
437
437
@ Specialization
438
- Object recvInto (VirtualFrame frame , PSocket socket , PByteArray buffer , Object flags ,
438
+ Object recvInto (VirtualFrame frame , PSocket socket , PByteArray buffer , @ SuppressWarnings ( "unused" ) Object flags ,
439
439
@ Cached GilNode gil ,
440
440
@ Cached ConditionProfile byteStorage ,
441
441
@ Cached SequenceStorageNodes .LenNode lenNode ,
@@ -488,16 +488,19 @@ Object recvInto(VirtualFrame frame, PSocket socket, PByteArray buffer, Object fl
488
488
@ Builtin (name = "recvmsg" , minNumOfPositionalArgs = 2 , maxNumOfPositionalArgs = 4 )
489
489
@ GenerateNodeFactory
490
490
abstract static class RecvMsgNode extends PythonBuiltinNode {
491
+ @ SuppressWarnings ("unused" )
491
492
@ Specialization
492
493
Object recvFrom (PSocket socket , int bufsize , int ancbufsize , int flags ) {
493
494
return PNotImplemented .NOT_IMPLEMENTED ;
494
495
}
495
496
497
+ @ SuppressWarnings ("unused" )
496
498
@ Specialization
497
499
Object recvFrom (PSocket socket , int bufsize , int ancbufsize , PNone flags ) {
498
500
return PNotImplemented .NOT_IMPLEMENTED ;
499
501
}
500
502
503
+ @ SuppressWarnings ("unused" )
501
504
@ Specialization
502
505
Object recvFrom (PSocket socket , int bufsize , PNone ancbufsize , PNone flags ) {
503
506
return PNotImplemented .NOT_IMPLEMENTED ;
@@ -509,7 +512,7 @@ Object recvFrom(PSocket socket, int bufsize, PNone ancbufsize, PNone flags) {
509
512
@ GenerateNodeFactory
510
513
abstract static class SendNode extends PythonTernaryBuiltinNode {
511
514
@ Specialization
512
- Object send (VirtualFrame frame , PSocket socket , PBytes bytes , Object flags ,
515
+ Object send (VirtualFrame frame , PSocket socket , PBytes bytes , @ SuppressWarnings ( "unused" ) Object flags ,
513
516
@ Cached GilNode gil ,
514
517
@ Cached SequenceStorageNodes .ToByteArrayNode toBytes ) {
515
518
// TODO: do not ignore flags
@@ -542,7 +545,7 @@ Object send(VirtualFrame frame, PSocket socket, PBytes bytes, Object flags,
542
545
@ GenerateNodeFactory
543
546
abstract static class SendAllNode extends PythonTernaryBuiltinNode {
544
547
@ Specialization
545
- Object sendAll (VirtualFrame frame , PSocket socket , PBytesLike bytes , Object flags ,
548
+ Object sendAll (VirtualFrame frame , PSocket socket , PBytesLike bytes , @ SuppressWarnings ( "unused" ) Object flags ,
546
549
@ Cached GilNode gil ,
547
550
@ Cached SequenceStorageNodes .ToByteArrayNode toBytes ,
548
551
@ Cached ConditionProfile hasTimeoutProfile ) {
@@ -586,11 +589,13 @@ Object sendAll(VirtualFrame frame, PSocket socket, PBytesLike bytes, Object flag
586
589
@ Builtin (name = "sendto" , minNumOfPositionalArgs = 3 , maxNumOfPositionalArgs = 4 )
587
590
@ GenerateNodeFactory
588
591
abstract static class SendToNode extends PythonBuiltinNode {
592
+ @ SuppressWarnings ("unused" )
589
593
@ Specialization
590
594
Object sendTo (PSocket socket , Object bytes , int flags , Object address ) {
591
595
return PNotImplemented .NOT_IMPLEMENTED ;
592
596
}
593
597
598
+ @ SuppressWarnings ("unused" )
594
599
@ Specialization
595
600
Object sendTo (PSocket socket , Object bytes , PNone flags , Object address ) {
596
601
return PNotImplemented .NOT_IMPLEMENTED ;
@@ -601,6 +606,7 @@ Object sendTo(PSocket socket, Object bytes, PNone flags, Object address) {
601
606
@ Builtin (name = "sendmsg" , minNumOfPositionalArgs = 2 , maxNumOfPositionalArgs = 5 )
602
607
@ GenerateNodeFactory
603
608
abstract static class SendMsgNode extends PythonBuiltinNode {
609
+ @ SuppressWarnings ("unused" )
604
610
@ Specialization
605
611
Object sendMsg (PSocket socket , Object buffers , Object ancdata , int flags , Object address ) {
606
612
return PNotImplemented .NOT_IMPLEMENTED ;
@@ -743,6 +749,7 @@ int detach(PSocket socket) {
743
749
@ Builtin (name = "_setsockopt" , minNumOfPositionalArgs = 4 )
744
750
@ GenerateNodeFactory
745
751
abstract static class SetSockOptNode extends PythonBuiltinNode {
752
+ @ SuppressWarnings ("unused" )
746
753
@ Specialization
747
754
Object setSockOpt (PSocket socket , Object level , Object optname , Object value , Object optlen ) {
748
755
return PNone .NONE ;
0 commit comments