diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/examples/groups/JavaGroupExample.sh.in | 29 | ||||
-rw-r--r-- | java/src/jni/h5dImp.c | 2 | ||||
-rw-r--r-- | java/src/jni/h5pImp.c | 4 | ||||
-rw-r--r-- | java/src/jni/h5sImp.c | 6 | ||||
-rw-r--r-- | java/src/jni/h5util.c | 10 |
5 files changed, 27 insertions, 24 deletions
diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in index a2cc4b7..9d68a58 100644 --- a/java/examples/groups/JavaGroupExample.sh.in +++ b/java/examples/groups/JavaGroupExample.sh.in @@ -34,13 +34,13 @@ nerrors=0 # where the libs exist HDFLIB_HOME="$top_srcdir/java/lib" BLDLIBDIR="$top_builddir/hdf5/lib" -BLDREFDIR="./groups" +BLDITERDIR="./groups" BLDDIR="." HDFTEST_HOME="$top_srcdir/java/examples/groups" JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar TESTJARFILE=jar@PACKAGE_TARNAME@groups.jar test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR -test -d $BLDREFDIR || mkdir -p $BLDREFDIR +test -d $BLDITERDIR || mkdir -p $BLDITERDIR ###################################################################### # library files @@ -59,9 +59,11 @@ LIST_JAR_TESTFILES=" $HDFLIB_HOME/slf4j-api-1.7.25.jar $HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar " -LIST_DATA_FILES=" +LIST_ITER_FILES=" $HDFTEST_HOME/h5ex_g_iterate.h5 $HDFTEST_HOME/h5ex_g_visit.h5 +" +LIST_DATA_FILES=" $HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Create.txt $HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Iterate.txt $HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Compact.txt @@ -146,6 +148,7 @@ CLEAN_LIBFILES_AND_BLDLIBDIR() } COPY_DATAFILES="$LIST_DATA_FILES" +COPY_ITERFILES="$LIST_ITER_FILES" COPY_DATAFILES_TO_BLDDIR() { @@ -190,12 +193,12 @@ CLEAN_DATAFILES_AND_BLDDIR() fi } -COPY_REFFILES="$LIST_REF_FILES" +COPY_ITERFILES="$LIST_ITER_FILES" -COPY_REFFILES_TO_BLDREFDIR() +COPY_ITERFILES_TO_BLDITERDIR() { # copy test files. Used -f to make sure get a new copy - for tstfile in $COPY_REFFILES + for tstfile in $COPY_ITERFILES do # ignore '#' comment echo $tstfile | tr -d ' ' | grep '^#' > /dev/null @@ -206,9 +209,9 @@ COPY_REFFILES_TO_BLDREFDIR() # make cp fail SDIR=`$DIRNAME $tstfile` INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $BLDREFDIR + $CP -f $tstfile $BLDITERDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." @@ -220,16 +223,16 @@ COPY_REFFILES_TO_BLDREFDIR() done } -CLEAN_REFFILES_AND_BLDREFDIR() +CLEAN_ITERFILES_AND_BLDITERDIR() { # skip rm if srcdir is same as destdir # this occurs when build/test performed in source dir and # make cp fail SDIR=`$DIRNAME $HDFTEST_HOME/h5ex_g_iterate.h5` INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` - INODE_DDIR=`$LS -i -d $BLDREFDIR | $AWK -F' ' '{print $1}'` + INODE_DDIR=`$LS -i -d $BLDITERDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $RM $BLDREFDIR + $RM $BLDITERDIR fi } @@ -252,7 +255,7 @@ JAVAEXEFLAGS=@H5_JAVAFLAGS@ # prepare for test COPY_LIBFILES_TO_BLDLIBDIR COPY_DATAFILES_TO_BLDDIR -COPY_REFFILES_TO_BLDREFDIR +COPY_REFFILES_TO_BLDITERDIR CPATH=".:"$BLDLIBDIR"/"$JARFILE":"$BLDLIBDIR"/slf4j-api-1.7.25.jar:"$BLDLIBDIR"/slf4j-simple-1.7.25.jar:"$TESTJARFILE"" @@ -368,7 +371,7 @@ fi # Clean up temporary files/directories CLEAN_LIBFILES_AND_BLDLIBDIR CLEAN_DATAFILES_AND_BLDDIR -CLEAN_REFFILES_AND_BLDREFDIR +CLEAN_ITERFILES_AND_BLDITERDIR # Report test results and exit if test $nerrors -eq 0 ; then diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index f984948..652c873 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -1109,7 +1109,7 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1string const char *utf8 = ENVPTR->GetStringUTFChars(ENVPAR obj, 0); if (utf8) { - strncpy(&c_buf[i * str_len], utf8, str_len); + HDstrncpy(&c_buf[i * str_len], utf8, str_len); } /* end if */ ENVPTR->ReleaseStringUTFChars(ENVPAR obj, utf8); diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index e6d1be8..52008ce 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -3881,7 +3881,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1fapl_1multi const char *utf8 = ENVPTR->GetStringUTFChars(ENVPAR obj, 0); if (utf8) { - member_name[i] = (char*)HDmalloc(strlen(utf8) + 1); + member_name[i] = (char*)HDmalloc(HDstrlen(utf8) + 1); if (member_name[i]) { strcpy(member_name[i], utf8); } /* end if */ @@ -4189,7 +4189,7 @@ Java_hdf_hdf5lib_H5_H5Pset_1mdc_1config h5JNIFatalError(env, "H5Pset_mdc_config: out of memory trace_file_name"); return; } /* end if */ - strncpy(cacheinfo.trace_file_name, str, 1025); + HDstrncpy(cacheinfo.trace_file_name, str, 1025); ENVPTR->ReleaseStringUTFChars(ENVPAR j_str, str); if(ENVPTR->ExceptionOccurred(ENVONLY)) { h5JNIFatalError(env, "H5Pset_mdc_config: loading trace_file_name failed"); diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index a4b4848..65cdd7b 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -571,7 +571,7 @@ Java_hdf_hdf5lib_H5_H5Sset_1extent_1simple h5JNIFatalError(env, "H5Pset_simple_extent: dims not pinned"); return -1; } /* end if */ - sa = lp = (hsize_t *) malloc((size_t)rank * sizeof(hsize_t)); + sa = lp = (hsize_t *) HDmalloc((size_t)rank * sizeof(hsize_t)); if (sa == NULL) { ENVPTR->ReleaseLongArrayElements(ENVPAR dims, dimsP, JNI_ABORT); h5JNIFatalError(env, "H5Sset_simple_extent: dims not converted to hsize_t"); @@ -1017,7 +1017,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1hyper_1blocklist h5JNIFatalError(env, "H5Sget_select_hyper_blocklist: buf not pinned"); } /* end if */ else { - ba = (hsize_t *) malloc((size_t)nb * 2 * (size_t)rank * sizeof(hsize_t)); + ba = (hsize_t *) HDmalloc((size_t)nb * 2 * (size_t)rank * sizeof(hsize_t)); if (ba == NULL) { ENVPTR->ReleaseLongArrayElements(ENVPAR buf, bufP, JNI_ABORT); h5JNIFatalError(env, "H5Screate-simple: buffer not converted to hsize_t"); @@ -1135,7 +1135,7 @@ Java_hdf_hdf5lib_H5_H5Sget_1select_1bounds return -1; } /* end if */ rank = (int) ENVPTR->GetArrayLength(ENVPAR start); - strt = (hsize_t *)malloc((size_t)rank * sizeof(hsize_t)); + strt = (hsize_t *)HDmalloc((size_t)rank * sizeof(hsize_t)); if (strt == NULL) { ENVPTR->ReleaseLongArrayElements(ENVPAR start, startP, JNI_ABORT); h5JNIFatalError(env, "H5Sget_select_bounds: start not converted to hsize_t"); diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 42f8a5c..fd34ba1 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -1768,7 +1768,7 @@ h5str_render_bin_output if (H5Tis_variable_str(tid)) { s = *(char**) mem; if (s != NULL) - size = strlen(s); + size = HDstrlen(s); } else { s = (char *) mem; @@ -2129,11 +2129,11 @@ render_bin_output_region_data_points ret_value = -1; HDfree(dims1); - } /* end if((dims1 = (hsize_t *) malloc(sizeof(hsize_t) * ndims)) != NULL) */ + } /* end if((dims1 = (hsize_t *) HDmalloc(sizeof(hsize_t) * ndims)) != NULL) */ else ret_value = -1; HDfree(region_buf); - } /* end if((region_buf = malloc(type_size * (size_t)npoints)) != NULL) */ + } /* end if((region_buf = HDmalloc(type_size * (size_t)npoints)) != NULL) */ else ret_value = -1; @@ -2436,7 +2436,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex H5Tclose(p_type); n = ENVPTR->GetArrayLength(ENVPAR buf); - rdata = (char *)malloc((size_t)n * size); + rdata = (char *)HDmalloc((size_t)n * size); if (rdata == NULL) { h5JNIFatalError(env, "H5AreadComplex: failed to allocate buff for read"); } /* end if */ @@ -2952,7 +2952,7 @@ obj_info_all if (retVal < 0) { *(datainfo->otype+datainfo->count) = -1; *(datainfo->ltype+datainfo->count) = -1; - *(datainfo->objname+datainfo->count) = (char *)HDmalloc(strlen(name)+1); + *(datainfo->objname+datainfo->count) = (char *)HDmalloc(HDstrlen(name)+1); HDstrcpy(*(datainfo->objname+datainfo->count), name); *(datainfo->objno+datainfo->count) = (unsigned long)-1; } /* end if */ |