Skip to content

Commit

Permalink
Fix off_t usage in Java wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins committed Jun 7, 2024
1 parent 6bc4297 commit 3eb98ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions java/src/jni/h5pDCPLImp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1external(JNIEnv *env, jclass clss, jlong plist, jstr

PIN_JAVA_STRING(ENVONLY, name, fileName, NULL, "H5Pset_external: file name not pinned");

if ((status = H5Pset_external((hid_t)plist, fileName, (off_t)offset, (hsize_t)size)) < 0)
if ((status = H5Pset_external((hid_t)plist, fileName, (HDoff_t)offset, (hsize_t)size)) < 0)
H5_LIBRARY_ERROR(ENVONLY);

done:
Expand All @@ -1089,7 +1089,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1external(JNIEnv *env, jclass clss, jlong plist, jint
jboolean isCopy;
jstring str;
hsize_t s;
off_t o;
HDoff_t o;
jsize arrLen;
jlong *theArray = NULL;
char *file = NULL;
Expand All @@ -1111,8 +1111,8 @@ Java_hdf_hdf5lib_H5_H5Pget_1external(JNIEnv *env, jclass clss, jlong plist, jint
if (NULL == (file = (char *)malloc(sizeof(char) * (size_t)name_size)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_external: memory allocation failed");

if ((status = H5Pget_external((hid_t)plist, (unsigned)idx, (size_t)name_size, file, (off_t *)&o,
(hsize_t *)&s)) < 0)
if ((status = H5Pget_external((hid_t)plist, (unsigned)idx, (size_t)name_size, file, &o, (hsize_t *)&s)) <
0)
H5_LIBRARY_ERROR(ENVONLY);

if (NULL != size) {
Expand Down

0 comments on commit 3eb98ad

Please sign in to comment.