summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/src/jni/h5aImp.c2
-rw-r--r--java/src/jni/h5dImp.c2
-rw-r--r--java/src/jni/h5rImp.c11
-rw-r--r--java/src/jni/h5util.c6
-rw-r--r--java/src/jni/nativeData.c40
-rw-r--r--tools/lib/h5diff.c1
-rw-r--r--tools/lib/h5diff_array.c1
-rw-r--r--tools/lib/h5tools_dump.c7
-rw-r--r--tools/src/h5ls/h5ls.c18
9 files changed, 33 insertions, 55 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;
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index b22af18..b2c19fe 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -274,7 +274,6 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2
int cmp;
trav_table_t *table = NULL;
size_t idx;
- int ret_value = 0;
h5difftrace("build_match_list start\n");
/* init */
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index c83b88d..aeb4f95 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -2258,7 +2258,6 @@ static hsize_t character_compare_opt(unsigned char *mem1, unsigned char *mem2,
unsigned char temp1_uchar;
unsigned char temp2_uchar;
double per;
- hbool_t both_zero;
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 936407e..bfd6be2 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -3977,7 +3977,6 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
hsize_t total_size[H5S_MAX_RANK];
hsize_t elmt_counter = 0; /*counts the # elements printed. */
int status = -1;
- hbool_t dimension_break;
h5tools_str_t buffer; /* string into which to render */
hsize_t curr_pos = 0; /* total data element position */
size_t ncols = 80; /* available output width */
@@ -4195,13 +4194,13 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
if(region_type == H5S_SEL_POINTS) {
/* Print point information */
H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "H5S_SEL_POINTS H5R_DATASET_REGION2");
- dimension_break = h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, &outputformat, &datactx,
+ h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, &outputformat, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
}
else if(region_type == H5S_SEL_HYPERSLABS) {
/* Print block information */
H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "H5S_SEL_HYPERSLABS H5R_DATASET_REGION2");
- dimension_break = h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, &outputformat, &datactx,
+ h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, &outputformat, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
}
else
@@ -4221,7 +4220,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
case H5R_ATTR:
H5TOOLS_DEBUG(H5E_tools_min_dbg_id_g, "ref_type is H5R_ATTR");
if((new_obj_id = H5Ropen_attr((const H5R_ref_t *)&ref_buf[i], H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
- dimension_break = h5tools_dump_region_attribute(new_obj_id, stream, &outputformat, &datactx,
+ h5tools_dump_region_attribute(new_obj_id, stream, &outputformat, &datactx,
&buffer, &curr_pos, ncols, i, elmt_counter);
if(H5Aclose(new_obj_id) < 0)
H5TOOLS_ERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Aclose H5R_ATTR failed");
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 0a43344..7342090 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -1530,17 +1530,12 @@ dump_dataset_values(hid_t dset)
H5TOOLS_ERR_INIT(herr_t, SUCCEED)
hid_t f_type = H5I_INVALID_HID;
hid_t space = H5I_INVALID_HID;
- hid_t new_obj_id = H5I_INVALID_HID;
- hid_t new_obj_sid = H5I_INVALID_HID;
hsize_t total_size[H5S_MAX_RANK];
- hsize_t nelmts = 1;
- hsize_t elmt_counter = 0; /*counts the # elements printed. */
int ndims;
size_t i;
char string_prefix[64];
static char fmt_double[16];
static char fmt_float[16];
- size_t ncols = 80; /* available output width */
hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
@@ -1708,22 +1703,13 @@ dump_attribute_values(hid_t attr, const char *attr_name)
{
H5TOOLS_ERR_INIT(herr_t, SUCCEED)
hid_t f_type = H5I_INVALID_HID;
- hid_t p_type = H5I_INVALID_HID;
hid_t space = H5I_INVALID_HID;
- hid_t new_obj_id = H5I_INVALID_HID;
- hid_t new_obj_sid = H5I_INVALID_HID;
hsize_t total_size[H5S_MAX_RANK];
- hsize_t nelmts = 1;
- hsize_t elmt_counter = 0; /*counts the # elements printed. */
- hsize_t temp_need;
- size_t need;
int ndims;
size_t i;
- void *buf;
char string_prefix[64];
static char fmt_double[16];
static char fmt_float[16];
- size_t ncols = 80; /* available output width */
hsize_t curr_pos = 0; /* total data element position */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
@@ -1899,18 +1885,14 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
hid_t attr = H5I_INVALID_HID;
hid_t space = H5I_INVALID_HID;
hid_t type = H5I_INVALID_HID;
- hid_t new_obj_id = H5I_INVALID_HID;
- hid_t new_obj_sid = H5I_INVALID_HID;
hsize_t size[H5S_MAX_RANK];
hsize_t nelmts = 1;
int ndims;
int i;
H5S_class_t space_type;
hsize_t curr_pos = 0; /* total data element position */
- hsize_t elmt_counter = 0; /*counts the # elements printed. */
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t ctx; /* print context */
- size_t ncols = 80; /* available output width */
h5tool_format_t *info = &ls_dataformat;
H5TOOLS_PUSH_STACK();