From cd48089318a2f4a9c393208fd83e07a93f5cd8f0 Mon Sep 17 00:00:00 2001 From: Ben Doherty Date: Tue, 15 Jun 2021 11:00:31 -0600 Subject: [PATCH] filament-utils-android: fix string literal conversions (#4137) --- android/filament-utils-android/src/main/cpp/Utils.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/filament-utils-android/src/main/cpp/Utils.cpp b/android/filament-utils-android/src/main/cpp/Utils.cpp index 8b443c9b8a..445b6891b1 100644 --- a/android/filament-utils-android/src/main/cpp/Utils.cpp +++ b/android/filament-utils-android/src/main/cpp/Utils.cpp @@ -102,10 +102,10 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) { jclass ktxloaderClass = env->FindClass("com/google/android/filament/utils/KTXLoader"); if (ktxloaderClass == nullptr) return JNI_ERR; static const JNINativeMethod ktxMethods[] = { - {"nCreateKTXTexture", "(JLjava/nio/Buffer;IZ)J", reinterpret_cast(nCreateKTXTexture)}, - {"nCreateIndirectLight", "(JLjava/nio/Buffer;IZ)J", reinterpret_cast(nCreateIndirectLight)}, - {"nCreateSkybox", "(JLjava/nio/Buffer;IZ)J", reinterpret_cast(nCreateSkybox)}, - {"nGetSphericalHarmonics", "(Ljava/nio/Buffer;I[F)Z", reinterpret_cast(nGetSphericalHarmonics)}, + {(char*)"nCreateKTXTexture", (char*)"(JLjava/nio/Buffer;IZ)J", reinterpret_cast(nCreateKTXTexture)}, + {(char*)"nCreateIndirectLight", (char*)"(JLjava/nio/Buffer;IZ)J", reinterpret_cast(nCreateIndirectLight)}, + {(char*)"nCreateSkybox", (char*)"(JLjava/nio/Buffer;IZ)J", reinterpret_cast(nCreateSkybox)}, + {(char*)"nGetSphericalHarmonics", (char*)"(Ljava/nio/Buffer;I[F)Z", reinterpret_cast(nGetSphericalHarmonics)}, }; rc = env->RegisterNatives(ktxloaderClass, ktxMethods, sizeof(ktxMethods) / sizeof(JNINativeMethod)); if (rc != JNI_OK) return rc; @@ -114,7 +114,7 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void*) { jclass hdrloaderClass = env->FindClass("com/google/android/filament/utils/HDRLoader"); if (hdrloaderClass == nullptr) return JNI_ERR; static const JNINativeMethod hdrMethods[] = { - {"nCreateHDRTexture", "(JLjava/nio/Buffer;II)J", reinterpret_cast(nCreateHDRTexture)}, + {(char*)"nCreateHDRTexture", (char*)"(JLjava/nio/Buffer;II)J", reinterpret_cast(nCreateHDRTexture)}, }; rc = env->RegisterNatives(hdrloaderClass, hdrMethods, sizeof(hdrMethods) / sizeof(JNINativeMethod)); if (rc != JNI_OK) return rc;