mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpiutil] jni_util: Add JSpan and CriticalJSpan (#5554)
These replace JArrayRef et al and support statically sized arrays similar to std::span.
This commit is contained in:
@@ -261,11 +261,10 @@ Java_edu_wpi_first_hal_SerialPortJNI_serialWrite
|
||||
(JNIEnv* env, jclass, jint handle, jbyteArray dataToSend, jint size)
|
||||
{
|
||||
int32_t status = 0;
|
||||
jint retVal =
|
||||
HAL_WriteSerial(static_cast<HAL_SerialPortHandle>(handle),
|
||||
reinterpret_cast<const char*>(
|
||||
JByteArrayRef(env, dataToSend).array().data()),
|
||||
size, &status);
|
||||
jint retVal = HAL_WriteSerial(
|
||||
static_cast<HAL_SerialPortHandle>(handle),
|
||||
reinterpret_cast<const char*>(JSpan<const jbyte>(env, dataToSend).data()),
|
||||
size, &status);
|
||||
CheckStatus(env, status);
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user