Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
Convert true/false to JNI_TRUE/JNI_FALSE correctly
  • Loading branch information
alanpaxton committed Sep 18, 2024
1 parent c8eb686 commit 904f9d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions java/rocksjni/ingest_external_file_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Java_org_rocksdb_IngestExternalFileOptions_verifyChecksumsBeforeIngest(
JNIEnv*, jclass, jlong jhandle) {
auto* options =
reinterpret_cast<ROCKSDB_NAMESPACE::IngestExternalFileOptions*>(jhandle);
return options->verify_checksums_before_ingest == JNI_TRUE;
return options->verify_checksums_before_ingest ? JNI_TRUE : JNI_FALSE;
}

/*
Expand Down Expand Up @@ -248,7 +248,7 @@ Java_org_rocksdb_IngestExternalFileOptions_verifyFileChecksum(JNIEnv*, jclass,
jlong jhandle) {
auto* options =
reinterpret_cast<ROCKSDB_NAMESPACE::IngestExternalFileOptions*>(jhandle);
return options->verify_file_checksum == JNI_TRUE;
return options->verify_file_checksum ? JNI_TRUE : JNI_FALSE;
}

/*
Expand All @@ -274,7 +274,7 @@ Java_org_rocksdb_IngestExternalFileOptions_failIfNotLastLevel(JNIEnv*, jclass,
jlong jhandle) {
auto* options =
reinterpret_cast<ROCKSDB_NAMESPACE::IngestExternalFileOptions*>(jhandle);
return options->fail_if_not_bottommost_level == JNI_TRUE;
return options->fail_if_not_bottommost_level ? JNI_TRUE : JNI_FALSE;
}

/*
Expand All @@ -300,7 +300,7 @@ JNIEXPORT jboolean JNICALL Java_org_rocksdb_IngestExternalFileOptions_linkFiles(
JNIEnv*, jclass, jlong jhandle) {
auto* options =
reinterpret_cast<ROCKSDB_NAMESPACE::IngestExternalFileOptions*>(jhandle);
return options->link_files == JNI_TRUE;
return options->link_files ? JNI_TRUE : JNI_FALSE;
}

/*
Expand Down

0 comments on commit 904f9d5

Please sign in to comment.