summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-10-23 21:29:21 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-10-23 21:29:21 (GMT)
commit1b6981c0620bde3f71c08d3575c47a724c98121e (patch)
tree6e8b915931084637d91c52ea47e203ae0594034d /tools/lib
parentcaa9e0c055f0837061d6586c55fd99fc596114fa (diff)
downloadhdf5-1b6981c0620bde3f71c08d3575c47a724c98121e.zip
hdf5-1b6981c0620bde3f71c08d3575c47a724c98121e.tar.gz
hdf5-1b6981c0620bde3f71c08d3575c47a724c98121e.tar.bz2
[svn-r15938]
for some reason , the use of H5_PRINTF_LL_WIDTH to convert to a unsigned long long format, is not working in ia64 linux (tg-login3) extra characters are printed, this time in h5ls hardcoded the format defined in HSIZE_T_FORMAT to "%llu" tested: windows, linux (kagiso), solaris, ia64 linux (tg-login3)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_array.c48
-rw-r--r--tools/lib/h5diff_util.c11
-rw-r--r--tools/lib/h5tools.h2
3 files changed, 10 insertions, 51 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 9d4edc6..02a260e 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -17,16 +17,12 @@
#include "h5diff.h"
#include "ph5diff.h"
#include "H5private.h"
+#include "h5tools.h"
+
#include <sys/timeb.h>
#include <time.h>
-#if 0
-#define H5DIFF_DO_TIME
-#endif
-#if 1
-#define H5DIFF_DO_NAN
-#endif
/*-------------------------------------------------------------------------
* printf formatting
@@ -247,7 +243,8 @@ void print_pos( int *ph, /* print header */
parallel_print("[ " );
for ( i = 0; i < rank; i++)
{
- parallel_print("%llu ", (unsigned long_long)pos[i]);
+ parallel_print(HSIZE_T_FORMAT, (unsigned long_long)pos[i]);
+ parallel_print(" ");
}
parallel_print("]" );
}
@@ -2999,20 +2996,7 @@ hsize_t diff_float(unsigned char *mem1,
else
{
-#if defined (H5DIFF_DO_TIME)
- int time;
- #if defined (WIN32)
- struct _timeb *tbstart = malloc(sizeof(struct _timeb));
- struct _timeb *tbstop = malloc(sizeof(struct _timeb));
- _ftime( tbstart);
- #else
- struct timeb *tbstart = malloc(sizeof(struct timeb));
- struct timeb *tbstop = malloc(sizeof(struct timeb));
- ftime( tbstart);
- #endif
-
-#endif
for ( i = 0; i < nelmts; i++)
{
@@ -3040,18 +3024,6 @@ hsize_t diff_float(unsigned char *mem1,
-#if defined (H5DIFF_DO_TIME)
-
- #if defined (WIN32)
- _ftime( tbstop );
- #else
- ftime( tbstop );
- #endif
-
- time = tbstop->time - tbstart->time;
- printf(" TIME = %d sec\n", time );
-
-#endif
}
@@ -5289,8 +5261,6 @@ hbool_t equal_double(double value, double expected)
int both_zero;
int is_zero;
-#if defined (H5DIFF_DO_NAN)
-
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
@@ -5321,8 +5291,6 @@ hbool_t equal_double(double value, double expected)
*-------------------------------------------------------------------------
*/
-#endif
-
BOTH_ZERO(value,expected)
if (both_zero)
return TRUE;
@@ -5354,8 +5322,6 @@ hbool_t equal_ldouble(long double value, long double expected)
int both_zero;
int is_zero;
-#if defined (H5DIFF_DO_NAN)
-
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
@@ -5386,8 +5352,6 @@ hbool_t equal_ldouble(long double value, long double expected)
*-------------------------------------------------------------------------
*/
-#endif
-
BOTH_ZERO(value,expected)
if (both_zero)
return TRUE;
@@ -5423,8 +5387,6 @@ hbool_t equal_float(float value, float expected)
int both_zero;
int is_zero;
-#if defined (H5DIFF_DO_NAN)
-
/*-------------------------------------------------------------------------
* detect NaNs
*-------------------------------------------------------------------------
@@ -5455,8 +5417,6 @@ hbool_t equal_float(float value, float expected)
*-------------------------------------------------------------------------
*/
-#endif
-
BOTH_ZERO(value,expected)
if (both_zero)
return TRUE;
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 559c5e5..223d591 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -16,6 +16,8 @@
#include "h5diff.h"
#include "ph5diff.h"
#include "H5private.h"
+#include "h5tools.h"
+
/* global variables */
int g_nTasks = 1;
@@ -101,18 +103,15 @@ void
print_dimensions (int rank, hsize_t *dims)
{
int i;
- char fmt_ullong[8];
-
- sprintf(fmt_ullong, "%%llu");
-
+
parallel_print("[" );
for ( i = 0; i < rank-1; i++)
{
- parallel_print(fmt_ullong, dims[i]);
+ parallel_print(HSIZE_T_FORMAT, dims[i]);
parallel_print("x");
}
- parallel_print(fmt_ullong, dims[rank-1]);
+ parallel_print(HSIZE_T_FORMAT, dims[rank-1]);
parallel_print("]" );
}
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index fb24f76..0ec07e5 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -48,7 +48,7 @@
#define H5TOOLS_MALLOCSIZE (128 * 1024 * 1024)
/* format for hsize_t */
-#define HSIZE_T_FORMAT "%"H5_PRINTF_LL_WIDTH"u"
+#define HSIZE_T_FORMAT "%llu"
/*
* Information about how to format output.