diff options
Diffstat (limited to 'src/H5Ipkg.h')
-rw-r--r-- | src/H5Ipkg.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index dc8e867..1666b76 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -44,7 +44,7 @@ * field sizes and masks are calculated from TYPE_BITS. */ #define TYPE_BITS 7 -#define TYPE_MASK ((1<<TYPE_BITS)-1) +#define TYPE_MASK (((hid_t)1 << TYPE_BITS) - 1) #define H5I_MAX_NUM_TYPES TYPE_MASK @@ -52,11 +52,11 @@ * Number of bits to use for the Atom index in each atom (assumes 8-bit * bytes). We don't use the sign bit. */ -#define ID_BITS ((sizeof(hid_t)*8)-(TYPE_BITS+1)) -#define ID_MASK ((1<<ID_BITS)-1) +#define ID_BITS ((sizeof(hid_t) * 8) - (TYPE_BITS + 1)) +#define ID_MASK (((hid_t)1 << ID_BITS) - 1) /* Map an atom to an ID type number */ -#define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a)>>ID_BITS) & TYPE_MASK)) +#define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a) >> ID_BITS) & TYPE_MASK)) /****************************/ |