Skip to content

Commit a29bf97

Browse files
committed
Fixed compiler warnings
1 parent f1bde9f commit a29bf97

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/src/main/cpp/hacklib.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
#include <jni.h>
66
#include <dlfcn.h>
7-
#include <string.h>
7+
#include <string>
88
#include "include/criware.h"
99

10+
#define CURRENT_JNI_VERSION JNI_VERSION_1_6
11+
1012
CriWareUnityApi CW_API_OBJECT_NAME = {0};
1113
void *g_GenuineLib = nullptr;
1214

@@ -18,7 +20,7 @@ JNI_OnLoad(JavaVM *vm, void *reserved) {
1820
DEBUG_LOG("On load: lib handle = %p", g_GenuineLib);
1921
ResolveFunctions();
2022

21-
jint ret = JNI_VERSION_1_1;
23+
jint ret = CURRENT_JNI_VERSION;
2224
if (CW_API_OBJECT_NAME.JNI_OnLoad) {
2325
ret = CW_API_OBJECT_NAME.JNI_OnLoad(vm, reserved);
2426
}
@@ -32,7 +34,7 @@ JNI_OnUnload(JavaVM *vm, void *reserved) {
3234
if (CW_API_OBJECT_NAME.JNI_OnUnload) {
3335
CW_API_OBJECT_NAME.JNI_OnUnload(vm, reserved);
3436
}
35-
memset(&CW_API_OBJECT_NAME, sizeof(CriWareUnityApi), 0);
37+
memset(&CW_API_OBJECT_NAME, 0, sizeof(CriWareUnityApi));
3638
dlclose(g_GenuineLib);
3739
}
3840
}

0 commit comments

Comments
 (0)