Skip to content

Commit

Permalink
constify JNINativeMethod tables
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Oct 5, 2021
1 parent 83586f8 commit 63b9f96
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 @@ -340,7 +340,7 @@ static void closeDevice(JNIEnv* /* env */, jclass /* clazz */, jlong ptr) {
}
}

static JNINativeMethod sMethods[] = {
static const JNINativeMethod sMethods[] = {
{"nativeOpenDevice",
"(Ljava/lang/String;IIII[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 @@ -40,7 +40,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_HidlMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static void nativeFinalize(JNIEnv* env, jobject jobj) {
delete native;
}

static JNINativeMethod gMethods[] = {
static const JNINativeMethod gMethods[] = {
{"nativeFinalize", "()V", (void*) nativeFinalize},
};

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 @@ -354,7 +354,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 @@ -589,7 +589,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 @@ -1065,7 +1065,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 libs/hwui/jni/android_graphics_DisplayListCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static void android_view_DisplayListCanvas_drawWebViewFunctor(CRITICAL_JNI_PARAM

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 @@ -1005,7 +1005,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 @@ -1016,7 +1016,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 @@ -246,7 +246,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 @@ -534,7 +534,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},
{"nativeGamepadOpen", "(Ljava/lang/String;Ljava/lang/String;)J", (void*)nativeGamepadOpen},
{"nativeClose", "(J)V", (void*)nativeClose},
Expand Down

0 comments on commit 63b9f96

Please sign in to comment.