Replace NULL with nullptr
Also fixed some lines that were too long, and a few other minor
details.
Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index 876e29a..46881b0 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -104,7 +104,7 @@
}
ScopedUtfChars traceFilename(env, javaTraceFilename);
- if (traceFilename.c_str() == NULL) {
+ if (traceFilename.c_str() == nullptr) {
return;
}
Trace::Start(traceFilename.c_str(), fd, bufferSize, flags, Trace::TraceOutputMode::kFile,
@@ -116,7 +116,7 @@
jint bufferSize, jint flags,
jboolean samplingEnabled, jint intervalUs) {
ScopedUtfChars traceFilename(env, javaTraceFilename);
- if (traceFilename.c_str() == NULL) {
+ if (traceFilename.c_str() == nullptr) {
return;
}
Trace::Start(traceFilename.c_str(), -1, bufferSize, flags, Trace::TraceOutputMode::kFile,
@@ -156,7 +156,7 @@
static void ThrowUnsupportedOperationException(JNIEnv* env) {
ScopedObjectAccess soa(env);
- soa.Self()->ThrowNewException("Ljava/lang/UnsupportedOperationException;", NULL);
+ soa.Self()->ThrowNewException("Ljava/lang/UnsupportedOperationException;", nullptr);
}
static void VMDebug_startInstructionCounting(JNIEnv* env, jclass) {
@@ -200,15 +200,15 @@
* error occurs during file handling.
*/
static void VMDebug_dumpHprofData(JNIEnv* env, jclass, jstring javaFilename, jobject javaFd) {
- // Only one of these may be NULL.
- if (javaFilename == NULL && javaFd == NULL) {
+ // Only one of these may be null.
+ if (javaFilename == nullptr && javaFd == nullptr) {
ScopedObjectAccess soa(env);
ThrowNullPointerException("fileName == null && fd == null");
return;
}
std::string filename;
- if (javaFilename != NULL) {
+ if (javaFilename != nullptr) {
ScopedUtfChars chars(env, javaFilename);
if (env->ExceptionCheck()) {
return;
@@ -219,7 +219,7 @@
}
int fd = -1;
- if (javaFd != NULL) {
+ if (javaFd != nullptr) {
fd = jniGetFDFromFileDescriptor(env, javaFd);
if (fd < 0) {
ScopedObjectAccess soa(env);