diff options
-rw-r--r-- | cmdline/cmdline_parser_test.cc | 6 | ||||
-rw-r--r-- | cmdline/detail/cmdline_parse_argument_detail.h | 4 | ||||
-rw-r--r-- | cmdline/detail/cmdline_parser_detail.h | 6 | ||||
-rw-r--r-- | dex2oat/linker/oat_writer.cc | 2 | ||||
-rw-r--r-- | libartbase/base/bit_struct_detail.h | 2 | ||||
-rw-r--r-- | libartbase/base/mem_map_fuchsia.cc | 8 | ||||
-rw-r--r-- | libdexfile/dex/code_item_accessors.h | 2 | ||||
-rw-r--r-- | openjdkjvm/OpenjdkJvm.cc | 12 | ||||
-rw-r--r-- | openjdkjvmti/ti_timers.cc | 2 | ||||
-rw-r--r-- | runtime/hprof/hprof.cc | 2 | ||||
-rw-r--r-- | runtime/interpreter/unstarted_runtime.cc | 4 | ||||
-rw-r--r-- | runtime/jdwp/jdwp_event.cc | 2 | ||||
-rw-r--r-- | runtime/jni/check_jni.cc | 2 | ||||
-rw-r--r-- | runtime/method_handles.cc | 4 | ||||
-rw-r--r-- | runtime/native/dalvik_system_DexFile.cc | 8 | ||||
-rw-r--r-- | runtime/native/dalvik_system_VMDebug.cc | 2 | ||||
-rw-r--r-- | runtime/native/java_lang_reflect_Constructor.cc | 2 | ||||
-rw-r--r-- | runtime/oat_file.h | 2 | ||||
-rw-r--r-- | test/674-hiddenapi/hiddenapi.cc | 30 | ||||
-rw-r--r-- | tools/jfuzz/jfuzz.cc | 2 |
20 files changed, 52 insertions, 52 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index a52e16328a..a33d53741c 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -59,7 +59,7 @@ namespace art { template <typename T> bool UsuallyEquals(const T& expected, const T& actual, typename std::enable_if< - detail::SupportsEqualityOperator<T>::value>::type* = 0) { + detail::SupportsEqualityOperator<T>::value>::type* = nullptr) { return expected == actual; } @@ -73,8 +73,8 @@ namespace art { template <typename T, typename ... Ignore> bool UsuallyEquals(const T& expected, const T& actual, const Ignore& ... more ATTRIBUTE_UNUSED, - typename std::enable_if<std::is_pod<T>::value>::type* = 0, - typename std::enable_if<!detail::SupportsEqualityOperator<T>::value>::type* = 0 + typename std::enable_if<std::is_pod<T>::value>::type* = nullptr, + typename std::enable_if<!detail::SupportsEqualityOperator<T>::value>::type* = nullptr ) { return memcmp(std::addressof(expected), std::addressof(actual), sizeof(T)) == 0; } diff --git a/cmdline/detail/cmdline_parse_argument_detail.h b/cmdline/detail/cmdline_parse_argument_detail.h index 65c11146aa..d011e7f71d 100644 --- a/cmdline/detail/cmdline_parse_argument_detail.h +++ b/cmdline/detail/cmdline_parse_argument_detail.h @@ -90,7 +90,7 @@ template <typename TArg> struct CmdlineParserArgumentInfo { // This version will only be used if TArg is arithmetic and thus has the <= operators. template <typename T = TArg> // Necessary to get SFINAE to kick in. - bool CheckRange(const TArg& value, typename EnableIfNumeric<T>::type* = 0) { + bool CheckRange(const TArg& value, typename EnableIfNumeric<T>::type* = nullptr) { if (has_range_) { return min_ <= value && value <= max_; } @@ -99,7 +99,7 @@ struct CmdlineParserArgumentInfo { // This version will be used at other times when TArg is not arithmetic. template <typename T = TArg> - bool CheckRange(const TArg&, typename DisableIfNumeric<T>::type* = 0) { + bool CheckRange(const TArg&, typename DisableIfNumeric<T>::type* = nullptr) { assert(!has_range_); return true; } diff --git a/cmdline/detail/cmdline_parser_detail.h b/cmdline/detail/cmdline_parser_detail.h index 4c26ba3012..2078d7a288 100644 --- a/cmdline/detail/cmdline_parser_detail.h +++ b/cmdline/detail/cmdline_parser_detail.h @@ -90,7 +90,7 @@ struct SupportsEqualityOperator : // NOLINT [whitespace/labels] [4] template <typename T> std::string ToStringAny(const T& value, typename std::enable_if< - SupportsInsertionOperator<T>::value>::type* = 0) { + SupportsInsertionOperator<T>::value>::type* = nullptr) { std::stringstream stream; stream << value; return stream.str(); @@ -99,7 +99,7 @@ std::string ToStringAny(const T& value, template <typename T> std::string ToStringAny(const std::vector<T> value, typename std::enable_if< - SupportsInsertionOperator<T>::value>::type* = 0) { + SupportsInsertionOperator<T>::value>::type* = nullptr) { std::stringstream stream; stream << "vector{"; @@ -118,7 +118,7 @@ std::string ToStringAny(const std::vector<T> value, template <typename T> std::string ToStringAny(const T&, typename std::enable_if< - !SupportsInsertionOperator<T>::value>::type* = 0 + !SupportsInsertionOperator<T>::value>::type* = nullptr ) { return std::string("(unknown type [no operator<< implemented] for )"); } diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc index a1a547c8e5..9351fb5328 100644 --- a/dex2oat/linker/oat_writer.cc +++ b/dex2oat/linker/oat_writer.cc @@ -1904,7 +1904,7 @@ class OatWriter::WriteCodeMethodVisitor : public OrderedMethodVisitor { DCHECK(target != nullptr); const void* oat_code_offset = target->GetEntryPointFromQuickCompiledCodePtrSize(pointer_size_); - if (oat_code_offset != 0) { + if (oat_code_offset != nullptr) { DCHECK(!writer_->GetCompilerOptions().IsBootImage()); DCHECK(!Runtime::Current()->GetClassLinker()->IsQuickResolutionStub(oat_code_offset)); DCHECK(!Runtime::Current()->GetClassLinker()->IsQuickToInterpreterBridge(oat_code_offset)); diff --git a/libartbase/base/bit_struct_detail.h b/libartbase/base/bit_struct_detail.h index 68c2e4461f..60de1b68ef 100644 --- a/libartbase/base/bit_struct_detail.h +++ b/libartbase/base/bit_struct_detail.h @@ -85,7 +85,7 @@ struct HasUnderscoreField { static constexpr FalseT Test(...); public: - static constexpr bool value = decltype(Test<T>(0))::value; + static constexpr bool value = decltype(Test<T>(nullptr))::value; }; // Infer the type of the member of &T::M. diff --git a/libartbase/base/mem_map_fuchsia.cc b/libartbase/base/mem_map_fuchsia.cc index db31efb1c0..d1c92ce4d6 100644 --- a/libartbase/base/mem_map_fuchsia.cc +++ b/libartbase/base/mem_map_fuchsia.cc @@ -41,8 +41,8 @@ void MemMap::TargetMMapInit() { ZX_INFO_VMAR, &vmarinfo, sizeof(vmarinfo), - NULL, - NULL), ZX_OK) << "could not find info from root vmar"; + nullptr, + nullptr), ZX_OK) << "could not find info from root vmar"; uintptr_t lower_mem_start = FUCHSIA_LOWER_MEM_START - vmarinfo.base; fuchsia_lowmem_size = FUCHSIA_LOWER_MEM_SIZE; @@ -97,8 +97,8 @@ void* MemMap::TargetMMap(void* start, size_t len, int prot, int flags, int fd, o ZX_INFO_VMAR, &vmarinfo, sizeof(vmarinfo), - NULL, - NULL); + nullptr, + nullptr); if (status < 0 || reinterpret_cast<uintptr_t>(start) < vmarinfo.base) { errno = EINVAL; return MAP_FAILED; diff --git a/libdexfile/dex/code_item_accessors.h b/libdexfile/dex/code_item_accessors.h index 5786d3f611..695cc7b1b2 100644 --- a/libdexfile/dex/code_item_accessors.h +++ b/libdexfile/dex/code_item_accessors.h @@ -80,7 +80,7 @@ class CodeItemInstructionAccessor { uint32_t insns_size_in_code_units_ = 0; // Pointer to the instructions, null if there is no code item. - const uint16_t* insns_ = 0; + const uint16_t* insns_ = nullptr; }; // Abstracts accesses to code item fields other than debug info for CompactDexFile and diff --git a/openjdkjvm/OpenjdkJvm.cc b/openjdkjvm/OpenjdkJvm.cc index df002b6efa..8d0200c346 100644 --- a/openjdkjvm/OpenjdkJvm.cc +++ b/openjdkjvm/OpenjdkJvm.cc @@ -187,7 +187,7 @@ JNIEXPORT int jio_fprintf(FILE* fp, const char* fmt, ...) { } JNIEXPORT int jio_vfprintf(FILE* fp, const char* fmt, va_list args) { - assert(fp != NULL); + assert(fp != nullptr); return vfprintf(fp, fmt, args); } @@ -203,7 +203,7 @@ JNIEXPORT void* JVM_FindLibraryEntry(void* handle, const char* name) { JNIEXPORT jlong JVM_CurrentTimeMillis(JNIEnv* env ATTRIBUTE_UNUSED, jclass clazz ATTRIBUTE_UNUSED) { struct timeval tv; - gettimeofday(&tv, (struct timezone *) NULL); + gettimeofday(&tv, (struct timezone *) nullptr); jlong when = tv.tv_sec * 1000LL + tv.tv_usec / 1000; return when; } @@ -319,8 +319,8 @@ JNIEXPORT jstring JVM_NativeLoad(JNIEnv* env, jstring javaFilename, jobject javaLoader) { ScopedUtfChars filename(env, javaFilename); - if (filename.c_str() == NULL) { - return NULL; + if (filename.c_str() == nullptr) { + return nullptr; } std::string error_msg; @@ -348,7 +348,7 @@ JNIEXPORT void JVM_SetThreadPriority(JNIEnv* env, jobject jthread, jint prio) { art::ScopedObjectAccess soa(env); art::MutexLock mu(soa.Self(), *art::Locks::thread_list_lock_); art::Thread* thread = art::Thread::FromManagedThread(soa, jthread); - if (thread != NULL) { + if (thread != nullptr) { thread->SetNativePriority(prio); } } @@ -421,7 +421,7 @@ JNIEXPORT void JVM_SetNativeThreadName(JNIEnv* env, jobject jthread, jstring jav art::SuspendReason::kInternal, &timed_out); } - if (thread != NULL) { + if (thread != nullptr) { { art::ScopedObjectAccess soa(env); thread->SetThreadName(name.c_str()); diff --git a/openjdkjvmti/ti_timers.cc b/openjdkjvmti/ti_timers.cc index 24fb0419ee..11b58c452e 100644 --- a/openjdkjvmti/ti_timers.cc +++ b/openjdkjvmti/ti_timers.cc @@ -83,7 +83,7 @@ jvmtiError TimerUtil::GetTime(jvmtiEnv* env ATTRIBUTE_UNUSED, jlong* nanos_ptr) // No CLOCK_MONOTONIC support on older Mac OS. struct timeval t; t.tv_sec = t.tv_usec = 0; - gettimeofday(&t, NULL); + gettimeofday(&t, nullptr); *nanos_ptr = static_cast<jlong>(t.tv_sec)*1000000000LL + static_cast<jlong>(t.tv_usec)*1000LL; #endif diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc index dc42cfa4fe..3f44928e3a 100644 --- a/runtime/hprof/hprof.cc +++ b/runtime/hprof/hprof.cc @@ -1590,7 +1590,7 @@ void Hprof::VisitRoot(mirror::Object* obj, const RootInfo& info) { if (obj == nullptr) { return; } - MarkRootObject(obj, 0, xlate[info.GetType()], info.GetThreadId()); + MarkRootObject(obj, nullptr, xlate[info.GetType()], info.GetThreadId()); } // If "direct_to_ddms" is true, the other arguments are ignored, and data is diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc index 22a6e9d941..9049b2bc7e 100644 --- a/runtime/interpreter/unstarted_runtime.cc +++ b/runtime/interpreter/unstarted_runtime.cc @@ -1965,7 +1965,7 @@ void UnstartedRuntime::Invoke(Thread* self, const CodeItemDataAccessor& accessor const auto& iter = invoke_handlers_.find(name); if (iter != invoke_handlers_.end()) { // Clear out the result in case it's not zeroed out. - result->SetL(0); + result->SetL(nullptr); // Push the shadow frame. This is so the failing method can be seen in abort dumps. self->PushShadowFrame(shadow_frame); @@ -1986,7 +1986,7 @@ void UnstartedRuntime::Jni(Thread* self, ArtMethod* method, mirror::Object* rece const auto& iter = jni_handlers_.find(name); if (iter != jni_handlers_.end()) { // Clear out the result in case it's not zeroed out. - result->SetL(0); + result->SetL(nullptr); (*iter->second)(self, method, receiver, args, result); } else if (Runtime::Current()->IsActiveTransaction()) { AbortTransactionF(self, "Attempt to invoke native method in non-started runtime: %s", diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc index 9409b7661f..0353ea7462 100644 --- a/runtime/jdwp/jdwp_event.cc +++ b/runtime/jdwp/jdwp_event.cc @@ -1159,7 +1159,7 @@ void JdwpState::PostException(const EventLocation* pThrowLoc, mirror::Throwable* } basket.className = Dbg::GetClassName(basket.locationClass.Get()); basket.exceptionClass.Assign(exception_object->GetClass()); - basket.caught = (pCatchLoc->method != 0); + basket.caught = (pCatchLoc->method != nullptr); basket.thisPtr.Assign(thisPtr); /* don't try to post an exception caused by the debugger */ diff --git a/runtime/jni/check_jni.cc b/runtime/jni/check_jni.cc index 66bd74b504..c5e8830d29 100644 --- a/runtime/jni/check_jni.cc +++ b/runtime/jni/check_jni.cc @@ -1462,7 +1462,7 @@ class ScopedCheck { break; } } - return 0; + return nullptr; } void AbortF(const char* fmt, ...) __attribute__((__format__(__printf__, 2, 3))) { diff --git a/runtime/method_handles.cc b/runtime/method_handles.cc index 01a32a2288..570fc48272 100644 --- a/runtime/method_handles.cc +++ b/runtime/method_handles.cc @@ -484,7 +484,7 @@ static inline bool MethodHandleInvokeMethod(ArtMethod* called_method, first_dest_reg, new_shadow_frame)) { DCHECK(self->IsExceptionPending()); - result->SetL(0); + result->SetL(nullptr); return false; } } else { @@ -500,7 +500,7 @@ static inline bool MethodHandleInvokeMethod(ArtMethod* called_method, operands, new_shadow_frame)) { DCHECK(self->IsExceptionPending()); - result->SetL(0); + result->SetL(nullptr); return false; } } diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc index cdba6b204f..b598df3eba 100644 --- a/runtime/native/dalvik_system_DexFile.cc +++ b/runtime/native/dalvik_system_DexFile.cc @@ -233,13 +233,13 @@ static jobject DexFile_createCookieWithDirectBuffer(JNIEnv* env, if (base_address == nullptr) { ScopedObjectAccess soa(env); ThrowWrappedIOException("dexFileBuffer not direct"); - return 0; + return nullptr; } std::unique_ptr<MemMap> dex_mem_map(AllocateDexMemoryMap(env, start, end)); if (dex_mem_map == nullptr) { DCHECK(Thread::Current()->IsExceptionPending()); - return 0; + return nullptr; } size_t length = static_cast<size_t>(end - start); @@ -255,7 +255,7 @@ static jobject DexFile_createCookieWithArray(JNIEnv* env, std::unique_ptr<MemMap> dex_mem_map(AllocateDexMemoryMap(env, start, end)); if (dex_mem_map == nullptr) { DCHECK(Thread::Current()->IsExceptionPending()); - return 0; + return nullptr; } auto destination = reinterpret_cast<jbyte*>(dex_mem_map.get()->Begin()); @@ -273,7 +273,7 @@ static jobject DexFile_openDexFileNative(JNIEnv* env, jobjectArray dex_elements) { ScopedUtfChars sourceName(env, javaSourceName); if (sourceName.c_str() == nullptr) { - return 0; + return nullptr; } Runtime* const runtime = Runtime::Current(); diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc index f1e267becc..7ac4086362 100644 --- a/runtime/native/dalvik_system_VMDebug.cc +++ b/runtime/native/dalvik_system_VMDebug.cc @@ -388,7 +388,7 @@ static jobjectArray VMDebug_getInstancesOfClasses(JNIEnv* env, // as PSS, private/shared dirty/shared data are available via // /proc/<pid>/smaps. static void VMDebug_getHeapSpaceStats(JNIEnv* env, jclass, jlongArray data) { - jlong* arr = reinterpret_cast<jlong*>(env->GetPrimitiveArrayCritical(data, 0)); + jlong* arr = reinterpret_cast<jlong*>(env->GetPrimitiveArrayCritical(data, nullptr)); if (arr == nullptr || env->GetArrayLength(data) < 9) { return; } diff --git a/runtime/native/java_lang_reflect_Constructor.cc b/runtime/native/java_lang_reflect_Constructor.cc index e54674f72b..4b4d6e332c 100644 --- a/runtime/native/java_lang_reflect_Constructor.cc +++ b/runtime/native/java_lang_reflect_Constructor.cc @@ -121,7 +121,7 @@ static jobject Constructor_newInstance0(JNIEnv* env, jobject javaMethod, jobject static jobject Constructor_newInstanceFromSerialization(JNIEnv* env, jclass unused ATTRIBUTE_UNUSED, jclass ctorClass, jclass allocClass) { jmethodID ctor = env->GetMethodID(ctorClass, "<init>", "()V"); - DCHECK(ctor != NULL); + DCHECK(ctor != nullptr); return env->NewObject(allocClass, ctor); } diff --git a/runtime/oat_file.h b/runtime/oat_file.h index 5f87bf0f99..4ed26facf7 100644 --- a/runtime/oat_file.h +++ b/runtime/oat_file.h @@ -550,7 +550,7 @@ class OatDexFile FINAL { const IndexBssMapping* const method_bss_mapping_ = nullptr; const IndexBssMapping* const type_bss_mapping_ = nullptr; const IndexBssMapping* const string_bss_mapping_ = nullptr; - const uint32_t* const oat_class_offsets_pointer_ = 0u; + const uint32_t* const oat_class_offsets_pointer_ = nullptr; TypeLookupTable lookup_table_; const DexLayoutSections* const dex_layout_sections_ = nullptr; diff --git a/test/674-hiddenapi/hiddenapi.cc b/test/674-hiddenapi/hiddenapi.cc index 04c3fbf03a..96754c3076 100644 --- a/test/674-hiddenapi/hiddenapi.cc +++ b/test/674-hiddenapi/hiddenapi.cc @@ -63,8 +63,8 @@ extern "C" JNIEXPORT void JNICALL Java_Main_appendToBootClassLoader( static jobject NewInstance(JNIEnv* env, jclass klass) { jmethodID constructor = env->GetMethodID(klass, "<init>", "()V"); - if (constructor == NULL) { - return NULL; + if (constructor == nullptr) { + return nullptr; } return env->NewObject(klass, constructor); } @@ -74,7 +74,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canDiscoverField( ScopedUtfChars utf_name(env, name); jfieldID field = is_static ? env->GetStaticFieldID(klass, utf_name.c_str(), "I") : env->GetFieldID(klass, utf_name.c_str(), "I"); - if (field == NULL) { + if (field == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -87,7 +87,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canGetField( ScopedUtfChars utf_name(env, name); jfieldID field = is_static ? env->GetStaticFieldID(klass, utf_name.c_str(), "I") : env->GetFieldID(klass, utf_name.c_str(), "I"); - if (field == NULL) { + if (field == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -95,7 +95,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canGetField( env->GetStaticIntField(klass, field); } else { jobject obj = NewInstance(env, klass); - if (obj == NULL) { + if (obj == nullptr) { env->ExceptionDescribe(); env->ExceptionClear(); return JNI_FALSE; @@ -117,7 +117,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canSetField( ScopedUtfChars utf_name(env, name); jfieldID field = is_static ? env->GetStaticFieldID(klass, utf_name.c_str(), "I") : env->GetFieldID(klass, utf_name.c_str(), "I"); - if (field == NULL) { + if (field == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -125,7 +125,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canSetField( env->SetStaticIntField(klass, field, 42); } else { jobject obj = NewInstance(env, klass); - if (obj == NULL) { + if (obj == nullptr) { env->ExceptionDescribe(); env->ExceptionClear(); return JNI_FALSE; @@ -147,7 +147,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canDiscoverMethod( ScopedUtfChars utf_name(env, name); jmethodID method = is_static ? env->GetStaticMethodID(klass, utf_name.c_str(), "()I") : env->GetMethodID(klass, utf_name.c_str(), "()I"); - if (method == NULL) { + if (method == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -160,7 +160,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canInvokeMethodA( ScopedUtfChars utf_name(env, name); jmethodID method = is_static ? env->GetStaticMethodID(klass, utf_name.c_str(), "()I") : env->GetMethodID(klass, utf_name.c_str(), "()I"); - if (method == NULL) { + if (method == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -169,7 +169,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canInvokeMethodA( env->CallStaticIntMethodA(klass, method, nullptr); } else { jobject obj = NewInstance(env, klass); - if (obj == NULL) { + if (obj == nullptr) { env->ExceptionDescribe(); env->ExceptionClear(); return JNI_FALSE; @@ -191,7 +191,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canInvokeMethodV( ScopedUtfChars utf_name(env, name); jmethodID method = is_static ? env->GetStaticMethodID(klass, utf_name.c_str(), "()I") : env->GetMethodID(klass, utf_name.c_str(), "()I"); - if (method == NULL) { + if (method == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -200,7 +200,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canInvokeMethodV( env->CallStaticIntMethod(klass, method); } else { jobject obj = NewInstance(env, klass); - if (obj == NULL) { + if (obj == nullptr) { env->ExceptionDescribe(); env->ExceptionClear(); return JNI_FALSE; @@ -224,7 +224,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canDiscoverConstructor( JNIEnv* env, jclass, jclass klass, jstring args) { ScopedUtfChars utf_args(env, args); jmethodID constructor = env->GetMethodID(klass, "<init>", utf_args.c_str()); - if (constructor == NULL) { + if (constructor == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -236,7 +236,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canInvokeConstructorA( JNIEnv* env, jclass, jclass klass, jstring args) { ScopedUtfChars utf_args(env, args); jmethodID constructor = env->GetMethodID(klass, "<init>", utf_args.c_str()); - if (constructor == NULL) { + if (constructor == nullptr) { env->ExceptionClear(); return JNI_FALSE; } @@ -261,7 +261,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_JNI_canInvokeConstructorV( JNIEnv* env, jclass, jclass klass, jstring args) { ScopedUtfChars utf_args(env, args); jmethodID constructor = env->GetMethodID(klass, "<init>", utf_args.c_str()); - if (constructor == NULL) { + if (constructor == nullptr) { env->ExceptionClear(); return JNI_FALSE; } diff --git a/tools/jfuzz/jfuzz.cc b/tools/jfuzz/jfuzz.cc index 60c62752ef..a97a99ce4b 100644 --- a/tools/jfuzz/jfuzz.cc +++ b/tools/jfuzz/jfuzz.cc @@ -1302,7 +1302,7 @@ class JFuzz { int32_t main(int32_t argc, char** argv) { // Time-based seed. struct timeval tp; - gettimeofday(&tp, NULL); + gettimeofday(&tp, nullptr); // Defaults. uint32_t seed = (tp.tv_sec * 1000000 + tp.tv_usec); |