summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-07-23 01:55:12 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-07-23 01:55:12 (GMT)
commit34bd25f361f81efc396314528f1824fe63af494e (patch)
tree0fa0ec3c102abac15cd4f1012b99941fdf703009 /src/H5T.c
parent138d4f52544af96770b4a5f151a7b64f2c4dc922 (diff)
downloadhdf5-34bd25f361f81efc396314528f1824fe63af494e.zip
hdf5-34bd25f361f81efc396314528f1824fe63af494e.tar.gz
hdf5-34bd25f361f81efc396314528f1824fe63af494e.tar.bz2
[svn-r11144] Purpose:
New port Description: Elena asked me to check in her NEC SX-6 work, so here it is! :-) Platforms tested: FreeBSD 4.11 (sleipnir) NEC SX-6 (by Elena)
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c58
1 files changed, 36 insertions, 22 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 644934a..575a9fe 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -103,7 +103,9 @@ hid_t H5T_NATIVE_LLONG_g = FAIL;
hid_t H5T_NATIVE_ULLONG_g = FAIL;
hid_t H5T_NATIVE_FLOAT_g = FAIL;
hid_t H5T_NATIVE_DOUBLE_g = FAIL;
+#if H5_SIZEOF_LONG_DOUBLE !=0
hid_t H5T_NATIVE_LDOUBLE_g = FAIL;
+#endif
hid_t H5T_NATIVE_B8_g = FAIL;
hid_t H5T_NATIVE_B16_g = FAIL;
hid_t H5T_NATIVE_B32_g = FAIL;
@@ -161,7 +163,9 @@ size_t H5T_NATIVE_LLONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_ULLONG_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_FLOAT_COMP_ALIGN_g = 0;
size_t H5T_NATIVE_DOUBLE_COMP_ALIGN_g = 0;
+#if H5_SIZEOF_LONG_DOUBLE !=0
size_t H5T_NATIVE_LDOUBLE_COMP_ALIGN_g = 0;
+#endif
size_t H5T_POINTER_COMP_ALIGN_g = 0;
size_t H5T_HVL_COMP_ALIGN_g = 0;
@@ -184,7 +188,9 @@ size_t H5T_NATIVE_LLONG_ALIGN_g = 0;
size_t H5T_NATIVE_ULLONG_ALIGN_g = 0;
size_t H5T_NATIVE_FLOAT_ALIGN_g = 0;
size_t H5T_NATIVE_DOUBLE_ALIGN_g = 0;
+#if H5_SIZEOF_LONG_DOUBLE !=0
size_t H5T_NATIVE_LDOUBLE_ALIGN_g = 0;
+#endif
/*
* Alignment constraints for C9x types. These are initialized at run time in
@@ -675,7 +681,9 @@ H5T_init_interface(void)
H5T_t *native_ullong=NULL; /* Datatype structure for native unsigned long long */
H5T_t *native_float=NULL; /* Datatype structure for native float */
H5T_t *native_double=NULL; /* Datatype structure for native double */
+#if H5_SIZEOF_LONG_DOUBLE !=0
H5T_t *native_ldouble=NULL; /* Datatype structure for native long double */
+#endif
H5T_t *std_u8le=NULL; /* Datatype structure for unsigned 8-bit little-endian integer */
H5T_t *std_u8be=NULL; /* Datatype structure for unsigned 8-bit big-endian integer */
H5T_t *std_u16le=NULL; /* Datatype structure for unsigned 16-bit little-endian integer */
@@ -748,8 +756,10 @@ H5T_init_interface(void)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object");
if (NULL==(native_double=H5I_object(H5T_NATIVE_DOUBLE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object");
+#if H5_SIZEOF_LONG_DOUBLE !=0
if (NULL==(native_ldouble=H5I_object(H5T_NATIVE_LDOUBLE_g)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype object");
+#endif
/*------------------------------------------------------------
* Native types
@@ -992,11 +1002,13 @@ H5T_init_interface(void)
/* floating point */
#if H5_CONVERT_DENORMAL_FLOAT
status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T_conv_float_double, H5AC_dxpl_id);
- status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T_conv_float_ldouble, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T_conv_double_float, H5AC_dxpl_id);
+#if H5_SIZEOF_LONG_DOUBLE !=0
+ status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T_conv_float_ldouble, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T_conv_double_ldouble, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T_conv_ldouble_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T_conv_ldouble_double, H5AC_dxpl_id);
+#endif
#endif /*H5_CONVERT_DENORMAL_FLOAT*/
/* from long_long */
@@ -1104,7 +1116,7 @@ H5T_init_interface(void)
status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T_conv_schar_double, H5AC_dxpl_id);
#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T_conv_schar_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
/* From unsigned char to floats */
status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T_conv_uchar_float, H5AC_dxpl_id);
@@ -1152,99 +1164,99 @@ H5T_init_interface(void)
#if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T_conv_ulong_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T_conv_ulong_double, H5AC_dxpl_id);
-#endif /*H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS*/
+#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS */
#if H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS
status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T_conv_ulong_ldouble, H5AC_dxpl_id);
-#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS */
/* From long long to floats */
status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T_conv_llong_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T_conv_llong_double, H5AC_dxpl_id);
#if H5_SW_INTEGER_TO_LDOUBLE_WORKS
status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T_conv_llong_ldouble, H5AC_dxpl_id);
-#endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/
+#endif /* H5_SW_INTEGER_TO_LDOUBLE_WORKS */
/* From unsigned long long to floats */
#if H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS
status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T_conv_ullong_float, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T_conv_ullong_double, H5AC_dxpl_id);
-#endif /*H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS*/
-#if H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS
+#if H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS
status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T_conv_ullong_ldouble, H5AC_dxpl_id);
-#endif /*H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS && H5_SW_INTEGER_TO_LDOUBLE_WORKS && H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS*/
+#endif /* H5_ULLONG_TO_LDOUBLE_PRECISION_WORKS */
+#endif /* H5_ULLONG_TO_FP_CAST_WORKS && H5_SW_ULONG_TO_FP_BOTTOM_BIT_WORKS */
/* From floats to char */
status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T_conv_float_schar, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T_conv_double_schar, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T_conv_ldouble_schar, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
/* From floats to unsigned char */
status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T_conv_float_uchar, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T_conv_double_uchar, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T_conv_ldouble_uchar, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
/* From floats to short */
status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T_conv_float_short, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T_conv_double_short, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T_conv_ldouble_short, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
/* From floats to unsigned short */
status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T_conv_float_ushort, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T_conv_double_ushort, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T_conv_ldouble_ushort, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
/* From floats to int */
status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T_conv_float_int, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T_conv_double_int, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T_conv_ldouble_int, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
/* From floats to unsigned int */
status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T_conv_float_uint, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T_conv_double_uint, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_CV_LDOUBLE_TO_UINT_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T_conv_ldouble_uint, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_CV_LDOUBLE_TO_UINT_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_CV_LDOUBLE_TO_UINT_WORKS */
status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T_conv_float_long, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T_conv_double_long, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T_conv_ldouble_long, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
/* From floats to unsigned long */
status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T_conv_float_ulong, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T_conv_double_ulong, H5AC_dxpl_id);
#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T_conv_ldouble_ulong, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
/* From floats to long long */
#ifndef H5_HW_FP_TO_LLONG_NOT_WORKS
status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T_conv_float_llong, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T_conv_double_llong, H5AC_dxpl_id);
-#endif /*H5_HW_FP_TO_LLONG_NOT_WORKS*/
-#if H5_SW_LDOUBLE_TO_INTEGER_WORKS && !H5_HW_FP_TO_LLONG_NOT_WORKS
+#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T_conv_ldouble_llong, H5AC_dxpl_id);
-#endif /*H5_SW_LDOUBLE_TO_INTEGER_WORKS && !H5_HW_FP_TO_LLONG_NOT_WORKS*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* !H5_HW_FP_TO_LLONG_NOT_WORKS */
/* From floats to unsigned long long */
#if H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM
status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T_conv_float_ullong, H5AC_dxpl_id);
status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T_conv_double_ullong, H5AC_dxpl_id);
-#endif /*H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/
-#if H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM
+#if H5_SW_LDOUBLE_TO_INTEGER_WORKS
status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T_conv_ldouble_ullong, H5AC_dxpl_id);
-#endif /*H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/
+#endif /* H5_SW_LDOUBLE_TO_INTEGER_WORKS */
+#endif /* H5_FP_TO_ULLONG_BOTTOM_BIT_WORKS && H5_FP_TO_ULLONG_RIGHT_MAXIMUM */
/*
* The special no-op conversion is the fastest, so we list it last. The
@@ -1460,7 +1472,9 @@ H5T_term_interface(void)
H5T_NATIVE_ULLONG_g = FAIL;
H5T_NATIVE_FLOAT_g = FAIL;
H5T_NATIVE_DOUBLE_g = FAIL;
+#if H5_SIZEOF_LONG_DOUBLE !=0
H5T_NATIVE_LDOUBLE_g = FAIL;
+#endif
H5T_NATIVE_B8_g = FAIL;
H5T_NATIVE_B16_g = FAIL;
H5T_NATIVE_B32_g = FAIL;