summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2001-01-10 21:24:07 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2001-01-10 21:24:07 (GMT)
commit2ae44ebdbadf06a6771ebe45e2784a05d17da22c (patch)
tree3be47b26eeaad4b77a80b96d38e0ea04ce9daf29 /tools
parentb8085ef1ee74ebb4745c7e5723f69d8e5cd76cae (diff)
downloadhdf5-2ae44ebdbadf06a6771ebe45e2784a05d17da22c.zip
hdf5-2ae44ebdbadf06a6771ebe45e2784a05d17da22c.tar.gz
hdf5-2ae44ebdbadf06a6771ebe45e2784a05d17da22c.tar.bz2
[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
Diffstat (limited to 'tools')
-rw-r--r--tools/h5tools.c19
1 files 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 */