From 376d1b62d976e1689eae72735c6783b8b82f3aa5 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 10 Nov 2000 17:27:51 -0500 Subject: [svn-r2862] Purpose: Bug fix. Description: Had been using older-style "HAVE_foo" macros instead of newer "H5_HAVE_foo" macros. Solution: Added a "H5_" to all the "HAVE_foo" macros. Platforms tested: FreeBSD 4.1.1 (hawkwind) --- test/chunk.c | 2 +- test/iopipe.c | 103 +++++++++++++++++++++++++++++----------------------------- test/ragged.c | 26 +++++++-------- 3 files changed, 66 insertions(+), 65 deletions(-) diff --git a/test/chunk.c b/test/chunk.c index d939458..0538543 100644 --- a/test/chunk.c +++ b/test/chunk.c @@ -22,7 +22,7 @@ #endif -#ifndef HAVE_ATTRIBUTE +#ifndef H5_HAVE_ATTRIBUTE # undef __attribute__ # define __attribute__(X) /*void*/ # define UNUSED /*void*/ diff --git a/test/iopipe.c b/test/iopipe.c index 7b78df1..ed81eaa 100644 --- a/test/iopipe.c +++ b/test/iopipe.c @@ -79,22 +79,22 @@ * *------------------------------------------------------------------------- */ -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE static void print_stats (const char *prefix, struct rusage *r_start, struct rusage *r_stop, struct timeval *t_start, struct timeval *t_stop, size_t nbytes) -#else /* HAVE_GETRUSAGE */ +#else /* H5_HAVE_GETRUSAGE */ static void print_stats (const char *prefix, struct timeval *r_start, struct timeval *r_stop, struct timeval *t_start, struct timeval *t_stop, size_t nbytes) -#endif /* HAVE_GETRUSAGE */ +#endif /* H5_HAVE_GETRUSAGE */ { double e_time, bw; -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE double u_time, s_time; u_time = ((double)(r_stop->ru_utime.tv_sec)+ @@ -107,7 +107,7 @@ print_stats (const char *prefix, ((double)(r_start->ru_stime.tv_sec)+ (double)(r_start->ru_stime.tv_usec)/1000000.0); #endif -#ifndef HAVE_SYS_TIMEB +#ifndef H5_HAVE_SYS_TIMEB e_time = ((double)(t_stop->tv_sec)+ (double)(t_stop->tv_usec)/1000000.0) - ((double)(t_start->tv_sec)+ @@ -120,7 +120,7 @@ print_stats (const char *prefix, #endif bw = (double)nbytes / e_time; -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n", prefix, u_time, s_time, e_time, bw/(1024*1024)); #else @@ -148,7 +148,7 @@ print_stats (const char *prefix, static void synchronize (void) { -#ifdef HAVE_SYSTEM +#ifdef H5_HAVE_SYSTEM #ifdef WIN32 _flushall(); #else @@ -192,7 +192,7 @@ main (void) unsigned char *the_data = NULL; hid_t file, dset, file_space=-1; herr_t status; -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE struct rusage r_start, r_stop; #else struct timeval r_start, r_stop; @@ -205,7 +205,7 @@ main (void) hsize_t count[2]; -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB struct _timeb *tbstart = malloc(sizeof(struct _timeb)); struct _timeb *tbstop = malloc(sizeof(struct _timeb)); #endif @@ -234,13 +234,14 @@ main (void) /* Fill raw */ synchronize (); -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE +printf("Before getrusage() call\n"); getrusage (RUSAGE_SELF, &r_start); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif @@ -250,13 +251,13 @@ main (void) fflush (stderr); memset (the_data, 0xAA, (size_t)(size[0]*size[1])); } -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_stop); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_stop, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); t_start.tv_sec = tbstart->time; t_start.tv_usec = tbstart->millitm; @@ -272,13 +273,13 @@ main (void) /* Fill hdf5 */ synchronize (); -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_start); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif @@ -290,13 +291,13 @@ main (void) H5P_DEFAULT, the_data); assert (status>=0); } -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_stop); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_stop, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); t_start.tv_sec = tbstart->time; t_start.tv_usec = tbstart->millitm; @@ -311,13 +312,13 @@ main (void) /* Write the raw dataset */ synchronize (); -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_start); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif @@ -330,13 +331,13 @@ main (void) n = write (fd, the_data, (size_t)(size[0]*size[1])); assert (n>=0 && (size_t)n==size[0]*size[1]); } -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_stop); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_stop, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); t_start.tv_sec = tbstart->time; t_start.tv_usec = tbstart->millitm; @@ -351,13 +352,13 @@ main (void) /* Write the hdf5 dataset */ synchronize (); -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_start); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif @@ -369,13 +370,13 @@ main (void) H5P_DEFAULT, the_data); assert (status>=0); } -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_stop); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_stop, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); t_start.tv_sec = tbstart->time; t_start.tv_usec = tbstart->millitm; @@ -390,13 +391,13 @@ main (void) /* Read the raw dataset */ synchronize (); -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_start); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif @@ -409,13 +410,13 @@ main (void) n = read (fd, the_data, (size_t)(size[0]*size[1])); assert (n>=0 && (size_t)n==size[0]*size[1]); } -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_stop); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_stop, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); t_start.tv_sec = tbstart->time; t_start.tv_usec = tbstart->millitm; @@ -431,13 +432,13 @@ main (void) /* Read the hdf5 dataset */ synchronize (); -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_start); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif @@ -449,13 +450,13 @@ main (void) H5P_DEFAULT, the_data); assert (status>=0); } -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_stop); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_stop, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); t_start.tv_sec = tbstart->time; t_start.tv_usec = tbstart->millitm; @@ -475,13 +476,13 @@ main (void) status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, start, NULL, count, NULL); assert (status>=0); synchronize (); -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_start); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif #endif @@ -493,13 +494,13 @@ main (void) H5P_DEFAULT, the_data); assert (status>=0); } -#ifdef HAVE_GETRUSAGE +#ifdef H5_HAVE_GETRUSAGE getrusage (RUSAGE_SELF, &r_stop); #endif -#ifdef HAVE_GETTIMEOFDAY +#ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_stop, NULL); #else -#ifdef HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB _ftime(tbstop); t_start.tv_sec = tbstart->time; t_start.tv_usec = tbstart->millitm; diff --git a/test/ragged.c b/test/ragged.c index 4fb4f73..2f5a3c4 100644 --- a/test/ragged.c +++ b/test/ragged.c @@ -33,30 +33,30 @@ typedef struct { #if 1 /* Typical VBT sizes */ static quant_t quant_g[] = { - {10.00, 1, 5}, - {89.00, 6, 20}, - { 0.90, 21, 100}, - { 0.09, 101, 1000}, - { 0.01, 1001, 10000}, + {10.00, 1, 5, 0}, + {89.00, 6, 20, 0}, + { 0.90, 21, 100, 0}, + { 0.09, 101, 1000, 0}, + { 0.01, 1001, 10000, 0}, }; #elif 0 /* Sizes for testing */ static quant_t quant_g[] = { - {10.0, 1, 5}, - {80.0, 6, 15}, - {10.0, 16, 20}, + {10.0, 1, 5, 0}, + {80.0, 6, 15, 0}, + {10.0, 16, 20, 0}, }; #elif 0 /* Larger I/O */ static quant_t quant_g[] = { - {10.0, 1, 1000}, - {80.0, 1001, 5000}, - {10.0, 5001, 10000}, + {10.0, 1, 1000, 0}, + {80.0, 1001, 5000, 0}, + {10.0, 5001, 10000, 0}, }; #else /* All same size */ static quant_t quant_g[] = { - {100.0, 1000, 1000} + {100.0, 1000, 1000, 0} }; #endif @@ -648,7 +648,7 @@ main(int argc, char *argv[]) H5Eset_auto(display_error_cb, NULL); /* Get a SIGALRM every few seconds */ -#ifdef HAVE_SIGACTION +#ifdef H5_HAVE_SIGACTION { struct sigaction act; act.sa_handler = catch_alarm; -- cgit v0.12