mirror of https://github.com/kiwix/libkiwix.git
Merge pull request #326 from kiwix/fix_pair_size
[JAVA] Use a long to store the offset of a article in the zim file.
This commit is contained in:
commit
7c49dc6af9
|
@ -22,5 +22,5 @@ package org.kiwix.kiwixlib;
|
||||||
public class Pair
|
public class Pair
|
||||||
{
|
{
|
||||||
public String filename;
|
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));
|
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)
|
const jobject obj, JNIEnv* env)
|
||||||
{
|
{
|
||||||
jclass objClass = env->GetObjectClass(obj);
|
jclass objClass = env->GetObjectClass(obj);
|
||||||
jfieldID filenameFid = env->GetFieldID(objClass, "filename", "Ljava/lang/String;");
|
jfieldID filenameFid = env->GetFieldID(objClass, "filename", "Ljava/lang/String;");
|
||||||
env->SetObjectField(obj, filenameFid, c2jni(filename, env));
|
env->SetObjectField(obj, filenameFid, c2jni(filename, env));
|
||||||
jfieldID offsetFid = env->GetFieldID(objClass, "offset", "I");
|
jfieldID offsetFid = env->GetFieldID(objClass, "offset", "J");
|
||||||
env->SetIntField(obj, offsetFid, offset);
|
env->SetLongField(obj, offsetFid, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _ANDROID_JNI_UTILS_H
|
#endif // _ANDROID_JNI_UTILS_H
|
||||||
|
|
Loading…
Reference in New Issue