mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-12 08:44:10 -04:00
[JAVA] Use a long to store the offset of a article in the zim file.
Fixes kiwix/kiwix-android#1769
This commit is contained in:
parent
5a65413750
commit
18eea94175
@ -22,5 +22,5 @@ package org.kiwix.kiwixlib;
|
||||
public class Pair
|
||||
{
|
||||
public String filename;
|
||||
public int offset;
|
||||
public long offset;
|
||||
}
|
||||
|
@ -258,14 +258,14 @@ inline void setBoolObjValue(const bool value, const jobject obj, JNIEnv* env)
|
||||
env->SetIntField(obj, objFid, c2jni(value, env));
|
||||
}
|
||||
|
||||
inline void setPairObjValue(const std::string& filename, const int offset,
|
||||
inline void setPairObjValue(const std::string& filename, const long offset,
|
||||
const jobject obj, JNIEnv* env)
|
||||
{
|
||||
jclass objClass = env->GetObjectClass(obj);
|
||||
jfieldID filenameFid = env->GetFieldID(objClass, "filename", "Ljava/lang/String;");
|
||||
env->SetObjectField(obj, filenameFid, c2jni(filename, env));
|
||||
jfieldID offsetFid = env->GetFieldID(objClass, "offset", "I");
|
||||
env->SetIntField(obj, offsetFid, offset);
|
||||
jfieldID offsetFid = env->GetFieldID(objClass, "offset", "J");
|
||||
env->SetLongField(obj, offsetFid, offset);
|
||||
}
|
||||
|
||||
#endif // _ANDROID_JNI_UTILS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user