summaryrefslogtreecommitdiffstats
path: root/src/H5Tnative.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2010-04-28 16:30:08 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2010-04-28 16:30:08 (GMT)
commitfadbd8866f5741da77a369fd015c82db5b191294 (patch)
tree163574aa1cf9b404c990fea78c67d5c7674e9233 /src/H5Tnative.c
parent35dc35e71390a4e35fd395ac572c6c3feb5b9638 (diff)
downloadhdf5-fadbd8866f5741da77a369fd015c82db5b191294.zip
hdf5-fadbd8866f5741da77a369fd015c82db5b191294.tar.gz
hdf5-fadbd8866f5741da77a369fd015c82db5b191294.tar.bz2
[svn-r18657] I added some comments. No test is needed.
Diffstat (limited to 'src/H5Tnative.c')
-rw-r--r--src/H5Tnative.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index ce2c141..5b685b1 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -317,8 +317,24 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member to compound datatype")
}
- /* Update size, offset and compound alignment for parent in the case of
- * nested compound type. */
+ /* Update size, offset and compound alignment for parent in the case of
+ * nested compound type. The alignment for a compound type as one field in
+ * a compound type is the biggest compound alignment among all its members.
+ * i.g. in the structure
+ * typedef struct s1 {
+ * char c;
+ * int i;
+ * s2 st;
+ * unsigned long long l;
+ * } s1;
+ * typedef struct s2 {
+ * short c2;
+ * long l2;
+ * long long ll2;
+ * } s2;
+ * The alignment for ST in S1 is the biggest structure alignment of all the
+ * members of S2, which is probably the LL2 of 'long long'. -SLU 2010/4/28
+ */
if(H5T_cmp_offset(comp_size, offset, children_size, (size_t)1, children_st_align,
struct_align) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")