Skip to content

Commit

Permalink
constify JNINativeMethod tables
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Aug 3, 2020
1 parent 63f3727 commit 0707181
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion cmds/hid/jni/com_android_commands_hid_Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static void closeDevice(JNIEnv* /* env */, jclass /* clazz */, jlong ptr) {
}
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{ "nativeOpenDevice",
"(Ljava/lang/String;III[B"
"Lcom/android/commands/hid/Device$DeviceCallback;)J",
Expand Down
2 changes: 1 addition & 1 deletion core/jni/android_app_ActivityThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void android_app_ActivityThread_initZygoteChildHeapProfiling(JNIEnv* env,
android_mallopt(M_INIT_ZYGOTE_CHILD_PROFILING, nullptr, 0);
}

static JNINativeMethod gActivityThreadMethods[] = {
static const JNINativeMethod gActivityThreadMethods[] = {
// ------------ Regular JNI ------------------
{ "nPurgePendingResources", "()V",
(void*) android_app_ActivityThread_purgePendingResources },
Expand Down
2 changes: 1 addition & 1 deletion core/jni/android_os_HwBinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static void JHwBinder_report_sysprop_change(JNIEnv * /*env*/, jclass /*clazz*/)
report_sysprop_change();
}

static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
{ "native_init", "()J", (void *)JHwBinder_native_init },
{ "native_setup", "()V", (void *)JHwBinder_native_setup },

Expand Down
2 changes: 1 addition & 1 deletion core/jni/android_os_HwBlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ static jlong JHwBlob_native_handle(JNIEnv *env, jobject thiz) {
return handle;
}

static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
{ "native_init", "()J", (void *)JHwBlob_native_init },
{ "native_setup", "(I)V", (void *)JHwBlob_native_setup },

Expand Down
2 changes: 1 addition & 1 deletion core/jni/android_os_HwParcel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ static void JHwParcel_native_writeBuffer(
}
}

static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
{ "native_init", "()J", (void *)JHwParcel_native_init },
{ "native_setup", "(Z)V", (void *)JHwParcel_native_setup },

Expand Down
2 changes: 1 addition & 1 deletion core/jni/android_os_HwRemoteBinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static jint JHwRemoteBinder_hashCode(JNIEnv* env, jobject thiz) {
return static_cast<jint>(longHash ^ (longHash >> 32)); // See Long.hashCode()
}

static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
{ "native_init", "()J", (void *)JHwRemoteBinder_native_init },

{ "native_setup_empty", "()V",
Expand Down
2 changes: 1 addition & 1 deletion core/jni/android_util_jar_StrictJarFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void StrictJarFile_nativeClose(JNIEnv*, jobject, jlong nativeHandle) {
CloseArchive(reinterpret_cast<ZipArchiveHandle>(nativeHandle));
}

JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
NATIVE_METHOD(StrictJarFile, nativeOpenJarFile, "(Ljava/lang/String;I)J"),
NATIVE_METHOD(StrictJarFile, nativeStartIteration, "(JLjava/lang/String;)J"),
NATIVE_METHOD(StrictJarFile, nativeNextEntry, "(J)Ljava/util/zip/ZipEntry;"),
Expand Down
2 changes: 1 addition & 1 deletion core/jni/android_view_DisplayListCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static void android_view_DisplayListCanvas_drawWebViewFunctor(jlong canvasPtr, j

const char* const kClassPathName = "android/graphics/RecordingCanvas";

static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {

// ------------ @FastNative ------------------

Expand Down
4 changes: 2 additions & 2 deletions media/jni/android_media_ImageWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ static jobjectArray Image_createSurfacePlanes(JNIEnv* env, jobject thiz,

// ----------------------------------------------------------------------------

static JNINativeMethod gImageWriterMethods[] = {
static const JNINativeMethod gImageWriterMethods[] = {
{"nativeClassInit", "()V", (void*)ImageWriter_classInit },
{"nativeInit", "(Ljava/lang/Object;Landroid/view/Surface;II)J",
(void*)ImageWriter_init },
Expand All @@ -974,7 +974,7 @@ static JNINativeMethod gImageWriterMethods[] = {
{"cancelImage", "(JLandroid/media/Image;)V", (void*)ImageWriter_cancelImage },
};

static JNINativeMethod gImageMethods[] = {
static const JNINativeMethod gImageMethods[] = {
{"nativeCreatePlanes", "(II)[Landroid/media/ImageWriter$WriterSurfaceImage$SurfacePlane;",
(void*)Image_createSurfacePlanes },
{"nativeGetWidth", "()I", (void*)Image_getWidth },
Expand Down
2 changes: 1 addition & 1 deletion media/jni/android_media_MediaSync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ static void android_media_MediaSync_native_finalize(JNIEnv *env, jobject thiz) {
android_media_MediaSync_release(env, thiz);
}

static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
{ "native_setSurface",
"(Landroid/view/Surface;)V",
(void *)android_media_MediaSync_native_setSurface },
Expand Down
2 changes: 1 addition & 1 deletion media/jni/soundpool/android_media_SoundPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ android_media_SoundPool_release(JNIEnv *env, jobject thiz)
// ----------------------------------------------------------------------------

// Dalvik VM type signatures
static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
{ "_load",
"(Ljava/io/FileDescriptor;JJI)I",
(void *)android_media_SoundPool_load_FD
Expand Down
2 changes: 1 addition & 1 deletion services/core/jni/com_android_server_UsbMidiDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ android_server_UsbMidiDevice_close(JNIEnv *env, jobject thiz, jobjectArray fds)
}
}

static JNINativeMethod method_table[] = {
static const JNINativeMethod method_table[] = {
{ "nativeGetSubdeviceCount", "(II)I", (void*)android_server_UsbMidiDevice_get_subdevice_count },
{ "nativeOpen", "(III)[Ljava/io/FileDescriptor;", (void*)android_server_UsbMidiDevice_open },
{ "nativeClose", "([Ljava/io/FileDescriptor;)V", (void*)android_server_UsbMidiDevice_close },
Expand Down
2 changes: 1 addition & 1 deletion services/core/jni/com_android_server_tv_TvUinputBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static void nativeClear(JNIEnv* env, jclass clazz, jlong ptr) {
* JNI registration
*/

static JNINativeMethod gUinputBridgeMethods[] = {
static const JNINativeMethod gUinputBridgeMethods[] = {
{ "nativeOpen", "(Ljava/lang/String;Ljava/lang/String;III)J",
(void*)nativeOpen },
{ "nativeClose", "(J)V",
Expand Down

0 comments on commit 0707181

Please sign in to comment.