summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-08-08 19:00:29 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-08-08 19:00:29 (GMT)
commite5ad6fddffbbbea838a4081b65c4daa114369fca (patch)
tree31dab0d13d9db4eb8f2d84eacf17b6c4728c175f
parent1352b673fd6c89da354bff81df9964a03649abcb (diff)
downloadhdf5-e5ad6fddffbbbea838a4081b65c4daa114369fca.zip
hdf5-e5ad6fddffbbbea838a4081b65c4daa114369fca.tar.gz
hdf5-e5ad6fddffbbbea838a4081b65c4daa114369fca.tar.bz2
[svn-r7306] Purpose:
Code cleanup Description: Added new macro 'H5_SIZEOF_HADDR_T' to describe the size of an 'haddr_t' Also added a new macro 'H5_PRINTF_HADDR_FMT' for the correct printf() format for displaying an 'haddr_t' Platforms tested: h5committested
-rw-r--r--src/H5public.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/H5public.h b/src/H5public.h
index 886a964..dec8ef4 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -163,36 +163,50 @@ typedef ssize_t hssize_t;
#if H5_SIZEOF_UINT64_T>=8
typedef uint64_t haddr_t;
# define HADDR_UNDEF ((haddr_t)(int64_t)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_UINT64_T
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF_INT>=8
typedef unsigned haddr_t;
# define HADDR_UNDEF ((haddr_t)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_UNSIGNED
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF_LONG>=8
typedef unsigned long haddr_t;
# define HADDR_UNDEF ((haddr_t)(long)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF_LONG_LONG>=8
typedef unsigned long long haddr_t;
# define HADDR_UNDEF ((haddr_t)(long long)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF___INT64>=8
typedef unsigned __int64 haddr_t;
# define HADDR_UNDEF ((haddr_t)(__int64)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF___INT64
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
# endif /* H5_HAVE_PARALLEL */
#else
# error "nothing appropriate for haddr_t"
#endif
+#if H5_SIZEOF_HADDR_T ==H5_SIZEOF_INT
+# define H5_PRINTF_HADDR_FMT "%u"
+#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG
+# define H5_PRINTF_HADDR_FMT "%lu"
+#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG
+# define H5_PRINTF_HADDR_FMT "%"H5_PRINTF_LL_WIDTH"u"
+#else
+# error "nothing appropriate for H5_PRINTF_HADDR_FMT"
+#endif
#define HADDR_MAX (HADDR_UNDEF-1)
/* Functions in H5.c */