summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5Flow.c3
-rw-r--r--src/H5Fprivate.h14
-rw-r--r--src/H5Sall.c2
-rw-r--r--src/H5private.h5
4 files changed, 17 insertions, 7 deletions
diff --git a/src/H5Flow.c b/src/H5Flow.c
index d0b96e2..1223f87 100644
--- a/src/H5Flow.c
+++ b/src/H5Flow.c
@@ -1023,6 +1023,9 @@ H5F_addr_hash(const haddr_t *addr, uintn mod)
* Tuesday, October 23, 1998
*
* Modifications:
+ * Albert Cheng, Feb 18, 1999
+ * Changed objno to unsigned long type to be consistent with
+ * addr->offset and how it is being called.
*
*-------------------------------------------------------------------------
*/
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 71b6ca4..cd2b17c 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -117,9 +117,18 @@
(p) = (uint8_t*)(p)+8; \
}
+/* DECODE converts little endian bytes pointed by p to integer values and store
+ * it in i. For signed values, need to do sign-extension when converting
+ * the last byte which carries the sign bit.
+ * The macros does not require i be of a certain byte sizes. It just requires
+ * i be big enough to hold the intended value range. E.g. INT16DECODE works
+ * correctly even if i is actually a 64bit int like in a Cray.
+ */
+
# define INT16DECODE(p, i) { \
(i) = (int16_t)((*(p) & 0xff)); (p)++; \
- (i) |= (int16_t)((*(p) & 0xff) << 8); (p)++; \
+ (i) |= (int16_t)(((*(p) & 0xff) << 8) | \
+ ((*(p) & 0x80) ? ~0xffff : 0x0)); (p)++; \
}
# define UINT16DECODE(p, i) { \
@@ -131,7 +140,8 @@
(i) = ( *(p) & 0xff); (p)++; \
(i) |= ((int32_t)(*(p) & 0xff) << 8); (p)++; \
(i) |= ((int32_t)(*(p) & 0xff) << 16); (p)++; \
- (i) |= ((int32_t)(*(p) & 0xff) << 24); (p)++; \
+ (i) |= ((int32_t)(((*(p) & 0xff) << 24) | \
+ ((*(p) & 0x80) ? ~0xffffffff : 0x0))); (p)++; \
}
# define UINT32DECODE(p, i) { \
diff --git a/src/H5Sall.c b/src/H5Sall.c
index ea6eda0..c5cf909 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -135,7 +135,7 @@ H5S_all_favail (const H5S_t *space, const H5S_sel_iter_t *sel_iter, size_t max)
acc *= size[i];
nelmts = (max/acc) * acc;
if (nelmts<=0) {
- HRETURN_ERROR (H5E_IO, H5E_UNSUPPORTED, 0,
+ HRETURN_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL,
"strip mine buffer is too small");
}
diff --git a/src/H5private.h b/src/H5private.h
index 865c85d..1dae62c 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -232,9 +232,6 @@
* as the number of bits indicated in the type name. The `int8' types *must*
* be exactly one byte wide because we use it for pointer calculations to
* void* memory.
- *
- * For int16_t and uint16_t we use `short' only if it's exactly 2 bytes.
- * Otherwise we use `int' because it's probably faster.
*/
#if SIZEOF_INT8_T==0
typedef signed char int8_t;
@@ -255,7 +252,7 @@
#endif
#if SIZEOF_INT16_T>=2
-#elif SIZEOF_SHORT==2
+#elif SIZEOF_SHORT>=2
typedef short int16_t;
# undef SIZEOF_INT16_T
# define SIZEOF_INT16_T SIZEOF_SHORT