mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Fix trivial errorprone warnings (NFC) (#6135)
This commit is contained in:
@@ -383,7 +383,7 @@ public class ADIS16448_IMU implements AutoCloseable, Sendable {
|
||||
|
||||
/** */
|
||||
private static int toShort(int... buf) {
|
||||
return (short) (((buf[0] & 0xFF) << 8) + ((buf[1] & 0xFF)));
|
||||
return (short) (((buf[0] & 0xFF) << 8) + (buf[1] & 0xFF));
|
||||
}
|
||||
|
||||
/** */
|
||||
|
||||
@@ -453,7 +453,7 @@ public class ADIS16470_IMU implements AutoCloseable, Sendable {
|
||||
* @return
|
||||
*/
|
||||
private static int toUShort(ByteBuffer buf) {
|
||||
return (buf.getShort(0)) & 0xFFFF;
|
||||
return buf.getShort(0) & 0xFFFF;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -469,7 +469,7 @@ public class ADIS16470_IMU implements AutoCloseable, Sendable {
|
||||
* @return
|
||||
*/
|
||||
private static int toShort(int... buf) {
|
||||
return (short) (((buf[0] & 0xFF) << 8) + ((buf[1] & 0xFF)));
|
||||
return (short) (((buf[0] & 0xFF) << 8) + (buf[1] & 0xFF));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -693,7 +693,7 @@ public class ADIS16470_IMU implements AutoCloseable, Sendable {
|
||||
private void writeRegister(int reg, int val) {
|
||||
ByteBuffer buf = ByteBuffer.allocateDirect(2);
|
||||
// low byte
|
||||
buf.put(0, (byte) ((0x80 | reg)));
|
||||
buf.put(0, (byte) (0x80 | reg));
|
||||
buf.put(1, (byte) (val & 0xff));
|
||||
m_spi.write(buf, 2);
|
||||
// high byte
|
||||
|
||||
@@ -84,7 +84,7 @@ public class Servo extends PWM {
|
||||
degrees = kMaxServoAngle;
|
||||
}
|
||||
|
||||
setPosition(((degrees - kMinServoAngle)) / getServoAngleRange());
|
||||
setPosition((degrees - kMinServoAngle) / getServoAngleRange());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -368,7 +368,7 @@ public class DifferentialDrive extends RobotDriveBase implements Sendable, AutoC
|
||||
builder.setSmartDashboardType("DifferentialDrive");
|
||||
builder.setActuator(true);
|
||||
builder.setSafeState(this::stopMotor);
|
||||
builder.addDoubleProperty("Left Motor Speed", () -> m_leftOutput, m_leftMotor::accept);
|
||||
builder.addDoubleProperty("Right Motor Speed", () -> m_rightOutput, m_rightMotor::accept);
|
||||
builder.addDoubleProperty("Left Motor Speed", () -> m_leftOutput, m_leftMotor);
|
||||
builder.addDoubleProperty("Right Motor Speed", () -> m_rightOutput, m_rightMotor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,13 +321,10 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
builder.setSmartDashboardType("MecanumDrive");
|
||||
builder.setActuator(true);
|
||||
builder.setSafeState(this::stopMotor);
|
||||
builder.addDoubleProperty("Front Left Motor Speed", () -> m_frontLeftOutput, m_frontLeftMotor);
|
||||
builder.addDoubleProperty(
|
||||
"Front Left Motor Speed", () -> m_frontLeftOutput, m_frontLeftMotor::accept);
|
||||
builder.addDoubleProperty(
|
||||
"Front Right Motor Speed", () -> m_frontRightOutput, m_frontRightMotor::accept);
|
||||
builder.addDoubleProperty(
|
||||
"Rear Left Motor Speed", () -> m_rearLeftOutput, m_rearLeftMotor::accept);
|
||||
builder.addDoubleProperty(
|
||||
"Rear Right Motor Speed", () -> m_rearRightOutput, m_rearRightMotor::accept);
|
||||
"Front Right Motor Speed", () -> m_frontRightOutput, m_frontRightMotor);
|
||||
builder.addDoubleProperty("Rear Left Motor Speed", () -> m_rearLeftOutput, m_rearLeftMotor);
|
||||
builder.addDoubleProperty("Rear Right Motor Speed", () -> m_rearRightOutput, m_rearRightMotor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user