From d9fdc2cdd2caa7ab2f15343b0820423fb2869c35 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 11 Jan 2022 13:53:23 -0800 Subject: Return 0 instead of NULL for jlong musl libc defines NULL as nullptr, which is explicitly allowed by C++11. nullptr_t cannot be implicitly cast to an integral type. Return 0 instead. Bug: 190084016 Test: m USE_HOST_MUSL=true host-native Change-Id: Id83c1994a95cb105785c8ad902d2fe0589cb188d --- libs/hwui/jni/NinePatch.cpp | 2 +- libs/hwui/jni/android_util_PathParser.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/hwui/jni/NinePatch.cpp b/libs/hwui/jni/NinePatch.cpp index 6942017d5f27..3ca457f1a6a7 100644 --- a/libs/hwui/jni/NinePatch.cpp +++ b/libs/hwui/jni/NinePatch.cpp @@ -67,7 +67,7 @@ public: size_t chunkSize = env->GetArrayLength(obj); if (chunkSize < (int) (sizeof(Res_png_9patch))) { jniThrowRuntimeException(env, "Array too small for chunk."); - return NULL; + return 0; } int8_t* storage = new int8_t[chunkSize]; diff --git a/libs/hwui/jni/android_util_PathParser.cpp b/libs/hwui/jni/android_util_PathParser.cpp index 72995efb1c21..8cbb70ed2c86 100644 --- a/libs/hwui/jni/android_util_PathParser.cpp +++ b/libs/hwui/jni/android_util_PathParser.cpp @@ -61,7 +61,7 @@ static jlong createPathDataFromStringPath(JNIEnv* env, jobject, jstring inputStr } else { delete pathData; doThrowIAE(env, result.failureMessage.c_str()); - return NULL; + return 0; } } -- cgit v1.2.3-59-g8ed1b