summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Opublic.h14
-rw-r--r--src/H5Pfcpl.c2
-rwxr-xr-xsrc/H5SM.c24
3 files changed, 18 insertions, 22 deletions
diff --git a/src/H5Opublic.h b/src/H5Opublic.h
index 64fdd07..acce42c 100644
--- a/src/H5Opublic.h
+++ b/src/H5Opublic.h
@@ -52,13 +52,13 @@
* but we need to assign each kind of message to a different bit so that
* one index can hold multiple types.)
*/
-#define H5O_MESG_NONE_FLAG 0x0000 /* No shared messages */
-#define H5O_MESG_SDSPACE_FLAG 0x0001 /* Simple Dataspace Message. */
-#define H5O_MESG_DTYPE_FLAG 0x0002 /* Datatype Message. */
-#define H5O_MESG_FILL_FLAG 0x0004 /* Fill Value Message. */
-#define H5O_MESG_PLINE_FLAG 0x0008 /* Filter pipeline message. */
-#define H5O_MESG_ATTR_FLAG 0x0010 /* Attribute Message. */
-#define H5O_MESG_ALL_FLAG (H5O_MESG_SDSPACE_FLAG | H5O_MESG_DTYPE_FLAG | H5O_MESG_FILL_FLAG | H5O_MESG_PLINE_FLAG | H5O_MESG_ATTR_FLAG)
+#define H5O_SHMESG_NONE_FLAG 0x0000 /* No shared messages */
+#define H5O_SHMESG_SDSPACE_FLAG ((unsigned)1 << 0x0001) /* Simple Dataspace Message. */
+#define H5O_SHMESG_DTYPE_FLAG ((unsigned)1 << 0x0003) /* Datatype Message. */
+#define H5O_SHMESG_FILL_FLAG ((unsigned)1 << 0x0005) /* Fill Value Message. */
+#define H5O_SHMESG_PLINE_FLAG ((unsigned)1 << 0x000b) /* Filter pipeline message. */
+#define H5O_SHMESG_ATTR_FLAG ((unsigned)1 << 0x000c) /* Attribute Message. */
+#define H5O_SHMESG_ALL_FLAG (H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG | H5O_SHMESG_FILL_FLAG | H5O_SHMESG_PLINE_FLAG | H5O_SHMESG_ATTR_FLAG)
/* Object header status flag definitions */
#define H5O_HDR_CHUNK0_SIZE 0x03 /* 2-bit field indicating # of bytes to store the size of chunk 0's data */
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 6345961..8fd4909 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -757,7 +757,7 @@ H5Pset_shared_mesg_index(hid_t plist_id, unsigned index_num, unsigned mesg_type_
H5TRACE4("e", "iIuIuIu", plist_id, index_num, mesg_type_flags, min_mesg_size);
/* Check arguments */
- if(mesg_type_flags > H5O_MESG_ALL_FLAG)
+ if(mesg_type_flags > H5O_SHMESG_ALL_FLAG)
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "unrecognized flags in mesg_type_flags");
/* Get the plist structure */
diff --git a/src/H5SM.c b/src/H5SM.c
index 179a526..9607f23 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -220,7 +220,7 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d
/* Check for sharing attributes in this file, which means that creation
* indices must be tracked on object header message in the file.
*/
- if(type_flags_used & H5O_MESG_ATTR_FLAG)
+ if(type_flags_used & H5O_SHMESG_ATTR_FLAG)
f->shared->store_msg_crt_idx = TRUE;
/* Write shared message information to the superblock extension */
@@ -263,22 +263,18 @@ H5SM_type_to_flag(unsigned type_id, unsigned *type_flag)
/* Translate the H5O type_id into an H5SM type flag */
switch(type_id) {
+ case H5O_FILL_ID:
+ type_id = H5O_FILL_NEW_ID;
+ /* Fall through... */
+
case H5O_SDSPACE_ID:
- *type_flag = H5O_MESG_SDSPACE_FLAG;
- break;
case H5O_DTYPE_ID:
- *type_flag = H5O_MESG_DTYPE_FLAG;
- break;
- case H5O_FILL_ID:
case H5O_FILL_NEW_ID:
- *type_flag = H5O_MESG_FILL_FLAG;
- break;
case H5O_PLINE_ID:
- *type_flag = H5O_MESG_PLINE_FLAG;
- break;
case H5O_ATTR_ID:
- *type_flag = H5O_MESG_ATTR_FLAG;
+ *type_flag = (unsigned)1 << type_id;
break;
+
default:
HGOTO_ERROR(H5E_OHDR, H5E_BADTYPE, FAIL, "unknown message type ID")
} /* end switch */
@@ -307,7 +303,7 @@ done:
ssize_t
H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id)
{
- ssize_t x;
+ size_t x;
unsigned type_flag;
ssize_t ret_value = FAIL;
@@ -322,7 +318,7 @@ H5SM_get_index(const H5SM_master_table_t *table, unsigned type_id)
*/
for(x = 0; x < table->num_indexes; ++x)
if(table->indexes[x].mesg_types & type_flag)
- HGOTO_DONE(x)
+ HGOTO_DONE((ssize_t)x)
/* At this point, ret_value is either the location of the correct
* index or it's still FAIL because we didn't find an index.
@@ -1828,7 +1824,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id)
/* Check for sharing attributes in this file, which means that creation
* indices must be tracked on object header message in the file.
*/
- if(index_flags[u] & H5O_MESG_ATTR_FLAG)
+ if(index_flags[u] & H5O_SHMESG_ATTR_FLAG)
shared->store_msg_crt_idx = TRUE;
} /* end for */