From 73683e4380583563699330b8e32b1a34a476447a Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sun, 28 Apr 2002 03:34:17 -0500 Subject: [svn-r5278] Purpose: Migrate from configure macros of XYZ_ABC to H5_XYZ_ABC Description: configure generates many macros definitions on the fly and were stored in src/H5config.h which is included by H5public.h. But other software that uses hdf5 may also run their own configure. There can be a clash in macro name space. We decided awhile ago to prepend all generated macros with "H5_" to avoid conflicts. The process has started and this commit completes it (at least attempt to). Solution: Many macros symbols (e.g. SIZEOF_xxx and HAVE_xxx were changed to H5_SIZEOF_xxx and H5_HAVE_xxx). Then H5private.h no longer includes H5config.h. This cuts H5config.h away from HDF5 source code. Pending issues: The module of fortran and pablo are to be resolved in a different commit. Platforms tested: eirene (parallel), arabica (solaris 7 --enable-fortran, --enable-cxx) --- src/H5.c | 14 ++--- src/H5F.c | 2 +- src/H5Fpkg.h | 6 +- src/H5G.c | 4 +- src/H5detect.c | 56 +++++++++--------- src/H5private.h | 149 +++++++++++++++++++++++------------------------- test/big.c | 2 +- test/dtypes.c | 114 ++++++++++++++++++------------------ test/h5test.h | 2 +- test/tconfig.c | 84 +++++++++++++-------------- tools/h5dump/h5dump.c | 8 +-- tools/h5ls/h5ls.c | 4 +- tools/lib/h5tools_str.c | 6 +- 13 files changed, 221 insertions(+), 230 deletions(-) diff --git a/src/H5.c b/src/H5.c index c2c76d2..1fefa4f 100644 --- a/src/H5.c +++ b/src/H5.c @@ -805,7 +805,7 @@ HDfprintf (FILE *stream, const char *fmt, ...) } else if (sizeof(hsize_t)==sizeof(long)) { HDstrcpy (modifier, "l"); } else { - HDstrcpy (modifier, PRINTF_LL_WIDTH); + HDstrcpy (modifier, H5_PRINTF_LL_WIDTH); } break; case 'Z': @@ -814,7 +814,7 @@ HDfprintf (FILE *stream, const char *fmt, ...) } else if (sizeof(size_t)==sizeof(long)) { HDstrcpy (modifier, "l"); } else { - HDstrcpy (modifier, PRINTF_LL_WIDTH); + HDstrcpy (modifier, H5_PRINTF_LL_WIDTH); } break; default: @@ -917,7 +917,7 @@ HDfprintf (FILE *stream, const char *fmt, ...) * Some compilers complain when `long double' and * `double' are the same thing. */ -#if SIZEOF_LONG_DOUBLE != SIZEOF_DOUBLE +#if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE long double x = va_arg (ap, long double); n = fprintf (stream, format_templ, x); #else @@ -938,12 +938,12 @@ HDfprintf (FILE *stream, const char *fmt, ...) if (fwidth>0) { sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth); } - if (sizeof(x)==SIZEOF_INT) { + if (sizeof(x)==H5_SIZEOF_INT) { HDstrcat(format_templ, "d"); - } else if (sizeof(x)==SIZEOF_LONG) { + } else if (sizeof(x)==H5_SIZEOF_LONG) { HDstrcat(format_templ, "ld"); - } else if (sizeof(x)==SIZEOF_LONG_LONG) { - HDstrcat(format_templ, PRINTF_LL_WIDTH); + } else if (sizeof(x)==H5_SIZEOF_LONG_LONG) { + HDstrcat(format_templ, H5_PRINTF_LL_WIDTH); HDstrcat(format_templ, "d"); } n = fprintf(stream, format_templ, x); diff --git a/src/H5F.c b/src/H5F.c index 9c1fd21..84175af 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -3516,7 +3516,7 @@ H5F_addr_pack(H5F_t UNUSED *f, haddr_t *addr_p/*out*/, assert(addr_p); *addr_p = objno[0]; -#if SIZEOF_LONG @@ -55,13 +55,13 @@ * Macros that check for overflows. These are somewhat dangerous to fiddle * with. */ -#if (SIZEOF_SIZE_T >= SIZEOF_OFF_T) +#if (H5_SIZEOF_SIZE_T >= H5_SIZEOF_OFF_T) # define H5F_OVERFLOW_SIZET2OFFT(X) \ ((size_t)(X)>=(size_t)((size_t)1<<(8*sizeof(off_t)-1))) #else # define H5F_OVERFLOW_SIZET2OFFT(X) 0 #endif -#if (H5_SIZEOF_HSIZE_T >= SIZEOF_OFF_T) +#if (H5_SIZEOF_HSIZE_T >= H5_SIZEOF_OFF_T) # define H5F_OVERFLOW_HSIZET2OFFT(X) \ ((hsize_t)(X)>=(hsize_t)((hsize_t)1<<(8*sizeof(off_t)-1))) #else diff --git a/src/H5G.c b/src/H5G.c index bfbd9df..44fa8fc 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------- - * Copyright (C) 1997-2001 National Center for Supercomputing Applications + * Copyright (C) 1997-2002 National Center for Supercomputing Applications * All rights reserved. * *------------------------------------------------------------------------- @@ -2125,7 +2125,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, } else { /* Some other type of object */ statbuf->objno[0] = (unsigned long)(obj_ent.header); -#if SIZEOF_UINT64_T>SIZEOF_LONG +#if H5_SIZEOF_UINT64_T>H5_SIZEOF_LONG statbuf->objno[1] = (unsigned long)(obj_ent.header >> 8*sizeof(long)); #else diff --git a/src/H5detect.c b/src/H5detect.c index 39aeafa..0c789b7 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -1,8 +1,8 @@ /*keep this here -RPM*/ static const char *FileHeader = "\n\ /*-------------------------------------------------------------------------\n\ - * Copyright (C) 1997-2001 National Center for Supercomputing Applications \n\ - * All rights reserved. \n\ + * Copyright (C) 1997-2002 National Center for Supercomputing Applications \n\ + * All rights reserved. \n\ * \n\ *-------------------------------------------------------------------------"; /* @@ -1018,80 +1018,80 @@ main(void) /* * C9x integer types. */ -#if SIZEOF_INT8_T>0 +#if H5_SIZEOF_INT8_T>0 DETECT_I(int8_t, INT8, d[nd]); nd++; #endif -#if SIZEOF_UINT8_T>0 +#if H5_SIZEOF_UINT8_T>0 DETECT_I(uint8_t, UINT8, d[nd]); nd++; #endif -#if SIZEOF_INT_LEAST8_T>0 +#if H5_SIZEOF_INT_LEAST8_T>0 DETECT_I(int_least8_t, INT_LEAST8, d[nd]); nd++; #endif -#if SIZEOF_UINT_LEAST8_T>0 +#if H5_SIZEOF_UINT_LEAST8_T>0 DETECT_I(uint_least8_t, UINT_LEAST8, d[nd]); nd++; #endif -#if SIZEOF_INT_FAST8_T>0 +#if H5_SIZEOF_INT_FAST8_T>0 DETECT_I(int_fast8_t, INT_FAST8, d[nd]); nd++; #endif -#if SIZEOF_UINT_FAST8_T>0 +#if H5_SIZEOF_UINT_FAST8_T>0 DETECT_I(uint_fast8_t, UINT_FAST8, d[nd]); nd++; #endif -#if SIZEOF_INT16_T>0 +#if H5_SIZEOF_INT16_T>0 DETECT_I(int16_t, INT16, d[nd]); nd++; #endif -#if SIZEOF_UINT16_T>0 +#if H5_SIZEOF_UINT16_T>0 DETECT_I(uint16_t, UINT16, d[nd]); nd++; #endif -#if SIZEOF_INT_LEAST16_T>0 +#if H5_SIZEOF_INT_LEAST16_T>0 DETECT_I(int_least16_t, INT_LEAST16, d[nd]); nd++; #endif -#if SIZEOF_UINT_LEAST16_T>0 +#if H5_SIZEOF_UINT_LEAST16_T>0 DETECT_I(uint_least16_t, UINT_LEAST16, d[nd]); nd++; #endif -#if SIZEOF_INT_FAST16_T>0 +#if H5_SIZEOF_INT_FAST16_T>0 DETECT_I(int_fast16_t, INT_FAST16, d[nd]); nd++; #endif -#if SIZEOF_UINT_FAST16_T>0 +#if H5_SIZEOF_UINT_FAST16_T>0 DETECT_I(uint_fast16_t, UINT_FAST16, d[nd]); nd++; #endif -#if SIZEOF_INT32_T>0 +#if H5_SIZEOF_INT32_T>0 DETECT_I(int32_t, INT32, d[nd]); nd++; #endif -#if SIZEOF_UINT32_T>0 +#if H5_SIZEOF_UINT32_T>0 DETECT_I(uint32_t, UINT32, d[nd]); nd++; #endif -#if SIZEOF_INT_LEAST32_T>0 +#if H5_SIZEOF_INT_LEAST32_T>0 DETECT_I(int_least32_t, INT_LEAST32, d[nd]); nd++; #endif -#if SIZEOF_UINT_LEAST32_T>0 +#if H5_SIZEOF_UINT_LEAST32_T>0 DETECT_I(uint_least32_t, UINT_LEAST32, d[nd]); nd++; #endif -#if SIZEOF_INT_FAST32_T>0 +#if H5_SIZEOF_INT_FAST32_T>0 DETECT_I(int_fast32_t, INT_FAST32, d[nd]); nd++; #endif -#if SIZEOF_UINT_FAST32_T>0 +#if H5_SIZEOF_UINT_FAST32_T>0 DETECT_I(uint_fast32_t, UINT_FAST32, d[nd]); nd++; #endif -#if SIZEOF_INT64_T>0 +#if H5_SIZEOF_INT64_T>0 DETECT_I(int64_t, INT64, d[nd]); nd++; #endif -#if SIZEOF_UINT64_T>0 +#if H5_SIZEOF_UINT64_T>0 DETECT_I(uint64_t, UINT64, d[nd]); nd++; #endif -#if SIZEOF_INT_LEAST64_T>0 +#if H5_SIZEOF_INT_LEAST64_T>0 DETECT_I(int_least64_t, INT_LEAST64, d[nd]); nd++; #endif -#if SIZEOF_UINT_LEAST64_T>0 +#if H5_SIZEOF_UINT_LEAST64_T>0 DETECT_I(uint_least64_t, UINT_LEAST64, d[nd]); nd++; #endif -#if SIZEOF_INT_FAST64_T>0 +#if H5_SIZEOF_INT_FAST64_T>0 DETECT_I(int_fast64_t, INT_FAST64, d[nd]); nd++; #endif -#if SIZEOF_UINT_FAST64_T>0 +#if H5_SIZEOF_UINT_FAST64_T>0 DETECT_I(uint_fast64_t, UINT_FAST64, d[nd]); nd++; #endif -#if SIZEOF_LONG_LONG>0 +#if H5_SIZEOF_LONG_LONG>0 DETECT_I(long_long, LLONG, d[nd]); nd++; DETECT_I(unsigned long_long, ULLONG, d[nd]); nd++; #else @@ -1107,7 +1107,7 @@ main(void) DETECT_F(float, FLOAT, d[nd]); nd++; DETECT_F(double, DOUBLE, d[nd]); nd++; -#if SIZEOF_DOUBLE == SIZEOF_LONG_DOUBLE +#if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE /* * If sizeof(double)==sizeof(long double) then assume that `long double' * isn't supported and use `double' instead. This suppresses warnings on diff --git a/src/H5private.h b/src/H5private.h index c5c96ab..33f4fc3 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001 NCSA + * Copyright (C) 1998-2002 NCSA * All rights reserved. * * Programmer: Robb Matzke @@ -16,16 +16,6 @@ #include "H5public.h" /* Include Public Definitions */ -/* - * Since H5config.h is a generated header file, it is messy to try - * to put a #ifndef _H5config_H ... #endif guard in it. - * HDF5 has set an internal rule that it is being included here. - * Source files should NOT include H5config.h directly but include - * it via H5private.h. The #ifndef _H5private_H guard above would - * prevent repeated include. - */ -#include "H5config.h" /* Include all configuration info */ - /* include the pthread header */ #ifdef H5_HAVE_THREADSAFE #include @@ -135,6 +125,7 @@ # include #endif + #ifdef WIN32 #define VC_EXTRALEAN /*Exclude rarely-used stuff from Windows headers */ @@ -275,16 +266,16 @@ MS doesn't recognize it yet (as of April 2001) * supported by the compiler, usually 64 bits. It must be legal to qualify * `long_long' with `unsigned'. */ -#if SIZEOF_LONG_LONG>0 +#if H5_SIZEOF_LONG_LONG>0 # define long_long long long -#elif SIZEOF___INT64>0 +#elif H5_SIZEOF___INT64>0 # define long_long __int64 /*Win32*/ -# undef SIZEOF_LONG_LONG -# define SIZEOF_LONG_LONG SIZEOF___INT64 +# undef H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64 #else # define long_long long int -# undef SIZEOF_LONG_LONG -# define SIZEOF_LONG_LONG SIZEOF_LONG +# undef H5_SIZEOF_LONG_LONG +# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG #endif /* @@ -294,114 +285,114 @@ MS doesn't recognize it yet (as of April 2001) * be exactly one byte wide because we use it for pointer calculations to * void* memory. */ -#if SIZEOF_INT8_T==0 +#if H5_SIZEOF_INT8_T==0 typedef signed char int8_t; -# undef SIZEOF_INT8_T -# define SIZEOF_INT8_T SIZEOF_CHAR -#elif SIZEOF_INT8_T==1 +# undef H5_SIZEOF_INT8_T +# define H5_SIZEOF_INT8_T H5_SIZEOF_CHAR +#elif H5_SIZEOF_INT8_T==1 #else # error "the int8_t type must be 1 byte wide" #endif -#if SIZEOF_UINT8_T==0 +#if H5_SIZEOF_UINT8_T==0 typedef unsigned char uint8_t; -# undef SIZEOF_UINT8_T -# define SIZEOF_UINT8_T SIZEOF_CHAR -#elif SIZEOF_UINT8_T==1 +# undef H5_SIZEOF_UINT8_T +# define H5_SIZEOF_UINT8_T H5_SIZEOF_CHAR +#elif H5_SIZEOF_UINT8_T==1 #else # error "the uint8_t type must be 1 byte wide" #endif -#if SIZEOF_INT16_T>=2 -#elif SIZEOF_SHORT>=2 +#if H5_SIZEOF_INT16_T>=2 +#elif H5_SIZEOF_SHORT>=2 typedef short int16_t; -# undef SIZEOF_INT16_T -# define SIZEOF_INT16_T SIZEOF_SHORT -#elif SIZEOF_INT>=2 +# undef H5_SIZEOF_INT16_T +# define H5_SIZEOF_INT16_T H5_SIZEOF_SHORT +#elif H5_SIZEOF_INT>=2 typedef int int16_t; -# undef SIZEOF_INT16_T -# define SIZEOF_INT16_T SIZEOF_INT +# undef H5_SIZEOF_INT16_T +# define H5_SIZEOF_INT16_T H5_SIZEOF_INT #else # error "nothing appropriate for int16_t" #endif -#if SIZEOF_UINT16_T>=2 -#elif SIZEOF_SHORT>=2 +#if H5_SIZEOF_UINT16_T>=2 +#elif H5_SIZEOF_SHORT>=2 typedef unsigned short uint16_t; -# undef SIZEOF_UINT16_T -# define SIZEOF_UINT16_T SIZEOF_SHORT -#elif SIZEOF_INT>=2 +# undef H5_SIZEOF_UINT16_T +# define H5_SIZEOF_UINT16_T H5_SIZEOF_SHORT +#elif H5_SIZEOF_INT>=2 typedef unsigned uint16_t; -# undef SIZEOF_UINT16_T -# define SIZEOF_UINT16_T SIZEOF_INT +# undef H5_SIZEOF_UINT16_T +# define H5_SIZEOF_UINT16_T H5_SIZEOF_INT #else # error "nothing appropriate for uint16_t" #endif -#if SIZEOF_INT32_T>=4 -#elif SIZEOF_SHORT>=4 +#if H5_SIZEOF_INT32_T>=4 +#elif H5_SIZEOF_SHORT>=4 typedef short int32_t; -# undef SIZEOF_INT32_T -# define SIZEOF_INT32_T SIZEOF_SHORT -#elif SIZEOF_INT>=4 +# undef H5_SIZEOF_INT32_T +# define H5_SIZEOF_INT32_T H5_SIZEOF_SHORT +#elif H5_SIZEOF_INT>=4 typedef int int32_t; -# undef SIZEOF_INT32_T -# define SIZEOF_INT32_T SIZEOF_INT -#elif SIZEOF_LONG>=4 +# undef H5_SIZEOF_INT32_T +# define H5_SIZEOF_INT32_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=4 typedef long int32_t; -# undef SIZEOF_INT32_T -# define SIZEOF_INT32_T SIZEOF_LONG +# undef H5_SIZEOF_INT32_T +# define H5_SIZEOF_INT32_T H5_SIZEOF_LONG #else # error "nothing appropriate for int32_t" #endif -#if SIZEOF_UINT32_T>=4 -#elif SIZEOF_SHORT>=4 +#if H5_SIZEOF_UINT32_T>=4 +#elif H5_SIZEOF_SHORT>=4 typedef short uint32_t; -# undef SIZEOF_UINT32_T -# define SIZEOF_UINT32_T SIZEOF_SHORT -#elif SIZEOF_INT>=4 +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_SHORT +#elif H5_SIZEOF_INT>=4 typedef unsigned int uint32_t; -# undef SIZEOF_UINT32_T -# define SIZEOF_UINT32_T SIZEOF_INT -#elif SIZEOF_LONG>=4 +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=4 typedef unsigned long uint32_t; -# undef SIZEOF_UINT32_T -# define SIZEOF_UINT32_T SIZEOF_LONG +# undef H5_SIZEOF_UINT32_T +# define H5_SIZEOF_UINT32_T H5_SIZEOF_LONG #else # error "nothing appropriate for uint32_t" #endif -#if SIZEOF_INT64_T>=8 -#elif SIZEOF_INT>=8 +#if H5_SIZEOF_INT64_T>=8 +#elif H5_SIZEOF_INT>=8 typedef int int64_t; -# undef SIZEOF_INT64_T -# define SIZEOF_INT64_T SIZEOF_INT -#elif SIZEOF_LONG>=8 +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 typedef long int64_t; -# undef SIZEOF_INT64_T -# define SIZEOF_INT64_T SIZEOF_LONG -#elif SIZEOF_LONG_LONG>=8 +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 typedef long_long int64_t; -# undef SIZEOF_INT64_T -# define SIZEOF_INT64_T SIZEOF_LONG_LONG +# undef H5_SIZEOF_INT64_T +# define H5_SIZEOF_INT64_T H5_SIZEOF_LONG_LONG #else # error "nothing appropriate for int64_t" #endif -#if SIZEOF_UINT64_T>=8 -#elif SIZEOF_INT>=8 +#if H5_SIZEOF_UINT64_T>=8 +#elif H5_SIZEOF_INT>=8 typedef unsigned uint64_t; -# undef SIZEOF_UINT64_T -# define SIZEOF_UINT64_T SIZEOF_INT -#elif SIZEOF_LONG>=8 +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_INT +#elif H5_SIZEOF_LONG>=8 typedef unsigned long uint64_t; -# undef SIZEOF_UINT64_T -# define SIZEOF_UINT64_T SIZEOF_LONG -#elif SIZEOF_LONG_LONG>=8 +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG +#elif H5_SIZEOF_LONG_LONG>=8 typedef unsigned long_long uint64_t; -# undef SIZEOF_UINT64_T -# define SIZEOF_UINT64_T SIZEOF_LONG_LONG +# undef H5_SIZEOF_UINT64_T +# define H5_SIZEOF_UINT64_T H5_SIZEOF_LONG_LONG #else # error "nothing appropriate for uint64_t" #endif diff --git a/test/big.c b/test/big.c index 26a0269..f26bb71 100644 --- a/test/big.c +++ b/test/big.c @@ -18,7 +18,7 @@ const char *FILENAME[] = { #define WRT_SIZE 4*1024 #define FAMILY_SIZE 1024*1024*1024 -#if SIZEOF_LONG_LONG >= 8 +#if H5_SIZEOF_LONG_LONG >= 8 # define GB8LL ((unsigned long_long)8*1024*1024*1024) #else # define GB8LL 0 /*cannot do the test*/ diff --git a/test/dtypes.c b/test/dtypes.c index bcc90c9..d423582 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997 NCSA + * Copyright (C) 1997-2002 NCSA * All rights reserved. * * Programmer: Robb Matzke @@ -264,19 +264,19 @@ reset_hdf5(void) #endif if (without_hardware_g) h5_no_hwconv(); #ifdef TEST_ALIGNMENT - SET_ALIGNMENT(SCHAR, SIZEOF_CHAR); - SET_ALIGNMENT(UCHAR, SIZEOF_CHAR); - SET_ALIGNMENT(SHORT, SIZEOF_SHORT); - SET_ALIGNMENT(USHORT, SIZEOF_SHORT); - SET_ALIGNMENT(INT, SIZEOF_INT); - SET_ALIGNMENT(UINT, SIZEOF_INT); - SET_ALIGNMENT(LONG, SIZEOF_LONG); - SET_ALIGNMENT(ULONG, SIZEOF_LONG); - SET_ALIGNMENT(LLONG, SIZEOF_LONG_LONG); - SET_ALIGNMENT(ULLONG, SIZEOF_LONG_LONG); - SET_ALIGNMENT(FLOAT, SIZEOF_FLOAT); - SET_ALIGNMENT(DOUBLE, SIZEOF_DOUBLE); - SET_ALIGNMENT(LDOUBLE, SIZEOF_LONG_DOUBLE); + SET_ALIGNMENT(SCHAR, H5_SIZEOF_CHAR); + SET_ALIGNMENT(UCHAR, H5_SIZEOF_CHAR); + SET_ALIGNMENT(SHORT, H5_SIZEOF_SHORT); + SET_ALIGNMENT(USHORT, H5_SIZEOF_SHORT); + SET_ALIGNMENT(INT, H5_SIZEOF_INT); + SET_ALIGNMENT(UINT, H5_SIZEOF_INT); + SET_ALIGNMENT(LONG, H5_SIZEOF_LONG); + SET_ALIGNMENT(ULONG, H5_SIZEOF_LONG); + SET_ALIGNMENT(LLONG, H5_SIZEOF_LONG_LONG); + SET_ALIGNMENT(ULLONG, H5_SIZEOF_LONG_LONG); + SET_ALIGNMENT(FLOAT, H5_SIZEOF_FLOAT); + SET_ALIGNMENT(DOUBLE, H5_SIZEOF_DOUBLE); + SET_ALIGNMENT(LDOUBLE, H5_SIZEOF_LONG_DOUBLE); #endif } @@ -3223,12 +3223,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) break; case INT_LLONG: memcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long)); - HDfprintf(stdout," %29"PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); break; case INT_ULLONG: memcpy(aligned, saved+j*sizeof(long_long), sizeof(unsigned long_long)); - HDfprintf(stdout," %29"PRINTF_LL_WIDTH"u\n", + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); break; case INT_OTHER: @@ -3276,12 +3276,12 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) break; case INT_LLONG: memcpy(aligned, buf+j*sizeof(long_long), sizeof(long_long)); - HDfprintf(stdout," %29"PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)aligned)); break; case INT_ULLONG: memcpy(aligned, buf+j*sizeof(long_long), sizeof(unsigned long_long)); - HDfprintf(stdout," %29"PRINTF_LL_WIDTH"u\n", + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)aligned)); break; case INT_OTHER: @@ -3320,10 +3320,10 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) printf(" %29lu\n", *((unsigned long*)hw)); break; case INT_LLONG: - HDfprintf(stdout," %29"PRINTF_LL_WIDTH"d\n", *((long_long*)hw)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long_long*)hw)); break; case INT_ULLONG: - HDfprintf(stdout," %29"PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)hw)); + HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long_long*)hw)); break; case INT_OTHER: break; @@ -3442,7 +3442,7 @@ my_isnan(flt_t type, void *val) double x; memcpy(&x, val, sizeof(double)); retval = (x!=x); -#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else if (FLT_LDOUBLE==type) { long double x; memcpy(&x, val, sizeof(long double)); @@ -3465,7 +3465,7 @@ my_isnan(flt_t type, void *val) double x; memcpy(&x, val, sizeof(double)); sprintf(s, "%g", x); -#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else if (FLT_LDOUBLE==type) { long double x; memcpy(&x, val, sizeof(long double)); @@ -3519,7 +3519,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) float hw_f; /*hardware-converted */ double hw_d; /*hardware-converted */ void *aligned=NULL; /*aligned buffer */ -#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE long double hw_ld; /*hardware-converted */ #endif unsigned char *hw=NULL; /*ptr to hardware-conv'd*/ @@ -3569,7 +3569,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) } else if (H5Tequal(src, H5T_NATIVE_DOUBLE)) { src_type_name = "double"; src_type = FLT_DOUBLE; -#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else if (H5Tequal(src, H5T_NATIVE_LDOUBLE)) { src_type_name = "long double"; src_type = FLT_LDOUBLE; @@ -3585,7 +3585,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) } else if (H5Tequal(dst, H5T_NATIVE_DOUBLE)) { dst_type_name = "double"; dst_type = FLT_DOUBLE; -#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE +#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE } else if (H5Tequal(dst, H5T_NATIVE_LDOUBLE)) { dst_type_name = "long double"; dst_type = FLT_LDOUBLE; @@ -3645,7 +3645,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst) } else { for (j=0; j #endif diff --git a/test/tconfig.c b/test/tconfig.c index 8ed2a31..047097d 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -100,85 +100,85 @@ void test_config_ctypes(void) { /* standard basic types */ - vrfy_ctype(char, SIZEOF_CHAR); - vrfy_ctype(int, SIZEOF_INT); - vrfy_ctype(short, SIZEOF_SHORT); - vrfy_ctype(long, SIZEOF_LONG); - vrfy_ctype(float, SIZEOF_FLOAT); - vrfy_ctype(double, SIZEOF_DOUBLE); + vrfy_ctype(char, H5_SIZEOF_CHAR); + vrfy_ctype(int, H5_SIZEOF_INT); + vrfy_ctype(short, H5_SIZEOF_SHORT); + vrfy_ctype(long, H5_SIZEOF_LONG); + vrfy_ctype(float, H5_SIZEOF_FLOAT); + vrfy_ctype(double, H5_SIZEOF_DOUBLE); /* non-standard basic types */ -#if SIZEOF_LONG_LONG > 0 - vrfy_ctype(long_long, SIZEOF_LONG_LONG); +#if H5_SIZEOF_LONG_LONG > 0 + vrfy_ctype(long_long, H5_SIZEOF_LONG_LONG); #endif -#if SIZEOF_LONG_DOUBLE > 0 - vrfy_ctype(long double, SIZEOF_LONG_DOUBLE); +#if H5_SIZEOF_LONG_DOUBLE > 0 + vrfy_ctype(long double, H5_SIZEOF_LONG_DOUBLE); #endif -#if SIZEOF_UINT8_T > 0 - vrfy_ctype(uint8_t, SIZEOF_UINT8_T); +#if H5_SIZEOF_UINT8_T > 0 + vrfy_ctype(uint8_t, H5_SIZEOF_UINT8_T); #endif -#if SIZEOF_UINT16_T > 0 - vrfy_ctype(uint16_t, SIZEOF_UINT16_T); +#if H5_SIZEOF_UINT16_T > 0 + vrfy_ctype(uint16_t, H5_SIZEOF_UINT16_T); #endif -#if SIZEOF_UINT32_T > 0 - vrfy_ctype(uint32_t, SIZEOF_UINT32_T); +#if H5_SIZEOF_UINT32_T > 0 + vrfy_ctype(uint32_t, H5_SIZEOF_UINT32_T); #endif -#if SIZEOF_UINT64_T > 0 - vrfy_ctype(uint64_t, SIZEOF_UINT64_T); +#if H5_SIZEOF_UINT64_T > 0 + vrfy_ctype(uint64_t, H5_SIZEOF_UINT64_T); #endif -#if SIZEOF_UINT_FAST8_T > 0 - vrfy_ctype(uint_fast8_t, SIZEOF_UINT_FAST8_T); +#if H5_SIZEOF_UINT_FAST8_T > 0 + vrfy_ctype(uint_fast8_t, H5_SIZEOF_UINT_FAST8_T); #endif -#if SIZEOF_UINT_FAST16_T > 0 - vrfy_ctype(uint_fast16_t, SIZEOF_UINT_FAST16_T); +#if H5_SIZEOF_UINT_FAST16_T > 0 + vrfy_ctype(uint_fast16_t, H5_SIZEOF_UINT_FAST16_T); #endif -#if SIZEOF_UINT_FAST32_T > 0 - vrfy_ctype(uint_fast32_t, SIZEOF_UINT_FAST32_T); +#if H5_SIZEOF_UINT_FAST32_T > 0 + vrfy_ctype(uint_fast32_t, H5_SIZEOF_UINT_FAST32_T); #endif -#if SIZEOF_UINT_FAST64_T > 0 - vrfy_ctype(uint_fast64_t, SIZEOF_UINT_FAST64_T); +#if H5_SIZEOF_UINT_FAST64_T > 0 + vrfy_ctype(uint_fast64_t, H5_SIZEOF_UINT_FAST64_T); #endif -#if SIZEOF_UINT_LEAST8_T > 0 - vrfy_ctype(uint_least8_t, SIZEOF_UINT_LEAST8_T); +#if H5_SIZEOF_UINT_LEAST8_T > 0 + vrfy_ctype(uint_least8_t, H5_SIZEOF_UINT_LEAST8_T); #endif -#if SIZEOF_UINT_LEAST16_T > 0 - vrfy_ctype(uint_least16_t, SIZEOF_UINT_LEAST16_T); +#if H5_SIZEOF_UINT_LEAST16_T > 0 + vrfy_ctype(uint_least16_t, H5_SIZEOF_UINT_LEAST16_T); #endif -#if SIZEOF_UINT_LEAST32_T > 0 - vrfy_ctype(uint_least32_t, SIZEOF_UINT_LEAST32_T); +#if H5_SIZEOF_UINT_LEAST32_T > 0 + vrfy_ctype(uint_least32_t, H5_SIZEOF_UINT_LEAST32_T); #endif -#if SIZEOF_UINT_LEAST64_T > 0 - vrfy_ctype(uint_least64_t, SIZEOF_UINT_LEAST64_T); +#if H5_SIZEOF_UINT_LEAST64_T > 0 + vrfy_ctype(uint_least64_t, H5_SIZEOF_UINT_LEAST64_T); #endif /* pseudo standard basic types */ -#if SIZEOF___INT64 > 0 - vrfy_ctype(__int64, SIZEOF___INT64); +#if H5_SIZEOF___INT64 > 0 + vrfy_ctype(__int64, H5_SIZEOF___INT64); #endif -#if SIZEOF_OFF_T > 0 - vrfy_ctype(off_t, SIZEOF_OFF_T); +#if H5_SIZEOF_OFF_T > 0 + vrfy_ctype(off_t, H5_SIZEOF_OFF_T); #endif -#if SIZEOF_SIZE_T > 0 - vrfy_ctype(size_t, SIZEOF_SIZE_T); +#if H5_SIZEOF_SIZE_T > 0 + vrfy_ctype(size_t, H5_SIZEOF_SIZE_T); #endif -#if SIZEOF_SSIZE_T > 0 - vrfy_ctype(ssize_t, SIZEOF_SSIZE_T); +#if H5_SIZEOF_SSIZE_T > 0 + vrfy_ctype(ssize_t, H5_SIZEOF_SSIZE_T); #endif } diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 892aa36..65319c5 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -2945,10 +2945,10 @@ print_enum(hid_t type) for (j = 0; j < dst_size; j++) printf("%02x", value[i * dst_size + j]); } else if (H5T_SGN_NONE == H5Tget_sign(native)) { - HDfprintf(stdout,"%" PRINTF_LL_WIDTH "u", *((unsigned long_long *) + HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long_long *) ((void *) (value + i * dst_size)))); } else { - HDfprintf(stdout,"%" PRINTF_LL_WIDTH "d", + HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "d", *((long_long *) ((void *) (value + i * dst_size)))); } @@ -4932,10 +4932,10 @@ xml_print_enum(hid_t type) for (j = 0; j < dst_size; j++) printf("%02x", value[i * dst_size + j]); } else if (H5T_SGN_NONE == H5Tget_sign(native)) { - HDfprintf(stdout,"%" PRINTF_LL_WIDTH "u", *((unsigned long_long *) + HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "u", *((unsigned long_long *) ((void *) (value + i * dst_size)))); } else { - HDfprintf(stdout,"%" PRINTF_LL_WIDTH "d", + HDfprintf(stdout,"%" H5_PRINTF_LL_WIDTH "d", *((long_long *) ((void *) (value + i * dst_size)))); } printf("\n"); diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index ae45a02..b414319 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -817,10 +817,10 @@ display_enum_type(hid_t type, int ind) printf("%02x", value[i*dst_size+j]); } } else if (H5T_SGN_NONE==H5Tget_sign(native)) { - HDfprintf(stdout,"%"PRINTF_LL_WIDTH"u", + HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"u", *((unsigned long_long*)((void*)(value+i*dst_size)))); } else { - HDfprintf(stdout,"%"PRINTF_LL_WIDTH"d", + HDfprintf(stdout,"%"H5_PRINTF_LL_WIDTH"d", *((long_long*)((void*)(value+i*dst_size)))); } } diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c index e75ac3d..0820cfb 100644 --- a/tools/lib/h5tools_str.c +++ b/tools/lib/h5tools_str.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001 National Center for Supercomputing Applications + * Copyright (c) 2001-2002 National Center for Supercomputing Applications * All rights reserved. * * Programmer: Bill Wendling @@ -517,8 +517,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, /* Build default formats for long long types */ if (!fmt_llong[0]) { - sprintf(fmt_llong, "%%%sd", PRINTF_LL_WIDTH); - sprintf(fmt_ullong, "%%%su", PRINTF_LL_WIDTH); + sprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH); + sprintf(fmt_ullong, "%%%su", H5_PRINTF_LL_WIDTH); } /* Append value depending on data type */ -- cgit v0.12