Removes the HD prefix from java C99 calls (#3149)

POSIX calls (HDstrndup, etc.) are unchanged
This commit is contained in:
Dana Robinson 2023-06-18 21:55:57 -07:00 committed by GitHub
parent a37795d8b9
commit 560110dbc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 548 additions and 549 deletions

View File

@ -73,17 +73,17 @@ typedef struct H5E_num_t {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
\
if (NULL == (jm = ENVPTR->GetMethodID(ENVONLY, jc, "<init>", "(Ljava/lang/String;)V"))) { \
HDprintf("THROWEXCEPTION FATAL ERROR: GetMethodID failed\n"); \
printf("THROWEXCEPTION FATAL ERROR: GetMethodID failed\n"); \
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
} \
\
if (NULL == (ex = ENVPTR->NewObjectA(ENVONLY, jc, jm, (jvalue *)(args)))) { \
HDprintf("THROWEXCEPTION FATAL ERROR: Class %s: Creation failed\n", (className)); \
printf("THROWEXCEPTION FATAL ERROR: Class %s: Creation failed\n", (className)); \
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
} \
\
if (ENVPTR->Throw(ENVONLY, (jthrowable)ex) < 0) { \
HDprintf("THROWEXCEPTION FATAL ERROR: Class %s: Throw failed\n", (className)); \
printf("THROWEXCEPTION FATAL ERROR: Class %s: Throw failed\n", (className)); \
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); \
} \
}
@ -168,9 +168,9 @@ Java_hdf_hdf5lib_exceptions_HDF5LibraryException_printStackTrace0(JNIEnv *env, j
else {
PIN_JAVA_STRING(ENVONLY, file_name, file, NULL, "printStackTrace0: file name not pinned");
if ((stream = HDfopen(file, "a+"))) {
if ((stream = fopen(file, "a+"))) {
H5Eprint2(H5E_DEFAULT, stream);
HDfclose(stream);
fclose(stream);
}
}
@ -403,7 +403,7 @@ h5libraryError(JNIEnv *env)
goto done;
if (msg_size > 0) {
if (NULL == (msg_str = (char *)HDcalloc((size_t)msg_size + 1, sizeof(char))))
if (NULL == (msg_str = (char *)calloc((size_t)msg_size + 1, sizeof(char))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5libraryerror: failed to allocate buffer for error message");
if ((msg_size = H5Eget_msg(min_num, &error_msg_type, msg_str, (size_t)msg_size + 1)) < 0)
@ -428,7 +428,7 @@ h5libraryError(JNIEnv *env)
done:
if (msg_str)
HDfree(msg_str);
free(msg_str);
return retVal;
} /* end h5libraryError() */

View File

@ -181,7 +181,7 @@ Java_hdf_hdf5lib_H5_H5Aread(JNIEnv *env, jclass clss, jlong attr_id, jlong mem_t
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (readBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread: failed to allocate raw VL read buffer");
}
else {
@ -218,7 +218,7 @@ done:
}
if (vl_data_class) {
HDfree(readBuf);
free(readBuf);
}
else {
if (isCriticalPinning) {
@ -270,7 +270,7 @@ Java_hdf_hdf5lib_H5_H5Awrite(JNIEnv *env, jclass clss, jlong attr_id, jlong mem_
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (writeBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Awrite: failed to allocate raw VL write buffer");
}
else {
@ -304,7 +304,7 @@ done:
}
if (vl_data_class) {
HDfree(writeBuf);
free(writeBuf);
}
else {
if (isCriticalPinning) {
@ -993,17 +993,17 @@ Java_hdf_hdf5lib_H5_H5Aread_1string(JNIEnv *env, jclass clss, jlong attr_id, jlo
if (!(str_len = H5Tget_size((hid_t)mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (cstr = (char *)HDmalloc(str_len + 1)))
if (NULL == (cstr = (char *)malloc(str_len + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_string: memory allocation failed");
if (NULL == (c_buf = (char *)HDmalloc((size_t)n * str_len)))
if (NULL == (c_buf = (char *)malloc((size_t)n * str_len)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_string: memory allocation failed");
if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, c_buf)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
for (i = 0, pos = 0; i < n; i++) {
HDmemcpy(cstr, c_buf + pos, str_len);
memcpy(cstr, c_buf + pos, str_len);
cstr[str_len] = '\0';
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, cstr))) {
@ -1022,9 +1022,9 @@ Java_hdf_hdf5lib_H5_H5Aread_1string(JNIEnv *env, jclass clss, jlong attr_id, jlo
done:
if (c_buf)
HDfree(c_buf);
free(c_buf);
if (cstr)
HDfree(cstr);
free(cstr);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Aread_1string */
@ -1058,7 +1058,7 @@ Java_hdf_hdf5lib_H5_H5Awrite_1string(JNIEnv *env, jclass clss, jlong attr_id, jl
if (!(str_len = H5Tget_size((hid_t)mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (c_buf = (char *)HDmalloc((size_t)n * str_len)))
if (NULL == (c_buf = (char *)malloc((size_t)n * str_len)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Awrite_string: memory allocation failed");
for (i = 0; i < (size_t)n; i++) {
@ -1068,7 +1068,7 @@ Java_hdf_hdf5lib_H5_H5Awrite_1string(JNIEnv *env, jclass clss, jlong attr_id, jl
/*
* If the string object was NULL, skip it.
*/
HDmemset(&c_buf[i * str_len], 0, str_len);
memset(&c_buf[i * str_len], 0, str_len);
continue;
}
@ -1079,7 +1079,7 @@ Java_hdf_hdf5lib_H5_H5Awrite_1string(JNIEnv *env, jclass clss, jlong attr_id, jl
PIN_JAVA_STRING(ENVONLY, obj, utf8, NULL, "H5Awrite_string: string not pinned");
HDstrncpy(&c_buf[i * str_len], utf8, str_len);
strncpy(&c_buf[i * str_len], utf8, str_len);
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
utf8 = NULL;
@ -1094,7 +1094,7 @@ done:
if (utf8)
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
if (c_buf)
HDfree(c_buf);
free(c_buf);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Awrite_1string */
@ -1133,7 +1133,7 @@ Java_hdf_hdf5lib_H5_H5AreadVL(JNIEnv *env, jclass clss, jlong attr_id, jlong mem
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (readBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread: failed to allocate raw VL read buffer");
if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, (void *)readBuf)) < 0)
@ -1157,9 +1157,9 @@ done:
}
if (is_variable) {
for (size_t i = 0; i < (size_t)vl_array_len; i++)
HDfree(((char **)readBuf)[i]);
free(((char **)readBuf)[i]);
}
HDfree(readBuf);
free(readBuf);
}
return (jint)status;
@ -1202,7 +1202,7 @@ Java_hdf_hdf5lib_H5_H5AwriteVL(JNIEnv *env, jclass clss, jlong attr_id, jlong me
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (writeBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Awrite: failed to allocate raw VL write buffer");
if ((type_class = H5Tget_class((hid_t)mem_type_id)) < 0)
@ -1224,10 +1224,10 @@ done:
}
if (is_variable) {
for (size_t i = 0; i < (size_t)vl_array_len; i++)
HDfree(((char **)writeBuf)[i]);
free(((char **)writeBuf)[i]);
}
HDfree(writeBuf);
free(writeBuf);
}
return (jint)status;
@ -1323,7 +1323,7 @@ H5AreadVL_str(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5AreadVL_str: buf length < 0");
}
if (NULL == (strs = (char **)HDcalloc((size_t)n, sizeof(char *))))
if (NULL == (strs = (char **)calloc((size_t)n, sizeof(char *))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5AreadVL_str: failed to allocate variable length string read buffer");
@ -1356,7 +1356,7 @@ done:
H5free_memory(strs[i]);
}
HDfree(strs);
free(strs);
}
return status;
@ -1381,7 +1381,7 @@ H5AreadVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
void *readBuf = NULL;
herr_t status = FAIL;
HDmemset(&h5str, 0, sizeof(h5str_t));
memset(&h5str, 0, sizeof(h5str_t));
/* Get size of string array */
if ((n = ENVPTR->GetArrayLength(ENVONLY, buf)) < 0) {
@ -1396,7 +1396,7 @@ H5AreadVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
if (!(typeSize = H5Tget_size(tid)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)n, typeSize)))
if (NULL == (readBuf = calloc((size_t)n, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AreadVL_asstr: failed to allocate read buffer");
if ((status = H5Aread(aid, tid, readBuf)) < 0)
@ -1429,7 +1429,7 @@ done:
h5str_free(&h5str);
if (readBuf) {
H5Treclaim(tid, sid, H5P_DEFAULT, readBuf);
HDfree(readBuf);
free(readBuf);
}
if (sid >= 0)
H5Sclose(sid);
@ -1528,7 +1528,7 @@ H5AwriteVL_str(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5AwriteVL_str: buf length < 0");
}
if (NULL == (writeBuf = (char **)HDcalloc((size_t)size + 1, sizeof(char *))))
if (NULL == (writeBuf = (char **)calloc((size_t)size + 1, sizeof(char *))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5AwriteVL_str: failed to allocate variable length string write buffer");
@ -1550,10 +1550,10 @@ H5AwriteVL_str(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
PIN_JAVA_STRING(ENVONLY, obj, utf8, NULL, "H5AwriteVL_str: string not pinned");
if (NULL == (writeBuf[i] = (char *)HDmalloc((size_t)length + 1)))
if (NULL == (writeBuf[i] = (char *)malloc((size_t)length + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AwriteVL_str: failed to allocate string buffer");
HDstrncpy(writeBuf[i], utf8, (size_t)length + 1);
strncpy(writeBuf[i], utf8, (size_t)length + 1);
writeBuf[i][length] = '\0';
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
@ -1571,10 +1571,10 @@ done:
if (writeBuf) {
for (i = 0; i < size; i++) {
if (writeBuf[i])
HDfree(writeBuf[i]);
free(writeBuf[i]);
}
HDfree(writeBuf);
free(writeBuf);
}
return status;
@ -1610,7 +1610,7 @@ H5AwriteVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
if (!(typeSize = H5Tget_size(tid)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)n, typeSize)))
if (NULL == (writeBuf = calloc((size_t)n, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AwriteVL_asstr: failed to allocate write buffer");
/*
@ -1626,7 +1626,7 @@ H5AwriteVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
/*
* If the string object was NULL, skip it.
*/
HDmemset(&(((char *)writeBuf)[i * typeSize]), 0, typeSize);
memset(&(((char *)writeBuf)[i * typeSize]), 0, typeSize);
continue;
}
@ -1646,7 +1646,7 @@ H5AwriteVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
if (!h5str_convert(ENVONLY, &utf8_copy, aid, tid, &(((char *)writeBuf)[i * typeSize]), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
HDfree(utf8_copy);
free(utf8_copy);
UNPIN_JAVA_STRING(ENVONLY, jstr, utf8);
utf8 = NULL;
@ -1662,7 +1662,7 @@ done:
UNPIN_JAVA_STRING(ENVONLY, jstr, utf8);
if (writeBuf) {
H5Treclaim(tid, sid, H5P_DEFAULT, writeBuf);
HDfree(writeBuf);
free(writeBuf);
}
if (sid >= 0)
H5Sclose(sid);
@ -1687,14 +1687,14 @@ Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref(JNIEnv *env, jclass clss, jlong attr_id, j
UNUSED(clss);
HDmemset(&h5str, 0, sizeof(h5str_t));
memset(&h5str, 0, sizeof(h5str_t));
if ((n = ENVPTR->GetArrayLength(ENVONLY, buf)) < 0) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Aread_reg_ref: buf length < 0");
}
if (NULL == (ref_data = (H5R_ref_t *)HDcalloc(1, (size_t)n * sizeof(H5R_ref_t))))
if (NULL == (ref_data = (H5R_ref_t *)calloc(1, (size_t)n * sizeof(H5R_ref_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aread_reg_ref: failed to allocate read buffer");
if ((status = H5Aread((hid_t)attr_id, (hid_t)mem_type_id, ref_data)) < 0)
@ -1724,7 +1724,7 @@ done:
if (h5str.s)
h5str_free(&h5str);
if (ref_data)
HDfree(ref_data);
free(ref_data);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref */
@ -1784,7 +1784,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1name(JNIEnv *env, jclass clss, jlong attr_id)
if ((buf_size = H5Aget_name((hid_t)attr_id, 0, NULL)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (attrName = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (attrName = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aget_name: failed to allocate attribute name buffer");
if (H5Aget_name((hid_t)attr_id, (size_t)buf_size + 1, attrName) < 0)
@ -1796,7 +1796,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1name(JNIEnv *env, jclass clss, jlong attr_id)
done:
if (attrName)
HDfree(attrName);
free(attrName);
return str;
} /* end Java_hdf_hdf5lib_H5_H5Aget_1name */
@ -2140,7 +2140,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1name_1by_1idx(JNIEnv *env, jclass clss, jlong loc_id
(hsize_t)n, (char *)NULL, (size_t)0, (hid_t)lapl_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (attrName = (char *)HDmalloc(sizeof(char) * (size_t)status_size + 1)))
if (NULL == (attrName = (char *)malloc(sizeof(char) * (size_t)status_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Aget_name_by_idx: failed to allocate buffer for attribute name");
if ((H5Aget_name_by_idx((hid_t)loc_id, objName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t)n,
@ -2153,7 +2153,7 @@ Java_hdf_hdf5lib_H5_H5Aget_1name_1by_1idx(JNIEnv *env, jclass clss, jlong loc_id
done:
if (attrName)
HDfree(attrName);
free(attrName);
if (objName)
UNPIN_JAVA_STRING(ENVONLY, obj_name, objName);

View File

@ -207,7 +207,7 @@ Java_hdf_hdf5lib_H5_H5Dread(JNIEnv *env, jclass clss, jlong dataset_id, jlong me
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (readBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread: failed to allocate raw VL read buffer");
}
else {
@ -237,7 +237,7 @@ done:
H5Treclaim(dataset_id, mem_space_id, H5P_DEFAULT, readBuf);
if (vl_data_class) {
HDfree(readBuf);
free(readBuf);
}
else {
if (isCriticalPinning) {
@ -288,7 +288,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite(JNIEnv *env, jclass clss, jlong dataset_id, jlong m
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (writeBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dwrite: failed to allocate raw VL write buffer");
}
else {
@ -318,7 +318,7 @@ done:
H5Treclaim(dataset_id, mem_space_id, H5P_DEFAULT, writeBuf);
if (vl_data_class) {
HDfree(writeBuf);
free(writeBuf);
}
else {
if (isCriticalPinning) {
@ -1016,10 +1016,10 @@ Java_hdf_hdf5lib_H5_H5Dread_1string(JNIEnv *env, jclass clss, jlong dataset_id,
if (!(str_len = H5Tget_size((hid_t)mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (cstr = (char *)HDmalloc(str_len + 1)))
if (NULL == (cstr = (char *)malloc(str_len + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_string: memory allocation failed");
if (NULL == (c_buf = (char *)HDmalloc((size_t)n * str_len)))
if (NULL == (c_buf = (char *)malloc((size_t)n * str_len)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_string: memory allocation failed");
if ((status = H5Dread((hid_t)dataset_id, (hid_t)mem_type_id, (hid_t)mem_space_id, (hid_t)file_space_id,
@ -1027,7 +1027,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1string(JNIEnv *env, jclass clss, jlong dataset_id,
H5_LIBRARY_ERROR(ENVONLY);
for (i = 0, pos = 0; i < n; i++) {
HDmemcpy(cstr, c_buf + pos, str_len);
memcpy(cstr, c_buf + pos, str_len);
cstr[str_len] = '\0';
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, cstr))) {
@ -1046,9 +1046,9 @@ Java_hdf_hdf5lib_H5_H5Dread_1string(JNIEnv *env, jclass clss, jlong dataset_id,
done:
if (c_buf)
HDfree(c_buf);
free(c_buf);
if (cstr)
HDfree(cstr);
free(cstr);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Dread_1string */
@ -1083,7 +1083,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1string(JNIEnv *env, jclass clss, jlong dataset_id,
if (!(str_len = H5Tget_size((hid_t)mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (c_buf = (char *)HDmalloc((size_t)n * str_len)))
if (NULL == (c_buf = (char *)malloc((size_t)n * str_len)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dwrite_string: memory allocation failed");
for (i = 0; i < (size_t)n; i++) {
@ -1093,7 +1093,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1string(JNIEnv *env, jclass clss, jlong dataset_id,
/*
* If the string object was NULL, skip it.
*/
HDmemset(&c_buf[i * str_len], 0, str_len);
memset(&c_buf[i * str_len], 0, str_len);
continue;
}
@ -1104,7 +1104,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1string(JNIEnv *env, jclass clss, jlong dataset_id,
PIN_JAVA_STRING(ENVONLY, obj, utf8, NULL, "H5Dwrite_string: string not pinned");
HDstrncpy(&c_buf[i * str_len], utf8, str_len);
strncpy(&c_buf[i * str_len], utf8, str_len);
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
utf8 = NULL;
@ -1120,7 +1120,7 @@ done:
if (utf8)
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
if (c_buf)
HDfree(c_buf);
free(c_buf);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Dwrite_1string */
@ -1160,7 +1160,7 @@ Java_hdf_hdf5lib_H5_H5DreadVL(JNIEnv *env, jclass clss, jlong dataset_id, jlong
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (readBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DreadVL: failed to allocate raw VL read buffer");
if ((status = H5Dread((hid_t)dataset_id, (hid_t)mem_type_id, (hid_t)mem_space_id, (hid_t)file_space_id,
@ -1177,9 +1177,9 @@ done:
H5Treclaim(dataset_id, mem_space_id, H5P_DEFAULT, readBuf);
if (is_variable) {
for (size_t i = 0; i < (size_t)vl_array_len; i++)
HDfree(((char **)readBuf)[i]);
free(((char **)readBuf)[i]);
}
HDfree(readBuf);
free(readBuf);
}
return (jint)status;
@ -1221,7 +1221,7 @@ Java_hdf_hdf5lib_H5_H5DwriteVL(JNIEnv *env, jclass clss, jlong dataset_id, jlong
if (!(typeSize = H5Tget_size(mem_type_id)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)vl_array_len, typeSize)))
if (NULL == (writeBuf = calloc((size_t)vl_array_len, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DwriteVL: failed to allocate raw VL write buffer");
if ((type_class = H5Tget_class((hid_t)mem_type_id)) < 0)
@ -1239,10 +1239,10 @@ done:
H5Treclaim(dataset_id, mem_space_id, H5P_DEFAULT, writeBuf);
if (is_variable) {
for (size_t i = 0; i < (size_t)vl_array_len; i++)
HDfree(((char **)writeBuf)[i]);
free(((char **)writeBuf)[i]);
}
HDfree(writeBuf);
free(writeBuf);
}
return (jint)status;
@ -1342,7 +1342,7 @@ H5DreadVL_str(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid,
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5DreadVL_str: buf length < 0");
}
if (NULL == (strs = (char **)HDcalloc((size_t)n, sizeof(char *))))
if (NULL == (strs = (char **)calloc((size_t)n, sizeof(char *))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5DreadVL_str: failed to allocate variable length string read buffer");
@ -1375,7 +1375,7 @@ done:
H5free_memory(strs[i]);
}
HDfree(strs);
free(strs);
}
return status;
@ -1402,7 +1402,7 @@ H5DreadVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid
void *readBuf = NULL;
herr_t status = FAIL;
HDmemset(&h5str, 0, sizeof(h5str_t));
memset(&h5str, 0, sizeof(h5str_t));
if (mem_space == H5S_ALL) {
mem_space = file_sid;
@ -1429,7 +1429,7 @@ H5DreadVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid
if (!(typeSize = H5Tget_size(tid)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (readBuf = HDcalloc((size_t)n, typeSize)))
if (NULL == (readBuf = calloc((size_t)n, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DreadVL_asstr: failed to allocate read buffer");
if ((status = H5Dread(did, tid, mem_sid, file_sid, xfer_plist_id, readBuf)) < 0)
@ -1465,7 +1465,7 @@ done:
h5str_free(&h5str);
if (readBuf) {
H5Treclaim(tid, mem_space, xfer_plist_id, readBuf);
HDfree(readBuf);
free(readBuf);
}
if (close_mem_space)
H5Sclose(mem_space);
@ -1568,7 +1568,7 @@ H5DwriteVL_str(JNIEnv *env, hid_t dataset_id, hid_t mem_type_id, hid_t mem_space
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5DwriteVL_str: buf length < 0");
}
if (NULL == (writeBuf = (char **)HDcalloc((size_t)size + 1, sizeof(char *))))
if (NULL == (writeBuf = (char **)calloc((size_t)size + 1, sizeof(char *))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5DwriteVL_str: failed to allocate variable length string write buffer");
@ -1590,10 +1590,10 @@ H5DwriteVL_str(JNIEnv *env, hid_t dataset_id, hid_t mem_type_id, hid_t mem_space
PIN_JAVA_STRING(ENVONLY, obj, utf8, NULL, "H5DwriteVL_str: string not pinned");
if (NULL == (writeBuf[i] = (char *)HDmalloc((size_t)length + 1)))
if (NULL == (writeBuf[i] = (char *)malloc((size_t)length + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5DwriteVL_str: failed to allocate string buffer");
HDstrncpy(writeBuf[i], utf8, (size_t)length + 1);
strncpy(writeBuf[i], utf8, (size_t)length + 1);
writeBuf[i][length] = '\0';
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
@ -1612,10 +1612,10 @@ done:
if (writeBuf) {
for (i = 0; i < size; i++) {
if (writeBuf[i])
HDfree(writeBuf[i]);
free(writeBuf[i]);
}
HDfree(writeBuf);
free(writeBuf);
}
return status;
@ -1664,7 +1664,7 @@ H5DwriteVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_si
if (!(typeSize = H5Tget_size(tid)))
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (writeBuf = HDcalloc((size_t)n, typeSize)))
if (NULL == (writeBuf = calloc((size_t)n, typeSize)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5AwriteVL_asstr: failed to allocate write buffer");
for (i = 0; i < (size_t)n; ++i) {
@ -1674,7 +1674,7 @@ H5DwriteVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_si
/*
* If the string object was NULL, skip it.
*/
HDmemset(&(((char *)writeBuf)[i * typeSize]), 0, typeSize);
memset(&(((char *)writeBuf)[i * typeSize]), 0, typeSize);
continue;
}
@ -1694,7 +1694,7 @@ H5DwriteVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_si
if (!h5str_convert(ENVONLY, &utf8_copy, did, tid, &(((char *)writeBuf)[i * typeSize]), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
HDfree(utf8_copy);
free(utf8_copy);
UNPIN_JAVA_STRING(ENVONLY, jstr, utf8);
utf8 = NULL;
@ -1710,7 +1710,7 @@ done:
UNPIN_JAVA_STRING(ENVONLY, jstr, utf8);
if (writeBuf) {
H5Treclaim(tid, mem_space, xfer_plist_id, writeBuf);
HDfree(writeBuf);
free(writeBuf);
}
if (close_mem_space)
H5Sclose(mem_space);
@ -1736,14 +1736,14 @@ Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref(JNIEnv *env, jclass clss, jlong dataset_id
UNUSED(clss);
HDmemset(&h5str, 0, sizeof(h5str_t));
memset(&h5str, 0, sizeof(h5str_t));
if ((n = ENVPTR->GetArrayLength(ENVONLY, buf)) < 0) {
CHECK_JNI_EXCEPTION(ENVONLY, JNI_TRUE);
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Dread_reg_ref: buf length < 0");
}
if (NULL == (ref_data = (H5R_ref_t *)HDcalloc(1, (size_t)n * sizeof(H5R_ref_t))))
if (NULL == (ref_data = (H5R_ref_t *)calloc(1, (size_t)n * sizeof(H5R_ref_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dread_reg_ref: failed to allocate read buffer");
if ((status = H5Dread((hid_t)dataset_id, (hid_t)mem_type_id, (hid_t)mem_space_id, (hid_t)file_space_id,
@ -1774,7 +1774,7 @@ done:
if (h5str.s)
h5str_free(&h5str);
if (ref_data)
HDfree(ref_data);
free(ref_data);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref */
@ -2005,7 +2005,7 @@ Java_hdf_hdf5lib_H5_H5Dset_1extent(JNIEnv *env, jclass clss, jlong loc_id, jlong
PIN_LONG_ARRAY(ENVONLY, buf, dimsBuf, &isCopy, "H5Dset_extent: buffer not pinned");
if (NULL == (dims = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (dims = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Dset_extent: failed to allocate dataset dimension buffer");
for (i = 0; i < rank; i++)
@ -2016,7 +2016,7 @@ Java_hdf_hdf5lib_H5_H5Dset_1extent(JNIEnv *env, jclass clss, jlong loc_id, jlong
done:
if (dims)
HDfree(dims);
free(dims);
if (dimsBuf)
UNPIN_LONG_ARRAY(ENVONLY, buf, dimsBuf, JNI_ABORT);
} /* end Java_hdf_hdf5lib_H5_H5Dset_1extent */

View File

@ -298,7 +298,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1class_1name(JNIEnv *env, jclass clss, jlong cls_id)
if (!buf_size)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_class_name: no class name");
if (NULL == (namePtr = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (namePtr = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Eget_class_name: malloc failed");
if ((H5Eget_class_name((hid_t)cls_id, (char *)namePtr, (size_t)buf_size + 1)) < 0)
@ -310,7 +310,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1class_1name(JNIEnv *env, jclass clss, jlong cls_id)
done:
if (namePtr)
HDfree(namePtr);
free(namePtr);
return str;
} /* end Java_hdf_hdf5lib_H5_H5Eget_1class_1name */
@ -452,7 +452,7 @@ Java_hdf_hdf5lib_H5_H5Eget_1msg(JNIEnv *env, jclass clss, jlong msg_id, jintArra
if (!buf_size)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Eget_msg: invalid message");
if (NULL == (namePtr = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (namePtr = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Eget_msg: malloc failed");
PIN_INT_ARRAY(ENVONLY, error_msg_type_list, theArray, NULL, "H5Eget_msg: error_msg_type_list not pinned");
@ -470,7 +470,7 @@ done:
if (theArray)
UNPIN_INT_ARRAY(ENVONLY, error_msg_type_list, theArray, 0);
if (namePtr)
HDfree(namePtr);
free(namePtr);
return str;
} /* end Java_hdf_hdf5lib_H5_H5Eget_1msg */

View File

@ -126,7 +126,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1name(JNIEnv *env, jclass clss, jlong file_id)
if ((buf_size = H5Fget_name((hid_t)file_id, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (namePtr = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (namePtr = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Fget_name: malloc failed");
if ((H5Fget_name((hid_t)file_id, namePtr, (size_t)buf_size + 1)) < 0)
@ -138,7 +138,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1name(JNIEnv *env, jclass clss, jlong file_id)
done:
if (namePtr)
HDfree(namePtr);
free(namePtr);
return str;
} /* end Java_hdf_hdf5lib_H5_H5Fget_1name */
@ -430,7 +430,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1obj_1ids(JNIEnv *env, jclass clss, jlong file_id, ji
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Fget_obj_ids: obj_id_list length < 0");
}
if (NULL == (id_list = (hid_t *)HDmalloc((size_t)rank * sizeof(hid_t))))
if (NULL == (id_list = (hid_t *)malloc((size_t)rank * sizeof(hid_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Fget_obj_ids: malloc failed");
if ((ret_val = H5Fget_obj_ids((hid_t)file_id, (unsigned int)types, (size_t)maxObjs, id_list)) < 0)
@ -442,7 +442,7 @@ Java_hdf_hdf5lib_H5_H5Fget_1obj_1ids(JNIEnv *env, jclass clss, jlong file_id, ji
done:
if (id_list)
HDfree(id_list);
free(id_list);
if (obj_id_listP)
UNPIN_LONG_ARRAY(ENVONLY, obj_id_list, obj_id_listP, (ret_val < 0) ? JNI_ABORT : 0);

View File

@ -68,7 +68,7 @@ Java_hdf_hdf5lib_H5_H5Iget_1name_1long(JNIEnv *env, jclass clss, jlong obj_id, j
if (buf_size < 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Iget_name_long: buf_size < 0");
if (NULL == (aName = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (aName = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Iget_name_long: malloc failed");
if ((size = H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size + 1)) < 0)
@ -83,7 +83,7 @@ Java_hdf_hdf5lib_H5_H5Iget_1name_1long(JNIEnv *env, jclass clss, jlong obj_id, j
done:
if (aName)
HDfree(aName);
free(aName);
return (jlong)size;
} /* end Java_hdf_hdf5lib_H5_H5Iget_1name */
@ -106,7 +106,7 @@ Java_hdf_hdf5lib_H5_H5Iget_1name(JNIEnv *env, jclass clss, jlong obj_id)
if ((buf_size = H5Iget_name((hid_t)obj_id, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (aName = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (aName = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Iget_name: malloc failed");
if (H5Iget_name((hid_t)obj_id, aName, (size_t)buf_size + 1) < 0)
@ -118,7 +118,7 @@ Java_hdf_hdf5lib_H5_H5Iget_1name(JNIEnv *env, jclass clss, jlong obj_id)
done:
if (aName)
HDfree(aName);
free(aName);
return str;
} /* end Java_hdf_hdf5lib_H5_H5Iget_1name */

View File

@ -82,7 +82,7 @@
H5_JNI_FATAL_ERROR(envptr, "JNI error: GetMethodID failed"); \
} \
if (NULL == (ret_obj = (*envptr)->NewObjectA(envptr, cls, constructor, (args)))) { \
HDprintf("FATAL ERROR: %s: Creation failed\n", classname); \
printf("FATAL ERROR: %s: Creation failed\n", classname); \
CHECK_JNI_EXCEPTION(envptr, JNI_FALSE); \
} \
} while (0)

View File

@ -424,7 +424,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx(JNIEnv *env, jclass clss, jlong loc_id
H5_LIBRARY_ERROR(ENVONLY);
/* add extra space for the null terminator */
if (NULL == (linkName = (char *)HDmalloc(sizeof(char) * (size_t)status_size + 1)))
if (NULL == (linkName = (char *)malloc(sizeof(char) * (size_t)status_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_name_by_idx: failed to allocate buffer for link name");
if ((H5Lget_name_by_idx((hid_t)loc_id, groupName, (H5_index_t)index_field, (H5_iter_order_t)order,
@ -438,7 +438,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx(JNIEnv *env, jclass clss, jlong loc_id
done:
if (linkName)
HDfree(linkName);
free(linkName);
if (groupName)
UNPIN_JAVA_STRING(ENVONLY, name, groupName);
@ -478,7 +478,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value(JNIEnv *env, jclass clss, jlong loc_id, jstrin
if (H5L_TYPE_HARD == infobuf.type)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Lget_val: hard links are unsupported");
if (NULL == (linkValue = (char *)HDmalloc(sizeof(char) * infobuf.u.val_size + 1)))
if (NULL == (linkValue = (char *)malloc(sizeof(char) * infobuf.u.val_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_val: failed to allocate buffer for link value");
if ((status = H5Lget_val((hid_t)loc_id, linkName, (void *)linkValue, infobuf.u.val_size + 1,
@ -527,7 +527,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value(JNIEnv *env, jclass clss, jlong loc_id, jstrin
done:
if (linkValue)
HDfree(linkValue);
free(linkValue);
if (linkName)
UNPIN_JAVA_STRING(ENVONLY, name, linkName);
@ -572,7 +572,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx(JNIEnv *env, jclass clss, jlong loc_i
if (!infobuf.u.val_size)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (linkValue = (void *)HDmalloc(infobuf.u.val_size + 1)))
if (NULL == (linkValue = (void *)malloc(infobuf.u.val_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Lget_val_by_idx: failed to allocate buffer for link value");
if ((status = H5Lget_val_by_idx((hid_t)loc_id, grpName, (H5_index_t)index_field, (H5_iter_order_t)order,
@ -622,7 +622,7 @@ Java_hdf_hdf5lib_H5_H5Lget_1value_1by_1idx(JNIEnv *env, jclass clss, jlong loc_i
done:
if (linkValue)
HDfree(linkValue);
free(linkValue);
if (grpName)
UNPIN_JAVA_STRING(ENVONLY, name, grpName);

View File

@ -63,7 +63,7 @@ create_H5O_token_t(JNIEnv *envptr, const H5O_token_t *token, bool is_critical_pi
PIN_BYTE_ARRAY(envptr, tokenByteBuf, token_buf, &token_buf_is_copy,
"create_H5O_token_t: object token buffer not pinned");
HDmemcpy(token_buf, token, sizeof(H5O_token_t));
memcpy(token_buf, token, sizeof(H5O_token_t));
if (is_critical_pinning)
UNPIN_ARRAY_CRITICAL(envptr, tokenByteBuf, token_buf, 0);
@ -756,7 +756,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment(JNIEnv *env, jclass clss, jlong loc_id)
H5_LIBRARY_ERROR(ENVONLY);
if (buf_size) {
if (NULL == (oComment = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (oComment = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Oget_comment: failed to allocate object comment buffer");
if ((status = H5Oget_comment((hid_t)loc_id, oComment, (size_t)buf_size + 1)) < 0)
@ -769,7 +769,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment(JNIEnv *env, jclass clss, jlong loc_id)
done:
if (oComment)
HDfree(oComment);
free(oComment);
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Oget_1comment */
@ -801,7 +801,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment_1by_1name(JNIEnv *env, jclass clss, jlong lo
H5_LIBRARY_ERROR(ENVONLY);
if (buf_size) {
if (NULL == (objComment = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (objComment = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5Oget_comment_by_name: failed to allocate buffer for object comment");
@ -816,7 +816,7 @@ Java_hdf_hdf5lib_H5_H5Oget_1comment_1by_1name(JNIEnv *env, jclass clss, jlong lo
done:
if (objComment)
HDfree(objComment);
free(objComment);
if (objName)
UNPIN_JAVA_STRING(ENVONLY, name, objName);
@ -916,7 +916,7 @@ Java_hdf_hdf5lib_H5__1H5Oopen_1by_1token(JNIEnv *env, jclass clss, jlong loc_id,
PIN_BYTE_ARRAY(ENVONLY, (jbyteArray)token_data, token_buf, &token_buf_is_copy,
"H5Oopen_by_token: token buffer not pinned");
HDmemcpy(&obj_token, token_buf, sizeof(H5O_token_t));
memcpy(&obj_token, token_buf, sizeof(H5O_token_t));
UNPIN_BYTE_ARRAY(ENVONLY, (jbyteArray)token_data, token_buf, JNI_ABORT);
token_buf = NULL;

View File

@ -150,7 +150,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix(JNIEnv *env, jclass clss, jlong dapl_i
if ((prefix_size = H5Pget_efile_prefix((hid_t)dapl_id, (char *)NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (pre = (char *)HDmalloc(sizeof(char) * (size_t)prefix_size + 1)))
if (NULL == (pre = (char *)malloc(sizeof(char) * (size_t)prefix_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_efile_prefix: memory allocation failed");
if (H5Pget_efile_prefix((hid_t)dapl_id, (char *)pre, (size_t)prefix_size + 1) < 0)
@ -165,7 +165,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix(JNIEnv *env, jclass clss, jlong dapl_i
done:
if (pre)
HDfree(pre);
free(pre);
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1efile_1prefix */

View File

@ -104,7 +104,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1chunk(JNIEnv *env, jclass clss, jlong plist, jint nd
PIN_BYTE_ARRAY(ENVONLY, dim, theArray, &isCopy, "H5Pset_chunk: dim array not pinned");
if (NULL == (da = lp = (hsize_t *)HDmalloc(rank * sizeof(hsize_t))))
if (NULL == (da = lp = (hsize_t *)malloc(rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pset_chunk: memory allocation failed");
jlp = (jlong *)theArray;
@ -119,7 +119,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1chunk(JNIEnv *env, jclass clss, jlong plist, jint nd
done:
if (da)
HDfree(da);
free(da);
if (theArray)
UNPIN_BYTE_ARRAY(ENVONLY, dim, theArray, JNI_ABORT);
@ -155,7 +155,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1chunk(JNIEnv *env, jclass clss, jlong plist, jint ma
PIN_LONG_ARRAY(ENVONLY, dims, theArray, &isCopy, "H5Pget_chunk: input dims not pinned");
if (NULL == (da = (hsize_t *)HDmalloc((size_t)max_ndims * sizeof(hsize_t))))
if (NULL == (da = (hsize_t *)malloc((size_t)max_ndims * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_chunk: memory allocation failed");
if ((status = H5Pget_chunk((hid_t)plist, (int)max_ndims, da)) < 0)
@ -166,7 +166,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1chunk(JNIEnv *env, jclass clss, jlong plist, jint ma
done:
if (da)
HDfree(da);
free(da);
if (theArray)
UNPIN_LONG_ARRAY(ENVONLY, dims, theArray, (status < 0) ? JNI_ABORT : 0);
@ -576,7 +576,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter(JNIEnv *env, jclass clss, jlong plist, jint f
if (NULL == cd_values)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter: cd_values is NULL");
if (NULL == (filter = (char *)HDmalloc(sizeof(char) * (size_t)namelen)))
if (NULL == (filter = (char *)malloc(sizeof(char) * (size_t)namelen)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter: flags array not pinned");
@ -616,7 +616,7 @@ done:
if (flagsArray)
UNPIN_INT_ARRAY(ENVONLY, flags, flagsArray, (status < 0) ? JNI_ABORT : 0);
if (filter)
HDfree(filter);
free(filter);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1filter */
@ -651,7 +651,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter2(JNIEnv *env, jclass clss, jlong plist, jint
if (NULL == filter_config)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter2: filter_config is NULL");
if (NULL == (filter = (char *)HDmalloc(sizeof(char) * (size_t)namelen)))
if (NULL == (filter = (char *)malloc(sizeof(char) * (size_t)namelen)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter2: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter2: flags array not pinned");
@ -714,7 +714,7 @@ done:
if (flagsArray)
UNPIN_INT_ARRAY(ENVONLY, flags, flagsArray, (status < 0) ? JNI_ABORT : 0);
if (filter)
HDfree(filter);
free(filter);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1filter2 */
@ -754,7 +754,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id(JNIEnv *env, jclass clss, jlong plist
if (NULL == name)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter_by_id: name is NULL");
if (NULL == (aName = (char *)HDmalloc(sizeof(char) * (size_t)bs)))
if (NULL == (aName = (char *)malloc(sizeof(char) * (size_t)bs)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter_by_id: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter_by_id: flags not pinned");
@ -800,7 +800,7 @@ done:
if (flagsArray)
UNPIN_INT_ARRAY(ENVONLY, flags, flagsArray, (status < 0) ? JNI_ABORT : 0);
if (aName)
HDfree(aName);
free(aName);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id */
@ -842,7 +842,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id2(JNIEnv *env, jclass clss, jlong plis
if (NULL == filter_config)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Pget_filter_by_id2: filter_config is NULL");
if (NULL == (aName = (char *)HDmalloc(sizeof(char) * (size_t)bs)))
if (NULL == (aName = (char *)malloc(sizeof(char) * (size_t)bs)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_filter_by_id2: memory allocation failed");
PIN_INT_ARRAY(ENVONLY, flags, flagsArray, &isCopy, "H5Pget_filter_by_id2: flags not pinned");
@ -886,7 +886,7 @@ done:
if (flagsArray)
UNPIN_INT_ARRAY(ENVONLY, flags, flagsArray, (status < 0) ? JNI_ABORT : 0);
if (aName)
HDfree(aName);
free(aName);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1filter_1by_1id2 */
@ -1103,7 +1103,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1external(JNIEnv *env, jclass clss, jlong plist, jint
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_external: size input array < 2");
if (name_size > 0)
if (NULL == (file = (char *)HDmalloc(sizeof(char) * (size_t)name_size)))
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,
@ -1134,7 +1134,7 @@ done:
if (theArray)
UNPIN_LONG_ARRAY(ENVONLY, size, theArray, (status < 0) ? JNI_ABORT : 0);
if (file)
HDfree(file);
free(file);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1external */
@ -1228,7 +1228,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname(JNIEnv *env, jclass clss, jlong dc
if ((buf_size = H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t)idx, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (dname = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (dname = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_dsetname: memory allocation failed");
if (H5Pget_virtual_dsetname((hid_t)dcpl_id, (size_t)idx, dname, (size_t)buf_size + 1) < 0)
@ -1244,7 +1244,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname(JNIEnv *env, jclass clss, jlong dc
done:
if (dname)
HDfree(dname);
free(dname);
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1dsetname */
@ -1267,7 +1267,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename(JNIEnv *env, jclass clss, jlong dc
if ((buf_size = H5Pget_virtual_filename((hid_t)dcpl_id, (size_t)idx, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (fname = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (fname = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_filename: memory allocation failed");
if (H5Pget_virtual_filename((hid_t)dcpl_id, (size_t)idx, fname, (size_t)buf_size + 1) < 0)
@ -1283,7 +1283,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename(JNIEnv *env, jclass clss, jlong dc
done:
if (fname)
HDfree(fname);
free(fname);
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1filename */
@ -1369,7 +1369,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix(JNIEnv *env, jclass clss, jlong dapl
if ((prefix_size = H5Pget_virtual_prefix((hid_t)dapl_id, (char *)NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (pre = (char *)HDmalloc(sizeof(char) * (size_t)prefix_size + 1)))
if (NULL == (pre = (char *)malloc(sizeof(char) * (size_t)prefix_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_virtual_prefix: memory allocation failed");
if (H5Pget_virtual_prefix((hid_t)dapl_id, (char *)pre, (size_t)prefix_size + 1) < 0)
@ -1384,7 +1384,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix(JNIEnv *env, jclass clss, jlong dapl
done:
if (pre)
HDfree(pre);
free(pre);
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1virtual_1prefix */

View File

@ -301,7 +301,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1data_1transform(JNIEnv *env, jclass clss, jlong plis
if ((express_size = H5Pget_data_transform((hid_t)plist_id, (char *)NULL, (size_t)size)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (express = (char *)HDmalloc(sizeof(char) * (size_t)express_size + 1)))
if (NULL == (express = (char *)malloc(sizeof(char) * (size_t)express_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_data_transform: memory allocation failed");
if (H5Pget_data_transform((hid_t)plist_id, express, (size_t)express_size + 1) < 0)
@ -319,7 +319,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1data_1transform(JNIEnv *env, jclass clss, jlong plis
done:
if (express)
HDfree(express);
free(express);
return (jlong)express_size;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1data_1transform */

View File

@ -302,7 +302,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1family(JNIEnv *env, jclass clss, jlong tid, jl
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_family: memb_size array length < 0");
}
if (NULL == (sa = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (sa = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_family: memory allocation failed");
PIN_LONG_ARRAY(ENVONLY, memb_plist, plistArray, &isCopy, "H5Pget_family: plistArray not pinned");
@ -317,7 +317,7 @@ done:
if (plistArray)
UNPIN_LONG_ARRAY(ENVONLY, memb_plist, plistArray, (status < 0) ? JNI_ABORT : 0);
if (sa)
HDfree(sa);
free(sa);
if (sizeArray)
UNPIN_LONG_ARRAY(ENVONLY, memb_size, sizeArray, (status < 0) ? JNI_ABORT : 0);
@ -442,7 +442,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs(JNIEnv *env, jclass clss, jlong fapl_id,
UNUSED(clss);
#ifdef H5_HAVE_LIBHDFS
HDmemset(&instance, 0, sizeof(H5FD_hdfs_fapl_t));
memset(&instance, 0, sizeof(H5FD_hdfs_fapl_t));
if (NULL == (cls = ENVPTR->GetObjectClass(ENVONLY, fapl_config)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -462,14 +462,14 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs(JNIEnv *env, jclass clss, jlong fapl_id,
if (j_str) {
PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config namenode_name not pinned");
HDstrncpy(instance.namenode_name, str, H5FD__HDFS_NODE_NAME_SPACE + 1);
strncpy(instance.namenode_name, str, H5FD__HDFS_NODE_NAME_SPACE + 1);
instance.namenode_name[H5FD__HDFS_NODE_NAME_SPACE] = '\0';
UNPIN_JAVA_STRING(ENVONLY, j_str, str);
str = NULL;
}
else
HDmemset(instance.namenode_name, 0, H5FD__HDFS_NODE_NAME_SPACE + 1);
memset(instance.namenode_name, 0, H5FD__HDFS_NODE_NAME_SPACE + 1);
if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "namenode_port", "I")))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -486,14 +486,14 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs(JNIEnv *env, jclass clss, jlong fapl_id,
if (j_str) {
PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5FDset_fapl_hdfs: fapl_config user_name not pinned");
HDstrncpy(instance.user_name, str, H5FD__HDFS_USER_NAME_SPACE + 1);
strncpy(instance.user_name, str, H5FD__HDFS_USER_NAME_SPACE + 1);
instance.user_name[H5FD__HDFS_USER_NAME_SPACE] = '\0';
UNPIN_JAVA_STRING(ENVONLY, j_str, str);
str = NULL;
}
else
HDmemset(instance.user_name, 0, H5FD__HDFS_USER_NAME_SPACE + 1);
memset(instance.user_name, 0, H5FD__HDFS_USER_NAME_SPACE + 1);
if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "kerberos_ticket_cache", "Ljava/lang/String;")))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -505,14 +505,14 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1hdfs(JNIEnv *env, jclass clss, jlong fapl_id,
PIN_JAVA_STRING(ENVONLY, j_str, str, NULL,
"H5FDset_fapl_hdfs: fapl_config kerberos_ticket_cache not pinned");
HDstrncpy(instance.kerberos_ticket_cache, str, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
strncpy(instance.kerberos_ticket_cache, str, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
instance.kerberos_ticket_cache[H5FD__HDFS_KERB_CACHE_PATH_SPACE] = '\0';
UNPIN_JAVA_STRING(ENVONLY, j_str, str);
str = NULL;
}
else
HDmemset(instance.kerberos_ticket_cache, 0, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
memset(instance.kerberos_ticket_cache, 0, H5FD__HDFS_KERB_CACHE_PATH_SPACE + 1);
if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "stream_buffer_size", "I")))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -607,7 +607,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi(JNIEnv *env, jclass clss, jlong tid, jin
UNUSED(clss);
HDmemset(member_name, 0, H5FD_MEM_NTYPES * sizeof(char *));
memset(member_name, 0, H5FD_MEM_NTYPES * sizeof(char *));
if (memb_map)
PIN_INT_ARRAY(ENVONLY, memb_map, themapArray, &isCopy, "H5Pset_fapl_multi: memb_map not pinned");
@ -638,12 +638,12 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi(JNIEnv *env, jclass clss, jlong tid, jin
PIN_JAVA_STRING(ENVONLY, obj, utf8, NULL, "H5Pset_fapl_multi: string not pinned");
str_len = HDstrlen(utf8);
str_len = strlen(utf8);
if (NULL == (member_name[i] = (char *)HDmalloc(str_len + 1)))
if (NULL == (member_name[i] = (char *)malloc(str_len + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pset_fapl_multi: memory allocation failed");
HDstrncpy(member_name[i], utf8, str_len + 1);
strncpy(member_name[i], utf8, str_len + 1);
(member_name[i])[str_len] = '\0';
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
@ -692,7 +692,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi(JNIEnv *env, jclass clss, jlong tid, jin
ENVPTR->DeleteLocalRef(ENVONLY, o);
ENVPTR->DeleteLocalRef(ENVONLY, rstring);
HDfree(member_name[i]);
free(member_name[i]);
member_name[i] = NULL;
}
}
@ -700,7 +700,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi(JNIEnv *env, jclass clss, jlong tid, jin
done:
for (i = 0; i < H5FD_MEM_NTYPES; i++) {
if (member_name[i])
HDfree(member_name[i]);
free(member_name[i]);
}
if (utf8)
UNPIN_JAVA_STRING(ENVONLY, obj, utf8);
@ -741,7 +741,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1fapl_1multi(JNIEnv *env, jclass clss, jlong tid, jin
if (memb_addr)
PIN_LONG_ARRAY(ENVONLY, memb_addr, theaddrArray, &isCopy, "H5Pget_fapl_multi: memb_addr not pinned");
if (memb_name)
if (NULL == (mName = (char **)HDcalloc(H5FD_MEM_NTYPES, sizeof(*mName))))
if (NULL == (mName = (char **)calloc(H5FD_MEM_NTYPES, sizeof(*mName))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_fapl_multi: memory allocation failed");
if ((status = H5Pget_fapl_multi((hid_t)tid, (H5FD_mem_t *)themapArray, (hid_t *)thefaplArray, mName,
@ -862,7 +862,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3(JNIEnv *env, jclass clss, jlong fapl_id,
UNUSED(clss);
#ifdef H5_HAVE_ROS3_VFD
HDmemset(&instance, 0, sizeof(H5FD_ros3_fapl_t));
memset(&instance, 0, sizeof(H5FD_ros3_fapl_t));
if (NULL == (cls = ENVPTR->GetObjectClass(ENVONLY, fapl_config)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -882,14 +882,14 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3(JNIEnv *env, jclass clss, jlong fapl_id,
if (j_str) {
PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config aws_region not pinned");
HDstrncpy(instance.aws_region, str, H5FD_ROS3_MAX_REGION_LEN + 1);
strncpy(instance.aws_region, str, H5FD_ROS3_MAX_REGION_LEN + 1);
instance.aws_region[H5FD_ROS3_MAX_REGION_LEN] = '\0';
UNPIN_JAVA_STRING(ENVONLY, j_str, str);
str = NULL;
}
else
HDmemset(instance.aws_region, 0, H5FD_ROS3_MAX_REGION_LEN + 1);
memset(instance.aws_region, 0, H5FD_ROS3_MAX_REGION_LEN + 1);
if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "secret_id", "Ljava/lang/String;")))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -900,14 +900,14 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3(JNIEnv *env, jclass clss, jlong fapl_id,
if (j_str) {
PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config secret_id not pinned");
HDstrncpy(instance.secret_id, str, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
strncpy(instance.secret_id, str, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
instance.secret_id[H5FD_ROS3_MAX_SECRET_ID_LEN] = '\0';
UNPIN_JAVA_STRING(ENVONLY, j_str, str);
str = NULL;
}
else
HDmemset(instance.secret_id, 0, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
memset(instance.secret_id, 0, H5FD_ROS3_MAX_SECRET_ID_LEN + 1);
if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "secret_key", "Ljava/lang/String;")))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -918,14 +918,14 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1ros3(JNIEnv *env, jclass clss, jlong fapl_id,
if (j_str) {
PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_fapl_ros3: fapl_config secret_key not pinned");
HDstrncpy(instance.secret_key, str, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
strncpy(instance.secret_key, str, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
instance.secret_key[H5FD_ROS3_MAX_SECRET_KEY_LEN] = '\0';
UNPIN_JAVA_STRING(ENVONLY, j_str, str);
str = NULL;
}
else
HDmemset(instance.secret_key, 0, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
memset(instance.secret_key, 0, H5FD_ROS3_MAX_SECRET_KEY_LEN + 1);
if (instance.aws_region[0] != '\0' && instance.secret_id[0] != '\0' && instance.secret_key[0] != '\0')
instance.authenticate = true;
@ -1492,7 +1492,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1mdc_1config(JNIEnv *env, jclass clss, jlong plist, j
UNUSED(clss);
HDmemset(&cacheinfo, 0, sizeof(H5AC_cache_config_t));
memset(&cacheinfo, 0, sizeof(H5AC_cache_config_t));
if (NULL == (cls = ENVPTR->GetObjectClass(ENVONLY, cache_config)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -1530,14 +1530,14 @@ Java_hdf_hdf5lib_H5_H5Pset_1mdc_1config(JNIEnv *env, jclass clss, jlong plist, j
if (j_str) {
PIN_JAVA_STRING(ENVONLY, j_str, str, NULL, "H5Pset_mdc_config: cache_config not pinned");
HDstrncpy(cacheinfo.trace_file_name, str, H5AC__MAX_TRACE_FILE_NAME_LEN + 1);
strncpy(cacheinfo.trace_file_name, str, H5AC__MAX_TRACE_FILE_NAME_LEN + 1);
cacheinfo.trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN] = '\0';
UNPIN_JAVA_STRING(ENVONLY, j_str, str);
str = NULL;
}
else
HDmemset(cacheinfo.trace_file_name, 0, H5AC__MAX_TRACE_FILE_NAME_LEN + 1);
memset(cacheinfo.trace_file_name, 0, H5AC__MAX_TRACE_FILE_NAME_LEN + 1);
if (NULL == (fid = ENVPTR->GetFieldID(ENVONLY, cls, "evictions_enabled", "Z")))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -1716,7 +1716,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1config(JNIEnv *env, jclass clss, jlong plist)
UNUSED(clss);
HDmemset(&cacheinfo, 0, sizeof(H5AC_cache_config_t));
memset(&cacheinfo, 0, sizeof(H5AC_cache_config_t));
cacheinfo.version = H5AC__CURR_CACHE_CONFIG_VERSION;
if ((status = H5Pget_mdc_config((hid_t)plist, &cacheinfo)) < 0)
@ -1845,7 +1845,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options(JNIEnv *env, jclass clss, jlong fa
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Pget_mdc_log_options: location_size is 0");
location_size++; /* add extra space for the null terminator */
if (NULL == (lname = (char *)HDmalloc(sizeof(char) * location_size)))
if (NULL == (lname = (char *)malloc(sizeof(char) * location_size)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_mdc_log_options: memory allocation failed");
if ((status = H5Pget_mdc_log_options((hid_t)fapl_id, &is_enabled, lname, &location_size,
@ -1865,7 +1865,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1mdc_1log_1options(JNIEnv *env, jclass clss, jlong fa
done:
if (lname)
HDfree(lname);
free(lname);
if (mdc_log_options_ptr)
UNPIN_BOOL_ARRAY(ENVONLY, mdc_log_options, mdc_log_options_ptr, (status < 0) ? JNI_ABORT : 0);

View File

@ -128,7 +128,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1elink_1prefix(JNIEnv *env, jclass clss, jlong lapl_i
if ((prefix_size = H5Pget_elink_prefix((hid_t)lapl_id, (char *)NULL, size)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (pre = (char *)HDmalloc(sizeof(char) * (size_t)prefix_size + 1)))
if (NULL == (pre = (char *)malloc(sizeof(char) * (size_t)prefix_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Pget_elink_prefix: memory allocation failed");
if (H5Pget_elink_prefix((hid_t)lapl_id, (char *)pre, (size_t)prefix_size + 1) < 0)
@ -146,7 +146,7 @@ Java_hdf_hdf5lib_H5_H5Pget_1elink_1prefix(JNIEnv *env, jclass clss, jlong lapl_i
done:
if (pre)
HDfree(pre);
free(pre);
return (jlong)prefix_size;
} /* end Java_hdf_hdf5lib_H5_H5Pget_1elink_1prefix */

View File

@ -216,7 +216,7 @@ Java_hdf_hdf5lib_H5_H5PLget(JNIEnv *env, jclass clss, jint idx)
if ((buf_size = H5PLget((unsigned)idx, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (aName = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (aName = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5PLget: failed to allocate plugin name buffer");
if ((H5PLget((unsigned)idx, aName, (size_t)buf_size + 1)) < 0)
@ -228,7 +228,7 @@ Java_hdf_hdf5lib_H5_H5PLget(JNIEnv *env, jclass clss, jint idx)
done:
if (aName)
HDfree(aName);
free(aName);
return str;
} /* end Java_hdf_hdf5lib_H5_H5PLget */

View File

@ -47,7 +47,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1object(JNIEnv *env, jclass clss, jlong loc_id, js
PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_object: reference name not pinned");
if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
if (NULL == (refBuf = calloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_object: failed to allocate reference buffer");
H5R_ref_t loc_ref;
@ -55,7 +55,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1object(JNIEnv *env, jclass clss, jlong loc_id, js
H5_LIBRARY_ERROR(ENVONLY);
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(refBuf, &loc_ref, H5R_REF_BUF_SIZE);
memcpy(refBuf, &loc_ref, H5R_REF_BUF_SIZE);
if (NULL == (ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -67,7 +67,7 @@ done:
if (refName)
UNPIN_JAVA_STRING(ENVONLY, name, refName);
if (refBuf)
HDfree(refBuf);
free(refBuf);
return ref;
} /* end Java_hdf_hdf5lib_H5_H5Rcreate_1object */
@ -93,7 +93,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1region(JNIEnv *env, jclass clss, jlong loc_id, js
PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_region: reference name not pinned");
if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
if (NULL == (refBuf = calloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_region: failed to allocate reference buffer");
H5R_ref_t loc_ref;
@ -101,7 +101,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1region(JNIEnv *env, jclass clss, jlong loc_id, js
H5_LIBRARY_ERROR(ENVONLY);
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(refBuf, &loc_ref, H5R_REF_BUF_SIZE);
memcpy(refBuf, &loc_ref, H5R_REF_BUF_SIZE);
if (NULL == (ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -113,7 +113,7 @@ done:
if (refName)
UNPIN_JAVA_STRING(ENVONLY, name, refName);
if (refBuf)
HDfree(refBuf);
free(refBuf);
return ref;
} /* end Java_hdf_hdf5lib_H5_H5Rcreate_1region */
@ -144,7 +144,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1attr(JNIEnv *env, jclass clss, jlong loc_id, jstr
PIN_JAVA_STRING(ENVONLY, name, refName, NULL, "H5Rcreate_attr: reference name not pinned");
if (NULL == (refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
if (NULL == (refBuf = calloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_attr: failed to allocate reference buffer");
H5R_ref_t loc_ref;
@ -152,7 +152,7 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1attr(JNIEnv *env, jclass clss, jlong loc_id, jstr
H5_LIBRARY_ERROR(ENVONLY);
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(refBuf, &loc_ref, H5R_REF_BUF_SIZE);
memcpy(refBuf, &loc_ref, H5R_REF_BUF_SIZE);
if (NULL == (ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -166,7 +166,7 @@ done:
if (refName)
UNPIN_JAVA_STRING(ENVONLY, name, refName);
if (refBuf)
HDfree(refBuf);
free(refBuf);
return ref;
} /* end Java_hdf_hdf5lib_H5_H5Rcreate_1attr */
@ -199,7 +199,7 @@ Java_hdf_hdf5lib_H5_H5Rdestroy(JNIEnv *env, jclass clss, jbyteArray ref)
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
if ((status = H5Rdestroy(&loc_ref)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@ -237,7 +237,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1type(JNIEnv *env, jclass clss, jbyteArray ref)
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
if ((ref_type = H5Rget_type(&loc_ref)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@ -289,8 +289,8 @@ Java_hdf_hdf5lib_H5_H5Requal(JNIEnv *env, jclass clss, jbyteArray ref1, jbyteArr
H5R_ref_t loc_ref1, loc_ref2;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref1, refBuf1, H5R_REF_BUF_SIZE);
HDmemcpy(&loc_ref2, refBuf2, H5R_REF_BUF_SIZE);
memcpy(&loc_ref1, refBuf1, H5R_REF_BUF_SIZE);
memcpy(&loc_ref2, refBuf2, H5R_REF_BUF_SIZE);
if ((bval = H5Requal(&loc_ref1, &loc_ref2)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@ -334,19 +334,19 @@ Java_hdf_hdf5lib_H5_H5Rcopy(JNIEnv *env, jclass clss, jbyteArray src_ref)
PIN_BYTE_ARRAY(ENVONLY, src_ref, src_refBuf, &isCopy, "H5Rcopy: src reference buffer not pinned");
if (NULL == (dst_refBuf = HDcalloc(1, H5R_REF_BUF_SIZE)))
if (NULL == (dst_refBuf = calloc(1, H5R_REF_BUF_SIZE)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rcreate_attr: failed to allocate dst reference buffer");
H5R_ref_t loc_src_ref, loc_dst_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_src_ref, src_refBuf, H5R_REF_BUF_SIZE);
HDmemcpy(&loc_dst_ref, dst_refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_src_ref, src_refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_dst_ref, dst_refBuf, H5R_REF_BUF_SIZE);
if ((status = H5Rcopy(&loc_src_ref, &loc_dst_ref)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
HDmemcpy(dst_refBuf, &loc_dst_ref, H5R_REF_BUF_SIZE);
memcpy(dst_refBuf, &loc_dst_ref, H5R_REF_BUF_SIZE);
if (NULL == (dst_ref = ENVPTR->NewByteArray(ENVONLY, (jsize)H5R_REF_BUF_SIZE)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
@ -358,7 +358,7 @@ done:
if (src_refBuf)
UNPIN_BYTE_ARRAY(ENVONLY, src_ref, src_refBuf, (status < 0) ? JNI_ABORT : 0);
if (dst_refBuf)
HDfree(dst_refBuf);
free(dst_refBuf);
return dst_ref;
} /* end Java_hdf_hdf5lib_H5_H5Rcopy */
@ -391,7 +391,7 @@ Java_hdf_hdf5lib_H5__1H5Ropen_1object(JNIEnv *env, jclass clss, jbyteArray ref,
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
if ((retVal = H5Ropen_object(&loc_ref, (hid_t)rapl_id, (hid_t)oapl_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@ -431,7 +431,7 @@ Java_hdf_hdf5lib_H5__1H5Ropen_1region(JNIEnv *env, jclass clss, jbyteArray ref,
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
if ((retVal = H5Ropen_region(&loc_ref, (hid_t)rapl_id, (hid_t)oapl_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@ -471,7 +471,7 @@ Java_hdf_hdf5lib_H5__1H5Ropen_1attr(JNIEnv *env, jclass clss, jbyteArray ref, jl
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
if ((retVal = H5Ropen_attr(&loc_ref, (hid_t)rapl_id, (hid_t)aapl_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@ -506,7 +506,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1obj_1type3(JNIEnv *env, jclass clss, jbyteArray ref,
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
if ((retVal = H5Rget_obj_type3(&loc_ref, (hid_t)rapl_id, &object_info)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@ -546,13 +546,13 @@ Java_hdf_hdf5lib_H5_H5Rget_1file_1name(JNIEnv *env, jclass clss, jbyteArray ref)
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
/* Get the length of the name */
if ((buf_size = H5Rget_file_name(&loc_ref, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (namePtr = malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_file_name: malloc failed");
if ((check_size = H5Rget_file_name(&loc_ref, namePtr, (size_t)buf_size + 1)) < 0)
@ -564,7 +564,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1file_1name(JNIEnv *env, jclass clss, jbyteArray ref)
done:
if (namePtr)
HDfree(namePtr);
free(namePtr);
if (refBuf)
UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (check_size < 0) ? JNI_ABORT : 0);
@ -596,13 +596,13 @@ Java_hdf_hdf5lib_H5_H5Rget_1obj_1name(JNIEnv *env, jclass clss, jbyteArray ref,
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
/* Get the length of the name */
if ((buf_size = H5Rget_obj_name(&loc_ref, (hid_t)rapl_id, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (namePtr = malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_obj_name: malloc failed");
if ((check_size = H5Rget_obj_name(&loc_ref, (hid_t)rapl_id, namePtr, (size_t)buf_size + 1)) < 0)
@ -614,7 +614,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1obj_1name(JNIEnv *env, jclass clss, jbyteArray ref,
done:
if (namePtr)
HDfree(namePtr);
free(namePtr);
if (refBuf)
UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (check_size < 0) ? JNI_ABORT : 0);
@ -646,13 +646,13 @@ Java_hdf_hdf5lib_H5_H5Rget_1attr_1name(JNIEnv *env, jclass clss, jbyteArray ref)
H5R_ref_t loc_ref;
HDcompile_assert(H5R_REF_BUF_SIZE <= sizeof(H5R_ref_t));
HDmemcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
memcpy(&loc_ref, refBuf, H5R_REF_BUF_SIZE);
/* Get the length of the name */
if ((buf_size = H5Rget_attr_name(&loc_ref, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (namePtr = HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (namePtr = malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_attr_name: malloc failed");
if ((check_size = H5Rget_attr_name(&loc_ref, namePtr, (size_t)buf_size + 1)) < 0)
@ -664,7 +664,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1attr_1name(JNIEnv *env, jclass clss, jbyteArray ref)
done:
if (namePtr)
HDfree(namePtr);
free(namePtr);
if (refBuf)
UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, (check_size < 0) ? JNI_ABORT : 0);
@ -921,7 +921,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1name(JNIEnv *env, jclass clss, jlong loc_id, jint re
PIN_BYTE_ARRAY(ENVONLY, ref, refBuf, &isCopy, "H5Rget_name: reference buffer not pinned");
if (NULL == (aName = HDmalloc(sizeof(char) * (size_t)size + 1)))
if (NULL == (aName = malloc(sizeof(char) * (size_t)size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_name: failed to allocate referenced object name buffer");
if ((ret_val = (jlong)H5Rget_name((hid_t)loc_id, (H5R_type_t)ref_type, refBuf, aName, (size_t)size + 1)) <
@ -937,7 +937,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1name(JNIEnv *env, jclass clss, jlong loc_id, jint re
done:
if (aName)
HDfree(aName);
free(aName);
if (refBuf)
UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, JNI_ABORT);
@ -985,7 +985,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1name_1string(JNIEnv *env, jclass clss, jlong loc_id,
if ((buf_size = H5Rget_name((hid_t)loc_id, (H5R_type_t)ref_type, refBuf, NULL, 0)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
if (NULL == (aName = HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (aName = malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Rget_name: failed to allocate referenced object name buffer");
if ((ret_val = (jlong)H5Rget_name((hid_t)loc_id, (H5R_type_t)ref_type, refBuf, aName,
@ -998,7 +998,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1name_1string(JNIEnv *env, jclass clss, jlong loc_id,
done:
if (aName)
HDfree(aName);
free(aName);
if (refBuf)
UNPIN_BYTE_ARRAY(ENVONLY, ref, refBuf, JNI_ABORT);

View File

@ -95,7 +95,7 @@ Java_hdf_hdf5lib_H5__1H5Screate_1simple(JNIEnv *env, jclass clss, jint rank, jlo
PIN_LONG_ARRAY(ENVONLY, dims, dimsP, &isCopy, "H5Screate_simple: dims not pinned");
if (NULL == (sa = lp = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (sa = lp = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Screate_simple: failed to allocate dims buffer");
jlp = (jlong *)dimsP;
@ -112,7 +112,7 @@ Java_hdf_hdf5lib_H5__1H5Screate_1simple(JNIEnv *env, jclass clss, jint rank, jlo
else {
PIN_LONG_ARRAY(ENVONLY, maxdims, maxdimsP, &isCopy, "H5Screate_simple: maxdims not pinned");
if (NULL == (msa = lp = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (msa = lp = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Screate_simple: failed to allocate maxdims buffer");
jlp = (jlong *)maxdimsP;
@ -128,11 +128,11 @@ Java_hdf_hdf5lib_H5__1H5Screate_1simple(JNIEnv *env, jclass clss, jint rank, jlo
done:
if (msa)
HDfree(msa);
free(msa);
if (maxdimsP)
UNPIN_LONG_ARRAY(ENVONLY, maxdims, maxdimsP, JNI_ABORT);
if (sa)
HDfree(sa);
free(sa);
if (dimsP)
UNPIN_LONG_ARRAY(ENVONLY, dims, dimsP, JNI_ABORT);
@ -191,7 +191,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1elements(JNIEnv *env, jclass clss, jlong space_id
PIN_LONG_ARRAY(ENVONLY, coords, P, &isCopy, "H5Sselect_elements: coords not pinned");
if (NULL == (sa = (hssize_t *)HDmalloc((size_t)num_elemn * 2 * sizeof(hssize_t))))
if (NULL == (sa = (hssize_t *)malloc((size_t)num_elemn * 2 * sizeof(hssize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_elements: failed to allocate coordinate buffer");
for (i = 0; i < (num_elemn * 2); i++) {
@ -203,7 +203,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1elements(JNIEnv *env, jclass clss, jlong space_id
done:
if (sa)
HDfree(sa);
free(sa);
if (P)
UNPIN_LONG_ARRAY(ENVONLY, coords, P, JNI_ABORT);
@ -244,7 +244,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1elements(JNIEnv *env, jclass clss, jlong space_id
nlongs = (int)((size_t)size / sizeof(jlong));
if (NULL == (lp = (hsize_t *)HDmalloc((size_t)nlongs * sizeof(hsize_t))))
if (NULL == (lp = (hsize_t *)malloc((size_t)nlongs * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_elements: failed to allocate coordinate buffer");
jlp = (jlong *)P;
@ -261,7 +261,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1elements(JNIEnv *env, jclass clss, jlong space_id
done:
if (llp)
HDfree(llp);
free(llp);
if (P)
UNPIN_BYTE_ARRAY(ENVONLY, coords, P, JNI_ABORT);
@ -435,7 +435,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1simple_1extent_1dims(JNIEnv *env, jclass clss, jlong
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sget_simple_extent_dims: dims array length < 0");
}
if (NULL == (sa = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (sa = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_simple_extent_dims: failed to allocate dimension buffer");
}
@ -456,7 +456,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1simple_1extent_1dims(JNIEnv *env, jclass clss, jlong
else if (mrank != rank)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sget_simple_extent_dims: maxdims rank not same as dims");
if (NULL == (msa = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (msa = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5Sget_simple_extent_dims: failed to allocate maximum dimension buffer");
}
@ -478,11 +478,11 @@ Java_hdf_hdf5lib_H5_H5Sget_1simple_1extent_1dims(JNIEnv *env, jclass clss, jlong
done:
if (msa)
HDfree(msa);
free(msa);
if (maxdimsP)
UNPIN_LONG_ARRAY(ENVONLY, maxdims, maxdimsP, (status < 0) ? JNI_ABORT : 0);
if (sa)
HDfree(sa);
free(sa);
if (dimsP)
UNPIN_LONG_ARRAY(ENVONLY, dims, dimsP, (status < 0) ? JNI_ABORT : 0);
@ -555,7 +555,7 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple(JNIEnv *env, jclass clss, jlong space
PIN_LONG_ARRAY(ENVONLY, dims, dimsP, &isCopy, "H5Sset_extent_simple: dims not pinned");
if (NULL == (sa = lp = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (sa = lp = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sset_extent_simple: failed to allocate dimension buffer");
jlp = (jlong *)dimsP;
@ -572,7 +572,7 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple(JNIEnv *env, jclass clss, jlong space
else {
PIN_LONG_ARRAY(ENVONLY, maxdims, maxdimsP, &isCopy, "H5Sset_extent_simple: maxdims not pinned");
if (NULL == (msa = lp = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (msa = lp = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5Sset_extent_simple: failed to allocate maximum dimension buffer");
@ -589,11 +589,11 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple(JNIEnv *env, jclass clss, jlong space
done:
if (msa)
HDfree(msa);
free(msa);
if (maxdimsP)
UNPIN_LONG_ARRAY(ENVONLY, maxdims, maxdimsP, JNI_ABORT);
if (sa)
HDfree(sa);
free(sa);
if (dimsP)
UNPIN_LONG_ARRAY(ENVONLY, dims, dimsP, JNI_ABORT);
@ -650,7 +650,7 @@ Java_hdf_hdf5lib_H5_H5Soffset_1simple(JNIEnv *env, jclass clss, jlong space_id,
rank = (size_t)i / sizeof(jlong);
if (NULL == (sa = lp = (hssize_t *)HDmalloc((size_t)rank * sizeof(hssize_t))))
if (NULL == (sa = lp = (hssize_t *)malloc((size_t)rank * sizeof(hssize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Soffset_simple: failed to allocate offset buffer");
jlp = (jlong *)P;
@ -670,7 +670,7 @@ Java_hdf_hdf5lib_H5_H5Soffset_1simple(JNIEnv *env, jclass clss, jlong space_id,
done:
if (sa)
HDfree(sa);
free(sa);
if (P)
UNPIN_BYTE_ARRAY(ENVONLY, offset, P, JNI_ABORT);
@ -775,7 +775,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab(JNIEnv *env, jclass clss, jlong space_i
PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sselect_hyperslab: start not pinned");
if (NULL == (strt = lp = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t))))
if (NULL == (strt = lp = (hsize_t *)malloc((size_t)start_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate start buffer");
jlp = (jlong *)startP;
@ -787,7 +787,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab(JNIEnv *env, jclass clss, jlong space_i
PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Sselect_hyperslab: count not pinned");
if (NULL == (cnt = lp = (hsize_t *)HDmalloc((size_t)count_rank * sizeof(hsize_t))))
if (NULL == (cnt = lp = (hsize_t *)malloc((size_t)count_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate count buffer");
jlp = (jlong *)countP;
@ -812,7 +812,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab(JNIEnv *env, jclass clss, jlong space_i
PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Sselect_hyperslab: stride not pinned");
if (NULL == (strd = lp = (hsize_t *)HDmalloc((size_t)stride_rank * sizeof(hsize_t))))
if (NULL == (strd = lp = (hsize_t *)malloc((size_t)stride_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate stride buffer");
jlp = (jlong *)strideP;
@ -838,7 +838,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab(JNIEnv *env, jclass clss, jlong space_i
PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Sselect_hyperslab: block not pinned");
if (NULL == (blk = lp = (hsize_t *)HDmalloc((size_t)block_rank * sizeof(hsize_t))))
if (NULL == (blk = lp = (hsize_t *)malloc((size_t)block_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_hyperslab: failed to allocate block buffer");
jlp = (jlong *)blockP;
@ -855,19 +855,19 @@ Java_hdf_hdf5lib_H5_H5Sselect_1hyperslab(JNIEnv *env, jclass clss, jlong space_i
done:
if (blk)
HDfree(blk);
free(blk);
if (blockP)
UNPIN_LONG_ARRAY(ENVONLY, block, blockP, JNI_ABORT);
if (strd)
HDfree(strd);
free(strd);
if (strideP)
UNPIN_LONG_ARRAY(ENVONLY, stride, strideP, JNI_ABORT);
if (cnt)
HDfree(cnt);
free(cnt);
if (countP)
UNPIN_LONG_ARRAY(ENVONLY, count, countP, JNI_ABORT);
if (strt)
HDfree(strt);
free(strt);
if (startP)
UNPIN_LONG_ARRAY(ENVONLY, start, startP, JNI_ABORT);
@ -972,7 +972,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1hyper_1blocklist(JNIEnv *env, jclass clss, j
PIN_LONG_ARRAY(ENVONLY, buf, bufP, &isCopy, "H5Sget_select_hyper_blocklist: buffer not pinned");
buf_size = (size_t)numblocks * (size_t)2 * (size_t)rank * sizeof(hsize_t);
if (NULL == (ba = (hsize_t *)HDmalloc(buf_size)))
if (NULL == (ba = (hsize_t *)malloc(buf_size)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5Sget_select_hyper_blocklist: failed to allocate block list buffer");
@ -986,7 +986,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1hyper_1blocklist(JNIEnv *env, jclass clss, j
done:
if (ba)
HDfree(ba);
free(ba);
if (bufP)
UNPIN_LONG_ARRAY(ENVONLY, buf, bufP, (status < 0) ? JNI_ABORT : 0);
@ -1030,7 +1030,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1elem_1pointlist(JNIEnv *env, jclass clss, jl
PIN_LONG_ARRAY(ENVONLY, buf, bufP, &isCopy, "H5Sget_select_elem_pointlist: buffer not pinned");
if (NULL == (ba = (hsize_t *)HDmalloc(((size_t)numpoints * (size_t)rank) * sizeof(hsize_t))))
if (NULL == (ba = (hsize_t *)malloc(((size_t)numpoints * (size_t)rank) * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_select_elem_pointlist: failed to allocate point list buffer");
if ((status = H5Sget_select_elem_pointlist((hid_t)spaceid, (hsize_t)startpoint, (hsize_t)numpoints,
@ -1043,7 +1043,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1elem_1pointlist(JNIEnv *env, jclass clss, jl
done:
if (ba)
HDfree(ba);
free(ba);
if (bufP)
UNPIN_LONG_ARRAY(ENVONLY, buf, bufP, (status < 0) ? JNI_ABORT : 0);
@ -1081,12 +1081,12 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1bounds(JNIEnv *env, jclass clss, jlong space
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sget_select_bounds: start array length < 0");
}
if (NULL == (strt = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (strt = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_select_bounds: failed to allocate start buffer");
PIN_LONG_ARRAY(ENVONLY, end, endP, &isCopy, "H5Sget_select_bounds: end not pinned");
if (NULL == (en = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t))))
if (NULL == (en = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_select_bounds: failed to allocate end buffer");
if ((status = H5Sget_select_bounds((hid_t)spaceid, (hsize_t *)strt, (hsize_t *)en)) < 0)
@ -1099,11 +1099,11 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1bounds(JNIEnv *env, jclass clss, jlong space
done:
if (en)
HDfree(en);
free(en);
if (endP)
UNPIN_LONG_ARRAY(ENVONLY, end, endP, (status < 0) ? JNI_ABORT : 0);
if (strt)
HDfree(strt);
free(strt);
if (startP)
UNPIN_LONG_ARRAY(ENVONLY, start, startP, (status < 0) ? JNI_ABORT : 0);
@ -1134,7 +1134,7 @@ Java_hdf_hdf5lib_H5_H5Sencode(JNIEnv *env, jclass clss, jlong obj_id)
if (buf_size == 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Sencode: buf_size = 0");
if (NULL == (bufPtr = (unsigned char *)HDcalloc((size_t)1, buf_size)))
if (NULL == (bufPtr = (unsigned char *)calloc((size_t)1, buf_size)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sencode: failed to allocate encoding buffer");
if ((status = H5Sencode2((hid_t)obj_id, bufPtr, &buf_size, H5P_DEFAULT)) < 0)
@ -1148,7 +1148,7 @@ Java_hdf_hdf5lib_H5_H5Sencode(JNIEnv *env, jclass clss, jlong obj_id)
done:
if (bufPtr)
HDfree(bufPtr);
free(bufPtr);
return returnedArray;
} /* end Java_hdf_hdf5lib_H5_H5Sencode */
@ -1243,7 +1243,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *env, jclass clss, jlong s
PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sget_regular_hyperslab: start not pinned");
if (NULL == (strt = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t))))
if (NULL == (strt = (hsize_t *)malloc((size_t)start_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate start buffer");
}
@ -1263,7 +1263,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *env, jclass clss, jlong s
PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Sget_regular_hyperslab: stride not pinned");
if (NULL == (strd = (hsize_t *)HDmalloc((size_t)stride_rank * sizeof(hsize_t))))
if (NULL == (strd = (hsize_t *)malloc((size_t)stride_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate stride buffer");
}
@ -1283,7 +1283,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *env, jclass clss, jlong s
PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Sget_regular_hyperslab: count not pinned");
if (NULL == (cnt = (hsize_t *)HDmalloc((size_t)count_rank * sizeof(hsize_t))))
if (NULL == (cnt = (hsize_t *)malloc((size_t)count_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate count buffer");
}
@ -1303,7 +1303,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *env, jclass clss, jlong s
PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Sget_regular_hyperslab: block not pinned");
if (NULL == (blk = (hsize_t *)HDmalloc((size_t)block_rank * sizeof(hsize_t))))
if (NULL == (blk = (hsize_t *)malloc((size_t)block_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sget_regular_hyperslab: failed to allocate block buffer");
}
@ -1320,19 +1320,19 @@ Java_hdf_hdf5lib_H5_H5Sget_1regular_1hyperslab(JNIEnv *env, jclass clss, jlong s
done:
if (blk)
HDfree(blk);
free(blk);
if (blockP)
UNPIN_LONG_ARRAY(ENVONLY, block, blockP, (status < 0) ? JNI_ABORT : 0);
if (cnt)
HDfree(cnt);
free(cnt);
if (countP)
UNPIN_LONG_ARRAY(ENVONLY, count, countP, (status < 0) ? JNI_ABORT : 0);
if (strd)
HDfree(strd);
free(strd);
if (strideP)
UNPIN_LONG_ARRAY(ENVONLY, stride, strideP, (status < 0) ? JNI_ABORT : 0);
if (strt)
HDfree(strt);
free(strt);
if (startP)
UNPIN_LONG_ARRAY(ENVONLY, start, startP, (status < 0) ? JNI_ABORT : 0);
@ -1417,7 +1417,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *env, jclass clss, jlong space_id,
PIN_LONG_ARRAY(ENVONLY, offset, offsetP, &isCopy, "H5Sselect_adjust: offset not pinned");
if (NULL == (offst = (hssize_t *)HDmalloc((size_t)offset_rank * sizeof(hsize_t))))
if (NULL == (offst = (hssize_t *)malloc((size_t)offset_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_adjust: failed to allocate offset buffer");
}
@ -1430,7 +1430,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1adjust(JNIEnv *env, jclass clss, jlong space_id,
done:
if (offst)
HDfree(offst);
free(offst);
if (offsetP)
UNPIN_LONG_ARRAY(ENVONLY, offset, offsetP, (status < 0) ? JNI_ABORT : 0);
@ -1477,7 +1477,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *env, jclass clss, jlong
PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Sselect_intersect_block: start not pinned");
if (NULL == (strt = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t))))
if (NULL == (strt = (hsize_t *)malloc((size_t)start_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate start buffer");
}
@ -1497,7 +1497,7 @@ Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *env, jclass clss, jlong
PIN_LONG_ARRAY(ENVONLY, end, endP, &isCopy, "H5Sselect_intersect_block: end not pinned");
if (NULL == (nd = (hsize_t *)HDmalloc((size_t)end_rank * sizeof(hsize_t))))
if (NULL == (nd = (hsize_t *)malloc((size_t)end_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Sselect_intersect_block: failed to allocate end buffer");
}
@ -1513,11 +1513,11 @@ Java_hdf_hdf5lib_H5_H5Sselect_1intersect_1block(JNIEnv *env, jclass clss, jlong
done:
if (strt)
HDfree(strt);
free(strt);
if (startP)
UNPIN_LONG_ARRAY(ENVONLY, start, startP, (bval < 0) ? JNI_ABORT : 0);
if (nd)
HDfree(nd);
free(nd);
if (endP)
UNPIN_LONG_ARRAY(ENVONLY, end, endP, (bval < 0) ? JNI_ABORT : 0);
@ -1584,7 +1584,7 @@ Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_
PIN_LONG_ARRAY(ENVONLY, start, startP, &isCopy, "H5Scombine_hyperslab: start not pinned");
if (NULL == (strt = lp = (hsize_t *)HDmalloc((size_t)start_rank * sizeof(hsize_t))))
if (NULL == (strt = lp = (hsize_t *)malloc((size_t)start_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate start buffer");
jlp = (jlong *)startP;
@ -1596,7 +1596,7 @@ Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_
PIN_LONG_ARRAY(ENVONLY, count, countP, &isCopy, "H5Scombine_hyperslab: count not pinned");
if (NULL == (cnt = lp = (hsize_t *)HDmalloc((size_t)count_rank * sizeof(hsize_t))))
if (NULL == (cnt = lp = (hsize_t *)malloc((size_t)count_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate count buffer");
jlp = (jlong *)countP;
@ -1621,7 +1621,7 @@ Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_
PIN_LONG_ARRAY(ENVONLY, stride, strideP, &isCopy, "H5Scombine_hyperslab: stride not pinned");
if (NULL == (strd = lp = (hsize_t *)HDmalloc((size_t)stride_rank * sizeof(hsize_t))))
if (NULL == (strd = lp = (hsize_t *)malloc((size_t)stride_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate stride buffer");
jlp = (jlong *)strideP;
@ -1647,7 +1647,7 @@ Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_
PIN_LONG_ARRAY(ENVONLY, block, blockP, &isCopy, "H5Scombine_hyperslab: block not pinned");
if (NULL == (blk = lp = (hsize_t *)HDmalloc((size_t)block_rank * sizeof(hsize_t))))
if (NULL == (blk = lp = (hsize_t *)malloc((size_t)block_rank * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Scombine_hyperslab: failed to allocate block buffer");
jlp = (jlong *)blockP;
@ -1664,19 +1664,19 @@ Java_hdf_hdf5lib_H5_H5Scombine_1hyperslab(JNIEnv *env, jclass clss, jlong space_
done:
if (blk)
HDfree(blk);
free(blk);
if (blockP)
UNPIN_LONG_ARRAY(ENVONLY, block, blockP, JNI_ABORT);
if (strd)
HDfree(strd);
free(strd);
if (strideP)
UNPIN_LONG_ARRAY(ENVONLY, stride, strideP, JNI_ABORT);
if (cnt)
HDfree(cnt);
free(cnt);
if (countP)
UNPIN_LONG_ARRAY(ENVONLY, count, countP, JNI_ABORT);
if (strt)
HDfree(strt);
free(strt);
if (startP)
UNPIN_LONG_ARRAY(ENVONLY, start, startP, JNI_ABORT);

View File

@ -1189,7 +1189,7 @@ Java_hdf_hdf5lib_H5_H5Tenum_1nameof_1int(JNIEnv *env, jclass clss, jlong type_id
if (size <= 0)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Tenum_nameof_int: name size < 0");
if (NULL == (nameP = (char *)HDmalloc(sizeof(char) * (size_t)size)))
if (NULL == (nameP = (char *)malloc(sizeof(char) * (size_t)size)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tenum_nameof_int: failed to allocate name buffer");
PIN_INT_ARRAY(ENVONLY, value, intP, &isCopy, "H5Tenum_nameof_int: value not pinned");
@ -1208,7 +1208,7 @@ done:
if (intP)
UNPIN_INT_ARRAY(ENVONLY, value, intP, JNI_ABORT);
if (nameP)
HDfree(nameP);
free(nameP);
return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Tenum_1nameof_1int */
@ -1234,7 +1234,7 @@ Java_hdf_hdf5lib_H5_H5Tenum_1nameof(JNIEnv *env, jclass clss, jlong type_id, jby
if (NULL == value)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Tenum_nameof: value is NULL");
if (NULL == (nameP = (char *)HDmalloc(sizeof(char) * (size_t)size)))
if (NULL == (nameP = (char *)malloc(sizeof(char) * (size_t)size)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tenum_nameof: failed to allocate name buffer");
PIN_BYTE_ARRAY(ENVONLY, value, byteP, &isCopy, "H5Tenum_nameof: value not pinned");
@ -1250,7 +1250,7 @@ done:
if (byteP)
UNPIN_BYTE_ARRAY(ENVONLY, value, byteP, JNI_ABORT);
if (nameP)
HDfree(nameP);
free(nameP);
return str;
} /* end Java_hdf_hdf5lib_H5_H5Tenum_1nameof */
@ -1432,7 +1432,7 @@ Java_hdf_hdf5lib_H5_H5Tget_1array_1dims(JNIEnv *env, jclass clss, jlong type_id,
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Tget_array_dims: dims array length < 0");
}
if (NULL == (cdims = (hsize_t *)HDmalloc((size_t)dlen * sizeof(hsize_t))))
if (NULL == (cdims = (hsize_t *)malloc((size_t)dlen * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tget_array_dims: failed to allocate dimension buffer");
if ((ndims = H5Tget_array_dims2((hid_t)type_id, cdims)) < 0)
@ -1444,7 +1444,7 @@ Java_hdf_hdf5lib_H5_H5Tget_1array_1dims(JNIEnv *env, jclass clss, jlong type_id,
done:
if (cdims)
HDfree(cdims);
free(cdims);
if (dimsP)
UNPIN_INT_ARRAY(ENVONLY, dims, dimsP, (ndims < 0) ? JNI_ABORT : 0);
@ -1572,7 +1572,7 @@ Java_hdf_hdf5lib_H5__1H5Tarray_1create2(JNIEnv *env, jclass clss, jlong base_id,
if (dlen != rank)
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Tarray_create: dimension array length != array rank");
if (NULL == (cdims = (hsize_t *)HDmalloc((size_t)dlen * sizeof(hsize_t))))
if (NULL == (cdims = (hsize_t *)malloc((size_t)dlen * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tarray_create: failed to allocate dimension buffer");
for (i = 0; i < (size_t)dlen; i++) {
@ -1584,7 +1584,7 @@ Java_hdf_hdf5lib_H5__1H5Tarray_1create2(JNIEnv *env, jclass clss, jlong base_id,
done:
if (cdims)
HDfree(cdims);
free(cdims);
if (dimsP)
UNPIN_LONG_ARRAY(ENVONLY, dims, dimsP, (retVal < 0) ? JNI_ABORT : 0);
@ -1618,7 +1618,7 @@ Java_hdf_hdf5lib_H5_H5Tget_1array_1dims2(JNIEnv *env, jclass clss, jlong type_id
H5_BAD_ARGUMENT_ERROR(ENVONLY, "H5Tarray_get_dims2: dims array length < 0");
}
if (NULL == (cdims = (hsize_t *)HDmalloc((size_t)dlen * sizeof(hsize_t))))
if (NULL == (cdims = (hsize_t *)malloc((size_t)dlen * sizeof(hsize_t))))
H5_OUT_OF_MEMORY_ERROR(ENVONLY, "H5Tarray_get_dims2: failed to allocate dimension buffer");
if ((ndims = H5Tget_array_dims2((hid_t)type_id, (hsize_t *)cdims)) < 0)
@ -1630,7 +1630,7 @@ Java_hdf_hdf5lib_H5_H5Tget_1array_1dims2(JNIEnv *env, jclass clss, jlong type_id
done:
if (cdims)
HDfree(cdims);
free(cdims);
if (dimsP)
UNPIN_LONG_ARRAY(ENVONLY, dims, dimsP, (ndims < 0) ? JNI_ABORT : 0);

File diff suppressed because it is too large Load Diff

View File

@ -221,7 +221,7 @@ Java_hdf_hdf5lib_H5_H5VLget_1connector_1name(JNIEnv *env, jclass clss, jlong obj
H5_LIBRARY_ERROR(ENVONLY);
if (buf_size > 0) {
if (NULL == (volName = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1)))
if (NULL == (volName = (char *)malloc(sizeof(char) * (size_t)buf_size + 1)))
H5_OUT_OF_MEMORY_ERROR(ENVONLY,
"H5VLget_connector_name: failed to allocated VOL connector name buffer");
@ -235,7 +235,7 @@ Java_hdf_hdf5lib_H5_H5VLget_1connector_1name(JNIEnv *env, jclass clss, jlong obj
done:
if (volName)
HDfree(volName);
free(volName);
return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5VLget_1connector_1name */