diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-02-28 18:26:34 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-02-28 18:26:34 (GMT) |
commit | df6c92e506a81ed0ede7dacc1269d21ae3e0f411 (patch) | |
tree | c67a1ca1bb197289bd955ca4065f0c611dbcdf6e | |
parent | 9423da6a4d53cb2eb6c48a9e0d254307bbf8ae9b (diff) | |
download | hdf5-df6c92e506a81ed0ede7dacc1269d21ae3e0f411.zip hdf5-df6c92e506a81ed0ede7dacc1269d21ae3e0f411.tar.gz hdf5-df6c92e506a81ed0ede7dacc1269d21ae3e0f411.tar.bz2 |
[svn-r22004] Reduced warnings and fixed conflicts resulting from including h5tools.h
Tested: local linux
33 files changed, 331 insertions, 313 deletions
diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index d5d169e..810be78 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -17,6 +17,7 @@ #include <stdlib.h> #include "gif.h" +#include "h5tools.h" #include "h5tools_utils.h" diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 907fb80..7995bb4 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -37,7 +37,7 @@ #include "gif.h" -#define VERSION "1.00" +#define GIF2VERSION "1.00" GIFTOMEM Gif2Mem(BYTE *MemGif) diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index a193240..090d657 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -17,6 +17,7 @@ #include <assert.h> #include "gif.h" #include "H5IMpublic.h" +#include "h5tools.h" #include "h5tools_utils.h" diff --git a/perform/pio_engine.c b/perform/pio_engine.c index abb72fa..0e3190c 100644 --- a/perform/pio_engine.c +++ b/perform/pio_engine.c @@ -320,22 +320,22 @@ do_pio(parameters param) /* Need barrier to make sure everyone starts at the same time */ MPI_Barrier(pio_comm_g); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_CREATE | PIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); hrc == SUCCESS; - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -349,20 +349,20 @@ do_pio(parameters param) MPI_Barrier(pio_comm_g); /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -413,7 +413,7 @@ done: static char * pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t size) { - const char *prefix, *suffix=""; + const char *prefix, *suffix = ""; char *ptr, last = '\0'; size_t i, j; @@ -968,7 +968,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Write */ @@ -1399,7 +1399,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -1899,7 +1899,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Read */ @@ -2354,7 +2354,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ @@ -3115,9 +3115,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, START); + set_time(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, STOP); + set_time(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -3126,9 +3126,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, START); + set_time(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, STOP); + set_time(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -3136,9 +3136,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, START); + set_time(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, STOP); + set_time(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } @@ -3146,9 +3146,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, START); + set_time(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, STOP); + set_time(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 9cbd65d..337e982 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -288,14 +288,14 @@ struct options { unsigned interleaved; /* Interleaved vs. contiguous blocks */ unsigned collective; /* Collective vs. independent I/O */ unsigned dim2d; /* 1D vs. 2D geometry */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ off_t h5_alignment; /* alignment in HDF5 file */ off_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ }; typedef struct _minmax { @@ -683,7 +683,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -749,7 +749,7 @@ run_test(iotype iot, parameters parms, struct options *opts) } if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -1103,10 +1103,10 @@ print_indent(register int indent) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + fputc(' ', output); } } @@ -1131,11 +1131,11 @@ static void print_io_api(long io_types) { if (io_types & PIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & PIO_MPI) - HDfprintf(output, "mpiio "); + HDfprintf(output, "mpiio "); if (io_types & PIO_HDF5) - HDfprintf(output, "phdf5 "); + HDfprintf(output, "phdf5 "); HDfprintf(output, "\n"); } @@ -1144,7 +1144,7 @@ report_parameters(struct options *opts) { int rank = comm_world_rank_g; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "rank %d: ==== Parameters ====\n", rank); HDfprintf(output, "rank %d: IO API=", rank); @@ -1565,7 +1565,7 @@ parse_size_directive(const char *size) * Return: Nothing * Programmer: Bill Wendling, 31. October 2001 * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) + * Added 2D testing (Christian Chilan, 10. August 2005) */ static void usage(const char *prog) @@ -1575,7 +1575,7 @@ usage(const char *prog) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - print_version(prog); + print_version(prog); printf("usage: %s [OPTIONS]\n", prog); printf(" OPTIONS\n"); printf(" -h, --help Print a usage message and exit\n"); diff --git a/perform/pio_perf.h b/perform/pio_perf.h index 6f510ca..094b31d 100644 --- a/perform/pio_perf.h +++ b/perform/pio_perf.h @@ -19,6 +19,7 @@ #ifndef STANDALONE #include "H5private.h" #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #else #include "pio_standalone.h" diff --git a/perform/pio_timer.c b/perform/pio_timer.c index 9c8abb7..aba219e 100644 --- a/perform/pio_timer.c +++ b/perform/pio_timer.c @@ -43,15 +43,15 @@ pio_time *timer_g; /* timer: global for stub functions */ * Function: sub_time * Purpose: Struct two time values, and return the difference, in microseconds * - * Note that the function assumes that a > b + * Note that the function assumes that a > b * Programmer: Leon Arber, 1/27/06 */ static double sub_time(struct timeval* a, struct timeval* b) { return (((double)a->tv_sec + ((double)a->tv_usec) / MICROSECOND) - - ((double)b->tv_sec + - ((double)b->tv_usec) / MICROSECOND)); + ((double)b->tv_sec + + ((double)b->tv_usec) / MICROSECOND)); } @@ -89,7 +89,7 @@ pio_time_new(clock_type type) void pio_time_destroy(pio_time *pt) { - free(pt); + HDfree(pt); /* reset the global timer pointer too. */ timer_g = NULL; } @@ -134,37 +134,37 @@ set_time(pio_time *pt, timer_type t, int start_stop) { if (pt) { if (pt->type == MPI_TIMER) { - if (start_stop == START) { + if (start_stop == TSTART) { pt->mpi_timer[t] = MPI_Wtime(); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS]; - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS]; + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_WRITE_FIXED_DIMS]; + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_GROSS_READ_FIXED_DIMS]; } else { pt->total_time[t] += MPI_Wtime() - pt->mpi_timer[t]; - pt->mpi_timer[t] = MPI_Wtime(); - - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS]; - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS]; + pt->mpi_timer[t] = MPI_Wtime(); + + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_WRITE_FIXED_DIMS]; + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += pt->mpi_timer[t] - pt->mpi_timer[HDF5_FINE_READ_FIXED_DIMS]; } } else { - if (start_stop == START) { + if (start_stop == TSTART) { HDgettimeofday(&pt->sys_timer[t], NULL); - /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS - * we compute the time it took to only open the file */ - if(t == HDF5_FINE_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); - else if(t == HDF5_FINE_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); + /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS + * we compute the time it took to only open the file */ + if(t == HDF5_FINE_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS])); + else if(t == HDF5_FINE_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS])); } else { @@ -178,12 +178,12 @@ set_time(pio_time *pt, timer_type t, int start_stop) ((double)pt->sys_timer[t].tv_sec + ((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/ - /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS - * we compute the time it took to close the file after the last read/write finished */ - if(t == HDF5_GROSS_WRITE_FIXED_DIMS) - pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); - else if(t == HDF5_GROSS_READ_FIXED_DIMS) - pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); + /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS + * we compute the time it took to close the file after the last read/write finished */ + if(t == HDF5_GROSS_WRITE_FIXED_DIMS) + pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS])); + else if(t == HDF5_GROSS_READ_FIXED_DIMS) + pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS])); } } @@ -231,7 +231,7 @@ set_time(pio_time *pt, timer_type t, int start_stop) } fprintf(output, " Proc %d: %s %s: %.2f\n", myrank, msg, - (start_stop == START ? "Start" : "Stop"), + (start_stop == TSTART ? "Start" : "Stop"), pt->total_time[t]); } } diff --git a/perform/pio_timer.h b/perform/pio_timer.h index 943521a..a5ee6d7 100644 --- a/perform/pio_timer.h +++ b/perform/pio_timer.h @@ -53,8 +53,8 @@ typedef enum clock_type_ { /* Miscellaneous identifiers */ enum { - START, /* Start a specified timer */ - STOP /* Stop a specified timer */ + TSTART, /* Start a specified timer */ + TSTOP /* Stop a specified timer */ }; /* The performance time structure */ diff --git a/perform/sio_engine.c b/perform/sio_engine.c index e892bcc..df2e21e 100644 --- a/perform/sio_engine.c +++ b/perform/sio_engine.c @@ -22,7 +22,7 @@ #include <stdlib.h> #include <fcntl.h> #ifdef H5_HAVE_UNISTD_H -# include <unistd.h> +# include <unistd.h> #endif #include <errno.h> @@ -233,18 +233,18 @@ do_sio(parameters param) HDfprintf(output, "data filename=%s\n", fname); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -253,19 +253,19 @@ do_sio(parameters param) */ /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, START); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(&res, &fd, ¶m, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, STOP); + set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -551,7 +551,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) } /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); /* Perform write */ hrc = dset_write(rank-1, fd, parms, buffer); @@ -563,7 +563,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -628,7 +628,7 @@ static herr_t dset_write(int local_dim, file_descr *fd, parameters *parms, void int cur_dim = order[local_dim]-1; int ret_code = SUCCESS; int k; - hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS]; + hsize_t dims[MAX_DIMS], maxdims[MAX_DIMS]; long i,j; herr_t hrc; @@ -855,7 +855,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) } /* end switch */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, START); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); hrc = dset_read(rank-1, fd, parms, buffer, buffer2); if (hrc < 0) { @@ -864,7 +864,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) } /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, STOP); + set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ diff --git a/perform/sio_perf.c b/perform/sio_perf.c index 8900e2e..16e1750 100644 --- a/perform/sio_perf.c +++ b/perform/sio_perf.c @@ -295,15 +295,15 @@ struct options { int buf_rank; /* Rank */ int order_rank; /* Rank */ int chk_rank; /* Rank */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ off_t h5_alignment; /* alignment in HDF5 file */ off_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int h5_extendable; /* Perform the write tests only */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int h5_extendable; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* Use MPI-posix VFD for HDF5 I/O (instead of MPI-I/O VFD) */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ vfdtype vfd; /* File driver */ }; @@ -558,7 +558,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -604,7 +604,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size); if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -815,10 +815,10 @@ output_report(const char *fmt, ...) static void print_indent(register int indent) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + fputc(' ', output); } static void @@ -842,9 +842,9 @@ static void print_io_api(long io_types) { if (io_types & SIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & SIO_HDF5) - HDfprintf(output, "hdf5 "); + HDfprintf(output, "hdf5 "); HDfprintf(output, "\n"); } @@ -854,7 +854,7 @@ report_parameters(struct options *opts) int i, rank; rank = opts->dset_rank; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "==== Parameters ====\n"); HDfprintf(output, "IO API="); @@ -1348,7 +1348,7 @@ parse_size_directive(const char *size) static void usage(const char *prog) { - print_version(prog); + print_version(prog); printf("usage: %s [OPTIONS]\n", prog); printf(" OPTIONS\n"); printf(" -h Print an usage message and exit\n"); diff --git a/perform/sio_perf.h b/perform/sio_perf.h index 2417b6f..3e4456a 100644 --- a/perform/sio_perf.h +++ b/perform/sio_perf.h @@ -19,6 +19,7 @@ #ifndef STANDALONE #include "H5private.h" #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #else #include "sio_standalone.h" @@ -49,24 +50,24 @@ typedef enum vfdtype_ { } vfdtype; typedef struct parameters_ { - iotype io_type; /* The type of IO test to perform */ + iotype io_type; /* The type of IO test to perform */ vfdtype vfd; - long num_files; /* Number of files to create */ - long num_dsets; /* Number of datasets to create */ - off_t num_bytes; /* Number of bytes in each dset */ + long num_files; /* Number of files to create */ + long num_dsets; /* Number of datasets to create */ + off_t num_bytes; /* Number of bytes in each dset */ int num_iters; /* Number of times to loop doing the IO */ int rank; /* Rank of dataset */ - off_t dset_size[MAX_DIMS]; /* Dataset size */ - size_t buf_size[MAX_DIMS]; /* Buffer size */ - size_t chk_size[MAX_DIMS]; /* Chunk size */ - int order[MAX_DIMS]; /* Buffer size */ - hsize_t h5_align; /* HDF5 object alignment */ - hsize_t h5_thresh; /* HDF5 object alignment threshold */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_extendable; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ + off_t dset_size[MAX_DIMS]; /* Dataset size */ + size_t buf_size[MAX_DIMS]; /* Buffer size */ + size_t chk_size[MAX_DIMS]; /* Chunk size */ + int order[MAX_DIMS]; /* Buffer size */ + hsize_t h5_align; /* HDF5 object alignment */ + hsize_t h5_thresh; /* HDF5 object alignment threshold */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_extendable; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ unsigned h5_use_mpi_posix; /* VFD for HDF5 I/O */ - int verify; /* Verify data correctness */ + int verify; /* Verify data correctness */ } parameters; typedef struct results_ { diff --git a/perform/sio_timer.c b/perform/sio_timer.c index f188a10..f233de3 100644 --- a/perform/sio_timer.c +++ b/perform/sio_timer.c @@ -39,15 +39,15 @@ sio_time *timer_g; /* timer: global for stub functions */ * Function: sub_time
* Purpose: Struct two time values, and return the difference, in microseconds
*
- * Note that the function assumes that a > b
+ * Note that the function assumes that a > b
* Programmer: Leon Arber, 1/27/06
*/
static double sub_time(struct timeval* a, struct timeval* b)
{
return (((double)a->tv_sec +
((double)a->tv_usec) / MICROSECOND) -
- ((double)b->tv_sec +
- ((double)b->tv_usec) / MICROSECOND));
+ ((double)b->tv_sec +
+ ((double)b->tv_usec) / MICROSECOND));
}
@@ -82,7 +82,7 @@ sio_time_new(void) void
sio_time_destroy(sio_time *pt)
{
- free(pt);
+ HDfree(pt);
/* reset the global timer pointer too. */
timer_g = NULL;
}
@@ -100,15 +100,15 @@ sio_time * set_time(sio_time *pt, timer_type t, int start_stop)
{
if (pt) {
- if (start_stop == START) {
+ if (start_stop == TSTART) {
HDgettimeofday(&pt->sys_timer[t], NULL);
- /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
- * we compute the time it took to only open the file */
- if(t == HDF5_FINE_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
- else if(t == HDF5_FINE_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
+ /* When we start the timer for HDF5_FINE_WRITE_FIXED_DIMS or HDF5_FINE_READ_FIXED_DIMS
+ * we compute the time it took to only open the file */
+ if(t == HDF5_FINE_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_FINE_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_OPEN] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_GROSS_READ_FIXED_DIMS]));
} else {
@@ -122,12 +122,12 @@ set_time(sio_time *pt, timer_type t, int start_stop) ((double)pt->sys_timer[t].tv_sec +
((double)pt->sys_timer[t].tv_usec) / MICROSECOND);*/
- /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
- * we compute the time it took to close the file after the last read/write finished */
- if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
- pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
- else if(t == HDF5_GROSS_READ_FIXED_DIMS)
- pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
+ /* When we stop the timer for HDF5_GROSS_WRITE_FIXED_DIMS or HDF5_GROSS_READ_FIXED_DIMS
+ * we compute the time it took to close the file after the last read/write finished */
+ if(t == HDF5_GROSS_WRITE_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_WRITE_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_WRITE_FIXED_DIMS]));
+ else if(t == HDF5_GROSS_READ_FIXED_DIMS)
+ pt->total_time[HDF5_FILE_READ_CLOSE] += sub_time(&(pt->sys_timer[t]), &(pt->sys_timer[HDF5_FINE_READ_FIXED_DIMS]));
}
@@ -171,7 +171,7 @@ set_time(sio_time *pt, timer_type t, int start_stop) }
fprintf(output, " %s %s: %.2f\n", msg,
- (start_stop == START ? "Start" : "Stop"),
+ (start_stop == TSTART ? "Start" : "Stop"),
pt->total_time[t]);
}
}
diff --git a/perform/sio_timer.h b/perform/sio_timer.h index 1fa880d..04432af 100644 --- a/perform/sio_timer.h +++ b/perform/sio_timer.h @@ -27,7 +27,7 @@ #endif #ifdef H5_HAVE_WINSOCK_H -# include <winsock2.h> +# include <winsock2.h> #endif /* H5_HAVE_WINSOCK_H */ /* The different types of timers we can have */ @@ -52,8 +52,8 @@ typedef enum timer_type_ { /* Miscellaneous identifiers */ enum { - START, /* Start a specified timer */ - STOP /* Stop a specified timer */ + TSTART, /* Start a specified timer */ + TSTOP /* Stop a specified timer */ }; /* The performance time structure */ diff --git a/perform/zip_perf.c b/perform/zip_perf.c index 4e1f043..585dc13 100644 --- a/perform/zip_perf.c +++ b/perform/zip_perf.c @@ -23,6 +23,7 @@ /* our header files */ #include "h5test.h" +#include "h5tools.h" #include "h5tools_utils.h" #ifdef H5_HAVE_FILTER_DEFLATE diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 1a9a8eb..574ba94 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -465,7 +465,7 @@ main (int argc, const char *argv[]) /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + HDfree((char*)linkinfo.trg_path); /* close propertis */ if(H5Pclose(ocpl_id)<0) @@ -497,7 +497,7 @@ error: /* free link info path */ if (linkinfo.trg_path) - HDfree(linkinfo.trg_path); + HDfree((char*)linkinfo.trg_path); H5E_BEGIN_TRY { H5Pclose(ocpl_id); diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index f7532f2..b8e46f3 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -17,6 +17,7 @@ #include <string.h> #include "h5diff.h" #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" static int check_n_input( const char* ); @@ -53,7 +54,7 @@ static struct long_options l_opts[] = { * *------------------------------------------------------------------------- */ -static check_options(diff_opt_t* options) +static void check_options(diff_opt_t* options) { /*-------------------------------------------------------------- * check for mutually exclusive options @@ -179,7 +180,7 @@ void parse_command_line(int argc, } /* init */ - exclude_node->obj_path = opt_arg; + exclude_node->obj_path = (char*)opt_arg; exclude_node->obj_type = H5TRAV_TYPE_UNKNOWN; exclude_prev = exclude_head; diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 51a49c2..607d58e 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -18,6 +18,7 @@ #include <memory.h> #include "h5diff.h" #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 5bd5567..1fc563b 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -19,6 +19,7 @@ #include <string.h> #include <assert.h> #include "h5diff_common.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 89701bd..56dc5ab 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -20,6 +20,7 @@ #include <string.h> #include <ctype.h> #include "h5import.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ @@ -1361,7 +1362,7 @@ static int processConfigurationFile(char *infile, struct Input *in) break; case 12: /* EXTERNAL-STORAGE */ - if (in->configOptionVector[EXTERNAL] == 1) { + if (in->configOptionVector[EXTERNALSTORE] == 1) { (void) HDfprintf(stderr, err15a, infile); HDfclose(strm); return (-1); @@ -1372,7 +1373,7 @@ static int processConfigurationFile(char *infile, struct Input *in) HDfclose(strm); return (-1); } - in->configOptionVector[EXTERNAL] = 1; + in->configOptionVector[EXTERNALSTORE] = 1; break; case 13: /* MAXIMUM-DIMENSIONS */ @@ -1435,7 +1436,7 @@ static int validateConfigurationParameters(struct Input *in) return (-1); } - if (in->configOptionVector[EXTERNAL] == 1) { + if (in->configOptionVector[EXTERNALSTORE] == 1) { if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[CHUNK] == 1) || (in->configOptionVector[EXTEND] == 1)) { (void) HDfprintf(stderr, "%s", err2); return (-1); @@ -2360,7 +2361,7 @@ static int process(struct Options *opt) H5Pset_deflate(proplist, (unsigned) in->compressionParam); } - if (in->configOptionVector[EXTERNAL] == 1) { + if (in->configOptionVector[EXTERNALSTORE] == 1) { /* creating the external file if it doesnt exist */ if ((extfile = HDfopen(in->externFilename, "ab")) == NULL) { (void) HDfprintf(stderr, "%s", err4); diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h index 05de476..dbc6844 100755 --- a/tools/h5import/h5import.h +++ b/tools/h5import/h5import.h @@ -47,7 +47,7 @@ #define CHUNK 0 #define COMPRESS 1 #define EXTEND 2 -#define EXTERNAL 3 +#define EXTERNALSTORE 3 #define DIM 4 #define RANK 5 #define PATH 6 diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 39a78ae..f536605 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -21,6 +21,7 @@ #endif #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" void parse_command_line (int argc, const char *argv[]); diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 923bc5a..981eead 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -15,6 +15,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 1dfdfc7..4751dad 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -15,6 +15,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" /* Name of tool */ diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index 2ffcbda..0169d71 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -21,6 +21,7 @@ #include "hdf5.h" #include "H5private.h" +#include "h5tools.h" #include "h5tools_utils.h" #define TRUE 1 diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 3e335e9..7315796 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -3127,7 +3127,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_symlink_g); /* lnk_info.trg_path is malloced in H5tools_get_symlink_info() * so it will be freed via buf later */ - buf = lnk_info.trg_path; + buf = (char*)lnk_info.trg_path; /* error */ if (ret < 0) goto done; @@ -3185,7 +3185,7 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) ret = H5tools_get_symlink_info(iter->fid, name, &lnk_info, follow_link); /* lnk_info.trg_path is malloced in H5tools_get_symlink_info() * so it will be freed via buf later */ - buf = lnk_info.trg_path; + buf = (char*)lnk_info.trg_path; /* error */ if (ret < 0) goto done; diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index b36eb37..28d66c5 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -493,24 +493,24 @@ int copy_attr(hid_t loc_in, type_class = H5Tget_class(wtype_id); is_ref = (type_class == H5T_REFERENCE); if (type_class == H5T_VLEN ||type_class == H5T_ARRAY ) { - hid_t base_type = -1; - base_type = H5Tget_super(ftype_id); - is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE)); - H5Tclose(base_type); + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + is_ref = (is_ref || (H5Tget_class(base_type)==H5T_REFERENCE)); + H5Tclose(base_type); } if (type_class == H5T_COMPOUND) { - int nmembers = H5Tget_nmembers(wtype_id) ; - for (j=0; j<nmembers; j++) { - hid_t mtid = H5Tget_member_type( wtype_id, j ); - H5T_class_t mtclass = H5Tget_class(mtid); - H5Tclose(mtid); - - if (mtclass==H5T_REFERENCE) { - is_ref = 1; - break; - } - } /* for (j=0; i<nmembers; j++) */ + int nmembers = H5Tget_nmembers(wtype_id) ; + for (j=0; j<nmembers; j++) { + hid_t mtid = H5Tget_member_type( wtype_id, j ); + H5T_class_t mtclass = H5Tget_class(mtid); + H5Tclose(mtid); + + if (mtclass==H5T_REFERENCE) { + is_ref = 1; + break; + } + } /* for (j=0; i<nmembers; j++) */ } /* if (type_class == H5T_COMPOUND) */ if(is_ref) { diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 15b57b0..720e8d6 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -13,6 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#include "h5tools.h" #include "h5tools_utils.h" #include "h5repack.h" diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index b1a3469..d0fcff3 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -14,6 +14,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5tools.h" #include "h5tools_utils.h" /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 910b182..70eadd2 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -14,6 +14,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5tools.h" #include "h5tools_utils.h" /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 915b0e9..7108491 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -28,7 +28,7 @@ static const char* MapIdToName(hid_t refobj_id,trav_table_t *travt); static int copy_refs_attr(hid_t loc_in, hid_t loc_out, pack_opt_t *options, trav_table_t *travt, hid_t fidout); static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, - hid_t fid_out, void *ref_out, trav_table_t *travt); + hid_t fid_out, void *ref_out, trav_table_t *travt); /*------------------------------------------------------------------------- * Function: do_copy_refobjs @@ -432,13 +432,13 @@ error: * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Modifier: xcao@hdfgroup.org, 9/12/2011 - * Update values of references(object and region) for the following types: + * Update values of references(object and region) for the following types: * 1) References, * 2) ARRAY of reference, * 3) VLEN of references. * 4) COMPOUND of references. * This function does not handle references in other complicated structures, - * such as references in nested compound datatypes. + * such as references in nested compound datatypes. * * Date: October, 28, 2003 * @@ -479,7 +479,7 @@ static int copy_refs_attr(hid_t loc_in, for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { - is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; + is_ref = is_ref_vlen = is_ref_array = is_ref_comp = 0; /* open attribute */ if((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -500,39 +500,39 @@ static int copy_refs_attr(hid_t loc_in, is_ref = (type_class == H5T_REFERENCE); if (type_class == H5T_VLEN ) { - hid_t base_type = -1; - base_type = H5Tget_super(ftype_id); - is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE); - msize = H5Tget_size(base_type); - H5Tclose(base_type); + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE); + msize = H5Tget_size(base_type); + H5Tclose(base_type); } if (type_class == H5T_ARRAY ) { - hid_t base_type = -1; - base_type = H5Tget_super(ftype_id); - is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE); - msize = H5Tget_size(base_type); - H5Tclose(base_type); + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE); + msize = H5Tget_size(base_type); + H5Tclose(base_type); } if (type_class == H5T_COMPOUND) { - int nmembers = H5Tget_nmembers(ftype_id) ; - if (nmembers < 1) - goto error; + int nmembers = H5Tget_nmembers(ftype_id) ; + if (nmembers < 1) + goto error; ref_comp_index = (int *)HDmalloc(nmembers*sizeof (int)); ref_comp_size = (size_t *)HDmalloc(nmembers*sizeof(ref_comp_size)); ref_comp_field_n = 0; - for (i=0; i<(unsigned)nmembers; i++) { - hid_t mtid = H5Tget_member_type( ftype_id, i ); - if ((H5Tget_class(mtid)==H5T_REFERENCE)) { - ref_comp_index[ref_comp_field_n] = i; - ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid); - ref_comp_field_n++; - } - H5Tclose(mtid); - } + for (i=0; i<(unsigned)nmembers; i++) { + hid_t mtid = H5Tget_member_type( ftype_id, i ); + if ((H5Tget_class(mtid)==H5T_REFERENCE)) { + ref_comp_index[ref_comp_field_n] = i; + ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid); + ref_comp_field_n++; + } + H5Tclose(mtid); + } /* if compound don't contain reference type member, free the above * mallocs. Otherwise there can be memory leaks by the 'continue' @@ -541,14 +541,14 @@ static int copy_refs_attr(hid_t loc_in, { if (ref_comp_index) { - HDfree(ref_comp_index); - ref_comp_index = NULL; + HDfree(ref_comp_index); + ref_comp_index = NULL; } if (ref_comp_size) { - HDfree(ref_comp_size); - ref_comp_size = NULL; + HDfree(ref_comp_size); + ref_comp_size = NULL; } } } @@ -556,10 +556,10 @@ static int copy_refs_attr(hid_t loc_in, is_ref_comp = (ref_comp_field_n > 0); if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) { - H5Tclose(mtype_id); - H5Tclose(ftype_id); - H5Aclose(attr_id); - continue; + H5Tclose(mtype_id); + H5Tclose(ftype_id); + H5Aclose(attr_id); + continue; } /* get name */ @@ -584,18 +584,18 @@ static int copy_refs_attr(hid_t loc_in, nelmts *= dims[j]; if (is_ref_array) { - unsigned array_rank = 0; - hsize_t array_size = 1; - hsize_t array_dims[H5S_MAX_RANK]; - hid_t base_type = -1; - base_type = H5Tget_super(ftype_id); - msize = H5Tget_size(base_type); - H5Tclose(base_type); - - array_rank = H5Tget_array_ndims(mtype_id); - H5Tget_array_dims2(mtype_id, array_dims); + unsigned array_rank = 0; + hsize_t array_size = 1; + hsize_t array_dims[H5S_MAX_RANK]; + hid_t base_type = -1; + base_type = H5Tget_super(ftype_id); + msize = H5Tget_size(base_type); + H5Tclose(base_type); + + array_rank = H5Tget_array_ndims(mtype_id); + H5Tget_array_dims2(mtype_id, array_dims); for(j = 0; j <array_rank; j++) - array_size *= array_dims[j]; + array_size *= array_dims[j]; nelmts *= array_size; } @@ -626,7 +626,7 @@ static int copy_refs_attr(hid_t loc_in, for(i = 0; i < (unsigned)nelmts; i++) { if (update_ref_value(attr_id, H5R_OBJECT, &((hobj_ref_t *)buf)[i], fidout, &((hobj_ref_t *)refbuf)[i], travt)<0) - continue; + continue; if(options->verbose) printf("object <%s> reference created to <%s>\n", name, refname); } /* k */ @@ -657,13 +657,13 @@ static int copy_refs_attr(hid_t loc_in, for(i = 0; i < (unsigned)nelmts; i++) { if (update_ref_value(attr_id, H5R_DATASET_REGION, &((hdset_reg_ref_t *)buf)[i], fidout, &((hdset_reg_ref_t *)refbuf)[i], travt)<0) - continue; + continue; if(options->verbose) printf("object <%s> region reference created to <%s>\n", name, refname); } } /* H5T_STD_REF_DSETREG */ else if (is_ref_vlen) { - /* handle VLEN of references */ + /* handle VLEN of references */ buf = (hvl_t *)HDmalloc((unsigned)(nelmts * sizeof(hvl_t))); refbuf = buf; /* reuse the read buffer for write */ @@ -677,31 +677,31 @@ static int copy_refs_attr(hid_t loc_in, if(H5Aread(attr_id, mtype_id, buf) < 0) goto error; - if (H5R_OBJ_REF_BUF_SIZE==msize) { - hobj_ref_t ref_out; - for (i=0; i<(unsigned)nelmts; i++) { - hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p; - for (j=0; j<((hvl_t *)buf)[i].len; j++ ) { - if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0) - continue; - HDmemcpy(&(ptr[j]), &ref_out, msize); - } - } /* for (i=0; i<nelems; i++) */ - } else if (H5R_DSET_REG_REF_BUF_SIZE == msize) { - - hdset_reg_ref_t ref_out; - for (i=0; i<(unsigned)nelmts; i++) { - hdset_reg_ref_t *ptr = (hdset_reg_ref_t *)((hvl_t *)buf)[i].p; - for (j=0; j<((hvl_t *)buf)[i].len; j++ ) { - if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt)<0) - continue; - HDmemcpy(&(ptr[j]), &ref_out, msize); - } - } /* for (i=0; i<nelems; i++) */ - } + if (H5R_OBJ_REF_BUF_SIZE==msize) { + hobj_ref_t ref_out; + for (i=0; i<(unsigned)nelmts; i++) { + hobj_ref_t *ptr = (hobj_ref_t *)((hvl_t *)buf)[i].p; + for (j=0; j<((hvl_t *)buf)[i].len; j++ ) { + if (update_ref_value(attr_id, H5R_OBJECT, &(ptr[j]), fidout, &ref_out, travt)<0) + continue; + HDmemcpy(&(ptr[j]), &ref_out, msize); + } + } /* for (i=0; i<nelems; i++) */ + } else if (H5R_DSET_REG_REF_BUF_SIZE == msize) { + + hdset_reg_ref_t ref_out; + for (i=0; i<(unsigned)nelmts; i++) { + hdset_reg_ref_t *ptr = (hdset_reg_ref_t *)((hvl_t *)buf)[i].p; + for (j=0; j<((hvl_t *)buf)[i].len; j++ ) { + if (update_ref_value(attr_id, H5R_DATASET_REGION, &(ptr[j]), fidout, &ref_out, travt)<0) + continue; + HDmemcpy(&(ptr[j]), &ref_out, msize); + } + } /* for (i=0; i<nelems; i++) */ + } } /* else if (is_ref_vlen) */ else if (is_ref_comp) { - /* handle ref fields in a compound */ + /* handle ref fields in a compound */ buf = HDmalloc((unsigned)(nelmts * msize)); refbuf = buf; /* reuse the read buffer for write */ @@ -716,22 +716,22 @@ static int copy_refs_attr(hid_t loc_in, goto error; for (i=0; i<(unsigned)nelmts; i++) { - for (j=0; j<(unsigned)ref_comp_field_n; j++) { - if (ref_comp_size[j] == H5R_OBJ_REF_BUF_SIZE) { - int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]); - hobj_ref_t ref_out; - if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0) - continue; - HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]); - } /* if */ - else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) { - int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]); - hdset_reg_ref_t ref_out; - if (update_ref_value(attr_id, H5R_DATASET_REGION, (hdset_reg_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0) - continue; - HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]); - } /* else if */ - } /* j */ + for (j=0; j<(unsigned)ref_comp_field_n; j++) { + if (ref_comp_size[j] == H5R_OBJ_REF_BUF_SIZE) { + int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]); + hobj_ref_t ref_out; + if (update_ref_value(attr_id, H5R_OBJECT, (hobj_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0) + continue; + HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]); + } /* if */ + else if (ref_comp_size[j] == H5R_DSET_REG_REF_BUF_SIZE) { + int idx = i*msize+H5Tget_member_offset( mtype_id, (unsigned)ref_comp_index[j]); + hdset_reg_ref_t ref_out; + if (update_ref_value(attr_id, H5R_DATASET_REGION, (hdset_reg_ref_t *)(((char *)buf)+idx), fidout, &ref_out, travt)<0) + continue; + HDmemcpy(((char *)buf)+idx, &ref_out, ref_comp_size[j]); + } /* else if */ + } /* j */ } /* i */ } /* else if (is_ref_comp) */ @@ -739,11 +739,11 @@ static int copy_refs_attr(hid_t loc_in, goto error; if (is_ref_vlen && buf) - H5Dvlen_reclaim (mtype_id, space_id, H5P_DEFAULT, buf); + H5Dvlen_reclaim (mtype_id, space_id, H5P_DEFAULT, buf); } /* if (nelmts) */ if (refbuf == buf) - refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */ + refbuf = NULL; /* set it to NULL to avoid double free since buf and refbuf are the same. */ if(buf) { HDfree(buf); @@ -756,13 +756,13 @@ static int copy_refs_attr(hid_t loc_in, } if (ref_comp_index) { - HDfree(ref_comp_index); - ref_comp_index = NULL; + HDfree(ref_comp_index); + ref_comp_index = NULL; } if (ref_comp_size) { - HDfree(ref_comp_size); - ref_comp_size = NULL; + HDfree(ref_comp_size); + ref_comp_size = NULL; } if(H5Aclose(attr_out) < 0) @@ -785,16 +785,16 @@ static int copy_refs_attr(hid_t loc_in, return 0; error: - if(refbuf) - HDfree(refbuf); - if(buf) - HDfree(buf); + if(refbuf) + HDfree(refbuf); + if(buf) + HDfree(buf); if (ref_comp_index) - HDfree(ref_comp_index); + HDfree(ref_comp_index); if (ref_comp_size) - HDfree(ref_comp_size); + HDfree(ref_comp_size); H5E_BEGIN_TRY { H5Tclose(ftype_id); @@ -808,9 +808,9 @@ error: } /*------------------------------------------------------------------------- - * Function: MapIdToName + * Function: MapIdToName * - * Purpose: map a ID from a reference to a dataset name + * Purpose: map a ID from a reference to a dataset name * *------------------------------------------------------------------------- */ @@ -843,41 +843,41 @@ out: } /*------------------------------------------------------------------------- - * Function: Update_Ref_value + * Function: Update_Ref_value * - * Purpose: Update a reference value + * Purpose: Update a reference value * * Programmer: xcao@hdfgroup.org 9/12/2011 * *------------------------------------------------------------------------- */ static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in, - hid_t fid_out, void *ref_out, trav_table_t *travt) + hid_t fid_out, void *ref_out, trav_table_t *travt) { - herr_t ret = -1; - const char* ref_obj_name; - hid_t space_id=-1, ref_obj_id=-1; + herr_t ret = -1; + const char* ref_obj_name; + hid_t space_id=-1, ref_obj_id=-1; - ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in); - if (ref_obj_id<0) - goto done; + ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in); + if (ref_obj_id<0) + goto done; - ref_obj_name = MapIdToName(ref_obj_id, travt); - if (ref_obj_name == NULL) - goto done; + ref_obj_name = MapIdToName(ref_obj_id, travt); + if (ref_obj_name == NULL) + goto done; - if (ref_type == H5R_DATASET_REGION) { - space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in); - if (space_id < 0) - goto done; - } + if (ref_type == H5R_DATASET_REGION) { + space_id = H5Rget_region(obj_id, H5R_DATASET_REGION, ref_in); + if (space_id < 0) + goto done; + } ret = H5Rcreate(ref_out, fid_out, ref_obj_name, ref_type, space_id); if (ret < 0) - goto done; + goto done; - ret = 0; + ret = 0; done: H5E_BEGIN_TRY { @@ -885,6 +885,6 @@ done: H5Oclose(ref_obj_id); } H5E_END_TRY; - return ret; + return ret; } diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index b0ab1d1..47cba5b 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -14,16 +14,17 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5repack.h" +#include "h5tools.h" #include "h5tools_utils.h" -static int verify_layout(hid_t pid, pack_info_t *obj); -static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter); - /* number of members in an array */ #ifndef NELMTS -# define NELMTS(X) (sizeof(X)/sizeof(X[0])) +# define NELMTS(X) (sizeof(X)/sizeof(X[0])) #endif +static int verify_layout(hid_t pid, pack_info_t *obj); +static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter); + /*------------------------------------------------------------------------- * Function: h5repack_verify @@ -301,9 +302,9 @@ error: * * Purpose: verify which layout is present in the property list DCPL_ID * - * H5D_COMPACT = 0 - * H5D_CONTIGUOUS = 1 - * H5D_CHUNKED = 2 + * H5D_COMPACT = 0 + * H5D_CONTIGUOUS = 1 + * H5D_CHUNKED = 2 * * Return: 1 has, 0 does not, -1 error * diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c index 0a6a77a..e91b2f7 100644 --- a/tools/h5repack/testh5repack_detect_szip.c +++ b/tools/h5repack/testh5repack_detect_szip.c @@ -16,6 +16,7 @@ #include <stdio.h> #include "h5repack.h" #include "h5tools.h" +#include "h5tools_utils.h" #include "h5test.h" diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index f86e914..bc8acd5 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -614,7 +614,7 @@ static herr_t trav_grp_symlinks(const char *path, const H5L_info_t *linfo, done: if (lnk_info.trg_path) - HDfree(lnk_info.trg_path); + HDfree((char *)lnk_info.trg_path); return 0; } @@ -728,25 +728,25 @@ hsize_t h5diff(const char *fname1, /* make the given object1 fullpath, start with "/" */ if (HDstrncmp(objname1, "/", 1)) { - HDstrcpy(obj1fullname, "/"); - HDstrcat(obj1fullname, objname1); + HDstrcpy((char *)obj1fullname, "/"); + HDstrcat((char *)obj1fullname, objname1); } else - HDstrcpy(obj1fullname, objname1); + HDstrcpy((char *)obj1fullname, objname1); /* make the given object2 fullpath, start with "/" */ if (HDstrncmp(objname2, "/", 1)) { - HDstrcpy(obj2fullname, "/"); - HDstrcat(obj2fullname, objname2); + HDstrcpy((char *)obj2fullname, "/"); + HDstrcat((char *)obj2fullname, objname2); } else - HDstrcpy(obj2fullname, objname2); + HDstrcpy((char *)obj2fullname, objname2); /*---------------------------------------------------------- * check if obj1 is root, group, single object or symlink */ - if(!HDstrcmp(obj1fullname, "/")) + if(!HDstrcmp((char *)obj1fullname, "/")) { obj1type = H5TRAV_TYPE_GROUP; } @@ -856,9 +856,9 @@ hsize_t h5diff(const char *fname1, { /* set root group */ obj1fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat(obj1fullname, "/"); + HDstrcat((char *)obj1fullname, "/"); obj2fullname = (char*)HDcalloc(2, sizeof(char)); - HDstrcat(obj2fullname, "/"); + HDstrcat((char *)obj2fullname, "/"); } @@ -1045,15 +1045,15 @@ out: /* free buffers */ if (obj1fullname) - HDfree(obj1fullname); + HDfree((char *)obj1fullname); if (obj2fullname) - HDfree(obj2fullname); + HDfree((char *)obj2fullname); /* free link info buffer */ if (trg_linfo1.trg_path) - HDfree(trg_linfo1.trg_path); + HDfree((char *)trg_linfo1.trg_path); if (trg_linfo2.trg_path) - HDfree(trg_linfo2.trg_path); + HDfree((char *)trg_linfo2.trg_path); /* close */ H5E_BEGIN_TRY @@ -1112,9 +1112,9 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, * make full path */ if (HDstrcmp (grp1, "/")) - grp1_path = grp1; + grp1_path = (char *)grp1; if (HDstrcmp (grp2, "/")) - grp2_path = grp2; + grp2_path = (char *)grp2; /*------------------------------------------------------------------------- * regarding the return value of h5diff (0, no difference in files, 1 difference ) @@ -1769,9 +1769,9 @@ out: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); return nfound; } @@ -2163,9 +2163,9 @@ hsize_t diff(hid_t file1_id, /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); return nfound; @@ -2206,9 +2206,9 @@ out2: /* free link info buffer */ if (linkinfo1.trg_path) - HDfree(linkinfo1.trg_path); + HDfree((char *)linkinfo1.trg_path); if (linkinfo2.trg_path) - HDfree(linkinfo2.trg_path); + HDfree((char *)linkinfo2.trg_path); /* close */ /* disable error reporting */ |