Skip to content

Commit 5737b34

Browse files
committed
some cleanups
1 parent a95cdee commit 5737b34

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/socket/SocketBuiltins.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
import com.oracle.truffle.api.profiles.ConditionProfile;
9999

100100
@CoreFunctions(extendClasses = PythonBuiltinClassType.PSocket)
101-
@SuppressWarnings("unused")
102101
public class SocketBuiltins extends PythonBuiltins {
103102

104103
@Override
@@ -342,7 +341,7 @@ Object listen(PSocket socket, int backlog) {
342341

343342
@Specialization
344343
@TruffleBoundary
345-
Object listen(PSocket socket, PNone backlog) {
344+
Object listen(PSocket socket, @SuppressWarnings("unused") PNone backlog) {
346345
return listen(socket, 50);
347346
}
348347
}
@@ -354,7 +353,7 @@ Object listen(PSocket socket, PNone backlog) {
354353
@GenerateNodeFactory
355354
abstract static class RecvNode extends PythonTernaryClinicBuiltinNode {
356355
@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,
358357
@Cached GilNode gil) {
359358
if (socket.getSocket() == null) {
360359
throw raiseOSError(frame, OSErrorEnum.ENOTCONN);
@@ -385,11 +384,13 @@ protected ArgumentClinicProvider getArgumentClinic() {
385384
@Builtin(name = "recvfrom", minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 3)
386385
@GenerateNodeFactory
387386
abstract static class RecvFromNode extends PythonTernaryBuiltinNode {
387+
@SuppressWarnings("unused")
388388
@Specialization
389389
Object recvFrom(PSocket socket, int bufsize, int flags) {
390390
return PNotImplemented.NOT_IMPLEMENTED;
391391
}
392392

393+
@SuppressWarnings("unused")
393394
@Specialization
394395
Object recvFrom(PSocket socket, int bufsize, PNone flags) {
395396
return PNotImplemented.NOT_IMPLEMENTED;
@@ -405,8 +406,7 @@ protected static SequenceStorageNodes.SetItemNode createSetItem() {
405406
}
406407

407408
@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,
410410
@Cached PyNumberAsSizeNode asSizeNode,
411411
@Cached("create(__LEN__)") LookupAndCallUnaryNode callLen,
412412
@Cached("create(__SETITEM__)") LookupAndCallTernaryNode setItem) {
@@ -435,7 +435,7 @@ Object recvInto(VirtualFrame frame, PSocket socket, PMemoryView buffer, Object f
435435
}
436436

437437
@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,
439439
@Cached GilNode gil,
440440
@Cached ConditionProfile byteStorage,
441441
@Cached SequenceStorageNodes.LenNode lenNode,
@@ -488,16 +488,19 @@ Object recvInto(VirtualFrame frame, PSocket socket, PByteArray buffer, Object fl
488488
@Builtin(name = "recvmsg", minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 4)
489489
@GenerateNodeFactory
490490
abstract static class RecvMsgNode extends PythonBuiltinNode {
491+
@SuppressWarnings("unused")
491492
@Specialization
492493
Object recvFrom(PSocket socket, int bufsize, int ancbufsize, int flags) {
493494
return PNotImplemented.NOT_IMPLEMENTED;
494495
}
495496

497+
@SuppressWarnings("unused")
496498
@Specialization
497499
Object recvFrom(PSocket socket, int bufsize, int ancbufsize, PNone flags) {
498500
return PNotImplemented.NOT_IMPLEMENTED;
499501
}
500502

503+
@SuppressWarnings("unused")
501504
@Specialization
502505
Object recvFrom(PSocket socket, int bufsize, PNone ancbufsize, PNone flags) {
503506
return PNotImplemented.NOT_IMPLEMENTED;
@@ -509,7 +512,7 @@ Object recvFrom(PSocket socket, int bufsize, PNone ancbufsize, PNone flags) {
509512
@GenerateNodeFactory
510513
abstract static class SendNode extends PythonTernaryBuiltinNode {
511514
@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,
513516
@Cached GilNode gil,
514517
@Cached SequenceStorageNodes.ToByteArrayNode toBytes) {
515518
// TODO: do not ignore flags
@@ -542,7 +545,7 @@ Object send(VirtualFrame frame, PSocket socket, PBytes bytes, Object flags,
542545
@GenerateNodeFactory
543546
abstract static class SendAllNode extends PythonTernaryBuiltinNode {
544547
@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,
546549
@Cached GilNode gil,
547550
@Cached SequenceStorageNodes.ToByteArrayNode toBytes,
548551
@Cached ConditionProfile hasTimeoutProfile) {
@@ -586,11 +589,13 @@ Object sendAll(VirtualFrame frame, PSocket socket, PBytesLike bytes, Object flag
586589
@Builtin(name = "sendto", minNumOfPositionalArgs = 3, maxNumOfPositionalArgs = 4)
587590
@GenerateNodeFactory
588591
abstract static class SendToNode extends PythonBuiltinNode {
592+
@SuppressWarnings("unused")
589593
@Specialization
590594
Object sendTo(PSocket socket, Object bytes, int flags, Object address) {
591595
return PNotImplemented.NOT_IMPLEMENTED;
592596
}
593597

598+
@SuppressWarnings("unused")
594599
@Specialization
595600
Object sendTo(PSocket socket, Object bytes, PNone flags, Object address) {
596601
return PNotImplemented.NOT_IMPLEMENTED;
@@ -601,6 +606,7 @@ Object sendTo(PSocket socket, Object bytes, PNone flags, Object address) {
601606
@Builtin(name = "sendmsg", minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 5)
602607
@GenerateNodeFactory
603608
abstract static class SendMsgNode extends PythonBuiltinNode {
609+
@SuppressWarnings("unused")
604610
@Specialization
605611
Object sendMsg(PSocket socket, Object buffers, Object ancdata, int flags, Object address) {
606612
return PNotImplemented.NOT_IMPLEMENTED;
@@ -743,6 +749,7 @@ int detach(PSocket socket) {
743749
@Builtin(name = "_setsockopt", minNumOfPositionalArgs = 4)
744750
@GenerateNodeFactory
745751
abstract static class SetSockOptNode extends PythonBuiltinNode {
752+
@SuppressWarnings("unused")
746753
@Specialization
747754
Object setSockOpt(PSocket socket, Object level, Object optname, Object value, Object optlen) {
748755
return PNone.NONE;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/expression/BinaryArithmetic.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
import com.oracle.graal.python.nodes.SpecialMethodNames;
5353
import com.oracle.graal.python.nodes.call.special.LookupAndCallBinaryNode;
5454
import com.oracle.graal.python.nodes.call.special.LookupAndCallBinaryNode.NotImplementedHandler;
55-
import com.oracle.graal.python.nodes.call.special.LookupAndCallTernaryNode;
5655
import com.oracle.graal.python.util.Supplier;
5756
import com.oracle.truffle.api.CompilerDirectives;
5857
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -138,9 +137,8 @@ public NodeCost getCost() {
138137
}
139138

140139
/**
141-
* A helper root node that dispatches to {@link LookupAndCallTernaryNode} to execute the
142-
* provided ternary operator. Note: this is just a root node and won't do any signature
143-
* checking.
140+
* A helper root node that dispatches to {@link LookupAndCallBinaryNode} to execute the provided
141+
* ternary operator. Note: this is just a root node and won't do any signature checking.
144142
*/
145143
static final class CallBinaryArithmeticRootNode extends CallArithmeticRootNode {
146144
static final Signature SIGNATURE_BINARY = new Signature(2, false, -1, false, new String[]{"$self", "other"}, null);

0 commit comments

Comments
 (0)