mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
clang-tidy: modernize-use-nullptr (NFC)
This commit is contained in:
@@ -42,7 +42,7 @@ Java_edu_wpi_first_hal_I2CJNI_i2CTransaction
|
||||
jbyte sendSize, jobject dataReceived, jbyte receiveSize)
|
||||
{
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
if (dataToSend != 0) {
|
||||
if (dataToSend != nullptr) {
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
@@ -88,7 +88,7 @@ Java_edu_wpi_first_hal_I2CJNI_i2CWrite
|
||||
{
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
|
||||
if (dataToSend != 0) {
|
||||
if (dataToSend != nullptr) {
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
|
||||
@@ -271,12 +271,12 @@ Java_edu_wpi_first_hal_InterruptJNI_attachInterruptHandler
|
||||
(JNIEnv* env, jclass, jint interruptHandle, jobject handler, jobject param)
|
||||
{
|
||||
jclass cls = env->GetObjectClass(handler);
|
||||
if (cls == 0) {
|
||||
if (cls == nullptr) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
jmethodID mid = env->GetMethodID(cls, "apply", "(ILjava/lang/Object;)V");
|
||||
if (mid == 0) {
|
||||
if (mid == nullptr) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ Java_edu_wpi_first_hal_SPIJNI_spiTransaction
|
||||
jbyte size)
|
||||
{
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
if (dataToSend != 0) {
|
||||
if (dataToSend != nullptr) {
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
@@ -85,7 +85,7 @@ Java_edu_wpi_first_hal_SPIJNI_spiWrite
|
||||
(JNIEnv* env, jclass, jint port, jobject dataToSend, jbyte size)
|
||||
{
|
||||
uint8_t* dataToSendPtr = nullptr;
|
||||
if (dataToSend != 0) {
|
||||
if (dataToSend != nullptr) {
|
||||
dataToSendPtr =
|
||||
reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(dataToSend));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user