summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-12-11 16:19:14 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-12-11 16:19:14 (GMT)
commitdcd54d7624bbfec6f10fd58abff83b9df0196b83 (patch)
tree6fecd963fe3fa1d0b821ab9c4aa697df9f7e12fe /src
parentf7d295517e6b746534e474f0ecfd66940080485e (diff)
downloadhdf5-dcd54d7624bbfec6f10fd58abff83b9df0196b83.zip
hdf5-dcd54d7624bbfec6f10fd58abff83b9df0196b83.tar.gz
hdf5-dcd54d7624bbfec6f10fd58abff83b9df0196b83.tar.bz2
[svn-r6195]
Purpose: Cleanup H5Tget_native_type code Description: improve code cosmetics. Solution: Platforms tested: modi4, eirene, arabica
Diffstat (limited to 'src')
-rw-r--r--src/H5T.c233
-rw-r--r--src/H5Tpkg.h5
-rw-r--r--src/H5Tprivate.h11
-rw-r--r--src/H5detect.c105
4 files changed, 249 insertions, 105 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 1aff6ab..51b14d5 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -149,6 +149,11 @@ size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0;
+size_t H5T_POINTER_COMP_ALIGN_g = 0;
+size_t H5T_HVL_COMP_ALIGN_g = 0;
+size_t H5T_HOBJREF_COMP_ALIGN_g = 0;
+size_t H5T_HDSETREGREF_COMP_ALIGN_g = 0;
+
/*
* Alignment constraints for native types. These are initialized at run time
* in H5Tinit.c
@@ -2761,32 +2766,84 @@ H5T_t* H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *stru
break;
case H5T_STRING:
- if(H5T_is_variable_str(dtype)) {
- if(NULL==(dt=H5I_object_verify(H5T_C_S1, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
- if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
- if(H5T_set_size(ret_value, H5T_VARIABLE)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot set size");
- } else {
- if(NULL==(dt=H5I_object_verify(H5T_NATIVE_UCHAR, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
- if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
- if(H5T_set_size(ret_value, size)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot set size");
+ {
+ size_t align;
+ size_t pointer_size;
+
+ if(H5T_is_variable_str(dtype)) {
+ if(NULL==(dt=H5I_object_verify(H5T_C_S1, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
+ if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
+ if(H5T_set_size(ret_value, H5T_VARIABLE)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot set size");
+
+ /* Update size, offset and compound alignment for parent. */
+ align = H5T_POINTER_COMP_ALIGN_g;
+ pointer_size = sizeof(char*);
+
+ if(H5T_cmp_offset(comp_size, offset, pointer_size, 1, align, struct_align)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+
+ } else {
+ /*size_t char_size;*/
+
+ if(NULL==(dt=H5I_object_verify(H5T_NATIVE_UCHAR, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
+ if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
+ if(H5T_set_size(ret_value, size)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot set size");
+
+ /* Update size, offset and compound alignment for parent. */
+ align = H5T_NATIVE_SCHAR_COMP_ALIGN_g;
+
+ if(H5T_cmp_offset(comp_size, offset, sizeof(char), size, align, struct_align)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+
+ if(H5T_close(dt)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "can't close data type");
+ }
}
-
break;
+ /* These three types don't need to compute compound field information since they
+ * can't be used as field. */
case H5T_TIME:
case H5T_BITFIELD:
case H5T_OPAQUE:
- case H5T_REFERENCE:
if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
break;
+ case H5T_REFERENCE:
+ {
+ size_t align;
+ size_t ref_size;
+ int not_equal;
+ H5T_t *dt;
+
+ if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
+
+ /* Decide if the data type is object or dataset region reference. */
+ if(NULL==(dt=H5I_object_verify(H5T_STD_REF_OBJ_g, H5I_DATATYPE)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
+ not_equal = H5T_cmp(ret_value, dt);
+
+ /* Update size, offset and compound alignment for parent. */
+ if(!not_equal) {
+ align = H5T_HOBJREF_COMP_ALIGN_g;
+ ref_size = sizeof(hobj_ref_t);
+ } else {
+ align = H5T_HDSETREGREF_COMP_ALIGN_g;
+ ref_size = sizeof(hdset_reg_ref_t);
+ }
+
+ if(H5T_cmp_offset(comp_size, offset, ref_size, 1, align, struct_align)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+ }
+ break;
case H5T_COMPOUND:
{
@@ -2861,14 +2918,15 @@ H5T_t* H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *stru
ret_value = new_type;
}
-
break;
case H5T_ENUM:
{
char *memb_name; /* Enum's member name */
void *memb_value; /* Enum's member value */
-
+
+ /* Don't need to do anything special for alignment, offset since the ENUM type usually is integer. */
+
/* Retrieve base type for enumarate type */
if((super_type=H5T_get_super(dtype))==NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get base type for enumarate type");
@@ -2907,13 +2965,17 @@ H5T_t* H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *stru
ret_value = new_type;
}
-
break;
case H5T_ARRAY:
{
int array_rank; /* Array's rank */
hsize_t *dims = NULL; /* Dimension sizes for array */
+ hsize_t nelems = 1;
+ size_t super_offset=0;
+ size_t super_size=0;
+ size_t super_align=0;
+ int i;
/* Retrieve dimension information for array data type */
if((array_rank=H5T_get_array_ndims(dtype))<=0)
@@ -2926,7 +2988,8 @@ H5T_t* H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *stru
/* Retrieve base type for array type */
if((super_type=H5T_get_super(dtype))==NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type");
- if((nat_super_type = H5T_get_native_type(super_type, direction, struct_align, offset, comp_size))==NULL)
+ if((nat_super_type = H5T_get_native_type(super_type, direction, &super_align,
+ &super_offset, &super_size))==NULL)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed");
/* Close super type */
@@ -2940,34 +3003,52 @@ H5T_t* H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *stru
/* Close base type */
if(H5T_close(nat_super_type)<0)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+
+ for(i=0; i<array_rank; i++)
+ nelems *= dims[i];
+ if(H5T_cmp_offset(comp_size, offset, super_size, nelems, super_align, struct_align)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+
H5MM_xfree(dims);
-
ret_value = new_type;
}
-
break;
case H5T_VLEN:
- /* Retrieve base type for array type */
- if((super_type=H5T_get_super(dtype))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type");
- if((nat_super_type = H5T_get_native_type(super_type, direction, struct_align, offset, comp_size))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed");
-
- /* Close super type */
- if(H5T_close(super_type)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
-
- /* Create a new array type based on native type */
- if((new_type=H5T_vlen_create(nat_super_type))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type");
+ {
+ size_t vl_align = 0;
+ size_t vl_size = 0;
+ size_t super_size=0;
+
+ /* Retrieve base type for array type */
+ if((super_type=H5T_get_super(dtype))==NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type");
+ /* Don't need alignment, offset information if this VL isn't a field of compound type. If it
+ * is, go to a few steps below to compute the information directly. */
+ if((nat_super_type = H5T_get_native_type(super_type, direction, NULL, NULL, &super_size))==NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed");
+
+ /* Close super type */
+ if(H5T_close(super_type)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+
+ /* Create a new array type based on native type */
+ if((new_type=H5T_vlen_create(nat_super_type))==NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type");
- /* Close base type */
- if(H5T_close(nat_super_type)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ /* Close base type */
+ if(H5T_close(nat_super_type)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
- ret_value = new_type;
-
+ /* Update size, offset and compound alignment for parent compound type directly. */
+ vl_align = H5T_HVL_COMP_ALIGN_g;
+ vl_size = sizeof(hvl_t);
+
+ if(H5T_cmp_offset(comp_size, offset, vl_size, 1, vl_align, struct_align)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+
+ ret_value = new_type;
+ }
break;
default:
@@ -3001,7 +3082,8 @@ done:
*
*-------------------------------------------------------------------------
*/
-H5T_t* H5T_get_native_integer(size_t size, H5T_sign_t sign, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size)
+H5T_t* H5T_get_native_integer(size_t size, H5T_sign_t sign, H5T_direction_t direction,
+ size_t *struct_align, size_t *offset, size_t *comp_size)
{
H5T_t *dt; /* Appropriate native datatype to copy */
hid_t tid; /* Datatype ID of appropriate native datatype */
@@ -3107,22 +3189,9 @@ H5T_t* H5T_get_native_integer(size_t size, H5T_sign_t sign, H5T_direction_t dire
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
/* compute size and offset of compound type member. */
- if(offset && comp_size) {
- if(align && *comp_size%align) {
- /* Add alignment value */
- *offset = *comp_size + (align - *comp_size%align);
- size = size + (align - *comp_size%align);
- } else
- *offset = *comp_size;
-
- /* compute size of compound type member. */
- *comp_size += size;
- } /* end if */
-
- /* Alignment for whole compound type */
- if(struct_align && *struct_align<align)
- *struct_align = align;
-
+ if(H5T_cmp_offset(comp_size, offset, size, 1, align, struct_align)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+
done:
FUNC_LEAVE(ret_value);
}
@@ -3210,22 +3279,54 @@ H5T_t* H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *stru
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
/* compute offset of compound type member. */
+ if(H5T_cmp_offset(comp_size, offset, size, 1, align, struct_align)<0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+
+done:
+ FUNC_LEAVE(ret_value);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5T_cmp_offset
+ *
+ * Purpose: This function is only for convenience. It computes the
+ * compound type size, offset of the member being considered
+ * and the alignment for the whole compound type.
+ *
+ * Return: Success: Non-negative value.
+ *
+ * Failure: Negative value.
+ *
+ * Programmer: Raymond Lu
+ * December 10, 2002
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size,
+ size_t nelems, size_t align, size_t *struct_align)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(H5T_cmp_offset, FAIL);
+
if(offset && comp_size) {
- if(align && *comp_size % align) {
+ if(align>1 && *comp_size%align) {
/* Add alignment value */
- *offset = *comp_size + (align - *comp_size % align);
- size = size + (align - *comp_size % align);
+ *offset = *comp_size + (align - *comp_size%align);
+ *comp_size += (align - *comp_size%align);
} else
*offset = *comp_size;
-
- /* compute size of compound type member. */
- *comp_size += size;
- } /* end if */
- /* Alignment for whole compound type */
+ /* compute size of compound type member. */
+ *comp_size += nelems*elem_size;
+ }
+
if(struct_align && *struct_align < align)
*struct_align = align;
-
+
done:
FUNC_LEAVE(ret_value);
}
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 0adc4e9..c3a9703 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -187,6 +187,11 @@ H5_DLLVAR size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g;
H5_DLLVAR size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g;
H5_DLLVAR size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g;
+H5_DLLVAR size_t H5T_POINTER_COMP_ALIGN_g;
+H5_DLLVAR size_t H5T_HVL_COMP_ALIGN_g;
+H5_DLLVAR size_t H5T_HOBJREF_COMP_ALIGN_g;
+H5_DLLVAR size_t H5T_HDSETREGREF_COMP_ALIGN_g;
+
/*
* Alignment information for native types. A value of N indicates that the
* data must be aligned on an address ADDR such that 0 == ADDR mod N. When
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index cd75f05..d9f4520 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -116,9 +116,14 @@ H5_DLL H5T_t *H5T_get_member_type(H5T_t *dt, int membno);
H5_DLL size_t H5T_get_member_offset(H5T_t *dt, int membno);
H5_DLL int H5T_get_nmembers(const H5T_t *dt);
H5_DLL htri_t H5T_is_variable_str(H5T_t *dt);
-H5_DLL H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size);
-H5_DLL H5T_t *H5T_get_native_integer(size_t size, H5T_sign_t sign, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size);
-H5_DLL H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size);
+H5_DLL H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction,
+ size_t *struct_align, size_t *offset, size_t *comp_size);
+H5_DLL H5T_t *H5T_get_native_integer(size_t size, H5T_sign_t sign, H5T_direction_t direction,
+ size_t *struct_align, size_t *offset, size_t *comp_size);
+H5_DLL H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction,
+ size_t *struct_align, size_t *offset, size_t *comp_size);
+H5_DLL herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size,
+ size_t nelems, size_t align, size_t *struct_align);
H5_DLL int H5T_cmp(const H5T_t *dt1, const H5T_t *dt2);
H5_DLL htri_t H5T_is_atomic(const H5T_t *dt);
H5_DLL herr_t H5T_insert(H5T_t *parent, const char *name, size_t offset,
diff --git a/src/H5detect.c b/src/H5detect.c
index 78ac69c..0d19208 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -31,6 +31,8 @@ static const char *FileHeader = "\n\
*/
#undef NDEBUG
#include "H5private.h"
+#include "H5Tpublic.h"
+#include "H5Rpublic.h"
#define MAXDETECT 64
/*
@@ -51,7 +53,14 @@ typedef struct detected_t {
size_t comp_align; /*alignment for structure */
} detected_t;
-static void print_results(int nd, detected_t *d);
+/* This structure holds structure alignment for pointers, hvl_t, hobj_ref_t,
+ * hdset_reg_ref_t */
+typedef struct malign_t {
+ const char *name;
+ size_t comp_align; /*alignment for structure */
+} malign_t;
+
+static void print_results(int nd, detected_t *d, int na, malign_t *m);
static void iprint(detected_t *);
static int byte_cmp(int, void *, void *);
static int bit_cmp(int, int *, void *, void *);
@@ -163,6 +172,11 @@ precision (detected_t *d)
} \
INFO.sign = ('U'!=*(#VAR)); \
ALIGNMENT(TYPE, INFO.align); \
+ if(!strcmp(INFO.varname, "SCHAR") || !strcmp(INFO.varname, "SHORT") || \
+ !strcmp(INFO.varname, "INT") || !strcmp(INFO.varname, "LONG") || \
+ !strcmp(INFO.varname, "LLONG")) { \
+ COMP_ALIGNMENT(TYPE,INFO.comp_align); \
+ } \
precision (&(INFO)); \
}
@@ -246,9 +260,36 @@ precision (detected_t *d)
_v1 = 1.0; \
INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \
ALIGNMENT(TYPE, INFO.align); \
+ if(!strcmp(INFO.varname, "FLOAT") || !strcmp(INFO.varname, "DOUBLE") || \
+ !strcmp(INFO.varname, "LDOUBLE")) { \
+ COMP_ALIGNMENT(TYPE,INFO.comp_align); \
+ } \
precision (&(INFO)); \
}
+
+/*-------------------------------------------------------------------------
+ * Function: DETECT_M
+ *
+ * Purpose: This macro takes only miscellaneous structures or pointer
+ * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It
+ * constructs the names and decides the alignment in structure.
+ *
+ * Return: void
+ *
+ * Programmer: Raymond Lu
+ * slu@ncsa.uiuc.edu
+ * Dec 9, 2002
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+#define DETECT_M(TYPE,VAR,INFO) { \
+ INFO.name = #VAR; \
+ COMP_ALIGNMENT(TYPE, INFO.comp_align); \
+}
+
/* Detect alignment for C structure */
#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \
struct { \
@@ -399,10 +440,10 @@ sigbus_handler(int UNUSED signo)
*-------------------------------------------------------------------------
*/
static void
-print_results(int nd, detected_t *d)
+print_results(int nd, detected_t *d, int na, malign_t *misc_align)
{
- int i;
+ int i, j;
/* Include files */
printf("\
@@ -514,6 +555,11 @@ H5TN_init_interface(void)\n\
}
}
+ /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
+ printf("\n /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */\n");
+ for(j=0; j<na; j++)
+ printf(" H5T_%s_COMP_ALIGN_g = %lu;\n", misc_align[j].name, (unsigned long)(misc_align[j].comp_align));
+
printf("\
\n\
done:\n\
@@ -1011,8 +1057,9 @@ int
main(void)
{
detected_t d[MAXDETECT];
- volatile int nd = 0;
-
+ malign_t m[MAXDETECT];
+ volatile int nd = 0, na = 0;
+
#if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS)
#if defined(UAC_NOPRINT) && defined(UAC_SIGBUS)
/*
@@ -1032,24 +1079,13 @@ main(void)
print_header();
/* C89 integer types */
- DETECT_I(signed char, SCHAR, d[nd]);
- COMP_ALIGNMENT(signed char, d[nd].comp_align); nd++;
-
+ DETECT_I(signed char, SCHAR, d[nd]); nd++;
DETECT_I(unsigned char, UCHAR, d[nd]); nd++;
-
- DETECT_I(short, SHORT, d[nd]);
- COMP_ALIGNMENT(short, d[nd].comp_align); nd++;
-
+ DETECT_I(short, SHORT, d[nd]); nd++;
DETECT_I(unsigned short, USHORT, d[nd]); nd++;
-
- DETECT_I(int, INT, d[nd]);
- COMP_ALIGNMENT(int, d[nd].comp_align); nd++;
-
+ DETECT_I(int, INT, d[nd]); nd++;
DETECT_I(unsigned int, UINT, d[nd]); nd++;
-
- DETECT_I(long, LONG, d[nd]);
- COMP_ALIGNMENT(long, d[nd].comp_align); nd++;
-
+ DETECT_I(long, LONG, d[nd]); nd++;
DETECT_I(unsigned long, ULONG, d[nd]); nd++;
/*
@@ -1129,9 +1165,7 @@ main(void)
#endif
#if H5_SIZEOF_LONG_LONG>0
- DETECT_I(long_long, LLONG, d[nd]);
- COMP_ALIGNMENT(long_long, d[nd].comp_align); nd++;
-
+ DETECT_I(long_long, LLONG, d[nd]); nd++;
DETECT_I(unsigned long_long, ULLONG, d[nd]); nd++;
#else
/*
@@ -1139,17 +1173,12 @@ main(void)
* so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG since
* `long long' is probably equivalent to `long' here anyway.
*/
- DETECT_I(long, LLONG, d[nd]);
- COMP_ALIGNMENT(long, d[nd].comp_align); nd++;
-
+ DETECT_I(long, LLONG, d[nd]); nd++;
DETECT_I(unsigned long, ULLONG, d[nd]); nd++;
#endif
- DETECT_F(float, FLOAT, d[nd]);
- COMP_ALIGNMENT(float, d[nd].comp_align); nd++;
-
- DETECT_F(double, DOUBLE, d[nd]);
- COMP_ALIGNMENT(double, d[nd].comp_align); nd++;
+ DETECT_F(float, FLOAT, d[nd]); nd++;
+ DETECT_F(double, DOUBLE, d[nd]); nd++;
#if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE
/*
@@ -1158,14 +1187,18 @@ main(void)
* some systems and `long double' is probably the same as `double' here
* anyway.
*/
- DETECT_F(double, LDOUBLE, d[nd]);
- COMP_ALIGNMENT(double, d[nd].comp_align); nd++;
+ DETECT_F(double, LDOUBLE, d[nd]); nd++;
#else
- DETECT_F(long double, LDOUBLE, d[nd]);
- COMP_ALIGNMENT(long double, d[nd].comp_align); nd++;
+ DETECT_F(long double, LDOUBLE, d[nd]); nd++;
#endif
- print_results (nd, d);
+ /* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */
+ DETECT_M(void *, POINTER, m[na]); na++;
+ DETECT_M(hvl_t, HVL, m[na]); na++;
+ DETECT_M(hobj_ref_t, HOBJREF, m[na]); na++;
+ DETECT_M(hdset_reg_ref_t, HDSETREGREF, m[na]); na++;
+
+ print_results (nd, d, na, m);
return 0;
}