diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-12-06 19:55:34 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:20:19 (GMT) |
commit | 56249af938ae5ceda4de17ca428cc67526c6dc4b (patch) | |
tree | 6fdb27b9a3b77bb6be23963e7ac6a79d24e8f07e /java/src/jni | |
parent | 972ce40f3626a15fd41cafe7542acee88e543b4c (diff) | |
download | hdf5-56249af938ae5ceda4de17ca428cc67526c6dc4b.zip hdf5-56249af938ae5ceda4de17ca428cc67526c6dc4b.tar.gz hdf5-56249af938ae5ceda4de17ca428cc67526c6dc4b.tar.bz2 |
Address compile warnings
Diffstat (limited to 'java/src/jni')
-rw-r--r-- | java/src/jni/h5aImp.c | 2 | ||||
-rw-r--r-- | java/src/jni/h5dImp.c | 2 | ||||
-rw-r--r-- | java/src/jni/h5rImp.c | 11 | ||||
-rw-r--r-- | java/src/jni/h5util.c | 6 | ||||
-rw-r--r-- | java/src/jni/nativeData.c | 40 |
5 files changed, 30 insertions, 31 deletions
diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index 099c88d..85872b2 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -1304,7 +1304,7 @@ H5AwriteVL_asstr { const char *utf8 = NULL; hsize_t dims[H5S_MAX_RANK]; - jstring jstr; + jstring jstr = NULL; size_t typeSize; size_t i; hid_t sid = H5I_INVALID_HID; diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index a305eef..352c047 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1502,7 +1502,7 @@ H5DwriteVL_asstr (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf) { const char *utf8 = NULL; - jstring obj; + jstring obj = NULL; hbool_t close_mem_space = FALSE; size_t typeSize; size_t i; diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c index 3f1fd96..4ad5d5f 100644 --- a/java/src/jni/h5rImp.c +++ b/java/src/jni/h5rImp.c @@ -39,7 +39,6 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1object (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong aid) { const char *refName = NULL; - jboolean isCopy; jbyteArray ref = NULL; jbyte *refBuf = NULL; herr_t status = FAIL; @@ -83,7 +82,6 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1region (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong space_id, jlong aid) { const char *refName = NULL; - jboolean isCopy; jbyteArray ref = NULL; jbyte *refBuf = NULL; herr_t status = FAIL; @@ -127,7 +125,6 @@ Java_hdf_hdf5lib_H5_H5Rcreate_1attr { const char *refName = NULL; const char *attrName = NULL; - jboolean isCopy; jbyteArray ref = NULL; jbyte *refBuf = NULL; herr_t status = FAIL; @@ -212,7 +209,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1type jboolean isCopy; jbyte *refBuf = NULL; jsize refBufLen; - H5R_type_t ref_type; + H5R_type_t ref_type = -1; UNUSED(clss); @@ -493,7 +490,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1file_1name jbyte *refBuf = NULL; jstring str = NULL; ssize_t buf_size; - ssize_t check_size; + ssize_t check_size = -1; char *namePtr = NULL; UNUSED(clss); @@ -539,7 +536,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1obj_1name jbyte *refBuf = NULL; jstring str = NULL; ssize_t buf_size; - ssize_t check_size; + ssize_t check_size = -1; char *namePtr = NULL; UNUSED(clss); @@ -585,7 +582,7 @@ Java_hdf_hdf5lib_H5_H5Rget_1attr_1name jbyte *refBuf = NULL; jstring str = NULL; ssize_t buf_size; - ssize_t check_size; + ssize_t check_size = -1; char *namePtr = NULL; UNUSED(clss); diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 367f5e0..5f1bccb 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -223,7 +223,7 @@ h5str_convert switch (typeSize) { case sizeof(float): { - float tmp_float = 0.0; + float tmp_float = 0.0f; sscanf(token, "%f", &tmp_float); HDmemcpy(cptr, &tmp_float, sizeof(float)); @@ -744,7 +744,7 @@ h5str_sprintf switch (typeSize) { case sizeof(float): { - float tmp_float = 0.0; + float tmp_float = 0.0f; HDmemcpy(&tmp_float, cptr, sizeof(float)); @@ -1161,6 +1161,8 @@ h5str_sprintf CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE); h5str_sprint_reference(ENVONLY, out_str, container, (void*)cptr); break; + case H5R_BADTYPE: + case H5R_MAXTYPE: default: break; } /* end switch */ diff --git a/java/src/jni/nativeData.c b/java/src/jni/nativeData.c index 947f843..ad01b01 100644 --- a/java/src/jni/nativeData.c +++ b/java/src/jni/nativeData.c @@ -101,7 +101,7 @@ JNIEXPORT jfloatArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToFloat___3B (JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */ { - jfloatArray rarray; + jfloatArray rarray = NULL; jboolean bb; jfloat *farray = NULL; jfloat *iap = NULL; @@ -152,7 +152,7 @@ JNIEXPORT jshortArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToShort___3B (JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */ { - jshortArray rarray; + jshortArray rarray = NULL; jboolean bb; jshort *sarray = NULL; jshort *iap = NULL; @@ -203,7 +203,7 @@ JNIEXPORT jlongArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToLong___3B (JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */ { - jlongArray rarray; + jlongArray rarray = NULL; jboolean bb; jlong *larray = NULL; jlong *iap = NULL; @@ -254,7 +254,7 @@ JNIEXPORT jdoubleArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToDouble___3B (JNIEnv *env, jclass clss, jbyteArray bdata) /* IN: array of bytes */ { - jdoubleArray rarray; + jdoubleArray rarray = NULL; jboolean bb; jdouble *darray = NULL; jdouble *iap = NULL; @@ -305,7 +305,7 @@ JNIEXPORT jintArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToInt__II_3B (JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */ { - jintArray rarray; + jintArray rarray = NULL; jboolean bb; jint *iarray = NULL; jint *iap = NULL; @@ -357,7 +357,7 @@ JNIEXPORT jshortArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToShort__II_3B (JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */ { - jshortArray rarray; + jshortArray rarray = NULL; jboolean bb; jshort *sarray = NULL; jshort *iap = NULL; @@ -409,7 +409,7 @@ JNIEXPORT jfloatArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToFloat__II_3B (JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */ { - jfloatArray rarray; + jfloatArray rarray = NULL; jboolean bb; jfloat *farray = NULL; jfloat *iap = NULL; @@ -461,7 +461,7 @@ JNIEXPORT jlongArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToLong__II_3B (JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */ { - jlongArray rarray; + jlongArray rarray = NULL; jboolean bb; jlong *larray = NULL; jlong *iap = NULL; @@ -513,7 +513,7 @@ JNIEXPORT jdoubleArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToDouble__II_3B (JNIEnv *env, jclass clss, jint start, jint len, jbyteArray bdata) /* IN: array of bytes */ { - jdoubleArray rarray; + jdoubleArray rarray = NULL; jboolean bb; jdouble *darray = NULL; jdouble *iap = NULL; @@ -565,7 +565,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_intToByte__II_3I (JNIEnv *env, jclass clss, jint start, jint len, jintArray idata) /* IN: array of int */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jbyte *barray = NULL; jbyte *bap = NULL; @@ -627,7 +627,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_shortToByte__II_3S (JNIEnv *env, jclass clss, jint start, jint len, jshortArray sdata) /* IN: array of short */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jshort *ip = NULL; jshort *sarr = NULL; @@ -689,7 +689,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_floatToByte__II_3F (JNIEnv *env, jclass clss, jint start, jint len, jfloatArray fdata) /* IN: array of float */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jfloat *ip = NULL; jfloat *farr = NULL; @@ -751,7 +751,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_doubleToByte__II_3D (JNIEnv *env, jclass clss, jint start, jint len, jdoubleArray ddata) /* IN: array of double */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jdouble *ip = NULL; jdouble *darr = NULL; @@ -813,7 +813,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_longToByte__II_3J (JNIEnv *env, jclass clss, jint start, jint len, jlongArray ldata) /* IN: array of long */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jlong *ip = NULL; jlong *larr = NULL; @@ -875,7 +875,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_intToByte__I (JNIEnv *env, jclass clss, jint idata) /* IN: int */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jbyte *barray = NULL; jbyte *bap = NULL; @@ -911,7 +911,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_floatToByte__F (JNIEnv *env, jclass clss, jfloat fdata) /* IN: float */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jbyte *barray = NULL; jbyte *bap = NULL; @@ -947,7 +947,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_shortToByte__S (JNIEnv *env, jclass clss, jshort sdata) /* IN: short */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jbyte *barray = NULL; jbyte *bap = NULL; @@ -983,7 +983,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_doubleToByte__D (JNIEnv *env, jclass clss, jdouble ddata) /* IN: double */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jbyte *barray = NULL; jbyte *bap = NULL; @@ -1019,7 +1019,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_longToByte__J (JNIEnv *env, jclass clss, jlong ldata) /* IN: long */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jbyte *barray = NULL; jbyte *bap = NULL; @@ -1055,7 +1055,7 @@ JNIEXPORT jbyteArray JNICALL Java_hdf_hdf5lib_HDFNativeData_byteToByte__B (JNIEnv *env, jclass clss, jbyte bdata) /* IN: byte */ { - jbyteArray rarray; + jbyteArray rarray = NULL; jboolean bb; jbyte *barray = NULL; jbyte *bap = NULL; |