From b4ff3e6e79a46fb474eb1786a11a7d2451455111 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 10 Mar 2009 14:00:39 -0500 Subject: [svn-r16560] Description: Remove another call to H5E_clear_stack() from within the library. Clean up lots of compiler warnings. Tested on: Mac OS X/32 10.5.6 (amazon) (followup on other platforms forthcoming) --- examples/h5_extlink.c | 12 +- examples/h5_ref2reg.c | 2 +- examples/h5_select.c | 2 +- hl/src/H5IM.c | 9 +- hl/src/H5PT.c | 20 +- perform/mpi-perf.c | 502 +++++++++++++++++++++--------------------- perform/perf.c | 322 +++++++++++++-------------- perform/pio_perf.c | 1 - perform/sio_engine.c | 19 +- perform/sio_perf.c | 9 - src/H5AC.c | 4 +- src/H5Aint.c | 2 +- src/H5C.c | 6 - src/H5D.c | 3 +- src/H5Dio.c | 10 +- src/H5Dmpio.c | 29 +-- src/H5FDdirect.c | 5 +- src/H5FDmpio.c | 2 +- src/H5FDmpiposix.c | 2 + src/H5FDstdio.c | 2 + src/H5FDwindows.c | 2 +- src/H5FLprivate.h | 16 +- src/H5Gloc.c | 12 +- src/H5Gname.c | 2 - src/H5Gnode.c | 4 +- src/H5HFbtree2.c | 9 - src/H5HFhuge.c | 14 +- src/H5HFsection.c | 17 +- src/H5HGdbg.c | 2 +- src/H5Oainfo.c | 4 +- src/H5Odtype.c | 12 +- src/H5RC.c | 16 +- src/H5RS.c | 106 ++++----- src/H5ST.c | 169 +++++++------- src/H5Smpio.c | 336 +++++++++++++--------------- src/H5Z.c | 14 +- test/cache.c | 2 - test/cache_common.c | 2 +- test/dsets.c | 13 +- test/dt_arith.c | 20 +- test/dtransform.c | 30 ++- test/dtypes.c | 27 +-- test/enum.c | 25 +-- test/error_test.c | 4 +- test/fillval.c | 4 +- test/freespace.c | 13 +- test/getname.c | 35 ++- test/h5test.c | 27 +-- test/links.c | 69 +++--- test/mf.c | 122 ++++++---- test/mount.c | 11 +- test/trefstr.c | 1 - test/tselect.c | 28 +-- test/tsohm.c | 29 +-- testpar/t_cache.c | 85 +++---- testpar/t_chunk_alloc.c | 17 +- testpar/t_coll_chunk.c | 101 ++------- testpar/t_filter_read.c | 2 +- testpar/t_mdset.c | 69 +++--- testpar/t_mpi.c | 14 +- testpar/t_pflush1.c | 6 +- testpar/t_pflush2.c | 3 +- testpar/t_posix_compliant.c | 7 +- testpar/t_span_tree.c | 8 +- tools/h5diff/h5diff_common.c | 15 +- tools/h5diff/h5diffgentest.c | 14 +- tools/h5diff/ph5diff_main.c | 10 +- tools/h5dump/h5dumpgentest.c | 3 +- tools/h5import/h5importtest.c | 25 +-- tools/h5repack/h5repacktst.c | 8 + tools/h5stat/h5stat.c | 5 - tools/h5stat/h5stat_gentest.c | 7 + 72 files changed, 1203 insertions(+), 1356 deletions(-) diff --git a/examples/h5_extlink.c b/examples/h5_extlink.c index 7886aeb..e8a24b8 100644 --- a/examples/h5_extlink.c +++ b/examples/h5_extlink.c @@ -224,7 +224,7 @@ static void soft_link_example(void) const H5L_class_t UD_soft_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* Version number for this struct. * This field is always H5L_LINK_CLASS_T_VERS */ - UD_SOFT_CLASS, /* Link class id number. This can be any + (H5L_type_t)UD_SOFT_CLASS, /* Link class id number. This can be any * value between H5L_TYPE_UD_MIN (64) and * H5L_TYPE_MAX (255). It should be a * value that isn't already being used by @@ -258,7 +258,7 @@ static void soft_link_example(void) /* Now create a user-defined link. We give it the path to the group * as its udata.1 */ - H5Lcreate_ud(file_id, UD_SOFT_LINK_NAME, UD_SOFT_CLASS, TARGET_GROUP, + H5Lcreate_ud(file_id, UD_SOFT_LINK_NAME, (H5L_type_t)UD_SOFT_CLASS, TARGET_GROUP, strlen(TARGET_GROUP) + 1, H5P_DEFAULT, H5P_DEFAULT); /* We can access the group through the UD soft link like we would through @@ -327,7 +327,7 @@ static void hard_link_example(void) const H5L_class_t UD_hard_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* Version number for this struct. * This field is always H5L_LINK_CLASS_T_VERS */ - UD_HARD_CLASS, /* Link class id number. This can be any + (H5L_type_t)UD_HARD_CLASS, /* Link class id number. This can be any * value between H5L_TYPE_UD_MIN (64) and * H5L_TYPE_MAX (255). It should be a * value that isn't already being used by @@ -368,7 +368,7 @@ static void hard_link_example(void) /* Now create a user-defined link. We give it the group's address * as its udata. */ - H5Lcreate_ud(file_id, UD_HARD_LINK_NAME, UD_HARD_CLASS, &(li.u.address), + H5Lcreate_ud(file_id, UD_HARD_LINK_NAME, (H5L_type_t)UD_HARD_CLASS, &(li.u.address), sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT); /* The UD hard link has now incremented the group's reference count @@ -546,7 +546,7 @@ static void plist_link_example(void) const H5L_class_t UD_plist_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* Version number for this struct. * This field is always H5L_LINK_CLASS_T_VERS */ - UD_PLIST_CLASS, /* Link class id number. This can be any + (H5L_type_t)UD_PLIST_CLASS, /* Link class id number. This can be any * value between H5L_TYPE_UD_MIN (64) and * H5L_TYPE_MAX (255). It should be a * value that isn't already being used by @@ -572,7 +572,7 @@ static void plist_link_example(void) /* Register "plist links" and create one. It has no udata at all. */ H5Lregister(UD_plist_class); - H5Lcreate_ud(file_id, "plist_link", UD_PLIST_CLASS, NULL, 0, + H5Lcreate_ud(file_id, "plist_link", (H5L_type_t)UD_PLIST_CLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT); /* Create a group access property list to pass in the target for the diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c index d6df438..17ec724 100644 --- a/examples/h5_ref2reg.c +++ b/examples/h5_ref2reg.c @@ -97,7 +97,7 @@ int main(void) * Create a reference to elements selection. */ status = H5Sselect_none(space_id); - status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, coord); + status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord); status = H5Rcreate(&ref[1], file_id, dsetnamev, H5R_DATASET_REGION, space_id); /* diff --git a/examples/h5_select.c b/examples/h5_select.c index 595a1b3..ceb9c2c 100644 --- a/examples/h5_select.c +++ b/examples/h5_select.c @@ -171,7 +171,7 @@ main (void) coord[2][0] = 3; coord[2][1] = 5; coord[3][0] = 5; coord[3][1] = 6; - ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, coord); + ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, (const hsize_t *)coord); /* * Write new selection of points to the dataset. diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 2fec7e0..479b572 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -512,7 +512,6 @@ herr_t H5IMlink_palette( hid_t loc_id, hid_t attr_type=-1; hid_t attr_id=-1; hid_t attr_space_id=-1; - hid_t attr_class=-1; hobj_ref_t ref; /* write a new reference */ hobj_ref_t *refbuf; /* buffer to read references */ hssize_t n_refs; @@ -579,7 +578,7 @@ herr_t H5IMlink_palette( hid_t loc_id, if((attr_type = H5Aget_type(attr_id)) < 0) goto out; - if((attr_class = H5Tget_class(attr_type)) < 0) + if(H5Tget_class(attr_type) < 0) goto out; /* Get and save the old reference(s) */ @@ -862,7 +861,6 @@ herr_t H5IMget_palette_info( hid_t loc_id, hid_t attr_type=-1; hid_t attr_id; hid_t attr_space_id=-1; - hid_t attr_class; hssize_t n_refs; hsize_t dim_ref; hobj_ref_t *refbuf; /* buffer to read references */ @@ -885,7 +883,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, if((attr_type = H5Aget_type(attr_id)) < 0) goto out; - if((attr_class = H5Tget_class(attr_type)) < 0) + if(H5Tget_class(attr_type) < 0) goto out; /* Get the reference(s) */ @@ -976,7 +974,6 @@ herr_t H5IMget_palette( hid_t loc_id, hid_t attr_type=-1; hid_t attr_id; hid_t attr_space_id=-1; - hid_t attr_class; hssize_t n_refs; hsize_t dim_ref; hobj_ref_t *refbuf; /* buffer to read references */ @@ -997,7 +994,7 @@ herr_t H5IMget_palette( hid_t loc_id, if((attr_type = H5Aget_type(attr_id)) < 0) goto out; - if((attr_class = H5Tget_class(attr_type)) < 0) + if(H5Tget_class(attr_type) < 0) goto out; /* Get the reference(s) */ diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index af6533e..10d2637 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -33,10 +33,10 @@ static H5I_type_t H5PT_ptable_id_type = H5I_UNINIT; #define H5PT_HASH_TABLE_SIZE 64 /* Packet Table private functions */ -herr_t H5PT_close( htbl_t* table ); -herr_t H5PT_create_index(htbl_t *table_id); -herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index); -herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); +static herr_t H5PT_close( htbl_t* table ); +static herr_t H5PT_create_index(htbl_t *table_id); +static herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index); +static herr_t H5PT_get_index(htbl_t *table_id, hsize_t *pt_index); /*------------------------------------------------------------------------- * @@ -306,7 +306,8 @@ out: * *------------------------------------------------------------------------- */ -herr_t H5PT_close( htbl_t* table) +static herr_t +H5PT_close( htbl_t* table) { if(table == NULL) goto out; @@ -559,7 +560,8 @@ out: * *------------------------------------------------------------------------- */ -herr_t H5PT_create_index(htbl_t *table) +static herr_t +H5PT_create_index(htbl_t *table) { if( table != NULL) { @@ -569,7 +571,8 @@ herr_t H5PT_create_index(htbl_t *table) return -1; } -herr_t H5PT_set_index(htbl_t *table, hsize_t index) +static herr_t +H5PT_set_index(htbl_t *table, hsize_t index) { /* Ensure index is valid */ if( table != NULL ) @@ -583,7 +586,8 @@ herr_t H5PT_set_index(htbl_t *table, hsize_t index) return -1; } -herr_t H5PT_get_index(htbl_t *table, hsize_t *index) +static herr_t +H5PT_get_index(htbl_t *table, hsize_t *index) { /* Ensure index is valid */ if( table != NULL ) diff --git a/perform/mpi-perf.c b/perform/mpi-perf.c index 1e0150e..c0fe794 100644 --- a/perform/mpi-perf.c +++ b/perform/mpi-perf.c @@ -77,282 +77,271 @@ char opt_pvfstab[256] = "notset\0"; int opt_pvfstab_set = 0; /* function prototypes */ -int parse_args(int argc, char **argv); -double Wtime(void); +static int parse_args(int argc, char **argv); extern int errno; -extern int debug_on; /* globals needed for getopt */ extern char *optarg; -extern int optind, opterr; int main(int argc, char **argv) { - char *buf, *tmp, *buf2, *tmp2, *check; - int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno; - double stim, etim; - double write_tim = 0; - double read_tim = 0; - double read_bw, write_bw; - double max_read_tim, max_write_tim; - double min_read_tim, min_write_tim; - double ave_read_tim, ave_write_tim; - int64_t iter_jump = 0; - int64_t seek_position = 0; - MPI_File fh; - MPI_Status status; - int nchars; - - /* startup MPI and determine the rank of this process */ - MPI_Init(&argc,&argv); - MPI_Comm_size(MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank(MPI_COMM_WORLD, &mynod); - - /* parse the command line arguments */ - parse_args(argc, argv); - - if (mynod == 0) printf("# Using mpi-io calls.\n"); - - - /* kindof a weird hack- if the location of the pvfstab file was - * specified on the command line, then spit out this location into - * the appropriate environment variable: */ + char *buf, *tmp, *buf2, *tmp2, *check; + int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno; + double stim, etim; + double write_tim = 0; + double read_tim = 0; + double read_bw, write_bw; + double max_read_tim, max_write_tim; + double min_read_tim, min_write_tim; + double ave_read_tim, ave_write_tim; + int64_t iter_jump = 0; + int64_t seek_position = 0; + MPI_File fh; + MPI_Status status; + int nchars; + + /* startup MPI and determine the rank of this process */ + MPI_Init(&argc,&argv); + MPI_Comm_size(MPI_COMM_WORLD, &nprocs); + MPI_Comm_rank(MPI_COMM_WORLD, &mynod); + + /* parse the command line arguments */ + parse_args(argc, argv); + + if (mynod == 0) printf("# Using mpi-io calls.\n"); + + + /* kindof a weird hack- if the location of the pvfstab file was + * specified on the command line, then spit out this location into + * the appropriate environment variable: */ #if H5_HAVE_SETENV /* no setenv or unsetenv */ - if (opt_pvfstab_set) { - if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){ - perror("setenv"); - goto die_jar_jar_die; - } - } + if (opt_pvfstab_set) { + if((setenv("PVFSTAB_FILE", opt_pvfstab, 1)) < 0){ + perror("setenv"); + goto die_jar_jar_die; + } + } #endif - /* this is how much of the file data is covered on each iteration of - * the test. used to help determine the seek offset on each - * iteration */ - iter_jump = nprocs * opt_block; - - /* setup a buffer of data to write */ - if (!(tmp = (char *) malloc(opt_block + 256))) { - perror("malloc"); - goto die_jar_jar_die; - } - buf = tmp + 128 - (((long)tmp) % 128); /* align buffer */ - - if (opt_correct) { - /* do the same buffer setup for verifiable data */ - if (!(tmp2 = (char *) malloc(opt_block + 256))) { - perror("malloc2"); - goto die_jar_jar_die; - } - buf2 = tmp + 128 - (((long)tmp) % 128); - } - - /* open the file for writing */ - err = MPI_File_open(MPI_COMM_WORLD, opt_file, - MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); - if (err < 0) { - fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno)); - goto die_jar_jar_die; - } - - /* now repeat the write operations the number of times - * specified on the command line */ - for (j=0; j < opt_iter; j++) { - - /* calculate the appropriate position depending on the iteration - * and rank of the current process */ - seek_position = (j*iter_jump)+(mynod*opt_block); - - if (opt_correct) /* fill in buffer for iteration */ { - for (i=mynod+j, check=buf; i= 0), "H5Pclose succeeded", H5FATAL); - /* compute the read and write times */ - MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX, - MPI_COMM_WORLD); - MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN, - MPI_COMM_WORLD); - MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM, - MPI_COMM_WORLD); + /* compute the read and write times */ + MPI_Allreduce(&read_tim, &max_read_tim, 1, MPI_DOUBLE, MPI_MAX, + MPI_COMM_WORLD); + MPI_Allreduce(&read_tim, &min_read_tim, 1, MPI_DOUBLE, MPI_MIN, + MPI_COMM_WORLD); + MPI_Allreduce(&read_tim, &ave_read_tim, 1, MPI_DOUBLE, MPI_SUM, + MPI_COMM_WORLD); - /* calculate the average from the sum */ - ave_read_tim = ave_read_tim / nprocs; + /* calculate the average from the sum */ + ave_read_tim = ave_read_tim / nprocs; - MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX, - MPI_COMM_WORLD); - MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN, - MPI_COMM_WORLD); - MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM, - MPI_COMM_WORLD); + MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX, + MPI_COMM_WORLD); + MPI_Allreduce(&write_tim, &min_write_tim, 1, MPI_DOUBLE, MPI_MIN, + MPI_COMM_WORLD); + MPI_Allreduce(&write_tim, &ave_write_tim, 1, MPI_DOUBLE, MPI_SUM, + MPI_COMM_WORLD); - /* calculate the average from the sum */ - ave_write_tim = ave_write_tim / nprocs; + /* calculate the average from the sum */ + ave_write_tim = ave_write_tim / nprocs; - /* print out the results on one node */ - if (mynod == 0) { - read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); - write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); + /* print out the results on one node */ + if (mynod == 0) { + read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); + write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); - printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, - opt_iter, (long)opt_block); + printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, + opt_iter, (long)opt_block); - printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter)); + printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter)); - printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", - min_write_tim, max_write_tim, ave_write_tim); - printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", - min_read_tim, max_read_tim, ave_read_tim); + printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", + min_write_tim, max_write_tim, ave_write_tim); + printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", + min_read_tim, max_read_tim, ave_read_tim); - printf("Write bandwidth = %f Mbytes/sec\n", write_bw); - printf("Read bandwidth = %f Mbytes/sec\n", read_bw); + printf("Write bandwidth = %f Mbytes/sec\n", write_bw); + printf("Read bandwidth = %f Mbytes/sec\n", read_bw); - if (opt_correct) { - printf("Correctness test %s.\n", correct ? "passed" : "failed"); - } - } + if (opt_correct) { + printf("Correctness test %s.\n", correct ? "passed" : "failed"); + } + } die_jar_jar_die: #if H5_HAVE_SETENV /* no setenv or unsetenv */ - /* clear the environment variable if it was set earlier */ - if (opt_pvfstab_set){ - unsetenv("PVFSTAB_FILE"); - } + /* clear the environment variable if it was set earlier */ + if (opt_pvfstab_set){ + unsetenv("PVFSTAB_FILE"); + } #endif - free(tmp); - if (opt_correct) free(tmp2); - MPI_Finalize(); - return(0); -} + free(tmp); + if (opt_correct) free(tmp2); + MPI_Finalize(); -int parse_args(int argc, char **argv) -{ - int c; - - while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) { - switch (c) { - case 's': /* stripe */ - opt_stripe = atoi(optarg); - break; - case 'b': /* block size */ - opt_block = atoi(optarg); - break; - case 'i': /* iterations */ - opt_iter = atoi(optarg); - break; - case 'f': /* filename */ - strncpy(opt_file, optarg, 255); - break; - case 'p': /* pvfstab file */ - strncpy(opt_pvfstab, optarg, 255); - opt_pvfstab_set = 1; - break; - case 'a': /* aligned allocation. - * syntax: -a/ - * e.g., -a4096/512 allocate at 4096 bytes - * boundary if request size >= 512. - */ - {char *p; - opt_alignment = atoi(optarg); - if (p=(char*)strchr(optarg, '/')) - opt_threshold = atoi(p+1); - } - HDfprintf(stdout, - "alignment/threshold=%Hu/%Hu\n", - opt_alignment, opt_threshold); - break; - case '2': /* use 2-files, i.e., split file driver */ - opt_split_vfd=1; - /* get meta and raw file extension. */ - /* syntax is , */ - meta_ext = raw_ext = optarg; - while (*raw_ext != '\0'){ - if (*raw_ext == ','){ - *raw_ext = '\0'; - raw_ext++; - break; - } - raw_ext++; - } - printf("split-file-vfd used: %s,%s\n", - meta_ext, raw_ext); - break; - case 'c': /* correctness */ - opt_correct = 1; - break; - case '?': /* unknown */ - default: - break; - } - } - return(0); + return(0); } -/* Wtime() - returns current time in sec., in a double */ -double Wtime() +static int +parse_args(int argc, char **argv) { - struct timeval t; + int c; + + while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) { + switch (c) { + case 's': /* stripe */ + opt_stripe = atoi(optarg); + break; + case 'b': /* block size */ + opt_block = atoi(optarg); + break; + case 'i': /* iterations */ + opt_iter = atoi(optarg); + break; + case 'f': /* filename */ + strncpy(opt_file, optarg, 255); + break; + case 'p': /* pvfstab file */ + strncpy(opt_pvfstab, optarg, 255); + opt_pvfstab_set = 1; + break; + case 'a': /* aligned allocation. + * syntax: -a/ + * e.g., -a4096/512 allocate at 4096 bytes + * boundary if request size >= 512. + */ + {char *p; + opt_alignment = atoi(optarg); + if (p=(char*)strchr(optarg, '/')) + opt_threshold = atoi(p+1); + } + HDfprintf(stdout, + "alignment/threshold=%Hu/%Hu\n", + opt_alignment, opt_threshold); + break; + case '2': /* use 2-files, i.e., split file driver */ + opt_split_vfd=1; + /* get meta and raw file extension. */ + /* syntax is , */ + meta_ext = raw_ext = optarg; + while (*raw_ext != '\0'){ + if (*raw_ext == ','){ + *raw_ext = '\0'; + raw_ext++; + break; + } + raw_ext++; + } + printf("split-file-vfd used: %s,%s\n", + meta_ext, raw_ext); + break; + case 'c': /* correctness */ + opt_correct = 1; + break; + case '?': /* unknown */ + default: + break; + } + } - gettimeofday(&t, NULL); - return((double)t.tv_sec + (double)t.tv_usec / 1000000); + return(0); } /* @@ -461,11 +452,12 @@ double Wtime() */ #else /* H5_HAVE_PARALLEL */ -/* dummy program since H5_HAVE_PARALLE is not configured in */ +/* dummy program since H5_HAVE_PARALLEL is not configured in */ int main(int UNUSED argc, char UNUSED **argv) { -printf("No parallel performance because parallel is not configured in\n"); -return(0); + printf("No parallel performance because parallel is not configured in\n"); + return(0); } #endif /* H5_HAVE_PARALLEL */ + diff --git a/perform/pio_perf.c b/perform/pio_perf.c index a6057b3..d3e2531 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -427,7 +427,6 @@ run_test_loop(struct options *opts) parameters parms; int num_procs; int doing_pio; /* if this process is doing PIO */ - off_t snbytes; parms.num_files = opts->num_files; parms.num_dsets = opts->num_dsets; diff --git a/perform/sio_engine.c b/perform/sio_engine.c index 0fdfac5..d4e7ad3 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -127,7 +127,6 @@ static int cont_dim; /* lowest dimension for contiguous POSIX static size_t cont_size; /* size of contiguous POSIX access */ static hid_t fapl; /* file access list */ static unsigned char *buf_p; /* buffer pointer */ -static unsigned char *buf2_p; /* buffer pointer */ static const char *multi_letters = "msbrglo"; /* string for multi driver */ static char *buffer2=NULL; /* buffer for data verification */ @@ -151,10 +150,7 @@ static hid_t h5dxpl = -1; /* Dataset transfer property list */ do_sio(parameters param) { char *buffer = NULL; /*data buffer pointer */ - off_t nbytes; /* dataset raw size */ - off_t dset_size[MAX_DIMS]; /* dataset size in bytes */ size_t buf_size[MAX_DIMS]; /* general buffer size in bytes */ - size_t chk_size[MAX_DIMS]; /* chunk size in bytes */ file_descr fd; /* file handles */ iotype iot; /* API type */ char base_name[256]; /* test file base name */ @@ -183,17 +179,14 @@ do_sio(parameters param) break; default: /* unknown request */ - fprintf(stderr, "Unknown IO type request (%d)\n", iot); + fprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); GOTOERROR(FAIL); } - nbytes = param.num_bytes; linear_buf_size = 1; for (i=0; ibuf_size[i]; - h5chunk[i] = parms->chk_size[i]; } h5dset_space_id = H5Screate_simple(rank, h5dims, NULL); @@ -955,7 +946,6 @@ static herr_t dset_read(int local_dim, file_descr *fd, parameters *parms, void * buf_offset[j] = 0; } buf_p = (unsigned char*)buffer; - buf2_p = (unsigned char*)buffer2; posix_buffer_read(0, fd, parms, buffer); break; @@ -1028,13 +1018,6 @@ static herr_t posix_buffer_read(int local_dim, file_descr *fd, parameters *parms rc = ((ssize_t)cont_size == POSIXREAD(fd->posixfd, buf_p, cont_size)); VRFY((rc != 0), "POSIXREAD"); -#if 0 - for (j=0; jnum_files; @@ -449,7 +447,6 @@ run_test(iotype iot, parameters parms, struct options *opts) { results res; register int i, ret_value = SUCCESS; - int comm_size; off_t raw_size; minmax *write_sys_mm_table=NULL; minmax *write_mm_table=NULL; @@ -988,7 +985,6 @@ parse_command_line(int argc, char *argv[]) const char *end = opt_arg; while (end && *end != '\0') { char buf[10]; - int i; memset(buf, '\0', sizeof(buf)); @@ -1028,7 +1024,6 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - int i; memset(buf, '\0', sizeof(buf)); @@ -1057,7 +1052,6 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - int i; memset(buf, '\0', sizeof(buf)); @@ -1116,7 +1110,6 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - int i; memset(buf, '\0', sizeof(buf)); @@ -1185,7 +1178,6 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - int i; memset(buf, '\0', sizeof(buf)); @@ -1214,7 +1206,6 @@ parse_command_line(int argc, char *argv[]) while (end && *end != '\0') { char buf[10]; - int i; memset(buf, '\0', sizeof(buf)); diff --git a/src/H5AC.c b/src/H5AC.c index 950615a..ccdd493 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -2288,10 +2288,10 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, { herr_t result; herr_t ret_value=SUCCEED; /* Return value */ - hbool_t size_changed = FALSE; hbool_t dirtied; size_t new_size = 0; #ifdef H5_HAVE_PARALLEL + hbool_t size_changed = FALSE; H5AC_aux_t * aux_ptr = NULL; #endif /* H5_HAVE_PARALLEL */ #if H5AC__TRACE_FILE_ENABLED @@ -2345,7 +2345,9 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, if ( ((H5AC_info_t *)thing)->size != new_size ) { +#ifdef H5_HAVE_PARALLEL size_changed = TRUE; +#endif /* H5_HAVE_PARALLEL */ flags = flags | H5AC__SIZE_CHANGED_FLAG; #if H5AC__TRACE_FILE_ENABLED trace_flags = flags; diff --git a/src/H5Aint.c b/src/H5Aint.c index c7013a2..2ac17fa 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -716,7 +716,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) /* Retrieve # of records in "name" B-tree */ /* (should be same # of records in all indices) */ if(H5B2_get_nrec(f, dxpl_id, H5A_BT2_NAME, ainfo->name_bt2_addr, &ainfo->nattrs) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't retrieve # of records in index") + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve # of records in index") } /* end if */ else /* Retrieve # of attributes from object header */ diff --git a/src/H5C.c b/src/H5C.c index 7d2d4ea..49e7921 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -9874,8 +9874,6 @@ H5C_flush_invalidate_cache(H5F_t * f, herr_t ret_value = SUCCEED; hbool_t done = FALSE; hbool_t first_flush = TRUE; - hbool_t first_pass = TRUE; - hbool_t have_pinned_entries; int32_t protected_entries = 0; int32_t i; int32_t cur_pel_len; @@ -9952,10 +9950,6 @@ H5C_flush_invalidate_cache(H5F_t * f, while ( ! done ) { - first_pass = FALSE; - - have_pinned_entries = ( cur_pel_len > 0 ); - /* first, try to flush-destroy any dirty entries. Do this by * making a scan through the slist. Note that new dirty entries * may be created by the flush call backs. Thus it is possible diff --git a/src/H5D.c b/src/H5D.c index 4dad2aa..bb5e772 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -368,14 +368,13 @@ done: herr_t H5Dclose(hid_t dset_id) { - H5D_t *dset; /* Dataset object to release */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(H5Dclose, FAIL) H5TRACE1("e", "i", dset_id); /* Check args */ - if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) + if(NULL == H5I_object_verify(dset_id, H5I_DATASET)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* diff --git a/src/H5Dio.c b/src/H5Dio.c index c1d57fd..cc75981 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -66,8 +66,7 @@ static herr_t H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_ H5D_type_info_t *type_info); #ifdef H5_HAVE_PARALLEL static herr_t H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, - const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - const H5S_t *file_space, const H5S_t *mem_space, + hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); static herr_t H5D_ioinfo_term(H5D_io_info_t *io_info); #endif /* H5_HAVE_PARALLEL */ @@ -396,7 +395,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_cache, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) + if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -570,7 +569,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_cache, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) + if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -845,8 +844,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, - const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, +H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) { diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index e4dd8b5..6693348 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -117,8 +117,10 @@ static herr_t H5D_inter_collective_io(H5D_io_info_t *io_info, static herr_t H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, size_t nelmts, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type); +#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS static herr_t H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt); +#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ static herr_t H5D_obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]); static herr_t H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, @@ -1074,7 +1076,6 @@ static herr_t H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { - H5D_t *dataset = io_info->dset;/* Local pointer to dataset info */ H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ H5D_io_info_t cpt_io_info; /* Compact I/O info object */ @@ -1347,7 +1348,6 @@ static herr_t H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { - H5D_t *dataset = io_info->dset;/* Local pointer to dataset info */ H5SL_node_t *chunk_node; /* Current node in chunk skip list */ H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ H5D_storage_t ctg_store; /* Chunk storage information as contiguous dataset */ @@ -1366,7 +1366,7 @@ if(H5DEBUG(D)) { int mpi_rank; mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); - HDfprintf(H5DEBUG(D), "coming to multi_chunk_collective_io_no_opt\n"); + HDfprintf(H5DEBUG(D), "Rank %d: coming to multi_chunk_collective_io_no_opt\n", mpi_rank); } #endif @@ -1614,7 +1614,6 @@ static herr_t H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, size_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type) { - int mpi_code; /* MPI return code */ hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */ herr_t ret_value = SUCCEED; @@ -1626,13 +1625,11 @@ H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info plist_is_setup = TRUE; if(io_info->op_type == H5D_IO_OP_WRITE) { - if((io_info->io_ops.single_write)(io_info, type_info, - (hsize_t)mpi_buf_count, NULL, NULL) < 0) + if((io_info->io_ops.single_write)(io_info, type_info, (hsize_t)mpi_buf_count, NULL, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") } /* end if */ else { - if((io_info->io_ops.single_read)(io_info, type_info, - (hsize_t)mpi_buf_count, NULL, NULL) < 0) + if((io_info->io_ops.single_read)(io_info, type_info, (hsize_t)mpi_buf_count, NULL, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") } /* end else */ @@ -1649,6 +1646,7 @@ if(H5DEBUG(D)) FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_final_collective_io */ +#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS /*------------------------------------------------------------------------- * Function: H5D_sort_chunk @@ -1790,6 +1788,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_sort_chunk() */ +#endif /* H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS */ /*------------------------------------------------------------------------- @@ -1833,17 +1832,19 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]) { int total_chunks; - unsigned percent_nproc_per_chunk,threshold_nproc_per_chunk; + unsigned percent_nproc_per_chunk, threshold_nproc_per_chunk; +#if defined(H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS) && defined(H5_MPI_SPECIAL_COLLECTIVE_IO_WORKS) H5FD_mpio_chunk_opt_t chunk_opt_mode; - uint8_t* io_mode_info=NULL; - uint8_t* recv_io_mode_info=NULL; - uint8_t* mergebuf=NULL; +#endif + uint8_t* io_mode_info = NULL; + uint8_t* recv_io_mode_info = NULL; + uint8_t* mergebuf = NULL; uint8_t* tempbuf; H5SL_node_t* chunk_node; H5D_chunk_info_t* chunk_info; - int mpi_size,mpi_rank; + int mpi_size, mpi_rank; MPI_Comm comm; - int ic,root; + int ic, root; int mpi_code; int mem_cleanup = 0; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 61eb318..fff31f3 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -1081,7 +1081,8 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h hbool_t _must_align = TRUE; herr_t ret_value=SUCCEED; /* Return value */ size_t alloc_size; - void *copy_buf, *p1, *p3; + void *copy_buf, *p1; + const void *p3; size_t _boundary; size_t _fbsize; size_t _cbsize; @@ -1187,7 +1188,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h HDmemcpy(p1, p3, copy_size); }else if(size >= _cbsize && copy_size > (alloc_size-(size_t)(copy_addr%_fbsize))) { HDmemcpy(p1, p3, (alloc_size - (size_t)(copy_addr % _fbsize))); - p3 = (unsigned char*)p3 + (alloc_size - (size_t)(copy_addr % _fbsize)); + p3 = (const unsigned char *)p3 + (alloc_size - (size_t)(copy_addr % _fbsize)); } /*look for the aligned position for writing the data*/ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 57da069..5e5349d 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1913,7 +1913,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing) +H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; herr_t ret_value = SUCCEED; diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 245fc3e..ff5b118 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -1215,7 +1215,9 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_mpiposix_t *file = (H5FD_mpiposix_t*)_file; +#if 0 /* JRM */ int mpi_code; /* MPI return code */ +#endif /* JRM */ ssize_t nbytes; /* Number of bytes written each I/O call */ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 59e5b1e..0ae09a6 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -563,7 +563,9 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; haddr_t addr; +#ifndef H5_HAVE_FSEEKO static const char *func = "H5FD_stdio_alloc"; /* Function Name for error reporting */ +#endif haddr_t ret_value; /* Return value */ /* Shut compiler up */ diff --git a/src/H5FDwindows.c b/src/H5FDwindows.c index ef26fec..37228d7 100644 --- a/src/H5FDwindows.c +++ b/src/H5FDwindows.c @@ -1008,7 +1008,7 @@ done: */ /* ARGSUSED */ static herr_t -H5FD_windows_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing) +H5FD_windows_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) { H5FD_windows_t *file = (H5FD_windows_t*)_file; #ifndef WINDOWS_USE_STDIO diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 446c852..a799dc4 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -118,7 +118,7 @@ typedef struct H5FL_reg_head_t { #define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t) /* Reference a free list for type 't' defined in another file */ -#define H5FL_EXTERN(t) extern H5_DLL H5FL_reg_head_t H5FL_REG_NAME(t) +#define H5FL_EXTERN(t) H5_DLLVAR H5FL_reg_head_t H5FL_REG_NAME(t) /* Declare a static free list to manage objects of type 't' */ #define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t) @@ -142,7 +142,7 @@ typedef struct H5FL_reg_head_t { #define H5FL_DEFINE_COMMON(t) int UNUSED H5FL_REG_NAME(t) #define H5FL_DEFINE(t) H5_DLL H5FL_DEFINE_COMMON(t) -#define H5FL_EXTERN(t) extern H5_DLL H5FL_DEFINE_COMMON(t) +#define H5FL_EXTERN(t) H5_DLLVAR H5FL_DEFINE_COMMON(t) #define H5FL_DEFINE_STATIC(t) static H5FL_DEFINE_COMMON(t) #define H5FL_MALLOC(t) (t *)H5MM_malloc(sizeof(t)) #define H5FL_CALLOC(t) (t *)H5MM_calloc(sizeof(t)) @@ -187,7 +187,7 @@ typedef struct H5FL_blk_head_t { #define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t) /* Reference a free list for type 't' defined in another file */ -#define H5FL_BLK_EXTERN(t) extern H5_DLL H5FL_blk_head_t H5FL_BLK_NAME(t) +#define H5FL_BLK_EXTERN(t) H5_DLLVAR H5FL_blk_head_t H5FL_BLK_NAME(t) /* Declare a static free list to manage objects of type 't' */ #define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t) @@ -212,7 +212,7 @@ typedef struct H5FL_blk_head_t { #define H5FL_BLK_DEFINE_COMMON(t) int UNUSED H5FL_BLK_NAME(t) #define H5FL_BLK_DEFINE(t) H5_DLL H5FL_BLK_DEFINE_COMMON(t) -#define H5FL_BLK_EXTERN(t) extern H5_DLL H5FL_BLK_DEFINE_COMMON(t) +#define H5FL_BLK_EXTERN(t) H5_DLLVAR H5FL_BLK_DEFINE_COMMON(t) #define H5FL_BLK_DEFINE_STATIC(t) static H5FL_BLK_DEFINE_COMMON(t) #define H5FL_BLK_MALLOC(t,size) (uint8_t *)H5MM_malloc(size) #define H5FL_BLK_CALLOC(t,size) (uint8_t *)H5MM_calloc(size) @@ -263,7 +263,7 @@ typedef struct H5FL_arr_head_t { #define H5FL_BARR_DEFINE(b,t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(sizeof(b),t,m) /* Reference a free list for arrays of type 't' defined in another file */ -#define H5FL_ARR_EXTERN(t) extern H5_DLL H5FL_arr_head_t H5FL_ARR_NAME(t) +#define H5FL_ARR_EXTERN(t) H5_DLLVAR H5FL_arr_head_t H5FL_ARR_NAME(t) /* Declare a static free list to manage arrays of type 't' */ #define H5FL_ARR_DEFINE_STATIC(t,m) static H5FL_ARR_DEFINE_COMMON(0,t,m) @@ -289,7 +289,7 @@ typedef struct H5FL_arr_head_t { #define H5FL_ARR_DEFINE(t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) = 0 #define H5FL_BARR_DEFINE(b,t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) = sizeof(b) -#define H5FL_ARR_EXTERN(t) extern H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) +#define H5FL_ARR_EXTERN(t) H5_DLLVAR H5FL_ARR_DEFINE_COMMON(t,m) #define H5FL_ARR_DEFINE_STATIC(t,m) static H5FL_ARR_DEFINE_COMMON(t,m) = 0 #define H5FL_BARR_DEFINE_STATIC(b,t,m) static H5FL_ARR_DEFINE_COMMON(t,m) = sizeof(b) #define H5FL_ARR_MALLOC(t,elem) H5MM_malloc(H5FL_ARR_NAME(t) + ((elem)*sizeof(t))) @@ -319,7 +319,7 @@ typedef struct H5FL_seq_head_t { #define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t) /* Reference a free list for sequences of type 't' defined in another file */ -#define H5FL_SEQ_EXTERN(t) extern H5_DLL H5FL_seq_head_t H5FL_SEQ_NAME(t) +#define H5FL_SEQ_EXTERN(t) H5_DLLVAR H5FL_seq_head_t H5FL_SEQ_NAME(t) /* Declare a static free list to manage sequences of type 't' */ #define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t) @@ -341,7 +341,7 @@ typedef struct H5FL_seq_head_t { #define H5FL_SEQ_DEFINE_COMMON(t) int UNUSED H5FL_SEQ_NAME(t) #define H5FL_SEQ_DEFINE(t) H5_DLL H5FL_SEQ_DEFINE_COMMON(t) -#define H5FL_SEQ_EXTERN(t) extern H5_DLL H5FL_SEQ_DEFINE_COMMON(t) +#define H5FL_SEQ_EXTERN(t) H5_DLLVAR H5FL_SEQ_DEFINE_COMMON(t) #define H5FL_SEQ_DEFINE_STATIC(t) static H5FL_SEQ_DEFINE_COMMON(t) #define H5FL_SEQ_MALLOC(t,elem) (t *)H5MM_malloc((elem)*sizeof(t)) #define H5FL_SEQ_CALLOC(t,elem) (t *)H5MM_calloc((elem)*sizeof(t)) diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 908c9a3..b6a3a17 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -727,6 +727,7 @@ H5G_loc_set_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, { H5G_loc_sc_t *udata = (H5G_loc_sc_t *)_udata; /* User data passed in */ H5O_name_t comment; /* Object header "comment" message */ + htri_t exists; /* Whether a "comment" message already exists */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5G_loc_set_comment_cb) @@ -735,9 +736,14 @@ H5G_loc_set_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, if(obj_loc == NULL) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") + /* Check for existing comment message */ + if((exists = H5O_msg_exists(obj_loc->oloc, H5O_NAME_ID, udata->dxpl_id)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read object header") + /* Remove the previous comment message if any */ - if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE, udata->dxpl_id) < 0) - H5E_clear_stack(NULL); + if(exists) + if(H5O_msg_remove(obj_loc->oloc, H5O_NAME_ID, 0, TRUE, udata->dxpl_id) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete existing comment object header message") /* Add the new message */ if(udata->comment && *udata->comment) { @@ -830,7 +836,7 @@ H5G_loc_get_comment_cb(H5G_loc_t UNUSED *grp_loc/*in*/, const char UNUSED *name, } else { if(udata->comment && udata->bufsize) HDstrncpy(udata->comment, comment.s, udata->bufsize); - udata->comment_size = HDstrlen(comment.s); + udata->comment_size = (ssize_t)HDstrlen(comment.s); H5O_msg_reset(H5O_NAME_ID, &comment); } /* end else */ diff --git a/src/H5Gname.c b/src/H5Gname.c index 205f2a2..581b649 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -578,7 +578,6 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char if(full_suffix_len < path_len) { const char *dst_suffix; /* Destination suffix that changes */ const char *src_suffix; /* Source suffix that changes */ - const char *path_prefix; /* Prefix for path */ size_t path_prefix_len; /* Length of path prefix */ const char *path_prefix2; /* 2nd prefix for path */ size_t path_prefix2_len; /* Length of 2nd path prefix */ @@ -589,7 +588,6 @@ H5G_name_move_path(H5RS_str_t **path_r_ptr, const char *full_suffix, const char /* Compute path prefix before full suffix*/ - path_prefix = path; path_prefix_len = path_len - full_suffix_len; /* Determine the common prefix for src & dst paths */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 6b16544..fe381fd 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -815,7 +815,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, /* Get a pointer to the name of the link */ if(NULL == (lnk.name = (char *)H5HL_offset_into(f, udata->common.heap, sn->entry[idx].name_off))) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get link name") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get link name") /* Set up rest of link structure */ lnk.corder_valid = FALSE; @@ -833,7 +833,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, /* Replace any object names */ if(H5G_link_name_replace(f, dxpl_id, udata->grp_full_path_r, &lnk) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get object type") + HGOTO_ERROR(H5E_SYM, H5E_CANTGET, H5B_INS_ERROR, "unable to get object type") /* Decrement the ref. count for hard links */ if(lnk.type == H5L_TYPE_HARD) { diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index eabb740..b750822 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -59,15 +59,6 @@ /* Local Prototypes */ /********************/ -/* v2 B-tree function callbacks */ -herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data); - /* v2 B-tree driver callbacks */ static herr_t H5HF_huge_btree2_indir_store(void *native, const void *udata); static herr_t H5HF_huge_btree2_indir_retrieve(void *udata, const void *native); diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index db9f7a1..60c6c9f 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -69,13 +69,13 @@ static herr_t H5HF_huge_bt2_create(H5HF_hdr_t *hdr, hid_t dxpl_id); /* v2 B-tree function callbacks (in H5HFbtree2.c) */ -herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data); -herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data); +H5_DLL herr_t H5HF_huge_bt2_indir_found(const void *nrecord, void *op_data); +H5_DLL herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *op_data); +H5_DLL herr_t H5HF_huge_bt2_filt_indir_found(const void *nrecord, void *op_data); +H5_DLL herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *op_data); +H5_DLL herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *op_data); +H5_DLL herr_t H5HF_huge_bt2_filt_dir_found(const void *nrecord, void *op_data); +H5_DLL herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *op_data); /* Local 'huge' object support routines */ static hsize_t H5HF_huge_new_id(H5HF_hdr_t *hdr); diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 81b353f..91031be 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -3105,7 +3105,6 @@ H5HF_sect_indirect_reduce_row(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_ unsigned start_col; /* Start column in indirect block */ unsigned end_entry; /* Entry for last block covered */ unsigned end_row; /* End row in indirect block */ - unsigned end_col; /* End column in indirect block */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce_row) @@ -3132,7 +3131,6 @@ HDfprintf(stderr, "%s: row_start_entry = %u, row_end_entry = %u\n", FUNC, row_st start_entry = (start_row * hdr->man_dtable.cparam.width) + start_col; end_entry = (start_entry + sect->u.indirect.num_entries) - 1; end_row = end_entry / hdr->man_dtable.cparam.width; - end_col = end_entry % hdr->man_dtable.cparam.width; /* Additional sanity check */ HDassert(sect->u.indirect.span_size > 0); @@ -3144,7 +3142,7 @@ HDfprintf(stderr, "%s: row_start_entry = %u, row_end_entry = %u\n", FUNC, row_st HDfprintf(stderr, "%s: sect->sect_info = {%a, %Hu, %u, %s}\n", FUNC, sect->sect_info.addr, sect->sect_info.size, sect->sect_info.type, (sect->sect_info.state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); HDfprintf(stderr, "%s: sect->u.indirect.parent = %p, sect->u.indirect.par_entry = %u\n", FUNC, sect->u.indirect.parent, sect->u.indirect.par_entry); HDfprintf(stderr, "%s: start_entry = %u, start_row = %u, start_col = %u\n", FUNC, start_entry, start_row, start_col); -HDfprintf(stderr, "%s: end_entry = %u, end_row = %u, end_col = %u\n", FUNC, end_entry, end_row, end_col); +HDfprintf(stderr, "%s: end_entry = %u, end_row = %u\n", FUNC, end_entry, end_row); #endif /* QAK */ /* Check if we should allocate from end of indirect section */ @@ -3400,7 +3398,6 @@ H5HF_sect_indirect_reduce(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *s unsigned start_col; /* Start column in indirect block */ unsigned end_entry; /* Entry for last block covered */ unsigned end_row; /* End row in indirect block */ - unsigned end_col; /* End column in indirect block */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5HF_sect_indirect_reduce) @@ -3422,12 +3419,11 @@ HDfprintf(stderr, "%s: child_entry = %u\n", FUNC, child_entry); start_entry = (start_row * hdr->man_dtable.cparam.width) + start_col; end_entry = (start_entry + sect->u.indirect.num_entries) - 1; end_row = end_entry / hdr->man_dtable.cparam.width; - end_col = end_entry % hdr->man_dtable.cparam.width; #ifdef QAK HDfprintf(stderr, "%s: sect->sect_info = {%a, %Hu, %u, %s}\n", FUNC, sect->sect_info.addr, sect->sect_info.size, sect->sect_info.type, (sect->sect_info.state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); HDfprintf(stderr, "%s: sect->u.indirect.parent = %p, sect->u.indirect.par_entry = %u\n", FUNC, sect->u.indirect.parent, sect->u.indirect.par_entry); HDfprintf(stderr, "%s: start_entry = %u, start_row = %u, start_col = %u\n", FUNC, start_entry, start_row, start_col); -HDfprintf(stderr, "%s: end_entry = %u, end_row = %u, end_col = %u\n", FUNC, end_entry, end_row, end_col); +HDfprintf(stderr, "%s: end_entry = %u, end_row = %u\n", FUNC, end_entry, end_row); #endif /* QAK */ /* Check how to adjust section for allocated entry */ @@ -3780,9 +3776,7 @@ H5HF_sect_indirect_merge_row(H5HF_hdr_t *hdr, hid_t dxpl_id, unsigned start_row1, start_col1; /* Starting row & column for section #1 */ unsigned end_entry1; /* End entry for section #1 */ unsigned end_row1; /* Ending row for section #1 */ - unsigned start_entry2; /* Start entry for section #2 */ - unsigned start_row2, start_col2; /* Starting row & column for section #2 */ - unsigned end_entry2; /* End entry for section #2 */ + unsigned start_row2; /* Starting row for section #2 */ hbool_t merged_rows; /* Flag to indicate that rows was merged together */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3831,12 +3825,9 @@ HDfprintf(stderr, "%s: sect1->u.indirect.num_entries = %u\n", FUNC, sect1->u.ind HDfprintf(stderr, "%s: end_row1 = %u, end_entry1 = %u\n", FUNC, end_row1, end_entry1); #endif /* QAK */ start_row2 = sect2->u.indirect.row; - start_col2 = sect2->u.indirect.col; - start_entry2 = (start_row2 * hdr->man_dtable.cparam.width) + start_col2; - end_entry2 = (start_entry2 + sect2->u.indirect.num_entries) - 1; #ifdef QAK HDfprintf(stderr, "%s: sect2->u.indirect.dir_nrows = %u\n", FUNC, sect2->u.indirect.dir_nrows); -HDfprintf(stderr, "%s: start_row2 = %u, start_col2 = %u, start_entry2 = %u\n", FUNC, start_row2, start_col2, start_entry2); +HDfprintf(stderr, "%s: start_row2 = %u\n", FUNC, start_row2); HDfprintf(stderr, "%s: sect2->u.indirect.num_entries = %u\n", FUNC, sect2->u.indirect.num_entries); #endif /* QAK */ diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c index 43c1ed0..7030da5 100644 --- a/src/H5HGdbg.c +++ b/src/H5HGdbg.c @@ -113,7 +113,7 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, (unsigned long)H5HG_ALIGN(h->obj[u].size)); p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR (f); for (j=0; jobj[u].size; j+=16) { - fprintf (stream, "%*s%04d: ", indent+6, "", j); + fprintf (stream, "%*s%04u: ", indent+6, "", j); for (k=0; k<16; k++) { if (8==k) fprintf (stream, " "); if (j+kobj[u].size) { diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 667f28c..e61d899 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -403,7 +403,7 @@ H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, */ static void * H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id) + hbool_t *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; @@ -467,7 +467,7 @@ static herr_t H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) { - H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src; + const H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_ainfo_post_copy_file) diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 24e443c..60f77d9 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -1580,11 +1580,11 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, "Version:", dt->shared->version); if (H5T_COMPOUND == dt->shared->type) { - fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, + fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of members:", dt->shared->u.compnd.nmembs); for(i = 0; i < dt->shared->u.compnd.nmembs; i++) { - sprintf(buf, "Member %d:", i); + sprintf(buf, "Member %u:", i); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, buf, dt->shared->u.compnd.memb[i].name); @@ -1597,11 +1597,11 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, } else if(H5T_ENUM == dt->shared->type) { fprintf(stream, "%*s%s\n", indent, "", "Base type:"); H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3)); - fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, + fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of members:", dt->shared->u.enumer.nmembs); for(i = 0; i < dt->shared->u.enumer.nmembs; i++) { - sprintf(buf, "Member %d:", i); + sprintf(buf, "Member %u:", i); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, buf, dt->shared->u.enumer.name[i]); @@ -1678,7 +1678,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, s = "disk"; break; default: - sprintf(buf, "H5T_LOC_%d", dt->shared->u.vlen.loc); + sprintf(buf, "H5T_LOC_%d", (int)dt->shared->u.vlen.loc); s = buf; break; } /* end switch */ @@ -1723,7 +1723,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, s); } /* end if */ } else if(H5T_ARRAY == dt->shared->type) { - fprintf(stream, "%*s%-*s %d\n", indent, "", fwidth, + fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Rank:", dt->shared->u.array.ndims); fprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:"); diff --git a/src/H5RC.c b/src/H5RC.c index 49e26a8..d9f62c3 100644 --- a/src/H5RC.c +++ b/src/H5RC.c @@ -55,25 +55,25 @@ H5FL_DEFINE_STATIC(H5RC_t); H5RC_t * H5RC_create(void *o, H5RC_free_func_t free_func) { - H5RC_t *ret_value=NULL; /* Return value */ + H5RC_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RC_create,NULL); + FUNC_ENTER_NOAPI(H5RC_create, NULL) /* Sanity check */ HDassert(o); HDassert(free_func); /* Allocate ref-counted string structure */ - if((ret_value=H5FL_MALLOC(H5RC_t))==NULL) - HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5RC_t))) + HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed") /* Set the internal fields */ - ret_value->o=o; - ret_value->n=1; - ret_value->free_func=free_func; + ret_value->o = o; + ret_value->n = 1; + ret_value->free_func = free_func; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RC_create() */ diff --git a/src/H5RS.c b/src/H5RS.c index 0142c1f..6456ac8 100644 --- a/src/H5RS.c +++ b/src/H5RS.c @@ -63,7 +63,7 @@ H5RS_xstrdup(const char *s) { char *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5RS_xstrdup) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_xstrdup) if(s) { ret_value = (char *)H5FL_BLK_MALLOC(str_buf, HDstrlen(s) + 1); @@ -99,21 +99,21 @@ H5RS_xstrdup(const char *s) H5RS_str_t * H5RS_create(const char *s) { - H5RS_str_t *ret_value=NULL; /* Return value */ + H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_create,NULL); + FUNC_ENTER_NOAPI(H5RS_create, NULL) /* Allocate ref-counted string structure */ - if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL) - HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s=H5RS_xstrdup(s); - ret_value->wrapped=0; - ret_value->n=1; + ret_value->s = H5RS_xstrdup(s); + ret_value->wrapped = 0; + ret_value->n = 1; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_create() */ @@ -139,21 +139,21 @@ done: H5RS_str_t * H5RS_wrap(const char *s) { - H5RS_str_t *ret_value=NULL; /* Return value */ + H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_wrap,NULL); + FUNC_ENTER_NOAPI(H5RS_wrap, NULL) /* Allocate ref-counted string structure */ - if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL) - HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s=(char*)s; /* (Cast away const OK - QAK) */ - ret_value->wrapped=1; - ret_value->n=1; + ret_value->s = (char*)s; /* (Cast away const OK - QAK) */ + ret_value->wrapped = 1; + ret_value->n = 1; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_wrap() */ @@ -181,21 +181,21 @@ done: H5RS_str_t * H5RS_own(char *s) { - H5RS_str_t *ret_value=NULL; /* Return value */ + H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_own,NULL); + FUNC_ENTER_NOAPI(H5RS_own, NULL) /* Allocate ref-counted string structure */ - if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL) - HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s=s; - ret_value->wrapped=0; - ret_value->n=1; + ret_value->s = s; + ret_value->wrapped = 0; + ret_value->n = 1; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_own() */ @@ -259,25 +259,25 @@ H5RS_decr(H5RS_str_t *rs) herr_t H5RS_incr(H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr) /* Sanity check */ - assert(rs); - assert(rs->n > 0); + HDassert(rs); + HDassert(rs->n > 0); /* If the ref-counted string started life as a wrapper around an existing * string, duplicate the string now, so that the wrapped string can go out * scope appropriately. */ if(rs->wrapped) { - rs->s=H5RS_xstrdup(rs->s); - rs->wrapped=0; + rs->s = H5RS_xstrdup(rs->s); + rs->wrapped = 0; } /* end if */ /* Increment reference count for string */ rs->n++; - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5RS_incr() */ @@ -303,14 +303,14 @@ H5RS_incr(H5RS_str_t *rs) H5RS_str_t * H5RS_dup(H5RS_str_t *ret_value) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup) /* Check for valid reference counted string */ - if(ret_value!=NULL) + if(ret_value != NULL) /* Increment reference count for string */ ret_value->n++; - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_dup() */ @@ -335,7 +335,7 @@ H5RS_dup(H5RS_str_t *ret_value) H5RS_str_t * H5RS_dup_str(const char *s) { - char *new_str = NULL; /* Duplicate of string */ + char *new_str; /* Duplicate of string */ size_t path_len; /* Length of the path */ H5RS_str_t *ret_value; @@ -387,15 +387,15 @@ int H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) { /* Can't return invalid value from this function */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_cmp); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_cmp) /* Sanity check */ - assert(rs1); - assert(rs1->s); - assert(rs2); - assert(rs2->s); + HDassert(rs1); + HDassert(rs1->s); + HDassert(rs2); + HDassert(rs2->s); - FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s,rs2->s)); + FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s, rs2->s)) } /* end H5RS_cmp() */ @@ -420,13 +420,13 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) ssize_t H5RS_len(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_len); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_len) /* Sanity check */ - assert(rs); - assert(rs->s); + HDassert(rs); + HDassert(rs->s); - FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s)); + FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s)) } /* end H5RS_len() */ @@ -454,13 +454,13 @@ H5RS_len(const H5RS_str_t *rs) char * H5RS_get_str(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str) /* Sanity check */ - assert(rs); - assert(rs->s); + HDassert(rs); + HDassert(rs->s); - FUNC_LEAVE_NOAPI(rs->s); + FUNC_LEAVE_NOAPI(rs->s) } /* end H5RS_get_str() */ @@ -486,12 +486,12 @@ H5RS_get_str(const H5RS_str_t *rs) unsigned H5RS_get_count(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count) /* Sanity check */ - assert(rs); - assert(rs->n>0); + HDassert(rs); + HDassert(rs->n > 0); - FUNC_LEAVE_NOAPI(rs->n); + FUNC_LEAVE_NOAPI(rs->n) } /* end H5RS_get_count() */ diff --git a/src/H5ST.c b/src/H5ST.c index 7dee73f..6d14115 100644 --- a/src/H5ST.c +++ b/src/H5ST.c @@ -50,19 +50,19 @@ H5FL_DEFINE_STATIC(H5ST_tree_t); H5ST_tree_t * H5ST_create(void) { - H5ST_tree_t *ret_value=NULL; /* Return value */ + H5ST_tree_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_create,NULL); + FUNC_ENTER_NOAPI(H5ST_create, NULL) /* Allocate wrapper for TST */ - if((ret_value=H5FL_MALLOC(H5ST_tree_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5ST_tree_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->root=NULL; + ret_value->root = NULL; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_create() */ @@ -178,16 +178,16 @@ H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj) p = &tree->root; while((pp = *p)) { /* If this node matches the character in the key, then drop down to the lower tree */ - if ((d = *s - pp->splitchar) == 0) { - if (*s++ == 0) - HGOTO_ERROR(H5E_TST,H5E_EXISTS,FAIL,"key already in tree"); + if(0 == (d = *s - pp->splitchar)) { + if(*s++ == 0) + HGOTO_ERROR(H5E_TST, H5E_EXISTS, FAIL, "key already in tree") up=pp; p = &(pp->eqkid); } /* end if */ else { /* Walk through the current tree, searching for the matching character */ - parent=pp; - if (d < 0) + parent = pp; + if(d < 0) p = &(pp->lokid); else p = &(pp->hikid); @@ -196,8 +196,8 @@ H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj) /* Finish walking through the key string, adding nodes until the end */ for (;;) { - if((*p = H5FL_MALLOC(H5ST_node_t))==NULL) - HGOTO_ERROR(H5E_RESOURCE,H5E_NOSPACE,FAIL,"memory allocation failed"); + if(NULL == (*p = H5FL_MALLOC(H5ST_node_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") pp = *p; pp->splitchar = *s; pp->up = up; @@ -205,19 +205,19 @@ H5ST_insert(H5ST_tree_t *tree, const char *s, void *obj) pp->lokid = pp->eqkid = pp->hikid = NULL; /* If this is the end of the key string, break out */ - if (*s++ == 0) { - pp->eqkid = (H5ST_ptr_t) obj; + if(*s++ == 0) { + pp->eqkid = (H5ST_ptr_t)obj; break; } /* end if */ /* Continue to next character */ - parent=NULL; - up=pp; + parent = NULL; + up = pp; p = &(pp->eqkid); } /* end for */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_insert() */ @@ -247,7 +247,7 @@ H5ST_search(H5ST_tree_t *tree, const char *s) H5ST_ptr_t p; /* Temporary pointer to TST node */ htri_t ret_value=FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5ST_search); + FUNC_ENTER_NOAPI_NOFUNC(H5ST_search) p = tree->root; while (p) { @@ -262,7 +262,7 @@ H5ST_search(H5ST_tree_t *tree, const char *s) } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_search() */ @@ -289,9 +289,9 @@ done: static H5ST_ptr_t H5ST_find_internal(H5ST_ptr_t p, const char *s) { - H5ST_ptr_t ret_value=NULL; /* Return value */ + H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_find_internal); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_find_internal) while (p) { if (*s < p->splitchar) @@ -305,7 +305,7 @@ H5ST_find_internal(H5ST_ptr_t p, const char *s) } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_find_internal() */ @@ -332,15 +332,15 @@ done: H5ST_ptr_t H5ST_find(H5ST_tree_t *tree, const char *s) { - H5ST_ptr_t ret_value=NULL; /* Return value */ + H5ST_ptr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_find,NULL); + FUNC_ENTER_NOAPI(H5ST_find, NULL) - if((ret_value=H5ST_find_internal(tree->root,s))==NULL) - HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"key not found in TST"); + if(NULL == (ret_value = H5ST_find_internal(tree->root, s))) + HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_find() */ @@ -369,17 +369,17 @@ H5ST_locate(H5ST_tree_t *tree, const char *s) H5ST_ptr_t node; /* Pointer to node located */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_locate,NULL); + FUNC_ENTER_NOAPI(H5ST_locate, NULL) /* Locate the node to remove */ - if((node=H5ST_find_internal(tree->root,s))==NULL) - HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"key not found in TST"); + if(NULL == (node = H5ST_find_internal(tree->root, s))) + HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") /* Get the pointer to the object to return */ - ret_value=node->eqkid; + ret_value = node->eqkid; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5ST_locate() */ @@ -404,28 +404,28 @@ done: static H5ST_ptr_t H5ST_findfirst_internal(H5ST_ptr_t p) { - H5ST_ptr_t ret_value=NULL; /* Return value */ + H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_findfirst_internal); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_findfirst_internal) while(p) { /* Find least node in current tree */ while(p->lokid) - p=p->lokid; + p = p->lokid; /* Is least node '\0'? */ - if(p->splitchar=='\0') { + if(p->splitchar == '\0') { /* Return it */ HGOTO_DONE(p); } /* end if */ else { /* Go down to next level of tree */ - p=p->eqkid; + p = p->eqkid; } /* end else */ } /* end while */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_findfirst_internal() */ @@ -452,13 +452,13 @@ H5ST_findfirst(H5ST_tree_t *tree) { H5ST_ptr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_findfirst,NULL); + FUNC_ENTER_NOAPI(H5ST_findfirst, NULL) - if((ret_value=H5ST_findfirst_internal(tree->root))==NULL) + if(NULL == (ret_value = H5ST_findfirst_internal(tree->root))) HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"no nodes in TST"); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_findfirst() */ @@ -483,40 +483,40 @@ done: static H5ST_ptr_t H5ST_getnext(H5ST_ptr_t p) { - H5ST_ptr_t ret_value=NULL; /* Return value */ + H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_getnext); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_getnext) /* If the node to continue from has higher-valued nodes attached */ if(p->hikid) { /* Go to first higher-valued node */ - p=p->hikid; + p = p->hikid; /* Find least node from here */ while(p->lokid) - p=p->lokid; + p = p->lokid; HGOTO_DONE(p); } /* end if */ else { H5ST_ptr_t q; /* Temporary TST node pointer */ /* Go up one level in current tree */ - q=p->parent; - if(q==NULL) + q = p->parent; + if(q == NULL) HGOTO_DONE(NULL); /* While the previous node was the higher-valued node, keep backing up the tree */ - while(q->hikid==p) { - p=q; - q=p->parent; - if(q==NULL) + while(q->hikid == p) { + p = q; + q = p->parent; + if(NULL == q) HGOTO_DONE(NULL); } /* end while */ HGOTO_DONE(q); } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_getnext() */ @@ -542,22 +542,22 @@ H5ST_ptr_t H5ST_findnext(H5ST_ptr_t p) { H5ST_ptr_t q; /* Temporary pointer to TST node */ - H5ST_ptr_t ret_value=NULL; /* Return value */ + H5ST_ptr_t ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOFUNC(H5ST_findnext); + FUNC_ENTER_NOAPI_NOFUNC(H5ST_findnext) /* Find the next node at the current level, or go back up the tree */ do { - q=H5ST_getnext(p); + q = H5ST_getnext(p); if(q) { HGOTO_DONE(H5ST_findfirst_internal(q->eqkid)); } /* end if */ else - p=p->up; + p = p->up; } while(p); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_findnext() */ @@ -661,15 +661,15 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) herr_t H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_delete,FAIL); + FUNC_ENTER_NOAPI(H5ST_delete, FAIL) - if(H5ST_delete_internal(&tree->root,p)<0) - HGOTO_ERROR(H5E_TST,H5E_CANTDELETE,FAIL,"can't delete node from TST"); + if(H5ST_delete_internal(&tree->root, p) < 0) + HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, FAIL, "can't delete node from TST") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5ST_delete() */ @@ -698,21 +698,21 @@ H5ST_remove(H5ST_tree_t *tree, const char *s) H5ST_ptr_t node; /* Pointer to node to remove */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5ST_remove,NULL); + FUNC_ENTER_NOAPI(H5ST_remove, NULL) /* Locate the node to remove */ - if((node=H5ST_find_internal(tree->root,s))==NULL) - HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"key not found in TST"); + if(NULL == (node = H5ST_find_internal(tree->root, s))) + HGOTO_ERROR(H5E_TST, H5E_NOTFOUND, NULL, "key not found in TST") /* Get the pointer to the object to return */ - ret_value=node->eqkid; + ret_value = node->eqkid; /* Remove the node from the TST */ - if(H5ST_delete_internal(&tree->root,node)<0) - HGOTO_ERROR(H5E_TST,H5E_CANTDELETE,NULL,"can't delete node from TST"); + if(H5ST_delete_internal(&tree->root, node) < 0) + HGOTO_ERROR(H5E_TST, H5E_CANTDELETE, NULL, "can't delete node from TST") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5ST_remove() */ #ifdef H5ST_DEBUG @@ -738,26 +738,26 @@ done: herr_t H5ST_dump_internal(H5ST_ptr_t p) { - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_dump_internal); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_dump_internal) - if (p) { - printf("p=%p\n",p); - printf("\tp->up=%p\n",p->up); - printf("\tp->parent=%p\n",p->parent); - printf("\tp->lokid=%p\n",p->lokid); - printf("\tp->hikid=%p\n",p->hikid); - printf("\tp->eqkid=%p\n",p->eqkid); - printf("\tp->splitchar=%c\n",p->splitchar); + if(p) { + printf("p=%p\n", p); + printf("\tp->up=%p\n", p->up); + printf("\tp->parent=%p\n", p->parent); + printf("\tp->lokid=%p\n", p->lokid); + printf("\tp->hikid=%p\n", p->hikid); + printf("\tp->eqkid=%p\n", p->eqkid); + printf("\tp->splitchar=%c\n", p->splitchar); H5ST_dump_internal(p->lokid); - if (p->splitchar) + if(p->splitchar) H5ST_dump_internal(p->eqkid); else - printf("%s\n", (char *) p->eqkid); + printf("%s\n", (char *)p->eqkid); H5ST_dump_internal(p->hikid); } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5ST_dump_internal() */ @@ -782,11 +782,12 @@ H5ST_dump_internal(H5ST_ptr_t p) herr_t H5ST_dump(H5ST_tree_t *tree) { - FUNC_ENTER_NOAPI_NOFUNC(H5ST_dump,NULL); + FUNC_ENTER_NOAPI_NOFUNC(H5ST_dump, NULL) /* Dump the tree */ H5ST_dump_internal(tree->root); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5ST_dump() */ #endif /* H5ST_DEBUG */ + diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 1f69706..72d61e6 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -107,17 +107,17 @@ H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, hsize_t nelmts; /*total number of elmts */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_all_type); + FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_all_type) /* Check args */ - assert (space); + HDassert(space); /* Just treat the entire extent as a block of bytes */ - if((snelmts = H5S_GET_EXTENT_NPOINTS(space))<0) - HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") - H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); + if((snelmts = H5S_GET_EXTENT_NPOINTS(space)) < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") + H5_ASSIGN_OVERFLOW(nelmts, snelmts, hssize_t, hsize_t); - total_bytes = (hsize_t)elmt_size*nelmts; + total_bytes = (hsize_t)elmt_size * nelmts; /* fill in the return values */ *new_type = MPI_BYTE; @@ -126,7 +126,7 @@ H5S_mpio_all_type( const H5S_t *space, size_t elmt_size, *is_derived_type = FALSE; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_mpio_all_type() */ @@ -210,7 +210,7 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, hbool_t *is_derived_type ) { H5S_sel_iter_t sel_iter; /* Selection iteration info */ - hbool_t sel_iter_init=0; /* Selection iteration info has been initialized */ + hbool_t sel_iter_init = FALSE; /* Selection iteration info has been initialized */ struct dim { /* less hassle than malloc/free & ilk */ hssize_t start; @@ -234,27 +234,27 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_hyper_type); /* Check args */ - assert (space); - assert(sizeof(MPI_Aint) >= sizeof(elmt_size)); - if (0==elmt_size) + HDassert(space); + HDassert(sizeof(MPI_Aint) >= sizeof(elmt_size)); + if(0 == elmt_size) goto empty; /* Initialize selection iterator */ - if (H5S_select_iter_init(&sel_iter, space, elmt_size)<0) - HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); - sel_iter_init=1; /* Selection iteration info has been initialized */ + if(H5S_select_iter_init(&sel_iter, space, elmt_size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") + sel_iter_init = 1; /* Selection iteration info has been initialized */ /* Abbreviate args */ - diminfo=sel_iter.u.hyp.diminfo; - assert (diminfo); + diminfo = sel_iter.u.hyp.diminfo; + HDassert(diminfo); /* make a local copy of the dimension info so we can operate with them */ /* Check if this is a "flattened" regular hyperslab selection */ if(sel_iter.u.hyp.iter_rank!=0 && sel_iter.u.hyp.iter_rankextent.rank) { /* Flattened selection */ - rank=sel_iter.u.hyp.iter_rank; - assert (rank >= 0 && rank<=H5S_MAX_RANK); /* within array bounds */ + rank = sel_iter.u.hyp.iter_rank; + HDassert(rank >= 0 && rank <= H5S_MAX_RANK); /* within array bounds */ if (0==rank) goto empty; #ifdef H5S_DEBUG @@ -288,7 +288,7 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size, else { /* Non-flattened selection */ rank = space->extent.rank; - assert (rank >= 0 && rank<=H5S_MAX_RANK); /* within array bounds */ + HDassert(rank >= 0 && rank<=H5S_MAX_RANK); /* within array bounds */ if (0==rank) goto empty; #ifdef H5S_DEBUG @@ -509,47 +509,39 @@ H5S_mpio_span_hyper_type( const H5S_t *space, MPI_Datatype *new_type,/* out: */ size_t *count, hsize_t *extra_offset, - hbool_t *is_derived_type ){ - - MPI_Datatype span_type; - H5S_hyper_span_t *ospan; - H5S_hyper_span_info_t *odown; - hsize_t *size; - int rank; - int mpi_code; - herr_t ret_value = SUCCEED; - MPI_Aint extent,lb; - - - FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_span_hyper_type); - - /* Check args */ - assert (space); + hbool_t *is_derived_type ) +{ - /* assert(sizeof(MPI_Aint) >= sizeof(elmt_size)); not sure the reason*/ + MPI_Datatype span_type; + H5S_hyper_span_t *ospan; + H5S_hyper_span_info_t *odown; + hsize_t *size; + int mpi_code; + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_span_hyper_type) - rank = space->extent.rank; + /* Check args */ + HDassert(space); - /* size = HDcalloc((size_t)rank,sizeof(hsize_t)); */ - if (0==elmt_size) + if(0 == elmt_size) goto empty; size = space->extent.size; - if(size == 0) + if(0 == size) goto empty; odown = space->select.sel_info.hslab->span_lst; - if(odown == NULL) - goto empty; + if(NULL == odown) + goto empty; ospan = odown->head; - if(ospan == NULL) - goto empty; + if(NULL == ospan) + goto empty; /* obtain derived data type */ - if(FAIL == H5S_obtain_datatype(space->extent.size,ospan,&span_type,elmt_size,rank)) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type"); + if(FAIL == H5S_obtain_datatype(space->extent.size, ospan, &span_type, elmt_size, space->extent.rank)) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type") - if (MPI_SUCCESS != (mpi_code = MPI_Type_commit(&span_type))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&span_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); *new_type = span_type; @@ -558,7 +550,7 @@ H5S_mpio_span_hyper_type( const H5S_t *space, *extra_offset = 0; *is_derived_type = TRUE; - HGOTO_DONE(SUCCEED); + HGOTO_DONE(SUCCEED) empty: /* special case: empty hyperslab */ @@ -568,8 +560,8 @@ empty: *is_derived_type = FALSE; done: - FUNC_LEAVE_NOAPI(ret_value); - } + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5S_mpio_span_hyper_type() */ /*------------------------------------------------------------------------- @@ -585,173 +577,162 @@ done: * Programmer: kyang * */ -static herr_t H5S_obtain_datatype(const hsize_t size[], +static herr_t +H5S_obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span, MPI_Datatype *span_type, size_t elmt_size, int dimindex) { - - int innercount,outercount; - MPI_Datatype bas_type; - MPI_Datatype temp_type; - MPI_Datatype tempinner_type; - MPI_Datatype *inner_type; - int *blocklen; - MPI_Aint *disp; - MPI_Aint stride; - MPI_Aint extent,lb; - H5S_hyper_span_info_t *down; - H5S_hyper_span_t *tspan; - int mpi_code; - herr_t ret_value = SUCCEED; - + int innercount, outercount; + MPI_Datatype bas_type; + MPI_Datatype temp_type; + MPI_Datatype tempinner_type; + MPI_Datatype *inner_type; + int *blocklen; + MPI_Aint *disp; + MPI_Aint stride; + H5S_hyper_span_info_t *down; + H5S_hyper_span_t *tspan; #ifdef H5_HAVE_MPI2 - MPI_Aint sizeaint,sizedtype; + MPI_Aint sizeaint, sizedtype; #endif /* H5_HAVE_MPI2 */ - hsize_t total_lowd,total_lowd1; - int i; - int ret; - - FUNC_ENTER_NOAPI_NOINIT(H5S_obtain_datatype); - assert(span); - - inner_type = NULL; - down = NULL; - tspan = NULL; - down = span->down; - tspan = span; - - outercount = 0; - -/* obtain the number of span tree for this dimension */ - while(tspan) { - tspan = tspan->next; - outercount ++; - } - - if(outercount == 0) { - span_type = NULL; - return 0; - } + hsize_t total_lowd, total_lowd1; + int i; + int mpi_code; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT(H5S_obtain_datatype) + + HDassert(span); + + inner_type = NULL; + down = NULL; + tspan = NULL; + down = span->down; + tspan = span; + + /* obtain the number of span tree for this dimension */ + outercount = 0; + while(tspan) { + tspan = tspan->next; + outercount++; + } /* end while */ + if(outercount == 0) + HGOTO_DONE(SUCCEED) /* MPI2 hasn't been widely acccepted, adding H5_HAVE_MPI2 for the future use */ #ifdef H5_HAVE_MPI2 - MPI_Type_extent(MPI_Aint,&sizeaint); - MPI_Type_extent(MPI_Datatype,&sizedtype); + MPI_Type_extent(MPI_Aint, &sizeaint); + MPI_Type_extent(MPI_Datatype, &sizedtype); - blocklen = (int *)HDcalloc((size_t)outercount,sizeof(int)); - disp = (MPI_Aint *)HDcalloc((size_t)outercount,sizeaint); - inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount,sizedtype); + blocklen = (int *)HDcalloc((size_t)outercount, sizeof(int)); + disp = (MPI_Aint *)HDcalloc((size_t)outercount, sizeaint); + inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount, sizedtype); #else - blocklen = (int *)HDcalloc((size_t)outercount,sizeof(int)); - disp = (MPI_Aint *)HDcalloc((size_t)outercount,sizeof(MPI_Aint)); - inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount,sizeof(MPI_Datatype)); + blocklen = (int *)HDcalloc((size_t)outercount, sizeof(int)); + disp = (MPI_Aint *)HDcalloc((size_t)outercount, sizeof(MPI_Aint)); + inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount, sizeof(MPI_Datatype)); #endif - tspan = span; - outercount = 0; + tspan = span; + outercount = 0; - /* if this is the fastest changing dimension, it is the base case for derived datatype. */ - if(down == NULL){ + /* if this is the fastest changing dimension, it is the base case for derived datatype. */ + if(down == NULL){ - assert(dimindex <= 1); - if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE,&bas_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code); + HDassert(dimindex <= 1); - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&bas_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE,&bas_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code); - while(tspan){ + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&bas_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - disp[outercount] = (MPI_Aint)elmt_size * tspan->low; - blocklen[outercount] = tspan->nelem; - tspan = tspan->next; - outercount ++; - } + while(tspan) { + disp[outercount] = (MPI_Aint)elmt_size * tspan->low; + blocklen[outercount] = tspan->nelem; + tspan = tspan->next; + outercount++; + } /* end while */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_hindexed(outercount,blocklen, - disp,bas_type,span_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_hindexed failed", mpi_code); + if(MPI_SUCCESS != (mpi_code = MPI_Type_hindexed(outercount, blocklen, disp, bas_type, span_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_hindexed failed", mpi_code); + } /* end if */ + else {/* dimindex is the rank of the dimension */ - } - else {/* dimindex is the rank of the dimension */ + HDassert(dimindex > 1); - assert(dimindex >1); - /* Calculate the total bytes of the lower dimension */ - total_lowd = 1; /* one dimension down */ - total_lowd1 = 1; /* two dimensions down */ + /* Calculate the total bytes of the lower dimension */ + total_lowd = 1; /* one dimension down */ + total_lowd1 = 1; /* two dimensions down */ - for ( i = dimindex-1; i > 0; i--) - total_lowd = total_lowd * size[i]; + for ( i = dimindex-1; i > 0; i--) + total_lowd = total_lowd * size[i]; - for ( i = dimindex-1; i > 1; i--) - total_lowd1 = total_lowd1 * size[i]; + for ( i = dimindex-1; i > 1; i--) + total_lowd1 = total_lowd1 * size[i]; - while(tspan){ + while(tspan) { - /* Displacement should be in byte and should have dimension information */ - /* First using MPI Type vector to build derived data type for this span only */ - /* Need to calculate the disp in byte for this dimension. */ - /* Calculate the total bytes of the lower dimension */ + /* Displacement should be in byte and should have dimension information */ + /* First using MPI Type vector to build derived data type for this span only */ + /* Need to calculate the disp in byte for this dimension. */ + /* Calculate the total bytes of the lower dimension */ - disp[outercount] = tspan->low*total_lowd*elmt_size; - blocklen[outercount] = 1; + disp[outercount] = tspan->low*total_lowd*elmt_size; + blocklen[outercount] = 1; - /* generating inner derived datatype by using MPI_Type_hvector */ - if(FAIL == H5S_obtain_datatype(size,tspan->down->head,&temp_type,elmt_size,dimindex-1)) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type"); + /* generating inner derived datatype by using MPI_Type_hvector */ + if(FAIL == H5S_obtain_datatype(size,tspan->down->head,&temp_type,elmt_size,dimindex-1)) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't obtain MPI derived data type") - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&temp_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&temp_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - /* building the inner vector datatype */ - stride = total_lowd*elmt_size; - innercount = tspan->nelem; + /* building the inner vector datatype */ + stride = total_lowd*elmt_size; + innercount = tspan->nelem; - if(MPI_SUCCESS != (mpi_code = MPI_Type_hvector(innercount,1,stride,temp_type,&tempinner_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_hvector failed", mpi_code); + if(MPI_SUCCESS != (mpi_code = MPI_Type_hvector(innercount,1,stride,temp_type,&tempinner_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_hvector failed", mpi_code); - if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&tempinner_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&tempinner_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code); - if(MPI_SUCCESS != (mpi_code =MPI_Type_free(&temp_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed",mpi_code); - inner_type[outercount] = tempinner_type; - outercount ++; - tspan = tspan->next; + if(MPI_SUCCESS != (mpi_code = MPI_Type_free(&temp_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_free failed", mpi_code); - } + inner_type[outercount] = tempinner_type; + outercount ++; + tspan = tspan->next; + } /* end while */ - /* building the whole vector datatype */ - if(MPI_SUCCESS != (mpi_code = - MPI_Type_struct(outercount,blocklen,disp,inner_type,span_type))) - HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code); - - } + /* building the whole vector datatype */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_struct(outercount, blocklen, disp, inner_type, span_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_struct failed", mpi_code); + } /* end else */ - if(inner_type != NULL){ - if(down != NULL) { - for(i=0;iid>=0 && cls->id<=H5Z_FILTER_MAX); + HDassert(cls); + HDassert(cls->id >= 0 && cls->id <= H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (i=0; iid) + for(i = 0; i < H5Z_table_used_g; i++) + if(H5Z_table_g[i].id == cls->id) break; /* Filter not already registered */ @@ -572,7 +572,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty break; default: - assert("invalid prelude type" && 0); + HDassert("invalid prelude type" && 0); } /* end switch */ } /* end else */ } /* end for */ diff --git a/test/cache.c b/test/cache.c index 8c1e328..f647f6e 100644 --- a/test/cache.c +++ b/test/cache.c @@ -15734,7 +15734,6 @@ check_evictions_enabled(void) hbool_t in_cache; int i; int mile_stone = 1; - size_t entry_size; H5C_t * cache_ptr = NULL; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -15791,7 +15790,6 @@ check_evictions_enabled(void) (size_t)( 512 * 1024)); base_addr = entries[MONSTER_ENTRY_TYPE]; - entry_size = MONSTER_ENTRY_SIZE; } if ( show_progress ) /* 2 */ diff --git a/test/cache_common.c b/test/cache_common.c index 39131bf..4595d7c 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -1755,7 +1755,7 @@ resize_pinned_entry(H5C_t * cache_ptr, HDassert( cache_ptr ); HDassert( ( 0 <= type ) && ( type < NUMBER_OF_ENTRY_TYPES ) ); HDassert( ( 0 <= idx ) && ( idx <= max_indices[type] ) ); - HDassert( type = VARIABLE_ENTRY_TYPE ) ; + HDassert( type == VARIABLE_ENTRY_TYPE ) ; HDassert( ( 0 < new_size ) && ( new_size <= entry_sizes[type] ) ); if ( pass ) { diff --git a/test/dsets.c b/test/dsets.c index e95e8af..060816d 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -5732,24 +5732,16 @@ error: *------------------------------------------------------------------------- */ static herr_t -test_filters_endianess(hid_t fapl) +test_filters_endianess(void) { hid_t fid=-1; /* file ID */ hid_t dsid=-1; /* dataset ID */ hid_t sid=-1; /* dataspace ID */ hid_t dcpl=-1; /* dataset creation property list ID */ - hsize_t dims[1]={2}; /* dataspace dimensions */ - hsize_t chunk_dims[1]={2}; /* chunk dimensions */ - int buf[2]; - int rank=1; int i; char *srcdir = getenv("srcdir"); /* the source directory */ char data_file[512]=""; /* buffer to hold name of existing file */ - for(i=0; i<2; i++){ - buf[i]=1; - } - TESTING("filters with big-endian/little-endian data"); #if defined H5_HAVE_FILTER_FLETCHER32 @@ -6724,7 +6716,6 @@ test_big_chunks_bypass_cache(hid_t fapl) static int wdata[BYPASS_CHUNK_DIM/2], rdata1[BYPASS_DIM], rdata2[BYPASS_CHUNK_DIM/2]; int i, j; - herr_t ret; /* Generic return value */ TESTING("big chunks bypassing the cache"); @@ -6966,7 +6957,7 @@ main(void) nerrors += (test_can_apply_szip(file) < 0 ? 1 : 0); nerrors += (test_compare_dcpl(file) < 0 ? 1 : 0); nerrors += (test_filter_delete(file) < 0 ? 1 : 0); - nerrors += (test_filters_endianess(my_fapl) < 0 ? 1 : 0); + nerrors += (test_filters_endianess() < 0 ? 1 : 0); nerrors += (test_zero_dims(file) < 0 ? 1 : 0); nerrors += (test_missing_chunk(file) < 0 ? 1 : 0); nerrors += (test_random_chunks(my_fapl) < 0 ? 1 : 0); diff --git a/test/dt_arith.c b/test/dt_arith.c index e507fd0..6c59555 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -617,12 +617,10 @@ generates_sigfpe(void) static int test_hard_query(void) { - htri_t ret; - TESTING("query functions of compiler conversion"); /* Verify the conversion from int to float is a hard conversion. */ - if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) { + if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); printf("Can't query conversion function\n"); goto error; @@ -631,7 +629,7 @@ test_hard_query(void) /* Unregister the hard conversion from int to float. Verify the conversion * is a soft conversion. */ H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float); - if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=FALSE) { + if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != FALSE) { H5_FAILED(); printf("Can't query conversion function\n"); goto error; @@ -640,7 +638,7 @@ test_hard_query(void) /* Register the hard conversion from int to float. Verify the conversion * is a hard conversion. */ H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float); - if((ret = H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT))!=TRUE) { + if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); printf("Can't query conversion function\n"); goto error; @@ -676,19 +674,18 @@ static H5T_conv_ret_t expt_handle(H5T_conv_except_t except_type, hid_t UNUSED src_id, hid_t UNUSED dst_id, void UNUSED *src_buf, void *dst_buf, void *user_data) { - H5T_conv_ret_t ret = H5T_CONV_HANDLED; signed char fill_value1 = 7; int fill_value2 = 13; if(except_type == H5T_CONV_EXCEPT_RANGE_HI || except_type == H5T_CONV_EXCEPT_RANGE_LOW || - except_type == H5T_CONV_EXCEPT_TRUNCATE) { + except_type == H5T_CONV_EXCEPT_TRUNCATE) { if(*(hbool_t*)user_data) *(signed char*)dst_buf = fill_value1; else *(int*)dst_buf = fill_value2; - } + } /* end if */ - return ret; + return H5T_CONV_HANDLED; } @@ -2710,7 +2707,6 @@ my_isinf(int endian, unsigned char *val, size_t size, unsigned char *bits; int retval = 0; size_t i; - ssize_t ret1=0, ret2=0; bits = (unsigned char*)calloc(1, size); @@ -2732,8 +2728,8 @@ my_isinf(int endian, unsigned char *val, size_t size, bits[size-(i+1)] = *(val + ENDIAN(size, i, endian)); #endif /*H5_VMS*/ - if((ret1=H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1))<0 && - (ret2=H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0))<0) + if(H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 && + H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) retval = 1; free(bits); diff --git a/test/dtransform.c b/test/dtransform.c index 3297fe6..8b5dce0 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -19,12 +19,12 @@ #define COLS 18 #define FLOAT_TOL 0.0001 -int init_test(hid_t file_id); -int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy); -int test_trivial(const hid_t dxpl_id_simple); -int test_poly(const hid_t dxpl_id_polynomial); -int test_set(void); -int test_getset(const hid_t dxpl_id_simple); +static int init_test(hid_t file_id); +static int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy); +static int test_trivial(const hid_t dxpl_id_simple); +static int test_poly(const hid_t dxpl_id_polynomial); +static int test_set(void); +static int test_getset(const hid_t dxpl_id_simple); /* These are needed for multiple tests, so are declared here globally and are init'ed in init_test */ hid_t dset_id_int; @@ -336,7 +336,8 @@ error: return -1; } -int init_test(hid_t file_id) +static int +init_test(hid_t file_id) { const char* f_to_c = "(5/9.0)*(x-32)"; /* utrans is a transform for unsigned types: no negative numbers involved and results are < 255 to fit into uchar */ @@ -389,7 +390,8 @@ error: return -1; } -int test_poly(const hid_t dxpl_id_polynomial) +static int +test_poly(const hid_t dxpl_id_polynomial) { float polyflres[ROWS][COLS]; int polyintread[ROWS][COLS]; @@ -430,7 +432,8 @@ error: return -1; } -int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy) +static int +test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_copy) { int windchillC; float polyflres[ROWS][COLS]; @@ -462,7 +465,8 @@ error: return -1; } -int test_trivial(const hid_t dxpl_id_simple) +static int +test_trivial(const hid_t dxpl_id_simple) { float windchillFfloatread[ROWS][COLS]; int windchillFintread[ROWS][COLS]; @@ -505,7 +509,8 @@ error: return -1; } -int test_getset(const hid_t dxpl_id_c_to_f) +static int +test_getset(const hid_t dxpl_id_c_to_f) { int row, col; float windchillFfloatread[ROWS][COLS]; @@ -566,7 +571,8 @@ error: return -1; } -int test_set(void) +static int +test_set(void) { hid_t dxpl_id; H5E_auto2_t func; diff --git a/test/dtypes.c b/test/dtypes.c index 991b2c9..548cc59 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -64,15 +64,11 @@ * the soft conversion list. One must call reset_hdf5() after this. */ #define CHECK_NMEMBS(NMEMBS,SRC_ID,DST_ID) \ - if (H5Tunregister(H5T_PERS_SOFT, NULL, SRC_ID, DST_ID, NULL) < 0) { \ + if(H5Tunregister(H5T_PERS_SOFT, NULL, SRC_ID, DST_ID, NULL) < 0) \ FAIL_STACK_ERROR \ - goto error; \ - } \ - if (H5Tclose(SRC_ID) < 0 || ((SRC_ID) != (DST_ID) && H5Tclose(DST_ID) < 0)) { \ + if(H5Tclose(SRC_ID) < 0 || ((SRC_ID) != (DST_ID) && H5Tclose(DST_ID) < 0)) \ FAIL_STACK_ERROR \ - goto error; \ - } \ - if ((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \ + if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \ H5_FAILED(); \ printf(" #dtype ids expected: %d; found: %d\n", NMEMBS, \ H5I_nmembers(H5I_DATATYPE)); \ @@ -4096,7 +4092,6 @@ test_conv_str_3(void) int ret_value = 1; int size; H5T_pad_t inpad; - H5T_cset_t cset; H5T_sign_t sign; char* tag; herr_t ret; @@ -4116,13 +4111,13 @@ test_conv_str_3(void) buf[i*8+j++] = '\0'; } - if ((size=H5Tget_precision(type))==0) goto error; - if ((size=H5Tget_size(type))==0) goto error; - if (H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE) < 0) goto error; - if ((cset=H5Tget_cset(type)) < 0) goto error; - if (H5Tget_strpad(type) < 0) goto error; - if (H5Tset_offset(type, 0) < 0) goto error; - if (H5Tget_order(type) < 0) goto error; + if(H5Tget_precision(type) == 0) FAIL_STACK_ERROR + if(H5Tget_size(type) == 0) FAIL_STACK_ERROR + if(H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE) < 0) FAIL_STACK_ERROR + if(H5Tget_cset(type) < 0) FAIL_STACK_ERROR + if(H5Tget_strpad(type) < 0) FAIL_STACK_ERROR + if(H5Tset_offset(type, 0) < 0) FAIL_STACK_ERROR + if(H5Tget_order(type) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { ret=H5Tset_precision(type, nelmts); @@ -4134,7 +4129,7 @@ test_conv_str_3(void) } /* end if */ H5E_BEGIN_TRY { - size=H5Tget_ebias(type); + size = H5Tget_ebias(type); } H5E_END_TRY; if (size>0) { H5_FAILED(); diff --git a/test/enum.c b/test/enum.c index 91a3790..4599a7c 100644 --- a/test/enum.c +++ b/test/enum.c @@ -455,7 +455,6 @@ test_funcs(void) hid_t type=-1; c_e1 val; size_t size; - int offset; H5T_pad_t inpad; H5T_cset_t cset; herr_t ret; @@ -463,18 +462,18 @@ test_funcs(void) TESTING("some functions with enumeration types"); /* A native integer */ - if ((type = H5Tcreate(H5T_ENUM, sizeof(c_e1)))<0) goto error; - if (H5Tenum_insert(type, "RED", CPTR(val, E1_RED ))<0) goto error; - if (H5Tenum_insert(type, "GREEN", CPTR(val, E1_GREEN))<0) goto error; - if (H5Tenum_insert(type, "BLUE", CPTR(val, E1_BLUE ))<0) goto error; - if (H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE))<0) goto error; - if (H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK))<0) goto error; - - if ((size=H5Tget_precision(type))==0) goto error; - if ((size=H5Tget_size(type))==0) goto error; - if ((offset=H5Tget_offset(type))<0) goto error; - if (H5Tget_sign(type)<0) goto error; - if (H5Tget_super(type)<0) goto error; + if((type = H5Tcreate(H5T_ENUM, sizeof(c_e1))) < 0) FAIL_STACK_ERROR + if(H5Tenum_insert(type, "RED", CPTR(val, E1_RED )) < 0) FAIL_STACK_ERROR + if(H5Tenum_insert(type, "GREEN", CPTR(val, E1_GREEN)) < 0) FAIL_STACK_ERROR + if(H5Tenum_insert(type, "BLUE", CPTR(val, E1_BLUE )) < 0) FAIL_STACK_ERROR + if(H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE)) < 0) FAIL_STACK_ERROR + if(H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK)) < 0) FAIL_STACK_ERROR + + if(H5Tget_precision(type) == 0) FAIL_STACK_ERROR + if(H5Tget_size(type) == 0) FAIL_STACK_ERROR + if(H5Tget_offset(type) < 0) FAIL_STACK_ERROR + if(H5Tget_sign(type) < 0) FAIL_STACK_ERROR + if(H5Tget_super(type) < 0) FAIL_STACK_ERROR H5E_BEGIN_TRY { ret=H5Tset_pad(type, H5T_PAD_ZERO, H5T_PAD_ONE); diff --git a/test/error_test.c b/test/error_test.c index 027f31b..a5afcfc 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -77,7 +77,7 @@ hid_t ERR_MIN_GETNUM; #define LONG_DESC_SIZE 8192 -herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, +static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data); @@ -420,7 +420,7 @@ error: * *------------------------------------------------------------------------- */ -herr_t +static herr_t custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data) { FILE *stream = (FILE *)client_data; diff --git a/test/fillval.c b/test/fillval.c index 5bf5c03..2f58380 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -1966,7 +1966,7 @@ skip: *------------------------------------------------------------------------- */ static int -test_compatible(hid_t fapl) +test_compatible(void) { hid_t file=-1, dset1=-1, dset2=-1; hid_t dcpl1=-1, dcpl2=-1, fspace=-1, mspace=-1; @@ -2170,7 +2170,7 @@ main(int argc, char *argv[]) nerrors += test_create(my_fapl, FILENAME[1], H5D_CONTIGUOUS); nerrors += test_rdwr (my_fapl, FILENAME[3], H5D_CONTIGUOUS); nerrors += test_extend(my_fapl, FILENAME[5], H5D_CONTIGUOUS); - nerrors += test_compatible(my_fapl); + nerrors += test_compatible(); } /* end if */ /* Compact dataset storage tests */ diff --git a/test/freespace.c b/test/freespace.c index 52a5deb..79a0864 100644 --- a/test/freespace.c +++ b/test/freespace.c @@ -2056,7 +2056,6 @@ test_fs_sect_change_class(hid_t fapl) TEST_free_section_t *sect_node1=NULL, *sect_node2=NULL, *sect_node3=NULL; unsigned init_flags=0; TEST_free_section_t *node; - htri_t node_found = FALSE; TESTING("the change of section class via H5FS_sect_change_class() in free-space: Test 1"); @@ -2130,8 +2129,8 @@ test_fs_sect_change_class(hid_t fapl) if(check_stats(frsp, &state)) TEST_ERROR - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp, - (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp, + (hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR if (node->sect_info.type != TEST_FSPACE_SECT_TYPE_NONE) @@ -2235,8 +2234,8 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* verify that section B has changed class */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp, - (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp, + (hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR if (node->sect_info.type != TEST_FSPACE_SECT_TYPE) @@ -2246,8 +2245,8 @@ test_fs_sect_change_class(hid_t fapl) TEST_ERROR /* verify that section C has changed class */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp, - (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp, + (hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR if (node->sect_info.type != TEST_FSPACE_SECT_TYPE) diff --git a/test/getname.c b/test/getname.c index 4084f9e..0dc623e 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2672,7 +2672,6 @@ test_reg_ref(hid_t fapl) hsize_t dimsr[1] = {2}; int rank = 2; int rankr = 1; - herr_t status; hdset_reg_ref_t ref[2]; hdset_reg_ref_t ref_out[2]; int data[2][9] = {{1,1,2,3,3,4,5,5,6},{1,2,2,3,4,4,5,6,6}}; @@ -2701,9 +2700,9 @@ test_reg_ref(hid_t fapl) TEST_ERROR /* Write data to the dataset */ - if((status = H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data)) < 0) + if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR - if((status = H5Dclose(dsetv_id)) < 0) + if(H5Dclose(dsetv_id) < 0) TEST_ERROR /* Dataset with references */ @@ -2717,31 +2716,31 @@ test_reg_ref(hid_t fapl) start[1] = 3; count[0] = 2; count[1] = 3; - if((status = H5Sselect_hyperslab(space_id,H5S_SELECT_SET,start,NULL,count,NULL)) < 0) + if(H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0) TEST_ERROR - if((status = H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id)) < 0) + if(H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0) TEST_ERROR /* Create a reference to elements selection */ - if((status = H5Sselect_none(space_id)) < 0) + if(H5Sselect_none(space_id) < 0) TEST_ERROR - if((status = H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord)) < 0) + if(H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0) TEST_ERROR - if((status = H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id)) < 0) + if(H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0) TEST_ERROR /* Write dataset with the references */ - if((status = H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT,ref)) < 0) + if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0) TEST_ERROR /* Close all objects */ - if((status = H5Sclose(space_id)) < 0) + if(H5Sclose(space_id) < 0) TEST_ERROR - if((status = H5Sclose(spacer_id)) < 0) + if(H5Sclose(spacer_id) < 0) TEST_ERROR - if((status = H5Dclose(dsetr_id)) < 0) + if(H5Dclose(dsetr_id) < 0) TEST_ERROR - if((status = H5Fclose(file_id)) < 0) + if(H5Fclose(file_id) < 0) TEST_ERROR @@ -2753,7 +2752,7 @@ test_reg_ref(hid_t fapl) if((dsetr_id = H5Dopen2(file_id, REFREG_DSETNAMER, H5P_DEFAULT)) < 0) TEST_ERROR - if((status = H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out)) < 0) + if(H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out) < 0) TEST_ERROR /* Get name of the dataset the first region reference points to using H5Rget_name */ @@ -2773,7 +2772,7 @@ test_reg_ref(hid_t fapl) name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE); if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR - if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR + if(H5Dclose(dsetv_id) < 0) TEST_ERROR PASSED() @@ -2794,13 +2793,13 @@ test_reg_ref(hid_t fapl) name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE); if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR - if((status = H5Dclose(dsetv_id)) < 0) TEST_ERROR + if(H5Dclose(dsetv_id) < 0) TEST_ERROR PASSED() - if((status = H5Dclose(dsetr_id)) < 0) + if(H5Dclose(dsetr_id) < 0) TEST_ERROR - if((status = H5Fclose(file_id)) < 0) + if(H5Fclose(file_id) < 0) TEST_ERROR return 0; diff --git a/test/h5test.c b/test/h5test.c index 029ca3e..f5bf180 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1031,49 +1031,45 @@ int h5_szip_can_encode(void ) * *------------------------------------------------------------------------- */ - -char* getenv_all(MPI_Comm comm, int root, const char* name) +char * +getenv_all(MPI_Comm comm, int root, const char* name) { int mpi_size, mpi_rank, mpi_initialized; int len; static char* env = NULL; - MPI_Status Status; assert(name); MPI_Initialized(&mpi_initialized); - if (!mpi_initialized){ + if(!mpi_initialized) { /* use original getenv */ if(env) HDfree(env); env = HDgetenv(name); - }else{ + } /* end if */ + else { MPI_Comm_rank(comm, &mpi_rank); MPI_Comm_size(comm, &mpi_size); assert(root < mpi_size); /* The root task does the getenv call * and sends the result to the other tasks */ - if(mpi_rank == root) - { + if(mpi_rank == root) { env = HDgetenv(name); - if(env) - { + if(env) { len = HDstrlen(env); MPI_Bcast(&len, 1, MPI_INT, root, comm); MPI_Bcast(env, len, MPI_CHAR, root, comm); } - else{ + else { /* len -1 indicates that the variable was not in the environment */ len = -1; MPI_Bcast(&len, 1, MPI_INT, root, comm); } } - else - { + else { MPI_Bcast(&len, 1, MPI_INT, root, comm); - if(len >= 0) - { + if(len >= 0) { if(env == NULL) env = (char*) HDmalloc(len+1); else if(strlen(env) < len) @@ -1082,8 +1078,7 @@ char* getenv_all(MPI_Comm comm, int root, const char* name) MPI_Bcast(env, len, MPI_CHAR, root, comm); env[len] = '\0'; } - else - { + else { if(env) HDfree(env); env = NULL; diff --git a/test/links.c b/test/links.c index ec0d21b..c169670 100644 --- a/test/links.c +++ b/test/links.c @@ -814,7 +814,6 @@ toomany(hid_t fapl, hbool_t new_format) hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename[NAME_BUF_SIZE]; if(new_format) @@ -888,7 +887,7 @@ toomany(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "hard21", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/hard21")) TEST_ERROR /* Create object in hard-linked group */ @@ -914,7 +913,7 @@ toomany(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "soft16", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/soft16")) TEST_ERROR /* Create object using soft links */ @@ -1742,7 +1741,6 @@ external_link_root(hid_t fapl, hbool_t new_format) hid_t gid = (-1), gid2 = (-1); /* Group IDs */ H5L_info_t linfo; /* Link information */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; const char *file; /* File from external link */ @@ -1801,7 +1799,7 @@ external_link_root(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/")) TEST_ERROR /* Create object in external file */ @@ -1834,9 +1832,9 @@ external_link_root(hid_t fapl, hbool_t new_format) if((gid2 = H5Gopen2(fid, "newer_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check names */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/new_group")) TEST_ERROR - if((name_len = H5Iget_name( gid2, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/newer_group")) TEST_ERROR /* Close opened objects */ @@ -1903,7 +1901,6 @@ external_link_path(hid_t fapl, hbool_t new_format) hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; @@ -1943,7 +1940,7 @@ external_link_path(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR /* Create object in external file */ @@ -1966,7 +1963,7 @@ external_link_path(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/A/B/C/new_group")) TEST_ERROR /* Close opened object */ @@ -2012,7 +2009,6 @@ external_link_mult(hid_t fapl, hbool_t new_format) hid_t fid = (-1), fid2 = (-1); /* File IDs */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], @@ -2090,7 +2086,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR /* Create object in external file */ @@ -2113,7 +2109,7 @@ external_link_mult(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "/A/B/C/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/A/B/C/new_group")) TEST_ERROR /* Close opened object */ @@ -2177,7 +2173,6 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) hid_t gid = (-1), gid2 = (-1); /* Group IDs */ hid_t lcpl_id = (-1); /* Link Creation Property List ID */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE]; char filename2[NAME_BUF_SIZE]; char filename3[NAME_BUF_SIZE]; @@ -2218,7 +2213,7 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "A/B/C/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/X")) TEST_ERROR /* Create object through external link */ @@ -2234,7 +2229,7 @@ external_link_self(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "X/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/X/new_group")) TEST_ERROR /* Close opened object */ @@ -2343,7 +2338,6 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ @@ -2394,7 +2388,7 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "link1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/final")) TEST_ERROR /* Create object in external file */ @@ -2417,7 +2411,7 @@ external_link_pingpong(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "/final/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/final/new_group")) TEST_ERROR /* Close opened object */ @@ -2488,7 +2482,6 @@ external_link_toomany(hid_t fapl, hbool_t new_format) hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ @@ -2562,7 +2555,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "link3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/final")) TEST_ERROR /* Create object in external file */ @@ -5315,7 +5308,6 @@ external_link_move(hid_t fapl, hbool_t new_format) hid_t fid = (-1); /* File ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ @@ -5360,7 +5352,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "src2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR if(HDstrcmp(objname, "/dst")) TEST_ERROR /* Create object in external file */ @@ -5405,7 +5397,7 @@ external_link_move(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR if(HDstrcmp(objname, "/dst")) TEST_ERROR /* Create object in external file */ @@ -5441,14 +5433,14 @@ external_link_move(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "/group2/src3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR if(HDstrcmp(objname, "/dst")) TEST_ERROR /* Move external link back to original location */ if(H5Lmove(fid, "/group2/src3", H5L_SAME_LOC, "/src", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) FAIL_STACK_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) FAIL_STACK_ERROR if(HDstrcmp(objname, "/dst")) TEST_ERROR /* Create object in external file */ @@ -5509,7 +5501,6 @@ external_link_ride(hid_t fapl, hbool_t new_format) hid_t gcpl = (-1); /* Group creation property list ID */ hid_t gid = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */ unsigned nmsgs; /* Number of messages in group's header */ @@ -5593,7 +5584,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/dst")) TEST_ERROR /* Create object in external file */ @@ -5628,7 +5619,7 @@ external_link_ride(hid_t fapl, hbool_t new_format) if((gid = H5Gopen2(fid, "src", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/dst")) TEST_ERROR /* Create object in external file */ @@ -6030,7 +6021,6 @@ external_link_strong(hid_t fapl, hbool_t new_format) hid_t fid1 = (-1), fid2 = (-1); /* File ID */ hid_t gid1 = (-1), gid2 = (-1); /* Group IDs */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; @@ -6071,7 +6061,7 @@ external_link_strong(hid_t fapl, hbool_t new_format) /* Access external link from file #1 */ if((fid2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR if((gid2 = H5Gopen2(fid2, "/W/X/DLINK", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((name_len = H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/A/B/C")) TEST_ERROR if(H5Gclose(gid2) < 0) TEST_ERROR if(H5Fclose(fid2) < 0) TEST_ERROR @@ -6250,7 +6240,6 @@ ud_hard_links(hid_t fapl) hid_t gid = (-1), gid2 = (-1); /* Group IDs */ H5L_info_t li; /* Link information */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ h5_stat_size_t empty_size; /* Size of an empty file */ char filename[NAME_BUF_SIZE]; @@ -6299,7 +6288,7 @@ ud_hard_links(hid_t fapl) if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/group")) TEST_ERROR /* Create object in group */ @@ -6313,7 +6302,7 @@ ud_hard_links(hid_t fapl) if((gid = H5Gopen2(fid, "group/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/group/new_group")) TEST_ERROR /* Close opened object */ @@ -6417,7 +6406,6 @@ ud_link_reregister(hid_t fapl) hid_t gid = (-1), gid2 = (-1); /* Group IDs */ H5L_info_t li; /* Link information */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename[NAME_BUF_SIZE]; h5_stat_size_t empty_size; /* Size of an empty file */ @@ -6486,7 +6474,7 @@ ud_link_reregister(hid_t fapl) if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/" REREG_TARGET_NAME)) TEST_ERROR /* Create object in group */ @@ -6500,7 +6488,7 @@ ud_link_reregister(hid_t fapl) if((gid = H5Gopen2(fid, "rereg_target/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/rereg_target/new_group")) TEST_ERROR /* Close opened object */ @@ -7291,7 +7279,6 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) hid_t tid = (-1), sid = (-1), did = (-1); /* Other IDs */ hid_t gapl = (-1), dapl = (-1), tapl = (-1); /* Other property lists */ char objname[NAME_BUF_SIZE]; /* Object name */ - ssize_t name_len; /* Length of object name */ char filename[NAME_BUF_SIZE]; size_t nlinks; /* nlinks for H5Pset_nlinks */ hsize_t dims[2]; @@ -7356,7 +7343,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) if((gid = H5Oopen(fid, "soft17", plist)) < 0) TEST_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/soft17")) TEST_ERROR /* Create group using soft link */ @@ -7389,7 +7376,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) if((gid = H5Oopen(fid, "soft4", plist)) < 0) TEST_ERROR /* Check name */ - if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR + if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(objname, "/soft4")) TEST_ERROR @@ -8756,7 +8743,7 @@ corder_transition(hid_t fapl) sprintf(objname, "filler %u", u); if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR } /* end for */ - sprintf(objname, "filler %u", 0); + sprintf(objname, "filler %u", (unsigned)0); if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR /* Close the group */ diff --git a/test/mf.c b/test/mf.c index 527fa4a..ff54751 100644 --- a/test/mf.c +++ b/test/mf.c @@ -277,7 +277,6 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - htri_t status; H5FD_mem_t type; haddr_t addr; haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; @@ -355,8 +354,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed */ - status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30); - if (status <= 0) + if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -404,8 +402,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* should not succeed in shrinking */ - status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30-10); - if (status > 0) + if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30 - 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -449,8 +446,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should not succeed in shrinking */ - status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30+10); - if (status > 0) + if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30 + 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -493,8 +489,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed in shrinking */ - status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr+10, (hsize_t)(TEST_BLOCK_SIZE30-10)); - if (status <= 0) + if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr+10, (hsize_t)(TEST_BLOCK_SIZE30 - 10)) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ @@ -847,7 +842,6 @@ test_mf_fs_alloc_free(hid_t fapl) frspace_state_t state; H5MF_sect_ud_t udata; H5FS_section_info_t *node; - htri_t node_found = FALSE; TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 1"); @@ -933,8 +927,8 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0) /* Free the free-space section node */ if(H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0) @@ -1014,8 +1008,8 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space manager */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR /* Free the free-space section node */ @@ -1090,8 +1084,8 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)TEST_BLOCK_SIZE30, (H5FS_section_info_t **)&node) < 0) FAIL_STACK_ERROR /* Free the free-space section node */ @@ -1187,7 +1181,6 @@ test_mf_fs_extend(hid_t fapl) frspace_state_t state; /* State of free space*/ H5MF_sect_ud_t udata; H5FS_section_info_t *node; - htri_t node_found = FALSE; htri_t extended; TESTING("H5MF_try_extend() of free-space manager:test 1"); @@ -1305,8 +1298,8 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the extended block */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0) TEST_ERROR /* Remove the free-space section node */ @@ -1415,8 +1408,8 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0) TEST_ERROR /* Remove the free-space section node */ @@ -1525,8 +1518,8 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)(TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50), (H5FS_section_info_t **)&node) < 0) TEST_ERROR /* Remove the free-space section node */ @@ -1635,8 +1628,8 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove section A from free-space manger */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)(TEST_BLOCK_SIZE30-10), (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)(TEST_BLOCK_SIZE30-10), (H5FS_section_info_t **)&node) < 0) TEST_ERROR /* Remove the free-space section node */ @@ -1644,8 +1637,8 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove section B from free-space manager */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)TEST_BLOCK_SIZE50, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)TEST_BLOCK_SIZE50, (H5FS_section_info_t **)&node) < 0) TEST_ERROR /* Remove the free-space section node */ @@ -1710,7 +1703,6 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) hsize_t ma_size=0; H5MF_free_section_t *sect_node=NULL; H5MF_sect_ud_t udata; - htri_t node_found=FALSE; H5FS_section_info_t *node; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -1765,8 +1757,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)TEST_BLOCK_SIZE2048, (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)TEST_BLOCK_SIZE2048, (H5FS_section_info_t **)&node) < 0) TEST_ERROR if (node->addr != ma_addr) TEST_ERROR @@ -1835,8 +1827,8 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], - (hsize_t)(ma_size+TEST_BLOCK_SIZE30), (H5FS_section_info_t **)&node)) < 0) + if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, f->shared->fs_man[type], + (hsize_t)(ma_size+TEST_BLOCK_SIZE30), (H5FS_section_info_t **)&node) < 0) TEST_ERROR if ((node->addr + TEST_BLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -2939,7 +2931,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) hid_t file = -1; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t empty_size; + h5_stat_size_t empty_size, file_size; H5FD_mem_t type, stype; haddr_t new_addr, addr, saddr; haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; @@ -3012,6 +3004,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is the correct size */ + if (file_size != empty_size) + TEST_ERROR + PASSED() } /* end if */ else { @@ -3074,6 +3074,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is the correct size */ + if (file_size != empty_size) + TEST_ERROR + PASSED() } /* end if */ else { @@ -3134,6 +3142,14 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is the correct size */ + if (file_size != empty_size) + TEST_ERROR + PASSED() } /* end if */ else { @@ -3177,14 +3193,13 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) hid_t file = -1; /* File ID */ char filename[FILENAME_LEN]; /* Filename to use */ H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t empty_size; + h5_stat_size_t empty_size, file_size; H5FD_mem_t type, stype; haddr_t addr1, addr2, addr3, saddr1; haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF; hsize_t ma_size=0, new_ma_size=0; hsize_t sdata_size=0, new_sdata_size=0; - htri_t status; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1"); @@ -3221,11 +3236,11 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); ma_addr = new_ma_addr - TEST_BLOCK_SIZE30; - if ((addr1+TEST_BLOCK_SIZE30) != new_ma_addr) + if((addr1 + TEST_BLOCK_SIZE30) != new_ma_addr) TEST_ERROR /* should succeed */ - if ((status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30)) <= 0) + if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30) <= 0) TEST_ERROR H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); @@ -3235,6 +3250,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is the correct size */ + if (file_size != empty_size) + TEST_ERROR + PASSED() } /* end if */ else { @@ -3269,7 +3292,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); /* should succeed */ - if ((status = H5MF_try_shrink(f, stype, H5P_DATASET_XFER_DEFAULT, saddr1, (hsize_t)TEST_BLOCK_SIZE50)) <= 0) + if(H5MF_try_shrink(f, stype, H5P_DATASET_XFER_DEFAULT, saddr1, (hsize_t)TEST_BLOCK_SIZE50) <= 0) TEST_ERROR H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size); @@ -3286,6 +3309,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is the correct size */ + if (file_size != empty_size) + TEST_ERROR + PASSED() } /* end if */ else { @@ -3326,7 +3357,7 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* should not succeed */ - if ((status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr2, (hsize_t)TEST_BLOCK_SIZE50)) > 0) + if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr2, (hsize_t)TEST_BLOCK_SIZE50) > 0) TEST_ERROR /* aggregator info should be the same as before */ @@ -3340,6 +3371,14 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR + /* Get the size of the file */ + if((file_size = h5_get_file_size(filename, fapl)) < 0) + TEST_ERROR + + /* Verify the file is the correct size */ + if (file_size != empty_size) + TEST_ERROR + PASSED() } /* end if */ else { @@ -3398,7 +3437,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) haddr_t addr1, addr2; haddr_t ma_addr=HADDR_UNDEF; hsize_t ma_size=0; - htri_t status, extended; + htri_t extended; frspace_state_t state; hsize_t alignment=0, mis_align=0, tmp=0, accum=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -3545,8 +3584,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* shrink the block */ - status = H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE50); - if (status <= 0) + if(H5MF_try_shrink(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE50) <= 0) TEST_ERROR if(H5Fclose(file) < 0) diff --git a/test/mount.c b/test/mount.c index 492f490..14ab346 100644 --- a/test/mount.c +++ b/test/mount.c @@ -2558,7 +2558,6 @@ test_acc_perm(hid_t fapl) hid_t gidA = -1, gidB = -1, gidC = -1, gidM = -1, gidAM = -1, gidAMZ = -1; /* Group IDs */ hid_t bad_id = -1; /* Bad ID from object create */ char name[NAME_BUF_SIZE]; /* Buffer for filename retrieved */ - ssize_t name_len; /* Filename length */ char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ @@ -2605,7 +2604,7 @@ test_acc_perm(hid_t fapl) TEST_ERROR /* Get and verify file name */ - if((name_len = H5Fget_name(gidA, name, NAME_BUF_SIZE)) < 0) + if(H5Fget_name(gidA, name, NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(name, filename1) != 0) TEST_ERROR @@ -2614,7 +2613,7 @@ test_acc_perm(hid_t fapl) TEST_ERROR /* Get and verify file name */ - if((name_len = H5Fget_name(fid2, name, NAME_BUF_SIZE)) < 0) + if(H5Fget_name(fid2, name, NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(name, filename2) != 0) TEST_ERROR @@ -2624,7 +2623,7 @@ test_acc_perm(hid_t fapl) TEST_ERROR /* Get and verify file name */ - if((name_len = H5Fget_name(fid2, name, NAME_BUF_SIZE)) < 0) + if(H5Fget_name(fid2, name, NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(name, filename2) != 0) TEST_ERROR @@ -2634,7 +2633,7 @@ test_acc_perm(hid_t fapl) TEST_ERROR /* Get and verify file name */ - if((name_len = H5Fget_name(gidAM, name, NAME_BUF_SIZE)) < 0) + if(H5Fget_name(gidAM, name, NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(name, filename2) != 0) TEST_ERROR @@ -2676,7 +2675,7 @@ test_acc_perm(hid_t fapl) TEST_ERROR /* Get and verify file name */ - if((name_len = H5Fget_name(gidAMZ, name, NAME_BUF_SIZE)) < 0) + if(H5Fget_name(gidAMZ, name, NAME_BUF_SIZE) < 0) TEST_ERROR if(HDstrcmp(name, filename3) != 0) TEST_ERROR diff --git a/test/trefstr.c b/test/trefstr.c index 81394f2..c39a6eb 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -290,7 +290,6 @@ test_refstr_wrap(void) static void test_refstr_own(void) { - static const char *FUNC = "test_refstr_own"; H5RS_str_t *rs; /* Ref-counted string created */ char *s; /* Pointer to string to transfer */ const char *t; /* Temporary pointers to string */ diff --git a/test/tselect.c b/test/tselect.c index 6d8f1bd..5845a9b 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -164,21 +164,21 @@ /* Location comparison function */ -int compare_size_t(const void *s1, const void *s2); +static int compare_size_t(const void *s1, const void *s2); -herr_t test_select_hyper_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); -herr_t test_select_point_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); -herr_t test_select_all_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); -herr_t test_select_none_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); -herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_operator_data); -herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); +static herr_t test_select_hyper_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); +static herr_t test_select_point_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); +static herr_t test_select_all_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); +static herr_t test_select_none_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); +static herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_operator_data); +static herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data); /**************************************************************** ** ** test_select_hyper_iter1(): Iterator for checking hyperslab iteration ** ****************************************************************/ -herr_t +static herr_t test_select_hyper_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) { uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ @@ -367,7 +367,7 @@ struct pnt_iter { ** (This is really ugly code, not a very good example of correct usage - QAK) ** ****************************************************************/ -herr_t +static herr_t test_select_point_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) { uint8_t *elem=(uint8_t *)_elem; /* Pointer to the element to examine */ @@ -641,7 +641,7 @@ test_select_point(hid_t xfer_plist) ** ** ****************************************************************/ -herr_t +static herr_t test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) { uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ @@ -661,7 +661,7 @@ test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, c ** (This is never supposed to be called, so it always returns -1) ** ****************************************************************/ -herr_t +static herr_t test_select_none_iter1(void UNUSED *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void UNUSED *_operator_data) { return(-1); @@ -1012,7 +1012,7 @@ test_select_combo(void) HDfree(rbuf); } /* test_select_combo() */ -int +static int compare_size_t(const void *s1, const void *s2) { if(*(const size_t *)s1<*(const size_t *)s2) @@ -3714,7 +3714,7 @@ test_select_hyper_nota_2d(void) ** test_select_hyper_iter2(): Iterator for checking hyperslab iteration ** ****************************************************************/ -herr_t +static herr_t test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) { int *tbuf=(int *)_elem, /* temporary buffer pointer */ @@ -4900,7 +4900,7 @@ typedef struct { ** test_select_hyper_iter3(): Iterator for checking hyperslab iteration ** ****************************************************************/ -herr_t +static herr_t test_select_hyper_iter3(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) { unsigned short *tbuf=(unsigned short *)_elem; /* temporary buffer pointer */ diff --git a/test/tsohm.c b/test/tsohm.c index 0516590..348677d 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -731,7 +731,6 @@ static void test_sohm_size1(void) hid_t file = -1; hid_t fcpl_id = -1; hid_t fapl_id = -1; - hsize_t norm_oh_size; hsize_t sohm_oh_size; hsize_t sohm_btree_oh_size; h5_stat_size_t norm_empty_filesize; @@ -782,13 +781,8 @@ static void test_sohm_size1(void) CHECK_I(file, "H5Fopen"); file = size1_helper(file, FILENAME, fapl_id, 0); CHECK_I(file, "size1_helper"); - - /* Get the size of a dataset object header */ - ret = H5Oget_info_by_name(file, DSETNAME[0], &oinfo, H5P_DEFAULT); - CHECK_I(ret, "H5Oget_info_by_name"); ret = H5Fclose(file); CHECK_I(ret, "H5Fclose"); - norm_oh_size = oinfo.hdr.space.total; /* Get the new file size */ norm_final_filesize = h5_get_file_size(FILENAME, fapl_id); @@ -927,13 +921,6 @@ static void test_sohm_size1(void) * headers. How the SOHM messages are stored shouldn't affect the * size of the object header. */ - /* JAMES: this fails because while the headers are the same size, the - * SOHM header is broken up by the SOHM table, so has to have a - * continuation message and a NULL message. - - if(sohm_oh_size >= norm_oh_size) - VERIFY(sohm_oh_size, 1, "H5Oget_info_by_name"); - */ if(sohm_oh_size != sohm_btree_oh_size) VERIFY(sohm_btree_oh_size, 1, "H5Oget_info_by_name"); @@ -1378,14 +1365,14 @@ static void size2_dump_struct(const char *name, size2_helper_struct *sizes) { puts(name); - printf(" empty size: %llu\n", sizes->empty_size); - printf(" first dataset: %llu \tdelta: %llu\n", sizes->first_dset, sizes->first_dset - sizes->empty_size); - printf("second dataset: %llu \tdelta: %llu\n", sizes->second_dset, sizes->second_dset - sizes->first_dset); - printf(" dsets 1: %llu \tdelta: %llu\n", sizes->dsets1, sizes->dsets1 - sizes->second_dset); - printf(" dsets 2: %llu \tdelta: %llu\n", sizes->dsets2, sizes->dsets2 - sizes->dsets1); - printf(" interleaved: %llu \tdelta: %llu\n", sizes->interleaved, sizes->interleaved - sizes->dsets2); - printf(" attributes: %llu \tdelta: %llu\n", sizes->attrs1, sizes->attrs1 - sizes->interleaved); - printf(" attributes 2: %llu \tdelta: %llu\n", sizes->attrs2, sizes->attrs2 - sizes->attrs1); + printf(" empty size: %llu\n", (unsigned long long)sizes->empty_size); + printf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size)); + printf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset)); + printf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset)); + printf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1)); + printf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2)); + printf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved)); + printf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1)); } diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 0fdd78a..ed3110a 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -276,52 +276,51 @@ MPI_Datatype mpi_mssg_t; /* for MPI derived type created from mssg */ /* stats functions */ -void print_stats(void); -void reset_stats(void); +static void reset_stats(void); /* MPI setup functions */ -hbool_t set_up_file_communicator(void); +static hbool_t set_up_file_communicator(void); /* data array manipulation functions */ -int addr_to_datum_index(haddr_t base_addr); -void init_data(void); +static int addr_to_datum_index(haddr_t base_addr); +static void init_data(void); /* test coodination related functions */ -int do_express_test(void); -void do_sync(void); -int get_max_nerrors(void); +static int do_express_test(void); +static void do_sync(void); +static int get_max_nerrors(void); /* mssg xfer related functions */ -hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset); -hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag); -hbool_t setup_derived_types(void); -hbool_t takedown_derived_types(void); +static hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset); +static hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag); +static hbool_t setup_derived_types(void); +static hbool_t takedown_derived_types(void); /* server functions */ -hbool_t server_main(void); -hbool_t serve_read_request(struct mssg_t * mssg_ptr); -hbool_t serve_sync_request(struct mssg_t * mssg_ptr); -hbool_t serve_write_request(struct mssg_t * mssg_ptr); +static hbool_t server_main(void); +static hbool_t serve_read_request(struct mssg_t * mssg_ptr); +static hbool_t serve_sync_request(struct mssg_t * mssg_ptr); +static hbool_t serve_write_request(struct mssg_t * mssg_ptr); /* call back functions & related data structures */ -herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest); -herr_t destroy_datum(H5F_t UNUSED * f, void * thing); -herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr, +static herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest); +static herr_t destroy_datum(H5F_t UNUSED * f, void * thing); +static herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr, void *thing); -void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, +static void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void UNUSED *udata1, void UNUSED *udata2); -herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr); +static herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr); #define DATUM_ENTRY_TYPE H5AC_TEST_ID @@ -398,6 +397,7 @@ hbool_t trace_file_check(void); /****************************** stats functions ******************************/ /*****************************************************************************/ +#ifdef UNUSED /***************************************************************************** * * Function: print_stats() @@ -417,7 +417,7 @@ hbool_t trace_file_check(void); * *****************************************************************************/ -void +static void print_stats(void) { HDfprintf(stdout, @@ -436,6 +436,7 @@ print_stats(void) return; } /* print_stats() */ +#endif /* UNUSED */ /***************************************************************************** * @@ -453,7 +454,7 @@ print_stats(void) * *****************************************************************************/ -void +static void reset_stats(void) { datum_clears = 0; @@ -494,7 +495,7 @@ reset_stats(void) * *****************************************************************************/ -hbool_t +static hbool_t set_up_file_communicator(void) { const char * fcn_name = "set_up_file_communicator()"; @@ -647,7 +648,7 @@ set_up_file_communicator(void) * *****************************************************************************/ -int +static int addr_to_datum_index(haddr_t base_addr) { /* const char * fcn_name = "addr_to_datum_index()"; */ @@ -704,7 +705,7 @@ addr_to_datum_index(haddr_t base_addr) * *****************************************************************************/ -void +static void init_data(void) { /* const char * fcn_name = "init_data()"; */ @@ -785,7 +786,7 @@ init_data(void) * *****************************************************************************/ -int +static int do_express_test(void) { const char * fcn_name = "do_express_test()"; @@ -839,7 +840,7 @@ do_express_test(void) * *****************************************************************************/ -void +static void do_sync(void) { const char * fcn_name = "do_sync()"; @@ -915,7 +916,7 @@ do_sync(void) * *****************************************************************************/ -int +static int get_max_nerrors(void) { const char * fcn_name = "get_max_nerrors()"; @@ -970,7 +971,7 @@ get_max_nerrors(void) #define CACHE_TEST_TAG 99 /* different from any used by the library */ -hbool_t +static hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset) { @@ -1055,7 +1056,7 @@ recv_mssg(struct mssg_t *mssg_ptr, * *****************************************************************************/ -hbool_t +static hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag) { @@ -1129,7 +1130,7 @@ send_mssg(struct mssg_t *mssg_ptr, * *****************************************************************************/ -hbool_t +static hbool_t setup_derived_types(void) { const char * fcn_name = "setup_derived_types()"; @@ -1223,7 +1224,7 @@ setup_derived_types(void) * *****************************************************************************/ -hbool_t +static hbool_t takedown_derived_types(void) { const char * fcn_name = "takedown_derived_types()"; @@ -1275,7 +1276,7 @@ takedown_derived_types(void) * *****************************************************************************/ -hbool_t +static hbool_t server_main(void) { const char * fcn_name = "server_main()"; @@ -1382,7 +1383,7 @@ server_main(void) * *****************************************************************************/ -hbool_t +static hbool_t serve_read_request(struct mssg_t * mssg_ptr) { const char * fcn_name = "serve_read_request()"; @@ -1488,7 +1489,7 @@ serve_read_request(struct mssg_t * mssg_ptr) * *****************************************************************************/ -hbool_t +static hbool_t serve_sync_request(struct mssg_t * mssg_ptr) { const char * fcn_name = "serve_sync_request()"; @@ -1556,7 +1557,7 @@ serve_sync_request(struct mssg_t * mssg_ptr) * *****************************************************************************/ -hbool_t +static hbool_t serve_write_request(struct mssg_t * mssg_ptr) { const char * fcn_name = "serve_write_request()"; @@ -1682,7 +1683,7 @@ serve_write_request(struct mssg_t * mssg_ptr) *------------------------------------------------------------------------- */ -herr_t +static herr_t clear_datum(H5F_t * f, void * thing, hbool_t dest) @@ -1756,7 +1757,7 @@ clear_datum(H5F_t * f, *------------------------------------------------------------------------- */ -herr_t +static herr_t destroy_datum(H5F_t UNUSED * f, void * thing) { @@ -1822,7 +1823,7 @@ destroy_datum(H5F_t UNUSED * f, *------------------------------------------------------------------------- */ -herr_t +static herr_t flush_datum(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, @@ -1959,7 +1960,7 @@ flush_datum(H5F_t *f, *------------------------------------------------------------------------- */ -void * +static void * load_datum(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, @@ -2129,7 +2130,7 @@ load_datum(H5F_t UNUSED *f, *------------------------------------------------------------------------- */ -herr_t +static herr_t size_datum(H5F_t UNUSED * f, void * thing, size_t * size_ptr) diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index 5d02822..a0cf0e2 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -82,7 +82,7 @@ typedef enum access_ { * elements. The allocation time is set to H5D_ALLOC_TIME_EARLY. Another * routine will open this in parallel for extension test. */ -void +static void create_chunked_dataset(const char *filename, int nchunks, write_type write_pattern) { hid_t file_id, dataset; /* handles */ @@ -98,7 +98,6 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte hsize_t offset[1]; /* Selection offset within dataspace */ /* Variables used in reading data back */ char buffer[CHUNKSIZE]; - int i; herr_t hrc; @@ -195,7 +194,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte * opens the dataset. At the end, it verifies the size of the dataset to be * consistent with argument 'nchunks'. */ -void +static void parallel_access_dataset(const char *filename, int nchunks, access_type action, hid_t *file_id, hid_t *dataset) { /* HDF5 gubbins */ @@ -203,7 +202,6 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h hid_t access_plist; /* HDF5 ID for file access property list */ herr_t hrc; /* HDF5 return code */ hsize_t size[1]; - hsize_t dim_size; hsize_t chunk_dims[1] ={CHUNKSIZE}; hsize_t count[1]; @@ -217,7 +215,6 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h /* MPI Gubbins */ MPI_Offset filesize, /* actual file size */ est_filesize; /* estimated file size */ - int mpierr; /* Initialize MPI */ MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); @@ -328,7 +325,8 @@ parallel_access_dataset(const char *filename, int nchunks, access_type action, h * 3. it returns correct values when the whole dataset has been written in an * interleaved pattern. */ -void verify_data(const char *filename, int nchunks, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset) +static void +verify_data(const char *filename, int nchunks, write_type write_pattern, int close, hid_t *file_id, hid_t *dataset) { /* HDF5 gubbins */ hid_t dataspace, memspace; /* HDF5 file identifier */ @@ -343,12 +341,7 @@ void verify_data(const char *filename, int nchunks, write_type write_pattern, in /* Variables used in reading data back */ char buffer[CHUNKSIZE]; int value, i; - int index, current; - - /* MPI Gubbins */ - MPI_Offset filesize, /* actual file size */ - est_filesize; /* estimated file size */ - int mpierr; + int index; /* Initialize MPI */ MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index fe0405e..61e7bfd 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -71,12 +71,9 @@ static void coll_chunktest(const char* filename,int chunk_factor,int select_fact void coll_chunk1(void) { + const char *filename = GetTestParameters(); - const char *filename; - - filename = GetTestParameters(); - coll_chunktest(filename,1,BYROW_CONT,API_NONE); - + coll_chunktest(filename, 1, BYROW_CONT, API_NONE); } @@ -118,12 +115,9 @@ coll_chunk1(void) void coll_chunk2(void) { + const char *filename = GetTestParameters(); - const char *filename; - - filename = GetTestParameters(); - coll_chunktest(filename,1,BYROW_DISCONT,API_NONE); - + coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE); } @@ -166,16 +160,11 @@ coll_chunk2(void) void coll_chunk3(void) { + const char *filename = GetTestParameters(); + int mpi_size; - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - MPI_Comm_size(comm,&mpi_size); - - filename = GetTestParameters(); - coll_chunktest(filename,mpi_size,BYROW_CONT,API_NONE); - + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE); } /*------------------------------------------------------------------------- @@ -217,15 +206,9 @@ coll_chunk3(void) void coll_chunk4(void) { + const char *filename = GetTestParameters(); - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - - filename = GetTestParameters(); - coll_chunktest(filename,1,BYROW_SELECTNONE,API_NONE); - + coll_chunktest(filename, 1, BYROW_SELECTNONE, API_NONE); } /*------------------------------------------------------------------------- @@ -267,15 +250,9 @@ coll_chunk4(void) void coll_chunk5(void) { + const char *filename = GetTestParameters(); - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - - filename = GetTestParameters(); - coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_HARD); - + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_HARD); } /*------------------------------------------------------------------------- @@ -317,15 +294,9 @@ coll_chunk5(void) void coll_chunk6(void) { + const char *filename = GetTestParameters(); - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - - filename = GetTestParameters(); - coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_MULTI_HARD); - + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_HARD); } /*------------------------------------------------------------------------- @@ -367,15 +338,9 @@ coll_chunk6(void) void coll_chunk7(void) { + const char *filename = GetTestParameters(); - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - - filename = GetTestParameters(); - coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_TRUE); - + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_TRUE); } /*------------------------------------------------------------------------- @@ -417,15 +382,9 @@ coll_chunk7(void) void coll_chunk8(void) { + const char *filename = GetTestParameters(); - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - - filename = GetTestParameters(); - coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_LINK_FALSE); - + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_LINK_FALSE); } /*------------------------------------------------------------------------- @@ -467,15 +426,9 @@ coll_chunk8(void) void coll_chunk9(void) { + const char *filename = GetTestParameters(); - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - - filename = GetTestParameters(); - coll_chunktest(filename,4,BYROW_SELECTUNBALANCE,API_MULTI_COLL); - + coll_chunktest(filename, 4, BYROW_SELECTUNBALANCE, API_MULTI_COLL); } /*------------------------------------------------------------------------- @@ -517,15 +470,9 @@ coll_chunk9(void) void coll_chunk10(void) { + const char *filename = GetTestParameters(); - const char *filename; - int mpi_size; - - MPI_Comm comm = MPI_COMM_WORLD; - - filename = GetTestParameters(); - coll_chunktest(filename,4,BYROW_SELECTINCHUNK,API_MULTI_IND); - + coll_chunktest(filename, 4, BYROW_SELECTINCHUNK, API_MULTI_IND); } @@ -555,8 +502,8 @@ static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, - int api_option) { - + int api_option) +{ hid_t file,dataset, file_dataspace; hid_t acc_plist,xfer_plist,crp_plist; diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index aa642b4..f38b30e 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -210,7 +210,7 @@ filter_read_internal(const char *filename, hid_t dcpl, void test_filter_read(void) { - hid_t dc,file; /* HDF5 IDs */ + hid_t dc; /* HDF5 IDs */ const hsize_t chunk_size[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */ hsize_t null_size; /* Size of dataset without filters */ herr_t hrc; diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index c4b319a..f7d7ebb 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -22,16 +22,16 @@ enum obj_type { is_group, is_dset }; -int get_size(void); -void write_dataset(hid_t, hid_t, hid_t); -int read_dataset(hid_t, hid_t, hid_t); -void create_group_recursive(hid_t, hid_t, hid_t, int); -void recursive_read_group(hid_t, hid_t, hid_t, int); -void group_dataset_read(hid_t fid, int mpi_rank, int m); -void write_attribute(hid_t, int, int); -int read_attribute(hid_t, int, int); -int check_value(DATATYPE *, DATATYPE *, int); -void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int); +static int get_size(void); +static void write_dataset(hid_t, hid_t, hid_t); +static int read_dataset(hid_t, hid_t, hid_t); +static void create_group_recursive(hid_t, hid_t, hid_t, int); +static void recursive_read_group(hid_t, hid_t, hid_t, int); +static void group_dataset_read(hid_t fid, int mpi_rank, int m); +static void write_attribute(hid_t, int, int); +static int read_attribute(hid_t, int, int); +static int check_value(DATATYPE *, DATATYPE *, int); +static void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int); /* @@ -44,7 +44,8 @@ void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int); * JRM - 8/11/04 */ -int get_size(void) +static int +get_size(void) { int mpi_rank; int mpi_size; @@ -867,7 +868,8 @@ void independent_group_read(void) * * JRM - 8/16/04 */ -void group_dataset_read(hid_t fid, int mpi_rank, int m) +static void +group_dataset_read(hid_t fid, int mpi_rank, int m) { int ret, i, j, size; char gname[64], dname[32]; @@ -1035,7 +1037,8 @@ void multiple_group_write(void) * * JRM - 8/16/04 */ -void write_dataset(hid_t memspace, hid_t filespace, hid_t gid) +static void +write_dataset(hid_t memspace, hid_t filespace, hid_t gid) { int i, j, n, size; int mpi_rank, mpi_size; @@ -1074,8 +1077,8 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid) * Creates subgroups of depth GROUP_DEPTH recursively. Also writes datasets * in parallel in each group. */ -void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, - int counter) +static void +create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, int counter) { hid_t child_gid; int mpi_rank; @@ -1196,7 +1199,8 @@ void multiple_group_read(void) * * JRM - 8/11/04 */ -int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) +static int +read_dataset(hid_t memspace, hid_t filespace, hid_t gid) { int i, j, n, mpi_rank, mpi_size, size, attr_errors=0, vrfy_errors=0; char dname[32]; @@ -1250,8 +1254,8 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) * This recursive function opens all the groups in vertical direction and * checks the data. */ -void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, - int counter) +static void +recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, int counter) { hid_t child_gid; int mpi_rank, err_num=0; @@ -1278,7 +1282,8 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, /* Create and write attribute for a group or a dataset. For groups, attribute * is a scalar datum; for dataset, it is a one-dimensional array. */ -void write_attribute(hid_t obj_id, int this_type, int num) +static void +write_attribute(hid_t obj_id, int this_type, int num) { hid_t sid, aid; hsize_t dspace_dims[1]={8}; @@ -1309,7 +1314,8 @@ void write_attribute(hid_t obj_id, int this_type, int num) } /* Read and verify attribute for group or dataset. */ -int read_attribute(hid_t obj_id, int this_type, int num) +static int +read_attribute(hid_t obj_id, int this_type, int num) { hid_t aid; hsize_t group_block[2]={1,1}, dset_block[2]={1, 8}; @@ -1351,7 +1357,8 @@ int read_attribute(hid_t obj_id, int this_type, int num) * * JRM - 8/16/04 */ -int check_value(DATATYPE *indata, DATATYPE *outdata, int size) +static int +check_value(DATATYPE *indata, DATATYPE *outdata, int size) { int mpi_rank, mpi_size, err_num=0; hsize_t i, j; @@ -1387,11 +1394,9 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size) * JRM - 8/11/04 */ -void get_slab(hsize_t chunk_origin[], - hsize_t chunk_dims[], - hsize_t count[], - hsize_t file_dims[], - int size) +static void +get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[], + hsize_t file_dims[], int size) { int mpi_rank, mpi_size; @@ -1450,10 +1455,6 @@ void io_mode_confusion(void) hsize_t dimsf[1]; /* dataset dimensions */ int data[N] = {1}; /* pointer to data buffer to write */ hsize_t coord[N] = {0L,1L,2L,3L}; - hsize_t start[1]; - hsize_t stride[1]; - hsize_t count[1]; - hsize_t block[1]; hid_t plist_id; /* property list identifier */ herr_t status; @@ -1579,11 +1580,6 @@ void io_mode_confusion(void) VRFY((filespace >= 0 ), "H5Dget_space() failed"); - start[0] = 0L; - stride[0] = 1; - count[0] = 1; - block[0] = N; - /* select all */ if(mpi_rank == 0 ) { if(verbose ) @@ -1591,8 +1587,7 @@ void io_mode_confusion(void) "%0d:%s: Calling H5Sselect_elements() -- set up hang?\n", mpi_rank, fcn_name); - status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, - &coord); + status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, (const hsize_t *)&coord); VRFY((status >= 0 ), "H5Sselect_elements() failed"); } else { /* select nothing */ if(verbose ) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 14ba6c6..2195c32 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -697,10 +697,10 @@ static int test_mpio_derived_dtype(char *filename) { MPI_Datatype etype,filetype; MPI_Datatype adv_filetype,bas_filetype[2]; MPI_Datatype etypenew, filetypenew; - MPI_Offset disp,dispnew; + MPI_Offset disp; MPI_Status Status; MPI_Aint adv_disp[2]; - MPI_Aint offsets[1],adv_offsets[2]; + MPI_Aint offsets[1]; int blocklens[1],adv_blocklens[2]; int count,outcount; int retcode; @@ -896,9 +896,9 @@ If it turns out that the previous working MPI-IO package no longer works, this t we can turn off the support for special collective IO; currently only special collective IO. */ -static int test_mpio_special_collective(char *filename) { - - char hostname[128]; +static int +test_mpio_special_collective(char *filename) +{ int mpi_size, mpi_rank; MPI_File fh; MPI_Datatype etype,buftype,filetype; @@ -907,12 +907,10 @@ static int test_mpio_special_collective(char *filename) { int mpi_err; char writedata[2]; char *buf; - char expect_val; - int i, irank; + int i; int count,bufcount; int blocklens[2]; MPI_Aint offsets[2]; - int nerrors = 0; /* number of errors */ MPI_Offset mpi_off; MPI_Status mpi_stat; int retcode; diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index 29d5c58..0773b93 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -50,7 +50,8 @@ static double the_data[100][100]; * *------------------------------------------------------------------------- */ -hid_t create_file(char* name, hid_t fapl) +static hid_t +create_file(char* name, hid_t fapl) { hid_t file, dcpl, space, dset, groups, grp, plist; hsize_t ds_size[2] = {100, 100}; @@ -121,8 +122,7 @@ int main(int argc, char* argv[]) { hid_t file1, file2, fapl; - MPI_File mpifh=-2; - int *mpifh_p = NULL; + MPI_File *mpifh_p = NULL; char name[1024]; const char *envval = NULL; int mpi_size, mpi_rank; diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index 82c112f..a570d4c 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -49,7 +49,8 @@ static double the_data[100][100]; * *------------------------------------------------------------------------- */ -int check_file(char* name, hid_t fapl) +static int +check_file(char* name, hid_t fapl) { hid_t file, space, dset, groups, grp, plist; hsize_t ds_size[2]; diff --git a/testpar/t_posix_compliant.c b/testpar/t_posix_compliant.c index a4b8a86..1be3e99 100644 --- a/testpar/t_posix_compliant.c +++ b/testpar/t_posix_compliant.c @@ -701,7 +701,8 @@ static int find_writesize(int rank, int numprocs, int size) return write_size; } -static void vrfy_elements(int* a, int* b, int size, int rank) +static void +vrfy_elements(int* a, int* b, int size, int rank) { int i, counter = 0; @@ -725,6 +726,7 @@ static void vrfy_elements(int* a, int* b, int size, int rank) /* print an explanation message by MAIN (0) process. */ +static void header_msg(void) { printf( @@ -736,7 +738,8 @@ header_msg(void) ); } -int main(int argc, char* argv[]) +int +main(int argc, char* argv[]) { int numprocs, rank, opt, mpi_tests=1, posix_tests=1; diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 800ad41..667872c 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -248,7 +248,7 @@ void coll_write_test(int chunk_factor) hsize_t chunk_dims[2]; herr_t ret; - unsigned i,j; + unsigned i; int fillvalue = 0; /* Fill value for the dataset */ #if 0 @@ -689,7 +689,8 @@ void coll_write_test(int chunk_factor) coll_write_test. *------------------------------------------------------------------------- */ -void coll_read_test(int chunk_factor) +static void +coll_read_test(int chunk_factor) { const char *filename; @@ -713,7 +714,7 @@ void coll_read_test(int chunk_factor) hsize_t block[2]; /* Block sizes */ herr_t ret; - unsigned i,j; + unsigned i; int *matrix_out; int *matrix_out1; @@ -932,3 +933,4 @@ void coll_read_test(int chunk_factor) return ; } + diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 547d910..8e7b181 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -19,9 +19,9 @@ #include "h5diff_common.h" #include "h5tools_utils.h" -int check_n_input( const char* ); -int check_p_input( const char* ); -int check_d_input( const char* ); +static int check_n_input( const char* ); +static int check_p_input( const char* ); +static int check_d_input( const char* ); /* module-scoped variables */ @@ -228,7 +228,8 @@ void parse_command_line(int argc, * *------------------------------------------------------------------------- */ -int check_n_input( const char *str ) +static int +check_n_input( const char *str ) { unsigned i; char c; @@ -263,7 +264,8 @@ int check_n_input( const char *str ) * *------------------------------------------------------------------------- */ -int check_p_input( const char *str ) +static int +check_p_input( const char *str ) { double x; @@ -296,7 +298,8 @@ int check_p_input( const char *str ) * *------------------------------------------------------------------------- */ -int check_d_input( const char *str ) +static int +check_d_input( const char *str ) { double x; diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index d9495e5..181e242 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -55,7 +55,7 @@ return -1; } const H5L_class_t UD_link_class[1] = {{ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */ - MY_LINKCLASS, /* Link type id number */ + (H5L_type_t)MY_LINKCLASS, /* Link type id number */ "UD link class", /* name for debugging */ NULL, /* Creation callback */ NULL, /* Move/rename callback */ @@ -492,7 +492,7 @@ int test_types(const char *fname) */ H5Lcreate_external("filename", "objname", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); H5Lregister(UD_link_class); - H5Lcreate_ud(fid1, "ud_link", MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT); + H5Lcreate_ud(fid1, "ud_link", (H5L_type_t)MY_LINKCLASS, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * Close @@ -2608,6 +2608,7 @@ void gen_datareg(hid_t fid, sid1 = H5Screate_simple(2, dims1, NULL); did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); + assert(status >= 0); /* create the reference dataset */ sid2 = H5Screate_simple(1, dims2, NULL); @@ -2624,10 +2625,12 @@ void gen_datareg(hid_t fid, } status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); + assert(status >= 0); H5Sget_select_npoints(sid1); /* store first dataset region */ status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1); + assert(status >= 0); /* select sequence of five points for second reference */ coord[0][0]=6; coord[0][1]=9; @@ -2649,15 +2652,20 @@ void gen_datareg(hid_t fid, /* write */ status = H5Dwrite(did2,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,rbuf); + assert(status >= 0); /* close, free memory buffers */ status = H5Dclose(did1); + assert(status >= 0); status = H5Sclose(sid1); + assert(status >= 0); status = H5Dclose(did2); + assert(status >= 0); status = H5Sclose(sid2); + assert(status >= 0); + free(rbuf); free(buf); - } diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index a4ac793..c613879 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -16,6 +16,7 @@ #include "h5diff.h" #include "ph5diff.h" #include +#include #include #include "h5diff_common.h" @@ -59,7 +60,6 @@ int main(int argc, const char *argv[]) const char *fname2 = NULL; const char *objname1 = NULL; const char *objname2 = NULL; - hsize_t nfound=0; diff_opt_t options; outBuffOffset = 0; @@ -78,7 +78,7 @@ int main(int argc, const char *argv[]) parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); - nfound = h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &options); print_info(&options); @@ -92,7 +92,7 @@ int main(int argc, const char *argv[]) { parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); - nfound = h5diff(fname1, fname2, objname1, objname2, &options); + h5diff(fname1, fname2, objname1, objname2, &options); MPI_Barrier(MPI_COMM_WORLD); @@ -131,7 +131,6 @@ ph5diff_worker(int nID) hid_t file1_id, file2_id; char filenames[2][1024]; char out_data[PRINT_DATA_MAX_SIZE] = {0}; - hsize_t nfound=0; struct diffs_found diffs; int i; MPI_Status Status; @@ -170,8 +169,7 @@ ph5diff_worker(int nID) /*Recv parameters for diff from manager task */ MPI_Recv(&args, sizeof(args), MPI_BYTE, 0, MPI_TAG_ARGS, MPI_COMM_WORLD, &Status); /*Do the diff */ - nfound = diff(file1_id, args.name, file2_id, args.name, &(args.options), args.type); - diffs.nfound = nfound; + diffs.nfound = diff(file1_id, args.name, file2_id, args.name, &(args.options), args.type); diffs.not_cmp = args.options.not_cmp; /*If print buffer has something in it, request print token.*/ diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 3b11eac..fc75681 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -5502,7 +5502,6 @@ static int gent_ldouble(void) hid_t did; hid_t tid; hid_t sid; - size_t size; hsize_t dims[1] = {3}; long double buf[3] = {1,2,3}; @@ -5515,7 +5514,7 @@ static int gent_ldouble(void) if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) goto error; - if((size = H5Tget_size(tid)) == 0) + if(H5Tget_size(tid) == 0) goto error; if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 718ec6b..dd1a2be 100755 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -33,7 +33,6 @@ main(void) int i, j, k; FILE *sp; - float b32r3[5][3][4]; float row4[3], col4[4], pln4[5]; float rowo4 = (float)11.0e0, colo4 = (float)21.0e0, plno4 = (float)51.0e0; float rowi4 = (float)1.0e0, coli4 = (float)2.0e0, plni4 = (float)5.0e0; @@ -44,7 +43,6 @@ main(void) int rowi4i = (int)1 , coli4i = (int)2 , plni4i = (int)5 ; #ifndef WIN32 - long long b64i2[3][4], b64i3[5][3][4]; long long row4i64[3], col4i64[4], pln4i64[5]; long long rowo4i64 = (long long)11 , colo4i64 = (long long)21 , plno4i64 = (long long)51 ; long long rowi4i64 = (long long)1 , coli4i64 = (long long)2 , plni4i64 = (long long)5 ; @@ -142,16 +140,6 @@ main(void) pln4i8[k] = pln4i8[k - 1] + plni4i8; } - for (i = 0; i < nrow; i++) - { - for (j = 0; j < ncol; j++) - { -#ifndef WIN32 - b64i2[i][j] = row4i64[i] + col4i64[j]; -#endif - } - } - /* * build array elements - rank 3 * @@ -159,29 +147,18 @@ main(void) */ for (i = 0; i < nrow; i++) - { for (j = 0; j < ncol; j++) - { - for (k = 0; k < npln; k++) - { - b32r3[k][i][j] = row4[i] + col4[j] + pln4[k]; + for (k = 0; k < npln; k++) { b64r3[k][i][j] = row8[i] + col8[j] + pln8[k]; b32i3[k][i][j] = row4i[i] + col4i[j] + pln4i[k]; -#ifndef WIN32 - b64i3[k][i][j] = row4i64[i] + col4i64[j] + pln4i64[k]; -#endif b16i3[k][i][j] = row4i16[i] + col4i16[j] + pln4i16[k]; b8i3[k][i][j] = row4i8[i] + col4i8[j] + pln4i8[k]; } - } - } #ifndef UNICOS - - /*------------------------------------------------------------------------- * TOOLTEST txtin16.txt -c $srcdir/testfiles/txtin16.conf -o txtin16.h5 *------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index c5f9d69..1a9422e 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -3735,9 +3735,11 @@ void make_dset_reg_ref(hid_t loc_id) /* Write selection to disk */ ret = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); + assert(ret >= 0); /* Close Dataset */ ret = H5Dclose(dset2); + assert(ret >= 0); /* Create dataspace for the reference dataset */ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL); @@ -3753,17 +3755,23 @@ void make_dset_reg_ref(hid_t loc_id) count[0] = 6; count[1] = 6; block[0] = 1; block[1] = 1; ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); + assert(ret >= 0); /* Store dataset region */ ret = H5Rcreate(&wbuf[0], loc_id, "dsetreg", H5R_DATASET_REGION, sid2); + assert(ret >= 0); /* Write selection to disk */ ret=H5Dwrite(dset1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf); + assert(ret >= 0); /* Close all objects */ ret = H5Sclose(sid1); + assert(ret >= 0); ret = H5Dclose(dset1); + assert(ret >= 0); ret = H5Sclose(sid2); + assert(ret >= 0); free(wbuf); free(dwbuf); diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index e95a9ee..315c558 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -98,9 +98,7 @@ int d_status = EXIT_SUCCESS; static int display_all = TRUE; static int display_file_metadata = FALSE; static int display_file = FALSE; -static int display_group_metadata = FALSE; static int display_group = FALSE; -static int display_dset_metadata = FALSE; static int display_dset = FALSE; static int display_dtype_metadata = FALSE; static int display_object = FALSE; @@ -698,7 +696,6 @@ parse_command_line(int argc, const char *argv[]) case 'G': display_all = FALSE; - display_group_metadata = TRUE; break; case 'g': @@ -713,7 +710,6 @@ parse_command_line(int argc, const char *argv[]) case 'D': display_all = FALSE; - display_dset_metadata = TRUE; break; case 'd': @@ -1106,7 +1102,6 @@ print_file_statistics(const iter_t *iter) display_file = TRUE; display_file_metadata = TRUE; display_group = TRUE; - display_group_metadata = TRUE; display_dset = TRUE; display_dtype_metadata = TRUE; display_attr = TRUE; diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index 250226e..3f933f2 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -23,6 +23,7 @@ * of the expected output and update the corresponding *.ddl files. */ +#include #include "hdf5.h" #define FILE "h5stat_newgrat.h5" @@ -47,6 +48,7 @@ static void gen_file(void) fapl = H5Pcreate(H5P_FILE_ACCESS); ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + assert(ret >= 0); /* Create dataset */ file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -68,12 +70,17 @@ static void gen_file(void) sprintf(attrname, "%s%d", ATTR_NAME,i); attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); ret = H5Aclose(attr_id); + assert(ret >= 0); } /* end for */ ret = H5Dclose(dset_id); + assert(ret >= 0); ret = H5Sclose(space_id); + assert(ret >= 0); ret = H5Tclose(type_id); + assert(ret >= 0); ret = H5Fclose(file); + assert(ret >= 0); } int main(void) -- cgit v0.12