Skip to content

Commit 74c0c6d

Browse files
committed
more style fixes
1 parent aa3f5bb commit 74c0c6d

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -683,13 +683,8 @@ public boolean isNan(Object value) {
683683
@Builtin(name = "isclose", minNumOfArguments = 2, keywordArguments = {"rel_tol", "abs_tol"})
684684
@GenerateNodeFactory
685685
public abstract static class IsCloseNode extends PythonBuiltinNode {
686-
private double defaultRel() {
687-
return 1e-09;
688-
}
689-
690-
private double defaultAbs() {
691-
return 0.0;
692-
}
686+
private static double DEFAULT_REL = 1e-09;
687+
private static double DEFAULT_ABS = 0.0;
693688

694689
private boolean isCloseDouble(double a, double b, double rel_tol, double abs_tol) {
695690
double diff;
@@ -713,18 +708,18 @@ private boolean isCloseDouble(double a, double b, double rel_tol, double abs_tol
713708
}
714709

715710
@Specialization
716-
public boolean isClose(double a, double b, PNone rel_tol, PNone abs_tol) {
717-
return isCloseDouble(a, b, defaultRel(), defaultAbs());
711+
public boolean isClose(double a, double b, @SuppressWarnings("unused") PNone rel_tol, @SuppressWarnings("unused") PNone abs_tol) {
712+
return isCloseDouble(a, b, DEFAULT_REL, DEFAULT_ABS);
718713
}
719714

720715
@Specialization
721-
public boolean isClose(double a, double b, PNone rel_tol, double abs_tol) {
722-
return isCloseDouble(a, b, defaultRel(), abs_tol);
716+
public boolean isClose(double a, double b, @SuppressWarnings("unused") PNone rel_tol, double abs_tol) {
717+
return isCloseDouble(a, b, DEFAULT_REL, abs_tol);
723718
}
724719

725720
@Specialization
726-
public boolean isClose(double a, double b, double rel_tol, PNone abs_tol) {
727-
return isCloseDouble(a, b, rel_tol, defaultAbs());
721+
public boolean isClose(double a, double b, double rel_tol, @SuppressWarnings("unused") PNone abs_tol) {
722+
return isCloseDouble(a, b, rel_tol, DEFAULT_ABS);
728723
}
729724

730725
@Specialization

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/floats/FloatBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ abstract static class NegNode extends PythonUnaryBuiltinNode {
878878
@Builtin(name = __GETFORMAT__, fixedNumOfArguments = 2)
879879
@GenerateNodeFactory
880880
abstract static class GetFormatNode extends PythonUnaryBuiltinNode {
881-
private String getDetectedEndianess() {
881+
private static String getDetectedEndianess() {
882882
try {
883883
ByteOrder byteOrder = ByteOrder.nativeOrder();
884884
if (byteOrder.equals(ByteOrder.BIG_ENDIAN)) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame/FrameBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Object get(PFrame self) {
198198
@GenerateNodeFactory
199199
public abstract static class FrameClearNode extends PythonBuiltinNode {
200200
@Specialization
201-
Object clear(PFrame self) {
201+
Object clear(@SuppressWarnings("unused") PFrame self) {
202202
// TODO: implement me
203203
// see: https://github.com/python/cpython/blob/master/Objects/frameobject.c#L503
204204
return PNone.NONE;

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str/StringBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ public PList doSplit(String self, @SuppressWarnings("unused") PNone sep, int max
719719
}
720720

721721
@Fallback
722-
public Object doSplit(Object self, Object sep, Object maxsplit) {
722+
public Object doSplit(@SuppressWarnings("unused") Object self, Object sep, @SuppressWarnings("unused") Object maxsplit) {
723723
throw raise(TypeError, " Can't convert %p object to str implicitly", sep);
724724
}
725725

scripts/py_unittests.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3636
# SOFTWARE.
3737

38-
#!/bin/bash
39-
4038
cd "$(dirname $0)"
4139
cd ..
4240
UNIT_TESTS_PATH="graalpython/lib-python/3/test/test_*.py"

0 commit comments

Comments
 (0)