Skip to content

Commit fd98d2b

Browse files
committed
style fixes
- missing truffle boundary - missing suppresswarnings annotation
1 parent 3e7edd1 commit fd98d2b

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ protected static boolean isPythonObjectNativeWrapper(Object object) {
995995
abstract static class CheckIterNextResultNode extends CheckFunctionResultNode {
996996

997997
@Specialization(limit = "3")
998-
static Object doGeneric(String name, Object result,
998+
static Object doGeneric(@SuppressWarnings("unused") String name, Object result,
999999
@CachedLibrary("result") InteropLibrary lib,
10001000
@CachedContext(PythonLanguage.class) ContextReference<PythonContext> contextRef,
10011001
@Cached PRaiseNode raiseNode) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/CExtNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3281,7 +3281,7 @@ static long doOther(Object object,
32813281
}
32823282

32833283
static boolean isFallback(Object object) {
3284-
return !(object instanceof PInt || object instanceof Integer || object instanceof Long);
3284+
return !(object instanceof PInt || object instanceof Integer || object instanceof Long);
32853285
}
32863286
}
32873287

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/PyLongDigitsWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ final Object readArrayElement(long index,
142142
}
143143
return (val >> (longShift * index)) & longMask;
144144
} else {
145-
byte[] bytes = ((PInt) delegate).abs().toByteArray();
145+
byte[] bytes = PInt.toByteArray(((PInt) delegate).abs());
146146
// the cast to int is safe since the length check already succeeded
147147
return getUInt32(bytes, (int) index, longShift) & longMask;
148148
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/CExtCommonNodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ static int doPIntTo32Bit(PInt obj, int signed, @SuppressWarnings("unused") long
541541
try {
542542
if (signed != 0) {
543543
return obj.intValueExact();
544-
} else if (obj.bitLength() <= 32) {
544+
} else if (obj.bitLength() <= 32) { // investigate the use of NarrowBigIntegerNode
545+
// (avoid the truffle boundary)
545546
if (obj.isNegative()) {
546547
return raiseNegativeValue(raiseNativeNode);
547548
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/ints/PInt.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ public byte[] toByteArray() {
487487
}
488488

489489
@TruffleBoundary
490-
private static byte[] toByteArray(BigInteger delegate) {
490+
public static byte[] toByteArray(BigInteger delegate) {
491491
return delegate.toByteArray();
492492
}
493493

graalpython/lib-python/3/test/test_struct.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def __init__(self, format):
198198
def test_one(self, x, pack=struct.pack,
199199
unpack=struct.unpack,
200200
unhexlify=binascii.unhexlify):
201+
201202
format = self.format
202203
if self.min_value <= x <= self.max_value:
203204
expected = x

0 commit comments

Comments
 (0)