mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Replaced C-style casts found by GCC in HAL, wpilibc, and JNI (#211)
This commit is contained in:
committed by
Peter Johnson
parent
2ec6132fcb
commit
93b486b6ba
@@ -1169,7 +1169,7 @@ static void throwJavaException(JNIEnv *env) {{
|
||||
jclass je = env->FindClass("{packagepath}/VisionException");
|
||||
int err = imaqGetLastError();
|
||||
const char* err_text = getErrorText(err);
|
||||
char* full_err_msg = (char*)malloc(30+strlen(err_text));
|
||||
char* full_err_msg = static_cast<char*>(malloc(30+strlen(err_text)));
|
||||
sprintf(full_err_msg, "imaqError: %d: %s", err, err_text);
|
||||
env->ThrowNew(je, full_err_msg);
|
||||
free(full_err_msg);
|
||||
@@ -1179,7 +1179,7 @@ static void throwJavaException(JNIEnv *env) {{
|
||||
static void dxthrowJavaException(JNIEnv *env, IMAQdxError err) {{
|
||||
jclass je = env->FindClass("{packagepath}/VisionException");
|
||||
const char* err_text = getErrorText(err);
|
||||
char* full_err_msg = (char*)malloc(30+strlen(err_text));
|
||||
char* full_err_msg = static_cast<char*>(malloc(30+strlen(err_text)));
|
||||
sprintf(full_err_msg, "IMAQdxError: %d: %s", err, err_text);
|
||||
env->ThrowNew(je, full_err_msg);
|
||||
free(full_err_msg);
|
||||
|
||||
Reference in New Issue
Block a user