diff options
Diffstat (limited to 'hl/src/H5LTparse.c')
-rw-r--r-- | hl/src/H5LTparse.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 35c4670..98dcbd5 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -14,9 +14,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* This file was generated by Yacc with the command "yacc -pH5LTyy -o H5LTparse.c -d H5LTparse.y" - * Do NOT modify it by hand. + * on jam. Do NOT modify it by hand. */ - #ifndef lint static char const yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $"; @@ -1053,22 +1052,35 @@ case 92: short short_val=(short)yylval.ival; int int_val=(int)yylval.ival; long long_val=(long)yylval.ival; - long_long llong_val=(long_long)yylval.ival; + long long llong_val=(long long)yylval.ival; hid_t super = H5Tget_super(enum_id); hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND); - + H5T_order_t super_order = H5Tget_order(super); + H5T_order_t native_order = H5Tget_order(native); + if(is_enum && is_enum_memb) { /*if it's an enum member*/ /*To handle machines of different endianness*/ - if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR)) + if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR)) { + if(super_order != native_order) + H5Tconvert(native, super, 1, &char_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &char_val); - else if(H5Tequal(native, H5T_NATIVE_SHORT) || H5Tequal(native, H5T_NATIVE_USHORT)) + } else if(H5Tequal(native, H5T_NATIVE_SHORT) || H5Tequal(native, H5T_NATIVE_USHORT)) { + if(super_order != native_order) + H5Tconvert(native, super, 1, &short_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &short_val); - else if(H5Tequal(native, H5T_NATIVE_INT) || H5Tequal(native, H5T_NATIVE_UINT)) + } else if(H5Tequal(native, H5T_NATIVE_INT) || H5Tequal(native, H5T_NATIVE_UINT)) { + if(super_order != native_order) + H5Tconvert(native, super, 1, &int_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &int_val); - else if(H5Tequal(native, H5T_NATIVE_LONG) || H5Tequal(native, H5T_NATIVE_ULONG)) + } else if(H5Tequal(native, H5T_NATIVE_LONG) || H5Tequal(native, H5T_NATIVE_ULONG)) { + if(super_order != native_order) + H5Tconvert(native, super, 1, &long_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &long_val); - else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG)) + } else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG)) { + if(super_order != native_order) + H5Tconvert(native, super, 1, &llong_val, NULL, H5P_DEFAULT); H5Tenum_insert(enum_id, enum_memb_symbol, &llong_val); + } is_enum_memb = 0; if(enum_memb_symbol) free(enum_memb_symbol); @@ -1078,7 +1090,7 @@ case 92: H5Tclose(native); } break; -#line 1063 "H5LTparse.c" +#line 1076 "H5LTparse.c" } yyssp -= yym; yystate = *yyssp; |