From 2ae44ebdbadf06a6771ebe45e2784a05d17da22c Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 10 Jan 2001 16:24:07 -0500 Subject: [svn-r3263] Purpose: Code cleanup Description: Changed so that the streaming stuff is inserted if > 1.2 version. Also modified init_prefix function so that it's sane. Platforms tested: Linux --- tools/h5tools.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tools/h5tools.c b/tools/h5tools.c index f88602d..8469c8c 100644 --- a/tools/h5tools.c +++ b/tools/h5tools.c @@ -2271,13 +2271,8 @@ init_table(table_t** temp) void init_prefix(char **prefix, int prefix_len) { - char *temp; - - assert(prefix_len>0); - temp = malloc((size_t)prefix_len); - - *temp = '\0'; - *prefix = temp; + assert(prefix_len > 0); + *prefix = calloc((size_t)prefix_len, 1); } /*------------------------------------------------------------------------- @@ -2618,6 +2613,10 @@ get_objectname(table_t* table, int idx) * * Thomas Radke, 2000-09-12 * Added Stream VFD to the driver[] array. + * + * Bill Wendling, 2001-01-10 + * Changed macro behavior so that if we have a version other + * than 1.2.x (i.e., > 1.2), then we do the drivers check. *-----------------------------------------------------------------------*/ hid_t h5dump_fopen(const char *fname, char *drivername, size_t drivername_size) @@ -2628,7 +2627,7 @@ h5dump_fopen(const char *fname, char *drivername, size_t drivername_size) } driver[16]; static int ndrivers = 0; hid_t fid=(-1); -#ifdef VERSION13 +#ifndef VERSION12 hid_t fapl = H5P_DEFAULT; #endif int drivernum; @@ -2641,7 +2640,7 @@ h5dump_fopen(const char *fname, char *drivername, size_t drivername_size) driver[ndrivers].fapl = H5P_DEFAULT; ndrivers++; -#ifdef VERSION13 +#ifndef VERSION12 driver[ndrivers].name = "family"; driver[ndrivers].fapl = fapl = H5Pcreate(H5P_FILE_ACCESS); H5Pset_fapl_family(fapl, 0, H5P_DEFAULT); @@ -2663,7 +2662,7 @@ h5dump_fopen(const char *fname, char *drivername, size_t drivername_size) H5Pset_fapl_stream(fapl, NULL); ndrivers++; #endif /* H5_HAVE_STREAM */ -#endif /* VERSION13 */ +#endif /* !VERSION12 */ } /* Try to open the file using each of the drivers */ -- cgit v0.12