summaryrefslogtreecommitdiffstats
path: root/dalvikvm
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-04-21 16:50:40 -0700
committerMathieu Chartier <mathieuc@google.com>2015-04-22 12:44:27 -0700
commit2cebb24bfc3247d3e9be138a3350106737455918 (patch)
treed04d27d21b3c7733d784e303f01f873bb99e7770 /dalvikvm
parent1f02f1a7b3073b8fef07770a67fbf94afad317f0 (diff)
downloadart-2cebb24bfc3247d3e9be138a3350106737455918.zip
art-2cebb24bfc3247d3e9be138a3350106737455918.tar.gz
art-2cebb24bfc3247d3e9be138a3350106737455918.tar.bz2
Replace NULL with nullptr
Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
Diffstat (limited to 'dalvikvm')
-rw-r--r--dalvikvm/dalvikvm.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/dalvikvm/dalvikvm.cc b/dalvikvm/dalvikvm.cc
index fd03002..85debe4 100644
--- a/dalvikvm/dalvikvm.cc
+++ b/dalvikvm/dalvikvm.cc
@@ -31,19 +31,19 @@ namespace art {
// Determine whether or not the specified method is public.
static bool IsMethodPublic(JNIEnv* env, jclass c, jmethodID method_id) {
ScopedLocalRef<jobject> reflected(env, env->ToReflectedMethod(c, method_id, JNI_FALSE));
- if (reflected.get() == NULL) {
+ if (reflected.get() == nullptr) {
fprintf(stderr, "Failed to get reflected method\n");
return false;
}
// We now have a Method instance. We need to call its
// getModifiers() method.
jclass method_class = env->FindClass("java/lang/reflect/Method");
- if (method_class == NULL) {
+ if (method_class == nullptr) {
fprintf(stderr, "Failed to find class java.lang.reflect.Method\n");
return false;
}
jmethodID mid = env->GetMethodID(method_class, "getModifiers", "()I");
- if (mid == NULL) {
+ if (mid == nullptr) {
fprintf(stderr, "Failed to find java.lang.reflect.Method.getModifiers\n");
return false;
}
@@ -61,7 +61,7 @@ static int InvokeMain(JNIEnv* env, char** argv) {
// it. Create an array and populate it. Note argv[0] is not
// included.
ScopedLocalRef<jobjectArray> args(env, toStringArray(env, argv + 1));
- if (args.get() == NULL) {
+ if (args.get() == nullptr) {
env->ExceptionDescribe();
return EXIT_FAILURE;
}
@@ -73,14 +73,14 @@ static int InvokeMain(JNIEnv* env, char** argv) {
std::replace(class_name.begin(), class_name.end(), '.', '/');
ScopedLocalRef<jclass> klass(env, env->FindClass(class_name.c_str()));
- if (klass.get() == NULL) {
+ if (klass.get() == nullptr) {
fprintf(stderr, "Unable to locate class '%s'\n", class_name.c_str());
env->ExceptionDescribe();
return EXIT_FAILURE;
}
jmethodID method = env->GetStaticMethodID(klass.get(), "main", "([Ljava/lang/String;)V");
- if (method == NULL) {
+ if (method == nullptr) {
fprintf(stderr, "Unable to find static main(String[]) in '%s'\n", class_name.c_str());
env->ExceptionDescribe();
return EXIT_FAILURE;
@@ -106,7 +106,7 @@ static int InvokeMain(JNIEnv* env, char** argv) {
// Parse arguments. Most of it just gets passed through to the runtime.
// The JNI spec defines a handful of standard arguments.
static int dalvikvm(int argc, char** argv) {
- setvbuf(stdout, NULL, _IONBF, 0);
+ setvbuf(stdout, nullptr, _IONBF, 0);
// Skip over argv[0].
argv++;
@@ -125,8 +125,8 @@ static int dalvikvm(int argc, char** argv) {
//
// [Do we need to catch & handle "-jar" here?]
bool need_extra = false;
- const char* lib = NULL;
- const char* what = NULL;
+ const char* lib = nullptr;
+ const char* what = nullptr;
int curr_opt, arg_idx;
for (curr_opt = arg_idx = 0; arg_idx < argc; arg_idx++) {
if (argv[arg_idx][0] != '-' && !need_extra) {
@@ -172,8 +172,8 @@ static int dalvikvm(int argc, char** argv) {
init_args.ignoreUnrecognized = JNI_FALSE;
// Start the runtime. The current thread becomes the main thread.
- JavaVM* vm = NULL;
- JNIEnv* env = NULL;
+ JavaVM* vm = nullptr;
+ JNIEnv* env = nullptr;
if (JNI_CreateJavaVM(&vm, &env, &init_args) != JNI_OK) {
fprintf(stderr, "Failed to initialize runtime (check log for details)\n");
return EXIT_FAILURE;