diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-12-11 19:14:43 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-12-11 19:14:43 (GMT) |
commit | aa4fc58ac985ba354525056428d79f918f95d119 (patch) | |
tree | c6526fa0d55e8e9cbe365fedd0a431e28c67043c /tools/misc | |
parent | f53c939bd05b44d0cfc520f4de870d139ab1e61f (diff) | |
download | hdf5-aa4fc58ac985ba354525056428d79f918f95d119.zip hdf5-aa4fc58ac985ba354525056428d79f918f95d119.tar.gz hdf5-aa4fc58ac985ba354525056428d79f918f95d119.tar.bz2 |
[svn-r28599] Normalization of tools with revise_chunks.
Tested on: 64-bit Ubuntu 15.10 (Linux 4.2.0 x86_64) gcc 5.2.1
serial only, autotools and CMake (3.3.2)
Diffstat (limited to 'tools/misc')
-rw-r--r-- | tools/misc/h5repart.c | 63 | ||||
-rw-r--r-- | tools/misc/talign.c | 8 | ||||
-rw-r--r-- | tools/misc/vds/UC_1.h | 2 | ||||
-rw-r--r-- | tools/misc/vds/UC_1_one_dim_gen.c | 2 | ||||
-rw-r--r-- | tools/misc/vds/UC_2.h | 2 | ||||
-rw-r--r-- | tools/misc/vds/UC_2_two_dims_gen.c | 2 | ||||
-rw-r--r-- | tools/misc/vds/UC_3_gaps_gen.c | 6 | ||||
-rw-r--r-- | tools/misc/vds/UC_4.h | 2 | ||||
-rw-r--r-- | tools/misc/vds/UC_4_printf_gen.c | 2 | ||||
-rw-r--r-- | tools/misc/vds/UC_5.h | 2 | ||||
-rw-r--r-- | tools/misc/vds/UC_5_stride_gen.c | 2 |
11 files changed, 52 insertions, 41 deletions
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index f58af3a..37d505a 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -200,21 +200,21 @@ main (int argc, char *argv[]) int verbose=FALSE; /*display file names? */ - const char *src_gen_name; /*general source name */ - char src_name[NAMELEN]; /*source member name */ + const char *src_gen_name; /*general source name */ + char *src_name=NULL; /*source member name */ int src_is_family; /*is source name a family name? */ int src_membno=0; /*source member number */ - const char *dst_gen_name; /*general destination name */ - char dst_name[NAMELEN]; /*destination member name */ + const char *dst_gen_name; /*general destination name */ + char *dst_name=NULL; /*destination member name */ int dst_is_family; /*is dst name a family name? */ int dst_membno=0; /*destination member number */ off_t left_overs=0; /*amount of zeros left over */ off_t src_offset=0; /*offset in source member */ off_t dst_offset=0; /*offset in destination member */ - off_t src_size; /*source logical member size */ + off_t src_size; /*source logical member size */ off_t src_act_size; /*source actual member size */ off_t dst_size=1 GB; /*destination logical memb size */ hid_t fapl; /*file access property list */ @@ -232,24 +232,30 @@ main (int argc, char *argv[]) * Parse switches. */ while (argno<argc && '-'==argv[argno][0]) { - if (!strcmp (argv[argno], "-v")) { - verbose = TRUE; - argno++; - } else if (!strcmp(argv[argno], "-V")) { - printf("This is %s version %u.%u release %u\n", - prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); - exit(EXIT_SUCCESS); + if (!strcmp (argv[argno], "-v")) { + verbose = TRUE; + argno++; + } else if (!strcmp(argv[argno], "-V")) { + printf("This is %s version %u.%u release %u\n", + prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); + exit(EXIT_SUCCESS); } else if (!strcmp (argv[argno], "-family_to_sec2")) { - family_to_sec2 = TRUE; - argno++; - } else if ('b'==argv[argno][1]) { - blk_size = get_size (prog_name, &argno, argc, argv); - } else if ('m'==argv[argno][1]) { - dst_size = get_size (prog_name, &argno, argc, argv); - } else { - usage (prog_name); - } - } + family_to_sec2 = TRUE; + argno++; + } else if ('b'==argv[argno][1]) { + blk_size = get_size (prog_name, &argno, argc, argv); + } else if ('m'==argv[argno][1]) { + dst_size = get_size (prog_name, &argno, argc, argv); + } else { + usage (prog_name); + } /* end if */ + } /* end while */ + + /* allocate names */ + if(NULL == (src_name = HDcalloc((size_t)NAMELEN, sizeof(char)))) + exit(EXIT_FAILURE); + if(NULL == (dst_name = HDcalloc((size_t)NAMELEN, sizeof(char)))) + exit(EXIT_FAILURE); /* * Get the name for the source file and open the first member. The size @@ -485,19 +491,22 @@ main (int argc, char *argv[]) H5E_BEGIN_TRY { file=H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl); } H5E_END_TRY; + if(file>=0) { if(H5Fclose(file)<0) { perror ("H5Fclose"); exit (EXIT_FAILURE); - } - } + } /* end if */ + } /* end if */ if(H5Pclose(fapl)<0) { perror ("H5Pclose"); exit (EXIT_FAILURE); - } + } /* end if */ /* Free resources and return */ - HDfree (buf); + HDfree(src_name); + HDfree(dst_name); + HDfree(buf); return EXIT_SUCCESS; -} +} /* end main */ diff --git a/tools/misc/talign.c b/tools/misc/talign.c index 7eb4c50..be373e7 100644 --- a/tools/misc/talign.c +++ b/tools/misc/talign.c @@ -49,7 +49,7 @@ int main(void) char string5[5]; float fok[2] = {1234.0f, 2341.0f}; float fnok[2] = {5678.0f, 6785.0f}; - float *fptr; + float *fptr = NULL; char *data = NULL; @@ -143,8 +143,10 @@ out: if(error < 0) { result = 1; puts("*FAILED - HDF5 library error*"); - } else if(fok[0] != fptr[0] || fok[1] != fptr[1] - || fnok[0] != fptr[2] || fnok[1] != fptr[3]) { + } else if(!(H5_FLT_ABS_EQUAL(fok[0], fptr[0])) + || !(H5_FLT_ABS_EQUAL(fok[1], fptr[1])) + || !(H5_FLT_ABS_EQUAL(fnok[0], fptr[2])) + || !(H5_FLT_ABS_EQUAL(fnok[1], fptr[3]))) { char *mname; result = 1; diff --git a/tools/misc/vds/UC_1.h b/tools/misc/vds/UC_1.h index 29df72b..24299d4 100644 --- a/tools/misc/vds/UC_1.h +++ b/tools/misc/vds/UC_1.h @@ -136,7 +136,7 @@ static char UC_1_SOURCE_DSET_PATH[NAME_LEN] = "/source_dset"; static char UC_1_VDS_DSET_NAME[NAME_LEN] = "vds_dset"; /* Fill values */ -static hsize_t UC_1_FILL_VALUES[UC_1_N_SOURCES] = { +static int UC_1_FILL_VALUES[UC_1_N_SOURCES] = { -1, -2, -3, diff --git a/tools/misc/vds/UC_1_one_dim_gen.c b/tools/misc/vds/UC_1_one_dim_gen.c index a78268b..ee56622 100644 --- a/tools/misc/vds/UC_1_one_dim_gen.c +++ b/tools/misc/vds/UC_1_one_dim_gen.c @@ -29,7 +29,7 @@ int -main(int argc, char *argv[]) +main(void) { hid_t src_sid = -1; /* source dataset's dataspace ID */ hid_t src_dcplid = -1; /* source dataset property list ID */ diff --git a/tools/misc/vds/UC_2.h b/tools/misc/vds/UC_2.h index 3e4e4fd..8b9f19a 100644 --- a/tools/misc/vds/UC_2.h +++ b/tools/misc/vds/UC_2.h @@ -138,7 +138,7 @@ static char UC_2_FILE_NAMES[UC_2_N_SOURCES][NAME_LEN] = { #define UC_2_VDS_DSET_NAME "vds_dset" /* Fill values */ -static hsize_t UC_2_FILL_VALUES[UC_2_N_SOURCES] = { +static int UC_2_FILL_VALUES[UC_2_N_SOURCES] = { -1, -2, -3, diff --git a/tools/misc/vds/UC_2_two_dims_gen.c b/tools/misc/vds/UC_2_two_dims_gen.c index b5fd319..c3dfa65 100644 --- a/tools/misc/vds/UC_2_two_dims_gen.c +++ b/tools/misc/vds/UC_2_two_dims_gen.c @@ -28,7 +28,7 @@ #include "UC_2.h" int -main(int argc, char *argv[]) +main(void) { hid_t src_sid = -1; /* source dataset's dataspace ID */ hid_t src_dcplid = -1; /* source dataset property list ID */ diff --git a/tools/misc/vds/UC_3_gaps_gen.c b/tools/misc/vds/UC_3_gaps_gen.c index 1f150c1..7cb208b 100644 --- a/tools/misc/vds/UC_3_gaps_gen.c +++ b/tools/misc/vds/UC_3_gaps_gen.c @@ -28,7 +28,7 @@ #include "UC_3.h" /* Create the VDS that uses use case 1 files */ -herr_t +static herr_t create_3_1_vds(void) { hid_t src_sid = -1; /* source dataset's dataspace ID */ @@ -135,7 +135,7 @@ error: } /* end create_3_1_vds() */ /* Create the VDS that uses use case 2 files */ -herr_t +static herr_t create_3_2_vds(void) { hid_t src_sid = -1; /* source dataset's dataspace ID */ @@ -236,7 +236,7 @@ error: } /* end create_3_2_vds() */ int -main(int argc, char *argv[]) +main(void) { if(create_3_1_vds() < 0) diff --git a/tools/misc/vds/UC_4.h b/tools/misc/vds/UC_4.h index ce74e63..bfcafed 100644 --- a/tools/misc/vds/UC_4.h +++ b/tools/misc/vds/UC_4.h @@ -74,7 +74,7 @@ static char UC_4_SOURCE_DSET_PATH[NAME_LEN] = "/source_dset"; static char UC_4_VDS_DSET_NAME[NAME_LEN] = "vds_dset"; /* Fill values */ -static hsize_t UC_4_FILL_VALUES[UC_4_N_SOURCES] = { +static int UC_4_FILL_VALUES[UC_4_N_SOURCES] = { -1, -2, -3 diff --git a/tools/misc/vds/UC_4_printf_gen.c b/tools/misc/vds/UC_4_printf_gen.c index c8e111a..c0bb6b5 100644 --- a/tools/misc/vds/UC_4_printf_gen.c +++ b/tools/misc/vds/UC_4_printf_gen.c @@ -27,7 +27,7 @@ #include "UC_4.h" int -main(int argc, char *argv[]) +main(void) { hid_t src_sid = -1; /* source dataset's dataspace ID */ hid_t src_dcplid = -1; /* source dataset property list ID */ diff --git a/tools/misc/vds/UC_5.h b/tools/misc/vds/UC_5.h index b22b177..96b2af3 100644 --- a/tools/misc/vds/UC_5.h +++ b/tools/misc/vds/UC_5.h @@ -72,7 +72,7 @@ static char UC_5_SOURCE_DSET_PATH[NAME_LEN] = "/source_dset"; static char UC_5_VDS_DSET_NAME[NAME_LEN] = "vds_dset"; /* Fill values */ -static hsize_t UC_5_FILL_VALUES[UC_5_N_SOURCES] = { +static int UC_5_FILL_VALUES[UC_5_N_SOURCES] = { -1, -2, -3 diff --git a/tools/misc/vds/UC_5_stride_gen.c b/tools/misc/vds/UC_5_stride_gen.c index 984aadc..9fa4908 100644 --- a/tools/misc/vds/UC_5_stride_gen.c +++ b/tools/misc/vds/UC_5_stride_gen.c @@ -27,7 +27,7 @@ #include "UC_5.h" int -main(int argc, char *argv[]) +main(void) { hid_t src_sid = -1; /* source dataset's dataspace ID */ hid_t src_dcplid = -1; /* source dataset property list ID */ |