summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-10-21 16:12:33 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-10-21 16:12:33 (GMT)
commit2b18e934c6812fd1b487ebfebf9240b009c3e4ae (patch)
tree4c5f328cf76071650907986d781191af05a3374a /src
parent0a9249a4016f327a3382a103d1b3d10cc6451a5a (diff)
downloadhdf5-2b18e934c6812fd1b487ebfebf9240b009c3e4ae.zip
hdf5-2b18e934c6812fd1b487ebfebf9240b009c3e4ae.tar.gz
hdf5-2b18e934c6812fd1b487ebfebf9240b009c3e4ae.tar.bz2
[svn-r24336] Bring revisions #24118 - #24200 from trunk.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt7
-rw-r--r--src/H5F.c13
-rw-r--r--src/H5Fpkg.h2
-rw-r--r--src/H5Fsuper.c62
-rw-r--r--src/H5PL.c6
-rw-r--r--src/H5Z.c4
-rw-r--r--src/H5config.h.in2
-rw-r--r--src/H5detect.c329
-rw-r--r--src/H5public.h4
-rw-r--r--src/Makefile.am1
-rw-r--r--src/Makefile.in27
-rw-r--r--src/libhdf5.settings.in2
12 files changed, 250 insertions, 209 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b667199..bbd02e0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -786,13 +786,8 @@ INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR})
# Setup the H5Detect utility which generates H5Tinit with platform
# specific type checks inside
#-----------------------------------------------------------------------------
-IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
- SET (LOCAL_OPT_FLAG "-O0")
-ELSE (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
- SET (LOCAL_OPT_FLAG " ")
-ENDIF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c)
-TARGET_C_PROPERTIES (H5detect ${LOCAL_OPT_FLAG} " ")
+TARGET_C_PROPERTIES (H5detect " " " ")
IF (MSVC)
TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib")
ENDIF (MSVC)
diff --git a/src/H5F.c b/src/H5F.c
index 6b89c4e..756a958 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -825,22 +825,25 @@ done:
htri_t
H5Fis_hdf5(const char *name)
{
- H5FD_t *file = NULL; /* Low-level file struct */
- htri_t ret_value; /* Return value */
+ H5FD_t *file = NULL; /* Low-level file struct */
+ haddr_t sig_addr; /* Address of hdf5 file signature */
+ htri_t ret_value; /* Return value */
FUNC_ENTER_API(FAIL)
H5TRACE1("t", "*s", name);
/* Check args and all the boring stuff. */
if(!name || !*name)
- HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "no file name specified")
/* Open the file at the virtual file layer */
if(NULL == (file = H5FD_open(name, H5F_ACC_RDONLY, H5P_FILE_ACCESS_DEFAULT, HADDR_UNDEF)))
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file")
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to open file")
/* The file is an hdf5 file if the hdf5 file signature can be found */
- ret_value = (HADDR_UNDEF != H5F_locate_signature(file, H5AC_ind_dxpl_id));
+ if(H5F_locate_signature(file, H5AC_ind_dxpl_id, &sig_addr) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature")
+ ret_value = (HADDR_UNDEF != sig_addr);
done:
/* Close the file */
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index e47662e..828d464 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -296,7 +296,7 @@ H5_DLLVAR const H5AC_class_t H5AC_SUPERBLOCK[1];
/* General routines */
H5_DLL herr_t H5F_init(void);
-H5_DLL haddr_t H5F_locate_signature(H5FD_t *file, hid_t dxpl_id);
+H5_DLL herr_t H5F_locate_signature(H5FD_t *file, hid_t dxpl_id, haddr_t *sig_addr);
H5_DLL herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing);
/* File mount related routines */
diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c
index 8205392..a1c67ec 100644
--- a/src/H5Fsuper.c
+++ b/src/H5Fsuper.c
@@ -100,34 +100,33 @@ H5F_init_super_interface(void)
/*-------------------------------------------------------------------------
- * Function: H5F_locate_signature
+ * Function: H5F_locate_signature
*
- * Purpose: Finds the HDF5 superblock signature in a file. The signature
- * can appear at address 0, or any power of two beginning with
- * 512.
+ * Purpose: Finds the HDF5 superblock signature in a file. The
+ * signature can appear at address 0, or any power of two
+ * beginning with 512.
*
- * Return: Success: The absolute format address of the signature.
- *
- * Failure: HADDR_UNDEF
+ * Return: Success: SUCCEED
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Friday, November 7, 1997
+ * Programmer: Robb Matzke
+ * Friday, November 7, 1997
*
*-------------------------------------------------------------------------
*/
-haddr_t
-H5F_locate_signature(H5FD_t *file, hid_t dxpl_id)
+herr_t
+H5F_locate_signature(H5FD_t *file, hid_t dxpl_id, haddr_t *sig_addr)
{
- haddr_t addr, eoa;
- uint8_t buf[H5F_SIGNATURE_LEN];
- unsigned n, maxpow;
- haddr_t ret_value; /* Return value */
+ haddr_t addr, eoa;
+ uint8_t buf[H5F_SIGNATURE_LEN];
+ unsigned n, maxpow;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
/* Find the least N such that 2^N is larger than the file size */
if(HADDR_UNDEF == (addr = H5FD_get_eof(file)) || HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER)))
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to obtain EOF/EOA value")
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to obtain EOF/EOA value")
for(maxpow = 0; addr; maxpow++)
addr >>= 1;
maxpow = MAX(maxpow, 9);
@@ -137,26 +136,27 @@ H5F_locate_signature(H5FD_t *file, hid_t dxpl_id)
* powers of two larger than 9.
*/
for(n = 8; n < maxpow; n++) {
- addr = (8 == n) ? 0 : (haddr_t)1 << n;
- if(H5FD_set_eoa(file, H5FD_MEM_SUPER, addr + H5F_SIGNATURE_LEN) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to set EOA value for file signature")
- if(H5FD_read(file, dxpl_id, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to read file signature")
- if(!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN))
+ addr = (8 == n) ? 0 : (haddr_t)1 << n;
+ if(H5FD_set_eoa(file, H5FD_MEM_SUPER, addr + H5F_SIGNATURE_LEN) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to set EOA value for file signature")
+ if(H5FD_read(file, dxpl_id, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to read file signature")
+ if(!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN))
break;
} /* end for */
/*
* If the signature was not found then reset the EOA value and return
- * failure.
+ * HADDR_UNDEF.
*/
if(n >= maxpow) {
- (void)H5FD_set_eoa(file, H5FD_MEM_SUPER, eoa); /* Ignore return value */
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to find a valid file signature")
+ if(H5FD_set_eoa(file, H5FD_MEM_SUPER, eoa) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to reset EOA value")
+ *sig_addr = HADDR_UNDEF;
} /* end if */
-
- /* Set return value */
- ret_value = addr;
+ else
+ /* Set return value */
+ *sig_addr = addr;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -330,8 +330,10 @@ H5F_super_read(H5F_t *f, hid_t dxpl_id)
FUNC_ENTER_NOAPI_TAG(dxpl_id, H5AC__SUPERBLOCK_TAG, FAIL)
/* Find the superblock */
- if(HADDR_UNDEF == (super_addr = H5F_locate_signature(f->shared->lf, dxpl_id)))
- HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to find file signature")
+ if(H5F_locate_signature(f->shared->lf, dxpl_id, &super_addr) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to locate file signature")
+ if(HADDR_UNDEF == super_addr)
+ HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "file signature not found")
/* Check for userblock present */
if(H5F_addr_gt(super_addr, 0)) {
diff --git a/src/H5PL.c b/src/H5PL.c
index 1c4b355..21bc0f2 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -85,7 +85,7 @@ typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void);
typedef const void *(*H5PL_get_plugin_info_t)(void);
#endif /* H5_HAVE_WIN32_API */
-#define H5PL_DEFAULT_PATH H5_DEFAULT_PLUGIN
+#define H5PL_DEFAULT_PATH H5_DEFAULT_PLUGINDIR
/* Special symbol to indicate no plugin loading */
#define H5PL_NO_PLUGIN "::"
@@ -273,6 +273,10 @@ H5PL_load(H5PL_type_t type, int id)
FUNC_ENTER_NOAPI(NULL)
+ /* Check for "no plugins" indicated" */
+ if(H5PL_no_plugin_g)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTLOAD, NULL, "required dynamically loaded plugin filter '%d' is not available", id)
+
/* Initialize the location paths for dynamic libraries, if they aren't
* already set up.
*/
diff --git a/src/H5Z.c b/src/H5Z.c
index d415060..901b506 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -1326,9 +1326,6 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
hbool_t issue_error = FALSE;
/* Check for "no plugins" indicated" */
- if(H5PL_no_plugin())
- issue_error = TRUE;
- else {
const H5Z_class2_t *filter_info;
/* Try loading the filter */
@@ -1343,7 +1340,6 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags,
} /* end if */
else
issue_error = TRUE;
- } /* end else */
/* Check for error */
if(issue_error) {
diff --git a/src/H5config.h.in b/src/H5config.h.in
index a86970a..02bafd8 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -18,7 +18,7 @@
#undef CXX_HAVE_OFFSETOF
/* Define the default plugins path to compile */
-#undef DEFAULT_PLUGIN
+#undef DEFAULT_PLUGINDIR
/* Define the default virtual file driver to compile */
#undef DEFAULT_VFD
diff --git a/src/H5detect.c b/src/H5detect.c
index 2bf0d2d..be661ea 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -118,10 +118,12 @@ static volatile int nd_g = 0, na_g = 0;
static void print_results(int nd, detected_t *d, int na, malign_t *m);
static void iprint(detected_t *);
-static int byte_cmp(int, const void *, const void *);
-static int bit_cmp(int, int *, volatile void *, volatile void *);
+static int byte_cmp(int, const void *, const void *, const unsigned char *);
+static int bit_cmp(int, int *, volatile void *, volatile void *,
+ const unsigned char *);
static void fix_order(int, int, int *, const char **);
-static int imp_bit(int, int *, volatile void *, volatile void *);
+static int imp_bit(int, int *, volatile void *, volatile void *,
+ const unsigned char *);
static unsigned long find_bias(int, int, int *, void *);
static void precision (detected_t*);
static void print_header(void);
@@ -200,15 +202,17 @@ precision (detected_t *d)
}
}
-
/*-------------------------------------------------------------------------
- * Function: DETECT_I
+ * Function: DETECT_I/DETECT_BYTE
*
- * Purpose: This macro takes a type like `int' and a base name like
+ * Purpose: These macro takes a type like `int' and a base name like
* `nati' and detects the byte order. The VAR is used to
* construct the names of the C variables defined.
*
+ * DETECT_I is used for types that are larger than one byte,
+ * DETECT_BYTE is used for types that are exactly one byte.
+ *
* Return: void
*
* Programmer: Robb Matzke
@@ -229,46 +233,52 @@ precision (detected_t *d)
* Robb Matzke, 5 Nov 1996
* Removed HFILE and CFILE arguments.
*
+ * Neil Fortner, 6 Sep 2013
+ * Split macro into DETECT_I and DETECT_BYTE macros, extracted
+ * common cod einto DETECT_I_BYTE_CORE. This was done to remove
+ * "will never be executed" warnings.
+ *
*-------------------------------------------------------------------------
*/
-#define DETECT_I(TYPE,VAR,INFO) { \
- TYPE _v; \
- int _int_v; \
- int _i, _j; \
- unsigned char *_x; \
+#define DETECT_I_BYTE_CORE(TYPE,VAR,INFO,DETECT_TYPE) { \
+ DETECT_TYPE _v; \
+ int _i, _j; \
+ unsigned char *_x; \
+ \
+ HDmemset(&INFO, 0, sizeof(INFO)); \
+ INFO.varname = #VAR; \
+ INFO.size = sizeof(TYPE); \
\
- HDmemset(&INFO, 0, sizeof(INFO)); \
- INFO.varname = #VAR; \
- INFO.size = sizeof(TYPE); \
+ for(_i = sizeof(DETECT_TYPE), _v = 0; _i > 0; --_i) \
+ _v = (_v << 8) + _i; \
+ for(_i = 0, _x = (unsigned char *)&_v; _i < (signed)sizeof(DETECT_TYPE); _i++) { \
+ _j = (*_x++) - 1; \
+ HDassert(_j < (signed)sizeof(DETECT_TYPE)); \
+ INFO.perm[_i] = _j; \
+ } /* end for */ \
\
- if(sizeof(TYPE) != 1) { \
- for(_i = sizeof(TYPE), _v = 0; _i > 0; --_i) \
- _v = (_v << 8) + _i; \
- for(_i = 0, _x = (unsigned char *)&_v; _i < (signed)sizeof(TYPE); _i++) { \
- _j = (*_x++) - 1; \
- HDassert(_j < (signed)sizeof(TYPE)); \
- INFO.perm[_i] = _j; \
- } /* end for */ \
- } else { /*Not able to detect order if type size is 1 byte. Use native int \
- *instead. No effect on data, just make it look correct. */ \
- for(_i = sizeof(int), _int_v = 0; _i > 0; --_i) \
- _int_v = (_int_v << 8) + _i; \
- for(_i = 0, _x = (unsigned char *)&_int_v; _i < (signed)sizeof(int); _i++) { \
- _j = (*_x++)-1; \
- HDassert(_j < (signed)sizeof(int)); \
- INFO.perm[_i] = _j; \
- } /* end for */ \
- } /* end else */ \
+ INFO.sign = ('U' != *(#VAR)); \
+ precision (&(INFO)); \
+ ALIGNMENT(TYPE, INFO); \
+ if(!HDstrcmp(INFO.varname, "SCHAR") || !HDstrcmp(INFO.varname, "SHORT") || \
+ !HDstrcmp(INFO.varname, "INT") || !HDstrcmp(INFO.varname, "LONG") || \
+ !HDstrcmp(INFO.varname, "LLONG")) { \
+ COMP_ALIGNMENT(TYPE, INFO.comp_align); \
+ } \
+}
+
+#define DETECT_BYTE(TYPE,VAR,INFO) { \
+ HDcompile_assert(sizeof(TYPE) == 1); \
\
- INFO.sign = ('U' != *(#VAR)); \
- precision (&(INFO)); \
- ALIGNMENT(TYPE, INFO); \
- if(!HDstrcmp(INFO.varname, "SCHAR") || !HDstrcmp(INFO.varname, "SHORT") || \
- !HDstrcmp(INFO.varname, "INT") || !HDstrcmp(INFO.varname, "LONG") || \
- !HDstrcmp(INFO.varname, "LLONG")) { \
- COMP_ALIGNMENT(TYPE, INFO.comp_align); \
- } \
+ DETECT_I_BYTE_CORE(TYPE,VAR,INFO,int) \
}
+
+#define DETECT_I(TYPE,VAR,INFO) { \
+ HDcompile_assert(sizeof(TYPE) > 1); \
+ \
+ DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \
+}
+
/*-------------------------------------------------------------------------
* Function: DETECT_F
@@ -290,71 +300,88 @@ precision (detected_t *d)
*
*-------------------------------------------------------------------------
*/
-#define DETECT_F(TYPE,VAR,INFO) { \
- volatile TYPE _v1, _v2, _v3; \
- unsigned char _buf1[sizeof(TYPE)], _buf3[sizeof(TYPE)]; \
- int _i, _j, _last = (-1); \
- char *_mesg; \
- \
- HDmemset(&INFO, 0, sizeof(INFO)); \
- INFO.varname = #VAR; \
- INFO.size = sizeof(TYPE); \
- \
- /* Completely initialize temporary variables, in case the bits used in */ \
- /* the type take less space than the number of bits used to store the type */ \
- HDmemset(&_v3, 0, sizeof(TYPE)); \
- HDmemset(&_v2, 0, sizeof(TYPE)); \
- HDmemset(&_v1, 0, sizeof(TYPE)); \
- \
- /* Byte Order */ \
- for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \
- _v3 = _v1; \
- _v1 += _v2; \
- _v2 /= 256.0; \
- HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \
- HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \
- _j = byte_cmp(sizeof(TYPE), &_buf3, &_buf1); \
- if(_j >= 0) { \
- INFO.perm[_i] = _j; \
- _last = _i; \
- } \
- } \
- fix_order(sizeof(TYPE), _last, INFO.perm, (const char**)&_mesg); \
+#define DETECT_F(TYPE,VAR,INFO) { \
+ volatile TYPE _v1, _v2, _v3; \
+ unsigned char _buf1[sizeof(TYPE)], _buf3[sizeof(TYPE)]; \
+ unsigned char _pad_mask[sizeof(TYPE)]; \
+ unsigned char _byte_mask; \
+ int _i, _j, _last = (-1); \
+ char *_mesg; \
\
- if(!HDstrcmp(_mesg, "VAX")) \
- INFO.is_vax = TRUE; \
- \
- /* Implicit mantissa bit */ \
- _v1 = 0.5; \
- _v2 = 1.0; \
- INFO.imp = imp_bit (sizeof(TYPE), INFO.perm, &_v1, &_v2); \
- \
- /* Sign bit */ \
- _v1 = 1.0; \
- _v2 = -1.0; \
- INFO.sign = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2); \
- \
- /* Mantissa */ \
- INFO.mpos = 0; \
- \
- _v1 = 1.0; \
- _v2 = 1.5; \
- INFO.msize = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2); \
- INFO.msize += 1 + (INFO.imp?0:1) - INFO.mpos; \
- \
- /* Exponent */ \
- INFO.epos = INFO.mpos + INFO.msize; \
- \
- INFO.esize = INFO.sign - INFO.epos; \
- \
- _v1 = 1.0; \
- INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \
- precision (&(INFO)); \
- ALIGNMENT(TYPE, INFO); \
- if(!HDstrcmp(INFO.varname, "FLOAT") || !HDstrcmp(INFO.varname, "DOUBLE") || \
- !HDstrcmp(INFO.varname, "LDOUBLE")) { \
- COMP_ALIGNMENT(TYPE,INFO.comp_align); \
- } \
+ HDmemset(&INFO, 0, sizeof(INFO)); \
+ INFO.varname = #VAR; \
+ INFO.size = sizeof(TYPE); \
+ \
+ /* Initialize padding mask */ \
+ HDmemset(_pad_mask, 0, sizeof(_pad_mask)); \
+ \
+ /* Padding bits. Set a variable to 4.0, then flip each bit and see if \
+ * the modified variable is equal ("==") to the original. Build a \
+ * padding bitmask to indicate which bits in the type are padding (i.e. \
+ * have no effect on the value and should be ignored by subsequent \
+ * steps). This is necessary because padding bits can change arbitrarily \
+ * and interfere with detection of the various properties below unless we \
+ * know to ignore them. */ \
+ _v1 = 4.0; \
+ HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \
+ for(_i = 0; _i < (int)sizeof(TYPE); _i++) \
+ for(_byte_mask = (unsigned char)1; _byte_mask; _byte_mask <<= 1) { \
+ _buf1[_i] ^= _byte_mask; \
+ HDmemcpy((void *)&_v2, (const void *)_buf1, sizeof(TYPE)); \
+ if(_v1 != _v2) \
+ _pad_mask[_i] |= _byte_mask; \
+ _buf1[_i] ^= _byte_mask; \
+ } /* enf for */ \
+ \
+ /* Byte Order */ \
+ for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \
+ _v3 = _v1; \
+ _v1 += _v2; \
+ _v2 /= 256.0; \
+ HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \
+ HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \
+ _j = byte_cmp(sizeof(TYPE), _buf3, _buf1, _pad_mask); \
+ if(_j >= 0) { \
+ INFO.perm[_i] = _j; \
+ _last = _i; \
+ } \
+ } \
+ fix_order(sizeof(TYPE), _last, INFO.perm, (const char**)&_mesg); \
+ \
+ if(!HDstrcmp(_mesg, "VAX")) \
+ INFO.is_vax = TRUE; \
+ \
+ /* Implicit mantissa bit */ \
+ _v1 = 0.5; \
+ _v2 = 1.0; \
+ INFO.imp = imp_bit (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \
+ \
+ /* Sign bit */ \
+ _v1 = 1.0; \
+ _v2 = -1.0; \
+ INFO.sign = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \
+ \
+ /* Mantissa */ \
+ INFO.mpos = 0; \
+ \
+ _v1 = 1.0; \
+ _v2 = 1.5; \
+ INFO.msize = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \
+ INFO.msize += 1 + (INFO.imp?0:1) - INFO.mpos; \
+ \
+ /* Exponent */ \
+ INFO.epos = INFO.mpos + INFO.msize; \
+ \
+ INFO.esize = INFO.sign - INFO.epos; \
+ \
+ _v1 = 1.0; \
+ INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \
+ precision (&(INFO)); \
+ ALIGNMENT(TYPE, INFO); \
+ if(!HDstrcmp(INFO.varname, "FLOAT") || !HDstrcmp(INFO.varname, "DOUBLE") || \
+ !HDstrcmp(INFO.varname, "LDOUBLE")) { \
+ COMP_ALIGNMENT(TYPE,INFO.comp_align); \
+ } \
}
@@ -879,7 +906,8 @@ iprint(detected_t *d)
*
* Purpose: Compares two chunks of memory A and B and returns the
* byte index into those arrays of the first byte that
- * differs between A and B.
+ * differs between A and B. Ignores differences where the
+ * corresponding bit in pad_mask is set to 0.
*
* Return: Success: Index of differing byte.
*
@@ -894,13 +922,16 @@ iprint(detected_t *d)
*-------------------------------------------------------------------------
*/
static int
-byte_cmp(int n, const void *_a, const void *_b)
+byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask)
{
- int i;
- const unsigned char *a = (const unsigned char *) _a;
- const unsigned char *b = (const unsigned char *) _b;
+ int i;
+ const unsigned char *a = (const unsigned char *) _a;
+ const unsigned char *b = (const unsigned char *) _b;
+
+ for(i = 0; i < n; i++)
+ if((a[i] & pad_mask[i]) != (b[i] & pad_mask[i]))
+ return i;
- for (i = 0; i < n; i++) if (a[i] != b[i]) return i;
return -1;
}
@@ -911,7 +942,8 @@ byte_cmp(int n, const void *_a, const void *_b)
* Purpose: Compares two bit vectors and returns the index for the
* first bit that differs between the two vectors. The
* size of the vector is NBYTES. PERM is a mapping from
- * actual order to little endian.
+ * actual order to little endian. Ignores differences where
+ * the corresponding bit in pad_mask is set to 0.
*
* Return: Success: Index of first differing bit.
*
@@ -926,22 +958,24 @@ byte_cmp(int n, const void *_a, const void *_b)
*-------------------------------------------------------------------------
*/
static int
-bit_cmp(int nbytes, int *perm, volatile void *_a, volatile void *_b)
+bit_cmp(int nbytes, int *perm, volatile void *_a, volatile void *_b,
+ const unsigned char *pad_mask)
{
- int i, j;
- volatile unsigned char *a = (volatile unsigned char *) _a;
- volatile unsigned char *b = (volatile unsigned char *) _b;
- unsigned char aa, bb;
+ int i, j;
+ volatile unsigned char *a = (volatile unsigned char *) _a;
+ volatile unsigned char *b = (volatile unsigned char *) _b;
+ unsigned char aa, bb;
for (i = 0; i < nbytes; i++) {
- HDassert(perm[i] < nbytes);
- if ((aa = a[perm[i]]) != (bb = b[perm[i]])) {
- for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) {
- if ((aa & 1) != (bb & 1)) return i * 8 + j;
- }
- HDassert("INTERNAL ERROR" && 0);
- HDabort();
- }
+ HDassert(perm[i] < nbytes);
+ if ((aa = a[perm[i]] & pad_mask[perm[i]])
+ != (bb = b[perm[i]] & pad_mask[perm[i]])) {
+ for (j = 0; j < 8; j++, aa >>= 1, bb >>= 1) {
+ if ((aa & 1) != (bb & 1)) return i * 8 + j;
+ }
+ fprintf(stderr, "INTERNAL ERROR");
+ HDabort();
+ }
}
return -1;
}
@@ -1050,18 +1084,19 @@ fix_order(int n, int last, int *perm, const char **mesg)
*-------------------------------------------------------------------------
*/
static int
-imp_bit(int n, int *perm, volatile void *_a, volatile void *_b)
+imp_bit(int n, int *perm, volatile void *_a, volatile void *_b,
+ const unsigned char *pad_mask)
{
- volatile unsigned char *a = (volatile unsigned char *) _a;
- volatile unsigned char *b = (volatile unsigned char *) _b;
- int changed, major, minor;
- int msmb; /*most significant mantissa bit */
+ volatile unsigned char *a = (volatile unsigned char *) _a;
+ volatile unsigned char *b = (volatile unsigned char *) _b;
+ int changed, major, minor;
+ int msmb; /*most significant mantissa bit */
/*
* Look for the least significant bit that has changed between
- * A and B. This is the least significant bit of the exponent.
+ * A and B. This is the least significant bit of the exponent.
*/
- changed = bit_cmp(n, perm, a, b);
+ changed = bit_cmp(n, perm, a, b, pad_mask);
HDassert(changed >= 0);
/*
@@ -1279,8 +1314,8 @@ bit.\n";
static void
detect_C89_integers(void)
{
- DETECT_I(signed char, SCHAR, d_g[nd_g]); nd_g++;
- DETECT_I(unsigned char, UCHAR, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++;
+ DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++;
DETECT_I(short, SHORT, d_g[nd_g]); nd_g++;
DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++;
DETECT_I(int, INT, d_g[nd_g]); nd_g++;
@@ -1330,22 +1365,46 @@ static void
detect_C99_integers8(void)
{
#if H5_SIZEOF_INT8_T>0
+ #if H5_SIZEOF_INT8_T==1
+ DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++;
+ #else
DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++;
+ #endif
#endif
#if H5_SIZEOF_UINT8_T>0
- DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++;
+ #if H5_SIZEOF_UINT8_T==1
+ DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++;
+ #else
+ DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++;
+ #endif
#endif
#if H5_SIZEOF_INT_LEAST8_T>0
+ #if H5_SIZEOF_INT_LEAST8_T==1
+ DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
+ #else
DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++;
+ #endif
#endif
#if H5_SIZEOF_UINT_LEAST8_T>0
+ #if H5_SIZEOF_UINT_LEAST8_T==1
+ DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
+ #else
DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++;
+ #endif
#endif
#if H5_SIZEOF_INT_FAST8_T>0
+ #if H5_SIZEOF_INT_FAST8_T==1
+ DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
+ #else
DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++;
+ #endif
#endif
#if H5_SIZEOF_UINT_FAST8_T>0
- DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
+ #if H5_SIZEOF_UINT_FAST8_T==1
+ DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
+ #else
+ DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++;
+ #endif
#endif
}
diff --git a/src/H5public.h b/src/H5public.h
index 49c9fbb..6136c05 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -75,10 +75,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 164 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 165 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "swmr0" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.164-swmr0" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.165-swmr0" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/Makefile.am b/src/Makefile.am
index 2e16d52..43d1d30 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -27,7 +27,6 @@ include $(top_srcdir)/config/lt_vers.am
# a long time to compile it with any optimization on. H5detect is used
# to generate H5Tinit.c once. So, optimization is not critical.
noinst_PROGRAMS = H5detect H5make_libsettings
-H5detect_CFLAGS = $(AM_CFLAGS) -g -O0
# Our main target, the HDF5 library
lib_LTLIBRARIES=libhdf5.la
diff --git a/src/Makefile.in b/src/Makefile.in
index de6ae97..a1666be 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -185,11 +185,8 @@ libhdf5_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(libhdf5_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(noinst_PROGRAMS)
H5detect_SOURCES = H5detect.c
-H5detect_OBJECTS = H5detect-H5detect.$(OBJEXT)
+H5detect_OBJECTS = H5detect.$(OBJEXT)
H5detect_LDADD = $(LDADD)
-H5detect_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
- $(LIBTOOLFLAGS) --mode=link $(CCLD) $(H5detect_CFLAGS) \
- $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
H5make_libsettings_SOURCES = H5make_libsettings.c
H5make_libsettings_OBJECTS = H5make_libsettings.$(OBJEXT)
H5make_libsettings_LDADD = $(LDADD)
@@ -355,6 +352,7 @@ LIPO = @LIPO@
LL_PATH = @LL_PATH@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_ADD_LIBHDF5_DEPENDENCY = @LT_ADD_LIBHDF5_DEPENDENCY@
LT_STATIC_EXEC = @LT_STATIC_EXEC@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
@@ -525,9 +523,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog
# Add libtool shared library version numbers to the HDF5 library
# See libtool versioning documentation online.
LT_VERS_INTERFACE = 6
-LT_VERS_REVISION = 154
+LT_VERS_REVISION = 155
LT_VERS_AGE = 0
-H5detect_CFLAGS = $(AM_CFLAGS) -g -O0
# Our main target, the HDF5 library
lib_LTLIBRARIES = libhdf5.la
@@ -751,7 +748,7 @@ clean-noinstPROGRAMS:
rm -f $$list
H5detect$(EXEEXT): $(H5detect_OBJECTS) $(H5detect_DEPENDENCIES) $(EXTRA_H5detect_DEPENDENCIES)
@rm -f H5detect$(EXEEXT)
- $(AM_V_CCLD)$(H5detect_LINK) $(H5detect_OBJECTS) $(H5detect_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(LINK) $(H5detect_OBJECTS) $(H5detect_LDADD) $(LIBS)
H5make_libsettings$(EXEEXT): $(H5make_libsettings_OBJECTS) $(H5make_libsettings_DEPENDENCIES) $(EXTRA_H5make_libsettings_DEPENDENCIES)
@rm -f H5make_libsettings$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(H5make_libsettings_OBJECTS) $(H5make_libsettings_LDADD) $(LIBS)
@@ -1033,7 +1030,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Ztrans.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5checksum.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5dbg.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5detect-H5detect.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5detect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5lib_settings.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5make_libsettings.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5system.Plo@am__quote@
@@ -1061,20 +1058,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
-H5detect-H5detect.o: H5detect.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(H5detect_CFLAGS) $(CFLAGS) -MT H5detect-H5detect.o -MD -MP -MF $(DEPDIR)/H5detect-H5detect.Tpo -c -o H5detect-H5detect.o `test -f 'H5detect.c' || echo '$(srcdir)/'`H5detect.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/H5detect-H5detect.Tpo $(DEPDIR)/H5detect-H5detect.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='H5detect.c' object='H5detect-H5detect.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(H5detect_CFLAGS) $(CFLAGS) -c -o H5detect-H5detect.o `test -f 'H5detect.c' || echo '$(srcdir)/'`H5detect.c
-
-H5detect-H5detect.obj: H5detect.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(H5detect_CFLAGS) $(CFLAGS) -MT H5detect-H5detect.obj -MD -MP -MF $(DEPDIR)/H5detect-H5detect.Tpo -c -o H5detect-H5detect.obj `if test -f 'H5detect.c'; then $(CYGPATH_W) 'H5detect.c'; else $(CYGPATH_W) '$(srcdir)/H5detect.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/H5detect-H5detect.Tpo $(DEPDIR)/H5detect-H5detect.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='H5detect.c' object='H5detect-H5detect.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(H5detect_CFLAGS) $(CFLAGS) -c -o H5detect-H5detect.obj `if test -f 'H5detect.c'; then $(CYGPATH_W) 'H5detect.c'; else $(CYGPATH_W) '$(srcdir)/H5detect.c'; fi`
-
mostlyclean-libtool:
-rm -f *.lo
diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in
index 343fa34..b594cc2 100644
--- a/src/libhdf5.settings.in
+++ b/src/libhdf5.settings.in
@@ -25,7 +25,7 @@ Compiling Options:
AM_CPPFLAGS: @AM_CPPFLAGS@
Shared C Library: @enable_shared@
Static C Library: @enable_static@
- Statically Linked Executables: @STATIC_EXEC@
+ Statically Linked Executables: @LT_STATIC_EXEC@
LDFLAGS: @LDFLAGS@
H5_LDFLAGS: @H5_LDFLAGS@
AM_LDFLAGS: @AM_LDFLAGS@