Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use nullptr instead of NULL / 0 in rocksdbjni #12575

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions java/rocksjni/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3917,7 +3917,7 @@ jlongArray Java_org_rocksdb_Options_tablePropertiesCollectorFactory(
// exception thrown: OutOfMemoryError
return nullptr;
}
jlong* buf = env->GetLongArrayElements(retVal, NULL);
jlong* buf = env->GetLongArrayElements(retVal, nullptr);
if (buf == nullptr) {
// exception thrown: OutOfMemoryError
return nullptr;
Expand All @@ -3943,7 +3943,7 @@ void Java_org_rocksdb_Options_setTablePropertiesCollectorFactory(
auto* opt = reinterpret_cast<ROCKSDB_NAMESPACE::Options*>(jhandle);
const jsize size = env->GetArrayLength(j_factory_handles);

jlong* buf = env->GetLongArrayElements(j_factory_handles, NULL);
jlong* buf = env->GetLongArrayElements(j_factory_handles, nullptr);
if (buf == nullptr) {
// exception thrown: OutOfMemoryError
return;
Expand Down
2 changes: 1 addition & 1 deletion java/rocksjni/portal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ class JniUtil {
} else if (env_rs == JNI_EDETACHED) {
// current thread is not attached, attempt to attach
const jint rs_attach =
jvm->AttachCurrentThread(reinterpret_cast<void**>(&env), NULL);
jvm->AttachCurrentThread(reinterpret_cast<void**>(&env), nullptr);
if (rs_attach == JNI_OK) {
*attached = JNI_TRUE;
return env;
Expand Down
2 changes: 1 addition & 1 deletion java/rocksjni/ttl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jlongArray Java_org_rocksdb_TtlDB_openCF(JNIEnv* env, jclass, jlong jopt_handle,
return jresults;
} else {
ROCKSDB_NAMESPACE::RocksDBExceptionJni::ThrowNew(env, s);
return NULL;
return nullptr;
}
}

Expand Down