diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2014-07-30 20:55:14 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2014-07-30 20:55:14 (GMT) |
commit | 33ea1ada248725e4cce6316c503e5c760bcca49c (patch) | |
tree | 3fd7e951132e6aa9b7d241a418505d3ae6e33587 | |
parent | 3f701fda6528be0844afa2315c2a28357591349a (diff) | |
download | hdf5-33ea1ada248725e4cce6316c503e5c760bcca49c.zip hdf5-33ea1ada248725e4cce6316c503e5c760bcca49c.tar.gz hdf5-33ea1ada248725e4cce6316c503e5c760bcca49c.tar.bz2 |
[svn-r25496] Description:
Merge 64-bit ID changes from branch to trunk. (Plus a few minor cleanups
that aren't on the branch)
Tested on:
Mac OSX/64 10.9.4 (amazon) w/C++ & FORTRAN
(h5committested on branch already for a week)
71 files changed, 1065 insertions, 768 deletions
diff --git a/bin/genltanalyze b/bin/genltanalyze index 8bb0423..0b1b1e5 100755 --- a/bin/genltanalyze +++ b/bin/genltanalyze @@ -49,6 +49,17 @@ echo "Generate hl/src/H5LTparse.c from hl/src/H5LTparse.y" bison -pH5LTyy -o H5LTparse.c -d H5LTparse.y echo "Generate hl/src/H5LTanalyze.c from hl/src/H5LTanalyze.l" flex --nounistd -PH5LTyy -oH5LTanalyze.c H5LTanalyze.l + +# fix H5LTparse.c to declare H5LTyyparse return type as an hid_t +# instead of int. Currently the generated function H5LTyyparse is +# generated with a return value of type int, which is a mapping to the +# flex yyparse function. The return value in the HL library should be +# an hid_t. +# I propose to not use flex to generate this function, but for now I am +# adding a perl command to find and replace this function declaration in +# H5LTparse.c. +perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' H5LTparse.c +perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' H5LTparse.c cd ../.. exit 0 diff --git a/examples/h5_reference.c b/examples/h5_reference.c index 758002f..38e6146 100644 --- a/examples/h5_reference.c +++ b/examples/h5_reference.c @@ -81,8 +81,8 @@ main(void) { * Create references to the group "A" and dataset "B" * and store them in the wbuf. */ - H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, -1); - H5Rcreate(&wbuf[1], fid, "B", H5R_OBJECT, -1); + H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, (hid_t)-1); + H5Rcreate(&wbuf[1], fid, "B", H5R_OBJECT, (hid_t)-1); /* * Write dataset R using default transfer properties. diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index bca050e..a4fb0b5 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -59,7 +59,7 @@ nh5rcreate_object_c(haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) /* * Call H5Rcreate function. */ - if(H5Rcreate(&ref_c, *loc_id, c_name, H5R_OBJECT, -1) < 0) + if(H5Rcreate(&ref_c, *loc_id, c_name, H5R_OBJECT, (hid_t)-1) < 0) HGOTO_DONE(FAIL) /* Copy the reference created */ diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index 06ce078..15d2f21 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -22,6 +22,9 @@ #include "H5TBprivate.h" +/* Local routines */ +static herr_t H5DS_is_reserved(hid_t did); +static hid_t H5DS_get_REFLIST_type(void); /*------------------------------------------------------------------------- * Function: H5DSset_scale @@ -221,11 +224,11 @@ herr_t H5DSattach_scale(hid_t did, *------------------------------------------------------------------------- */ /* create a reference for the >>DS<< dataset */ - if (H5Rcreate(&ref_to_ds,dsid,".",H5R_OBJECT,-1) < 0) + if (H5Rcreate(&ref_to_ds, dsid, ".", H5R_OBJECT, (hid_t)-1) < 0) return FAIL; /* create a reference for the >>data<< dataset */ - if (H5Rcreate(&dsl.ref,did,".",H5R_OBJECT,-1) < 0) + if (H5Rcreate(&dsl.ref, did, ".", H5R_OBJECT, (hid_t)-1) < 0) return FAIL; /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */ @@ -2109,6 +2112,7 @@ out: *------------------------------------------------------------------------- */ +static herr_t H5DS_is_reserved(hid_t did) { int has_class; @@ -2179,6 +2183,7 @@ out: *------------------------------------------------------------------------- */ +static hid_t H5DS_get_REFLIST_type(void) { hid_t ntid_t = -1; diff --git a/hl/src/H5DSprivate.h b/hl/src/H5DSprivate.h index 5094208..61c0a1c 100644 --- a/hl/src/H5DSprivate.h +++ b/hl/src/H5DSprivate.h @@ -37,8 +37,6 @@ typedef struct ds_list_t { *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5DS_is_reserved( hid_t did); -H5_HLDLL hid_t H5DS_get_REFLIST_type(void); #endif diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 9c7c7e8..9239e4e 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -554,7 +554,7 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; /* Create a reference. The reference is created on the local id. */ - if(H5Rcreate(&ref, loc_id, pal_name, H5R_OBJECT, -1) < 0) + if(H5Rcreate(&ref, loc_id, pal_name, H5R_OBJECT, (hid_t)-1) < 0) goto out; /* Write the attribute with the reference */ @@ -604,7 +604,7 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; /* Create a new reference for this palette. */ - if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0) + if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, (hid_t)-1 ) < 0) goto out; refbuf[n_refs] = ref; diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 6a151d6..5fe53ef 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -869,6 +869,7 @@ int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) #define token(x) (int)x +#define hid(x) (hid_t)x #ifdef YY_BUF_SIZE #undef YY_BUF_SIZE @@ -912,7 +913,7 @@ extern hbool_t is_opq_tag; hbool_t first_quote = 1; -#line 916 "H5LTanalyze.c" +#line 917 "H5LTanalyze.c" #define INITIAL 0 #define TAG_STRING 1 @@ -1087,10 +1088,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 72 "H5LTanalyze.l" +#line 73 "H5LTanalyze.l" -#line 1094 "H5LTanalyze.c" +#line 1095 "H5LTanalyze.c" if ( !(yy_init) ) { @@ -1184,277 +1185,277 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 74 "H5LTanalyze.l" -{return token(H5T_STD_I8BE_TOKEN);} +#line 75 "H5LTanalyze.l" +{return hid(H5T_STD_I8BE_TOKEN);} YY_BREAK case 2: YY_RULE_SETUP -#line 75 "H5LTanalyze.l" -{return token(H5T_STD_I8LE_TOKEN);} +#line 76 "H5LTanalyze.l" +{return hid(H5T_STD_I8LE_TOKEN);} YY_BREAK case 3: YY_RULE_SETUP -#line 76 "H5LTanalyze.l" -{return token(H5T_STD_I16BE_TOKEN);} +#line 77 "H5LTanalyze.l" +{return hid(H5T_STD_I16BE_TOKEN);} YY_BREAK case 4: YY_RULE_SETUP -#line 77 "H5LTanalyze.l" -{return token(H5T_STD_I16LE_TOKEN);} +#line 78 "H5LTanalyze.l" +{return hid(H5T_STD_I16LE_TOKEN);} YY_BREAK case 5: YY_RULE_SETUP -#line 78 "H5LTanalyze.l" -{return token(H5T_STD_I32BE_TOKEN);} +#line 79 "H5LTanalyze.l" +{return hid(H5T_STD_I32BE_TOKEN);} YY_BREAK case 6: YY_RULE_SETUP -#line 79 "H5LTanalyze.l" -{return token(H5T_STD_I32LE_TOKEN);} +#line 80 "H5LTanalyze.l" +{return hid(H5T_STD_I32LE_TOKEN);} YY_BREAK case 7: YY_RULE_SETUP -#line 80 "H5LTanalyze.l" -{return token(H5T_STD_I64BE_TOKEN);} +#line 81 "H5LTanalyze.l" +{return hid(H5T_STD_I64BE_TOKEN);} YY_BREAK case 8: YY_RULE_SETUP -#line 81 "H5LTanalyze.l" -{return token(H5T_STD_I64LE_TOKEN);} +#line 82 "H5LTanalyze.l" +{return hid(H5T_STD_I64LE_TOKEN);} YY_BREAK case 9: YY_RULE_SETUP -#line 83 "H5LTanalyze.l" -{return token(H5T_STD_U8BE_TOKEN);} +#line 84 "H5LTanalyze.l" +{return hid(H5T_STD_U8BE_TOKEN);} YY_BREAK case 10: YY_RULE_SETUP -#line 84 "H5LTanalyze.l" -{return token(H5T_STD_U8LE_TOKEN);} +#line 85 "H5LTanalyze.l" +{return hid(H5T_STD_U8LE_TOKEN);} YY_BREAK case 11: YY_RULE_SETUP -#line 85 "H5LTanalyze.l" -{return token(H5T_STD_U16BE_TOKEN);} +#line 86 "H5LTanalyze.l" +{return hid(H5T_STD_U16BE_TOKEN);} YY_BREAK case 12: YY_RULE_SETUP -#line 86 "H5LTanalyze.l" -{return token(H5T_STD_U16LE_TOKEN);} +#line 87 "H5LTanalyze.l" +{return hid(H5T_STD_U16LE_TOKEN);} YY_BREAK case 13: YY_RULE_SETUP -#line 87 "H5LTanalyze.l" -{return token(H5T_STD_U32BE_TOKEN);} +#line 88 "H5LTanalyze.l" +{return hid(H5T_STD_U32BE_TOKEN);} YY_BREAK case 14: YY_RULE_SETUP -#line 88 "H5LTanalyze.l" -{return token(H5T_STD_U32LE_TOKEN);} +#line 89 "H5LTanalyze.l" +{return hid(H5T_STD_U32LE_TOKEN);} YY_BREAK case 15: YY_RULE_SETUP -#line 89 "H5LTanalyze.l" -{return token(H5T_STD_U64BE_TOKEN);} +#line 90 "H5LTanalyze.l" +{return hid(H5T_STD_U64BE_TOKEN);} YY_BREAK case 16: YY_RULE_SETUP -#line 90 "H5LTanalyze.l" -{return token(H5T_STD_U64LE_TOKEN);} +#line 91 "H5LTanalyze.l" +{return hid(H5T_STD_U64LE_TOKEN);} YY_BREAK case 17: YY_RULE_SETUP -#line 92 "H5LTanalyze.l" -{return token(H5T_NATIVE_CHAR_TOKEN);} +#line 93 "H5LTanalyze.l" +{return hid(H5T_NATIVE_CHAR_TOKEN);} YY_BREAK case 18: YY_RULE_SETUP -#line 93 "H5LTanalyze.l" -{return token(H5T_NATIVE_SCHAR_TOKEN);} +#line 94 "H5LTanalyze.l" +{return hid(H5T_NATIVE_SCHAR_TOKEN);} YY_BREAK case 19: YY_RULE_SETUP -#line 94 "H5LTanalyze.l" -{return token(H5T_NATIVE_UCHAR_TOKEN);} +#line 95 "H5LTanalyze.l" +{return hid(H5T_NATIVE_UCHAR_TOKEN);} YY_BREAK case 20: YY_RULE_SETUP -#line 95 "H5LTanalyze.l" -{return token(H5T_NATIVE_SHORT_TOKEN);} +#line 96 "H5LTanalyze.l" +{return hid(H5T_NATIVE_SHORT_TOKEN);} YY_BREAK case 21: YY_RULE_SETUP -#line 96 "H5LTanalyze.l" -{return token(H5T_NATIVE_USHORT_TOKEN);} +#line 97 "H5LTanalyze.l" +{return hid(H5T_NATIVE_USHORT_TOKEN);} YY_BREAK case 22: YY_RULE_SETUP -#line 97 "H5LTanalyze.l" -{return token(H5T_NATIVE_INT_TOKEN);} +#line 98 "H5LTanalyze.l" +{return hid(H5T_NATIVE_INT_TOKEN);} YY_BREAK case 23: YY_RULE_SETUP -#line 98 "H5LTanalyze.l" -{return token(H5T_NATIVE_UINT_TOKEN);} +#line 99 "H5LTanalyze.l" +{return hid(H5T_NATIVE_UINT_TOKEN);} YY_BREAK case 24: YY_RULE_SETUP -#line 99 "H5LTanalyze.l" -{return token(H5T_NATIVE_LONG_TOKEN);} +#line 100 "H5LTanalyze.l" +{return hid(H5T_NATIVE_LONG_TOKEN);} YY_BREAK case 25: YY_RULE_SETUP -#line 100 "H5LTanalyze.l" -{return token(H5T_NATIVE_ULONG_TOKEN);} +#line 101 "H5LTanalyze.l" +{return hid(H5T_NATIVE_ULONG_TOKEN);} YY_BREAK case 26: YY_RULE_SETUP -#line 101 "H5LTanalyze.l" -{return token(H5T_NATIVE_LLONG_TOKEN);} +#line 102 "H5LTanalyze.l" +{return hid(H5T_NATIVE_LLONG_TOKEN);} YY_BREAK case 27: YY_RULE_SETUP -#line 102 "H5LTanalyze.l" -{return token(H5T_NATIVE_ULLONG_TOKEN);} +#line 103 "H5LTanalyze.l" +{return hid(H5T_NATIVE_ULLONG_TOKEN);} YY_BREAK case 28: YY_RULE_SETUP -#line 104 "H5LTanalyze.l" -{return token(H5T_IEEE_F32BE_TOKEN);} +#line 105 "H5LTanalyze.l" +{return hid(H5T_IEEE_F32BE_TOKEN);} YY_BREAK case 29: YY_RULE_SETUP -#line 105 "H5LTanalyze.l" -{return token(H5T_IEEE_F32LE_TOKEN);} +#line 106 "H5LTanalyze.l" +{return hid(H5T_IEEE_F32LE_TOKEN);} YY_BREAK case 30: YY_RULE_SETUP -#line 106 "H5LTanalyze.l" -{return token(H5T_IEEE_F64BE_TOKEN);} +#line 107 "H5LTanalyze.l" +{return hid(H5T_IEEE_F64BE_TOKEN);} YY_BREAK case 31: YY_RULE_SETUP -#line 107 "H5LTanalyze.l" -{return token(H5T_IEEE_F64LE_TOKEN);} +#line 108 "H5LTanalyze.l" +{return hid(H5T_IEEE_F64LE_TOKEN);} YY_BREAK case 32: YY_RULE_SETUP -#line 108 "H5LTanalyze.l" -{return token(H5T_NATIVE_FLOAT_TOKEN);} +#line 109 "H5LTanalyze.l" +{return hid(H5T_NATIVE_FLOAT_TOKEN);} YY_BREAK case 33: YY_RULE_SETUP -#line 109 "H5LTanalyze.l" -{return token(H5T_NATIVE_DOUBLE_TOKEN);} +#line 110 "H5LTanalyze.l" +{return hid(H5T_NATIVE_DOUBLE_TOKEN);} YY_BREAK case 34: YY_RULE_SETUP -#line 110 "H5LTanalyze.l" -{return token(H5T_NATIVE_LDOUBLE_TOKEN);} +#line 111 "H5LTanalyze.l" +{return hid(H5T_NATIVE_LDOUBLE_TOKEN);} YY_BREAK case 35: YY_RULE_SETUP -#line 112 "H5LTanalyze.l" +#line 113 "H5LTanalyze.l" {return token(H5T_STRING_TOKEN);} YY_BREAK case 36: YY_RULE_SETUP -#line 113 "H5LTanalyze.l" +#line 114 "H5LTanalyze.l" {return token(STRSIZE_TOKEN);} YY_BREAK case 37: YY_RULE_SETUP -#line 114 "H5LTanalyze.l" +#line 115 "H5LTanalyze.l" {return token(STRPAD_TOKEN);} YY_BREAK case 38: YY_RULE_SETUP -#line 115 "H5LTanalyze.l" +#line 116 "H5LTanalyze.l" {return token(CSET_TOKEN);} YY_BREAK case 39: YY_RULE_SETUP -#line 116 "H5LTanalyze.l" +#line 117 "H5LTanalyze.l" {return token(CTYPE_TOKEN);} YY_BREAK case 40: YY_RULE_SETUP -#line 117 "H5LTanalyze.l" +#line 118 "H5LTanalyze.l" {return token(H5T_STR_NULLTERM_TOKEN);} YY_BREAK case 41: YY_RULE_SETUP -#line 118 "H5LTanalyze.l" +#line 119 "H5LTanalyze.l" {return token(H5T_STR_NULLPAD_TOKEN);} YY_BREAK case 42: YY_RULE_SETUP -#line 119 "H5LTanalyze.l" +#line 120 "H5LTanalyze.l" {return token(H5T_STR_SPACEPAD_TOKEN);} YY_BREAK case 43: YY_RULE_SETUP -#line 120 "H5LTanalyze.l" +#line 121 "H5LTanalyze.l" {return token(H5T_CSET_ASCII_TOKEN);} YY_BREAK case 44: YY_RULE_SETUP -#line 121 "H5LTanalyze.l" +#line 122 "H5LTanalyze.l" {return token(H5T_CSET_UTF8_TOKEN);} YY_BREAK case 45: YY_RULE_SETUP -#line 122 "H5LTanalyze.l" +#line 123 "H5LTanalyze.l" {return token(H5T_C_S1_TOKEN);} YY_BREAK case 46: YY_RULE_SETUP -#line 123 "H5LTanalyze.l" +#line 124 "H5LTanalyze.l" {return token(H5T_FORTRAN_S1_TOKEN);} YY_BREAK case 47: YY_RULE_SETUP -#line 124 "H5LTanalyze.l" +#line 125 "H5LTanalyze.l" {return token(H5T_VARIABLE_TOKEN);} YY_BREAK case 48: YY_RULE_SETUP -#line 126 "H5LTanalyze.l" +#line 127 "H5LTanalyze.l" {return token(H5T_COMPOUND_TOKEN);} YY_BREAK case 49: YY_RULE_SETUP -#line 127 "H5LTanalyze.l" +#line 128 "H5LTanalyze.l" {return token(H5T_ENUM_TOKEN);} YY_BREAK case 50: YY_RULE_SETUP -#line 128 "H5LTanalyze.l" +#line 129 "H5LTanalyze.l" {return token(H5T_ARRAY_TOKEN);} YY_BREAK case 51: YY_RULE_SETUP -#line 129 "H5LTanalyze.l" +#line 130 "H5LTanalyze.l" {return token(H5T_VLEN_TOKEN);} YY_BREAK case 52: YY_RULE_SETUP -#line 131 "H5LTanalyze.l" +#line 132 "H5LTanalyze.l" {return token(H5T_OPAQUE_TOKEN);} YY_BREAK case 53: YY_RULE_SETUP -#line 132 "H5LTanalyze.l" +#line 133 "H5LTanalyze.l" {return token(OPQ_SIZE_TOKEN);} YY_BREAK case 54: YY_RULE_SETUP -#line 133 "H5LTanalyze.l" +#line 134 "H5LTanalyze.l" {return token(OPQ_TAG_TOKEN);} YY_BREAK case 55: YY_RULE_SETUP -#line 135 "H5LTanalyze.l" +#line 136 "H5LTanalyze.l" { if( is_str_size || (is_enum && is_enum_memb) || is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) || @@ -1467,7 +1468,7 @@ YY_RULE_SETUP YY_BREAK case 56: YY_RULE_SETUP -#line 145 "H5LTanalyze.l" +#line 146 "H5LTanalyze.l" { /*if it's first quote, and is a compound field name or an enum symbol*/ if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field)) @@ -1482,7 +1483,7 @@ YY_RULE_SETUP case 57: /* rule 57 can match eol */ YY_RULE_SETUP -#line 155 "H5LTanalyze.l" +#line 156 "H5LTanalyze.l" { #ifdef H5_HAVE_WIN32_API H5LTyylval.sval = _strdup(H5LTyytext); @@ -1495,52 +1496,52 @@ YY_RULE_SETUP YY_BREAK case 58: YY_RULE_SETUP -#line 165 "H5LTanalyze.l" +#line 166 "H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 166 "H5LTanalyze.l" +#line 167 "H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 167 "H5LTanalyze.l" +#line 168 "H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 168 "H5LTanalyze.l" +#line 169 "H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 169 "H5LTanalyze.l" +#line 170 "H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 170 "H5LTanalyze.l" +#line 171 "H5LTanalyze.l" {return token(';');} YY_BREAK case 64: /* rule 64 can match eol */ YY_RULE_SETUP -#line 171 "H5LTanalyze.l" +#line 172 "H5LTanalyze.l" ; YY_BREAK case 65: /* rule 65 can match eol */ YY_RULE_SETUP -#line 172 "H5LTanalyze.l" +#line 173 "H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 174 "H5LTanalyze.l" +#line 175 "H5LTanalyze.l" ECHO; YY_BREAK -#line 1544 "H5LTanalyze.c" +#line 1545 "H5LTanalyze.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TAG_STRING): yyterminate(); @@ -2509,7 +2510,7 @@ void H5LTyyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 174 "H5LTanalyze.l" +#line 175 "H5LTanalyze.l" int my_yyinput(char *buf, int max_size) diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 9682f78..6c883fc 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -23,6 +23,7 @@ int my_yyinput(char *, int); #undef YY_INPUT #define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms)) #define token(x) (int)x +#define hid(x) (hid_t)x #ifdef YY_BUF_SIZE #undef YY_BUF_SIZE @@ -71,43 +72,43 @@ hbool_t first_quote = 1; %% -H5T_STD_I8BE {return token(H5T_STD_I8BE_TOKEN);} -H5T_STD_I8LE {return token(H5T_STD_I8LE_TOKEN);} -H5T_STD_I16BE {return token(H5T_STD_I16BE_TOKEN);} -H5T_STD_I16LE {return token(H5T_STD_I16LE_TOKEN);} -H5T_STD_I32BE {return token(H5T_STD_I32BE_TOKEN);} -H5T_STD_I32LE {return token(H5T_STD_I32LE_TOKEN);} -H5T_STD_I64BE {return token(H5T_STD_I64BE_TOKEN);} -H5T_STD_I64LE {return token(H5T_STD_I64LE_TOKEN);} - -H5T_STD_U8BE {return token(H5T_STD_U8BE_TOKEN);} -H5T_STD_U8LE {return token(H5T_STD_U8LE_TOKEN);} -H5T_STD_U16BE {return token(H5T_STD_U16BE_TOKEN);} -H5T_STD_U16LE {return token(H5T_STD_U16LE_TOKEN);} -H5T_STD_U32BE {return token(H5T_STD_U32BE_TOKEN);} -H5T_STD_U32LE {return token(H5T_STD_U32LE_TOKEN);} -H5T_STD_U64BE {return token(H5T_STD_U64BE_TOKEN);} -H5T_STD_U64LE {return token(H5T_STD_U64LE_TOKEN);} - -H5T_NATIVE_CHAR {return token(H5T_NATIVE_CHAR_TOKEN);} -H5T_NATIVE_SCHAR {return token(H5T_NATIVE_SCHAR_TOKEN);} -H5T_NATIVE_UCHAR {return token(H5T_NATIVE_UCHAR_TOKEN);} -H5T_NATIVE_SHORT {return token(H5T_NATIVE_SHORT_TOKEN);} -H5T_NATIVE_USHORT {return token(H5T_NATIVE_USHORT_TOKEN);} -H5T_NATIVE_INT {return token(H5T_NATIVE_INT_TOKEN);} -H5T_NATIVE_UINT {return token(H5T_NATIVE_UINT_TOKEN);} -H5T_NATIVE_LONG {return token(H5T_NATIVE_LONG_TOKEN);} -H5T_NATIVE_ULONG {return token(H5T_NATIVE_ULONG_TOKEN);} -H5T_NATIVE_LLONG {return token(H5T_NATIVE_LLONG_TOKEN);} -H5T_NATIVE_ULLONG {return token(H5T_NATIVE_ULLONG_TOKEN);} - -H5T_IEEE_F32BE {return token(H5T_IEEE_F32BE_TOKEN);} -H5T_IEEE_F32LE {return token(H5T_IEEE_F32LE_TOKEN);} -H5T_IEEE_F64BE {return token(H5T_IEEE_F64BE_TOKEN);} -H5T_IEEE_F64LE {return token(H5T_IEEE_F64LE_TOKEN);} -H5T_NATIVE_FLOAT {return token(H5T_NATIVE_FLOAT_TOKEN);} -H5T_NATIVE_DOUBLE {return token(H5T_NATIVE_DOUBLE_TOKEN);} -H5T_NATIVE_LDOUBLE {return token(H5T_NATIVE_LDOUBLE_TOKEN);} +H5T_STD_I8BE {return hid(H5T_STD_I8BE_TOKEN);} +H5T_STD_I8LE {return hid(H5T_STD_I8LE_TOKEN);} +H5T_STD_I16BE {return hid(H5T_STD_I16BE_TOKEN);} +H5T_STD_I16LE {return hid(H5T_STD_I16LE_TOKEN);} +H5T_STD_I32BE {return hid(H5T_STD_I32BE_TOKEN);} +H5T_STD_I32LE {return hid(H5T_STD_I32LE_TOKEN);} +H5T_STD_I64BE {return hid(H5T_STD_I64BE_TOKEN);} +H5T_STD_I64LE {return hid(H5T_STD_I64LE_TOKEN);} + +H5T_STD_U8BE {return hid(H5T_STD_U8BE_TOKEN);} +H5T_STD_U8LE {return hid(H5T_STD_U8LE_TOKEN);} +H5T_STD_U16BE {return hid(H5T_STD_U16BE_TOKEN);} +H5T_STD_U16LE {return hid(H5T_STD_U16LE_TOKEN);} +H5T_STD_U32BE {return hid(H5T_STD_U32BE_TOKEN);} +H5T_STD_U32LE {return hid(H5T_STD_U32LE_TOKEN);} +H5T_STD_U64BE {return hid(H5T_STD_U64BE_TOKEN);} +H5T_STD_U64LE {return hid(H5T_STD_U64LE_TOKEN);} + +H5T_NATIVE_CHAR {return hid(H5T_NATIVE_CHAR_TOKEN);} +H5T_NATIVE_SCHAR {return hid(H5T_NATIVE_SCHAR_TOKEN);} +H5T_NATIVE_UCHAR {return hid(H5T_NATIVE_UCHAR_TOKEN);} +H5T_NATIVE_SHORT {return hid(H5T_NATIVE_SHORT_TOKEN);} +H5T_NATIVE_USHORT {return hid(H5T_NATIVE_USHORT_TOKEN);} +H5T_NATIVE_INT {return hid(H5T_NATIVE_INT_TOKEN);} +H5T_NATIVE_UINT {return hid(H5T_NATIVE_UINT_TOKEN);} +H5T_NATIVE_LONG {return hid(H5T_NATIVE_LONG_TOKEN);} +H5T_NATIVE_ULONG {return hid(H5T_NATIVE_ULONG_TOKEN);} +H5T_NATIVE_LLONG {return hid(H5T_NATIVE_LLONG_TOKEN);} +H5T_NATIVE_ULLONG {return hid(H5T_NATIVE_ULLONG_TOKEN);} + +H5T_IEEE_F32BE {return hid(H5T_IEEE_F32BE_TOKEN);} +H5T_IEEE_F32LE {return hid(H5T_IEEE_F32LE_TOKEN);} +H5T_IEEE_F64BE {return hid(H5T_IEEE_F64BE_TOKEN);} +H5T_IEEE_F64LE {return hid(H5T_IEEE_F64LE_TOKEN);} +H5T_NATIVE_FLOAT {return hid(H5T_NATIVE_FLOAT_TOKEN);} +H5T_NATIVE_DOUBLE {return hid(H5T_NATIVE_DOUBLE_TOKEN);} +H5T_NATIVE_LDOUBLE {return hid(H5T_NATIVE_LDOUBLE_TOKEN);} H5T_STRING {return token(H5T_STRING_TOKEN);} STRSIZE {return token(STRSIZE_TOKEN);} diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index 240a8d3..e9a3ec9 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -226,12 +226,13 @@ typedef union YYSTYPE /* Line 387 of yacc.c */ #line 68 "H5LTparse.y" - int ival; /*for integer token*/ - char *sval; /*for name string*/ + int ival; /*for integer token*/ + char *sval; /*for name string*/ + hid_t hid; /*for hid_t token*/ /* Line 387 of yacc.c */ -#line 235 "H5LTparse.c" +#line 236 "H5LTparse.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -242,15 +243,15 @@ extern YYSTYPE H5LTyylval; #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus -int H5LTyyparse (void *YYPARSE_PARAM); +hid_t H5LTyyparse (void *YYPARSE_PARAM); #else -int H5LTyyparse (); +hid_t H5LTyyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus -int H5LTyyparse (void); +hid_t H5LTyyparse (void); #else -int H5LTyyparse (); +hid_t H5LTyyparse (); #endif #endif /* ! YYPARSE_PARAM */ @@ -259,7 +260,7 @@ int H5LTyyparse (); /* Copy the second part of user declarations. */ /* Line 390 of yacc.c */ -#line 263 "H5LTparse.c" +#line 264 "H5LTparse.c" #ifdef short # undef short @@ -583,16 +584,16 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 100, 100, 101, 103, 104, 105, 106, 108, 109, - 110, 111, 112, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 144, 145, 146, 147, 148, 149, 150, 154, 153, 162, - 163, 165, 165, 199, 205, 206, 209, 211, 211, 220, - 221, 223, 224, 223, 231, 234, 240, 241, 246, 247, - 238, 253, 255, 259, 260, 268, 277, 284, 257, 308, - 309, 311, 312, 313, 315, 316, 318, 319, 323, 322, - 327, 328, 330, 330, 382, 384 + 0, 101, 101, 102, 104, 105, 106, 107, 109, 110, + 111, 112, 113, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 145, 146, 147, 148, 149, 150, 151, 155, 154, 163, + 164, 166, 166, 200, 206, 207, 210, 212, 212, 221, + 222, 224, 225, 224, 232, 235, 241, 242, 247, 248, + 239, 254, 256, 260, 261, 269, 278, 285, 258, 309, + 310, 312, 313, 314, 316, 317, 319, 320, 324, 323, + 328, 329, 331, 331, 383, 385 }; #endif @@ -625,11 +626,12 @@ static const char *const yytname[] = "NUMBER", "'{'", "'}'", "'['", "']'", "'\"'", "':'", "';'", "$accept", "start", "ddl_type", "atomic_type", "integer_type", "fp_type", "compound_type", "$@1", "memb_list", "memb_def", "$@2", "field_name", - "field_offset", "offset", "array_type", "$@3", "dim_list", "dim", "$@4", - "$@5", "dimsize", "vlen_type", "opaque_type", "$@6", "@7", "$@8", "$@9", - "opaque_size", "opaque_tag", "string_type", "$@10", "$@11", "$@12", - "$@13", "@14", "strsize", "strpad", "cset", "ctype", "enum_type", "$@15", - "enum_list", "enum_def", "$@16", "enum_symbol", "enum_val", YY_NULL + "field_offset", "offset", "array_type", "$@3", "dim_list", "dim", + "$@4", "$@5", "dimsize", "vlen_type", "opaque_type", "$@6", "@7", + "$@8", "$@9", "opaque_size", "opaque_tag", "string_type", "$@10", + "$@11", "$@12", "$@13", "@14", "strsize", "strpad", "cset", "ctype", + "enum_type", "$@15", "enum_list", "enum_def", "$@16", "enum_symbol", + "enum_val", YY_NULL }; #endif @@ -1369,20 +1371,20 @@ int yynerrs; #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) -int +hid_t yyparse (void *YYPARSE_PARAM) #else -int +hid_t yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) -int +hid_t yyparse (void) #else -int +hid_t yyparse () #endif @@ -1622,230 +1624,230 @@ yyreduce: { case 2: /* Line 1807 of yacc.c */ -#line 100 "H5LTparse.y" +#line 101 "H5LTparse.y" { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } break; case 3: /* Line 1807 of yacc.c */ -#line 101 "H5LTparse.y" - { return (yyval.ival);} +#line 102 "H5LTparse.y" + { return (yyval.hid);} break; case 13: /* Line 1807 of yacc.c */ -#line 115 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I8BE); } +#line 116 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I8BE); } break; case 14: /* Line 1807 of yacc.c */ -#line 116 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I8LE); } +#line 117 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I8LE); } break; case 15: /* Line 1807 of yacc.c */ -#line 117 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I16BE); } +#line 118 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I16BE); } break; case 16: /* Line 1807 of yacc.c */ -#line 118 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I16LE); } +#line 119 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I16LE); } break; case 17: /* Line 1807 of yacc.c */ -#line 119 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I32BE); } +#line 120 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I32BE); } break; case 18: /* Line 1807 of yacc.c */ -#line 120 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I32LE); } +#line 121 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I32LE); } break; case 19: /* Line 1807 of yacc.c */ -#line 121 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I64BE); } +#line 122 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I64BE); } break; case 20: /* Line 1807 of yacc.c */ -#line 122 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_I64LE); } +#line 123 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_I64LE); } break; case 21: /* Line 1807 of yacc.c */ -#line 123 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U8BE); } +#line 124 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U8BE); } break; case 22: /* Line 1807 of yacc.c */ -#line 124 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U8LE); } +#line 125 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U8LE); } break; case 23: /* Line 1807 of yacc.c */ -#line 125 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U16BE); } +#line 126 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U16BE); } break; case 24: /* Line 1807 of yacc.c */ -#line 126 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U16LE); } +#line 127 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U16LE); } break; case 25: /* Line 1807 of yacc.c */ -#line 127 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U32BE); } +#line 128 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U32BE); } break; case 26: /* Line 1807 of yacc.c */ -#line 128 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U32LE); } +#line 129 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U32LE); } break; case 27: /* Line 1807 of yacc.c */ -#line 129 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U64BE); } +#line 130 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U64BE); } break; case 28: /* Line 1807 of yacc.c */ -#line 130 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_STD_U64LE); } +#line 131 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_STD_U64LE); } break; case 29: /* Line 1807 of yacc.c */ -#line 131 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_CHAR); } +#line 132 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_CHAR); } break; case 30: /* Line 1807 of yacc.c */ -#line 132 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_SCHAR); } +#line 133 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_SCHAR); } break; case 31: /* Line 1807 of yacc.c */ -#line 133 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_UCHAR); } +#line 134 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_UCHAR); } break; case 32: /* Line 1807 of yacc.c */ -#line 134 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_SHORT); } +#line 135 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_SHORT); } break; case 33: /* Line 1807 of yacc.c */ -#line 135 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_USHORT); } +#line 136 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_USHORT); } break; case 34: /* Line 1807 of yacc.c */ -#line 136 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_INT); } +#line 137 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_INT); } break; case 35: /* Line 1807 of yacc.c */ -#line 137 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_UINT); } +#line 138 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_UINT); } break; case 36: /* Line 1807 of yacc.c */ -#line 138 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_LONG); } +#line 139 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_LONG); } break; case 37: /* Line 1807 of yacc.c */ -#line 139 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_ULONG); } +#line 140 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULONG); } break; case 38: /* Line 1807 of yacc.c */ -#line 140 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_LLONG); } +#line 141 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_LLONG); } break; case 39: /* Line 1807 of yacc.c */ -#line 141 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_ULLONG); } +#line 142 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_ULLONG); } break; case 40: /* Line 1807 of yacc.c */ -#line 144 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_IEEE_F32BE); } +#line 145 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F32BE); } break; case 41: /* Line 1807 of yacc.c */ -#line 145 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_IEEE_F32LE); } +#line 146 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F32LE); } break; case 42: /* Line 1807 of yacc.c */ -#line 146 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_IEEE_F64BE); } +#line 147 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F64BE); } break; case 43: /* Line 1807 of yacc.c */ -#line 147 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_IEEE_F64LE); } +#line 148 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_IEEE_F64LE); } break; case 44: /* Line 1807 of yacc.c */ -#line 148 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_FLOAT); } +#line 149 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_FLOAT); } break; case 45: /* Line 1807 of yacc.c */ -#line 149 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_DOUBLE); } +#line 150 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_DOUBLE); } break; case 46: /* Line 1807 of yacc.c */ -#line 150 "H5LTparse.y" - { (yyval.ival) = H5Tcopy(H5T_NATIVE_LDOUBLE); } +#line 151 "H5LTparse.y" + { (yyval.hid) = H5Tcopy(H5T_NATIVE_LDOUBLE); } break; case 47: /* Line 1807 of yacc.c */ -#line 154 "H5LTparse.y" +#line 155 "H5LTparse.y" { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } break; case 48: /* Line 1807 of yacc.c */ -#line 156 "H5LTparse.y" - { (yyval.ival) = cmpd_stack[csindex].id; +#line 157 "H5LTparse.y" + { (yyval.hid) = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; csindex--; @@ -1854,41 +1856,41 @@ yyreduce: case 51: /* Line 1807 of yacc.c */ -#line 165 "H5LTparse.y" +#line 166 "H5LTparse.y" { cmpd_stack[csindex].is_field = 1; /*notify lexer a compound member is parsed*/ } break; case 52: /* Line 1807 of yacc.c */ -#line 167 "H5LTparse.y" +#line 168 "H5LTparse.y" { size_t origin_size, new_size; hid_t dtype_id = cmpd_stack[csindex].id; /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size((yyvsp[(1) - (7)].ival)) + (yyvsp[(6) - (7)].ival); + new_size = H5Tget_size((yyvsp[(1) - (7)].hid)) + (yyvsp[(6) - (7)].ival); H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].ival)); + H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); if((yyvsp[(6) - (7)].ival) == 0) { - new_size = origin_size + H5Tget_size((yyvsp[(1) - (7)].ival)); + new_size = origin_size + H5Tget_size((yyvsp[(1) - (7)].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), origin_size, (yyvsp[(1) - (7)].ival)); + H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), origin_size, (yyvsp[(1) - (7)].hid)); } else { - new_size = (yyvsp[(6) - (7)].ival) + H5Tget_size((yyvsp[(1) - (7)].ival)); + new_size = (yyvsp[(6) - (7)].ival) + H5Tget_size((yyvsp[(1) - (7)].hid)); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].ival)); + H5Tinsert(dtype_id, (yyvsp[(4) - (7)].sval), (yyvsp[(6) - (7)].ival), (yyvsp[(1) - (7)].hid)); } } cmpd_stack[csindex].is_field = 0; - H5Tclose((yyvsp[(1) - (7)].ival)); + H5Tclose((yyvsp[(1) - (7)].hid)); new_size = H5Tget_size(dtype_id); } @@ -1896,7 +1898,7 @@ yyreduce: case 53: /* Line 1807 of yacc.c */ -#line 200 "H5LTparse.y" +#line 201 "H5LTparse.y" { (yyval.sval) = yylval.sval; } @@ -1904,42 +1906,42 @@ yyreduce: case 54: /* Line 1807 of yacc.c */ -#line 205 "H5LTparse.y" +#line 206 "H5LTparse.y" { (yyval.ival) = 0; } break; case 55: /* Line 1807 of yacc.c */ -#line 207 "H5LTparse.y" +#line 208 "H5LTparse.y" { (yyval.ival) = yylval.ival; } break; case 57: /* Line 1807 of yacc.c */ -#line 211 "H5LTparse.y" +#line 212 "H5LTparse.y" { asindex++; /*pushd onto the stack*/ } break; case 58: /* Line 1807 of yacc.c */ -#line 213 "H5LTparse.y" +#line 214 "H5LTparse.y" { - (yyval.ival) = H5Tarray_create2((yyvsp[(5) - (6)].ival), arr_stack[asindex].ndims, arr_stack[asindex].dims); + (yyval.hid) = H5Tarray_create2((yyvsp[(5) - (6)].hid), arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; - H5Tclose((yyvsp[(5) - (6)].ival)); + H5Tclose((yyvsp[(5) - (6)].hid)); } break; case 61: /* Line 1807 of yacc.c */ -#line 223 "H5LTparse.y" +#line 224 "H5LTparse.y" { arr_stack[asindex].is_dim = 1; /*notice lexer of dimension size*/ } break; case 62: /* Line 1807 of yacc.c */ -#line 224 "H5LTparse.y" +#line 225 "H5LTparse.y" { unsigned ndims = arr_stack[asindex].ndims; arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival; arr_stack[asindex].ndims++; @@ -1949,56 +1951,56 @@ yyreduce: case 65: /* Line 1807 of yacc.c */ -#line 235 "H5LTparse.y" - { (yyval.ival) = H5Tvlen_create((yyvsp[(3) - (4)].ival)); H5Tclose((yyvsp[(3) - (4)].ival)); } +#line 236 "H5LTparse.y" + { (yyval.hid) = H5Tvlen_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 66: /* Line 1807 of yacc.c */ -#line 240 "H5LTparse.y" +#line 241 "H5LTparse.y" { is_opq_size = 1; } break; case 67: /* Line 1807 of yacc.c */ -#line 241 "H5LTparse.y" +#line 242 "H5LTparse.y" { size_t size = (size_t)yylval.ival; - (yyval.ival) = H5Tcreate(H5T_OPAQUE, size); + (yyval.hid) = H5Tcreate(H5T_OPAQUE, size); is_opq_size = 0; } break; case 68: /* Line 1807 of yacc.c */ -#line 246 "H5LTparse.y" +#line 247 "H5LTparse.y" { is_opq_tag = 1; } break; case 69: /* Line 1807 of yacc.c */ -#line 247 "H5LTparse.y" +#line 248 "H5LTparse.y" { - H5Tset_tag((yyvsp[(7) - (13)].ival), yylval.sval); + H5Tset_tag((yyvsp[(7) - (13)].hid), yylval.sval); is_opq_tag = 0; } break; case 70: /* Line 1807 of yacc.c */ -#line 251 "H5LTparse.y" - { (yyval.ival) = (yyvsp[(7) - (15)].ival); } +#line 252 "H5LTparse.y" + { (yyval.hid) = (yyvsp[(7) - (15)].hid); } break; case 73: /* Line 1807 of yacc.c */ -#line 259 "H5LTparse.y" +#line 260 "H5LTparse.y" { is_str_size = 1; } break; case 74: /* Line 1807 of yacc.c */ -#line 260 "H5LTparse.y" +#line 261 "H5LTparse.y" { if((yyvsp[(5) - (6)].ival) == H5T_VARIABLE_TOKEN) is_variable = 1; @@ -2010,7 +2012,7 @@ yyreduce: case 75: /* Line 1807 of yacc.c */ -#line 268 "H5LTparse.y" +#line 269 "H5LTparse.y" { if((yyvsp[(9) - (10)].ival) == H5T_STR_NULLTERM_TOKEN) str_pad = H5T_STR_NULLTERM; @@ -2023,7 +2025,7 @@ yyreduce: case 76: /* Line 1807 of yacc.c */ -#line 277 "H5LTparse.y" +#line 278 "H5LTparse.y" { if((yyvsp[(13) - (14)].ival) == H5T_CSET_ASCII_TOKEN) str_cset = H5T_CSET_ASCII; @@ -2034,20 +2036,20 @@ yyreduce: case 77: /* Line 1807 of yacc.c */ -#line 284 "H5LTparse.y" +#line 285 "H5LTparse.y" { - if((yyvsp[(17) - (18)].ival) == H5T_C_S1_TOKEN) - (yyval.ival) = H5Tcopy(H5T_C_S1); - else if((yyvsp[(17) - (18)].ival) == H5T_FORTRAN_S1_TOKEN) - (yyval.ival) = H5Tcopy(H5T_FORTRAN_S1); + if((yyvsp[(17) - (18)].hid) == H5T_C_S1_TOKEN) + (yyval.hid) = H5Tcopy(H5T_C_S1); + else if((yyvsp[(17) - (18)].hid) == H5T_FORTRAN_S1_TOKEN) + (yyval.hid) = H5Tcopy(H5T_FORTRAN_S1); } break; case 78: /* Line 1807 of yacc.c */ -#line 291 "H5LTparse.y" +#line 292 "H5LTparse.y" { - hid_t str_id = (yyvsp[(19) - (20)].ival); + hid_t str_id = (yyvsp[(19) - (20)].hid); /*set string size*/ if(is_variable) { @@ -2060,73 +2062,73 @@ yyreduce: H5Tset_strpad(str_id, str_pad); H5Tset_cset(str_id, str_cset); - (yyval.ival) = str_id; + (yyval.hid) = str_id; } break; case 79: /* Line 1807 of yacc.c */ -#line 308 "H5LTparse.y" +#line 309 "H5LTparse.y" {(yyval.ival) = H5T_VARIABLE_TOKEN;} break; case 81: /* Line 1807 of yacc.c */ -#line 311 "H5LTparse.y" +#line 312 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLTERM_TOKEN;} break; case 82: /* Line 1807 of yacc.c */ -#line 312 "H5LTparse.y" +#line 313 "H5LTparse.y" {(yyval.ival) = H5T_STR_NULLPAD_TOKEN;} break; case 83: /* Line 1807 of yacc.c */ -#line 313 "H5LTparse.y" +#line 314 "H5LTparse.y" {(yyval.ival) = H5T_STR_SPACEPAD_TOKEN;} break; case 84: /* Line 1807 of yacc.c */ -#line 315 "H5LTparse.y" +#line 316 "H5LTparse.y" {(yyval.ival) = H5T_CSET_ASCII_TOKEN;} break; case 85: /* Line 1807 of yacc.c */ -#line 316 "H5LTparse.y" +#line 317 "H5LTparse.y" {(yyval.ival) = H5T_CSET_UTF8_TOKEN;} break; case 86: /* Line 1807 of yacc.c */ -#line 318 "H5LTparse.y" - {(yyval.ival) = H5T_C_S1_TOKEN;} +#line 319 "H5LTparse.y" + {(yyval.hid) = H5T_C_S1_TOKEN;} break; case 87: /* Line 1807 of yacc.c */ -#line 319 "H5LTparse.y" - {(yyval.ival) = H5T_FORTRAN_S1_TOKEN;} +#line 320 "H5LTparse.y" + {(yyval.hid) = H5T_FORTRAN_S1_TOKEN;} break; case 88: /* Line 1807 of yacc.c */ -#line 323 "H5LTparse.y" - { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].ival)); H5Tclose((yyvsp[(3) - (4)].ival)); } +#line 324 "H5LTparse.y" + { is_enum = 1; enum_id = H5Tenum_create((yyvsp[(3) - (4)].hid)); H5Tclose((yyvsp[(3) - (4)].hid)); } break; case 89: /* Line 1807 of yacc.c */ -#line 325 "H5LTparse.y" - { is_enum = 0; /*reset*/ (yyval.ival) = enum_id; } +#line 326 "H5LTparse.y" + { is_enum = 0; /*reset*/ (yyval.hid) = enum_id; } break; case 92: /* Line 1807 of yacc.c */ -#line 330 "H5LTparse.y" +#line 331 "H5LTparse.y" { is_enum_memb = 1; /*indicate member of enum*/ #ifdef H5_HAVE_WIN32_API @@ -2139,7 +2141,7 @@ yyreduce: case 93: /* Line 1807 of yacc.c */ -#line 339 "H5LTparse.y" +#line 340 "H5LTparse.y" { char char_val=(char)yylval.ival; short short_val=(short)yylval.ival; @@ -2186,7 +2188,7 @@ yyreduce: /* Line 1807 of yacc.c */ -#line 2190 "H5LTparse.c" +#line 2192 "H5LTparse.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires diff --git a/hl/src/H5LTparse.h b/hl/src/H5LTparse.h index f40c822..621dacd 100644 --- a/hl/src/H5LTparse.h +++ b/hl/src/H5LTparse.h @@ -112,12 +112,13 @@ typedef union YYSTYPE /* Line 2065 of yacc.c */ #line 68 "H5LTparse.y" - int ival; /*for integer token*/ - char *sval; /*for name string*/ + int ival; /*for integer token*/ + char *sval; /*for name string*/ + hid_t hid; /*for hid_t token*/ /* Line 2065 of yacc.c */ -#line 121 "H5LTparse.h" +#line 122 "H5LTparse.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index d4c786c..4c07533 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -66,20 +66,21 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ %} %union { - int ival; /*for integer token*/ - char *sval; /*for name string*/ + int ival; /*for integer token*/ + char *sval; /*for name string*/ + hid_t hid; /*for hid_t token*/ } -%token <ival> H5T_STD_I8BE_TOKEN H5T_STD_I8LE_TOKEN H5T_STD_I16BE_TOKEN H5T_STD_I16LE_TOKEN -%token <ival> H5T_STD_I32BE_TOKEN H5T_STD_I32LE_TOKEN H5T_STD_I64BE_TOKEN H5T_STD_I64LE_TOKEN -%token <ival> H5T_STD_U8BE_TOKEN H5T_STD_U8LE_TOKEN H5T_STD_U16BE_TOKEN H5T_STD_U16LE_TOKEN -%token <ival> H5T_STD_U32BE_TOKEN H5T_STD_U32LE_TOKEN H5T_STD_U64BE_TOKEN H5T_STD_U64LE_TOKEN -%token <ival> H5T_NATIVE_CHAR_TOKEN H5T_NATIVE_SCHAR_TOKEN H5T_NATIVE_UCHAR_TOKEN -%token <ival> H5T_NATIVE_SHORT_TOKEN H5T_NATIVE_USHORT_TOKEN H5T_NATIVE_INT_TOKEN H5T_NATIVE_UINT_TOKEN -%token <ival> H5T_NATIVE_LONG_TOKEN H5T_NATIVE_ULONG_TOKEN H5T_NATIVE_LLONG_TOKEN H5T_NATIVE_ULLONG_TOKEN +%token <hid> H5T_STD_I8BE_TOKEN H5T_STD_I8LE_TOKEN H5T_STD_I16BE_TOKEN H5T_STD_I16LE_TOKEN +%token <hid> H5T_STD_I32BE_TOKEN H5T_STD_I32LE_TOKEN H5T_STD_I64BE_TOKEN H5T_STD_I64LE_TOKEN +%token <hid> H5T_STD_U8BE_TOKEN H5T_STD_U8LE_TOKEN H5T_STD_U16BE_TOKEN H5T_STD_U16LE_TOKEN +%token <hid> H5T_STD_U32BE_TOKEN H5T_STD_U32LE_TOKEN H5T_STD_U64BE_TOKEN H5T_STD_U64LE_TOKEN +%token <hid> H5T_NATIVE_CHAR_TOKEN H5T_NATIVE_SCHAR_TOKEN H5T_NATIVE_UCHAR_TOKEN +%token <hid> H5T_NATIVE_SHORT_TOKEN H5T_NATIVE_USHORT_TOKEN H5T_NATIVE_INT_TOKEN H5T_NATIVE_UINT_TOKEN +%token <hid> H5T_NATIVE_LONG_TOKEN H5T_NATIVE_ULONG_TOKEN H5T_NATIVE_LLONG_TOKEN H5T_NATIVE_ULLONG_TOKEN -%token <ival> H5T_IEEE_F32BE_TOKEN H5T_IEEE_F32LE_TOKEN H5T_IEEE_F64BE_TOKEN H5T_IEEE_F64LE_TOKEN -%token <ival> H5T_NATIVE_FLOAT_TOKEN H5T_NATIVE_DOUBLE_TOKEN H5T_NATIVE_LDOUBLE_TOKEN +%token <hid> H5T_IEEE_F32BE_TOKEN H5T_IEEE_F32LE_TOKEN H5T_IEEE_F64BE_TOKEN H5T_IEEE_F64LE_TOKEN +%token <hid> H5T_NATIVE_FLOAT_TOKEN H5T_NATIVE_DOUBLE_TOKEN H5T_NATIVE_LDOUBLE_TOKEN %token <ival> H5T_STRING_TOKEN STRSIZE_TOKEN STRPAD_TOKEN CSET_TOKEN CTYPE_TOKEN H5T_VARIABLE_TOKEN %token <ival> H5T_STR_NULLTERM_TOKEN H5T_STR_NULLPAD_TOKEN H5T_STR_SPACEPAD_TOKEN @@ -98,7 +99,7 @@ hbool_t is_opq_tag = 0; /*flag to lexer for opaque type tag*/ %% start : { memset(arr_stack, 0, STACK_SIZE*sizeof(struct arr_info)); /*initialize here?*/ } - | ddl_type { return $<ival>$;} + | ddl_type { return $<hid>$;} ; ddl_type : atomic_type | compound_type @@ -112,48 +113,48 @@ atomic_type : integer_type | opaque_type ; -integer_type : H5T_STD_I8BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I8BE); } - | H5T_STD_I8LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I8LE); } - | H5T_STD_I16BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I16BE); } - | H5T_STD_I16LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I16LE); } - | H5T_STD_I32BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I32BE); } - | H5T_STD_I32LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I32LE); } - | H5T_STD_I64BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I64BE); } - | H5T_STD_I64LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_I64LE); } - | H5T_STD_U8BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U8BE); } - | H5T_STD_U8LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U8LE); } - | H5T_STD_U16BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U16BE); } - | H5T_STD_U16LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U16LE); } - | H5T_STD_U32BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U32BE); } - | H5T_STD_U32LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U32LE); } - | H5T_STD_U64BE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U64BE); } - | H5T_STD_U64LE_TOKEN { $<ival>$ = H5Tcopy(H5T_STD_U64LE); } - | H5T_NATIVE_CHAR_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_CHAR); } - | H5T_NATIVE_SCHAR_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_SCHAR); } - | H5T_NATIVE_UCHAR_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_UCHAR); } - | H5T_NATIVE_SHORT_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_SHORT); } - | H5T_NATIVE_USHORT_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_USHORT); } - | H5T_NATIVE_INT_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_INT); } - | H5T_NATIVE_UINT_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_UINT); } - | H5T_NATIVE_LONG_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_LONG); } - | H5T_NATIVE_ULONG_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_ULONG); } - | H5T_NATIVE_LLONG_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_LLONG); } - | H5T_NATIVE_ULLONG_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_ULLONG); } +integer_type : H5T_STD_I8BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I8BE); } + | H5T_STD_I8LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I8LE); } + | H5T_STD_I16BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I16BE); } + | H5T_STD_I16LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I16LE); } + | H5T_STD_I32BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I32BE); } + | H5T_STD_I32LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I32LE); } + | H5T_STD_I64BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I64BE); } + | H5T_STD_I64LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_I64LE); } + | H5T_STD_U8BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U8BE); } + | H5T_STD_U8LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U8LE); } + | H5T_STD_U16BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U16BE); } + | H5T_STD_U16LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U16LE); } + | H5T_STD_U32BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U32BE); } + | H5T_STD_U32LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U32LE); } + | H5T_STD_U64BE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U64BE); } + | H5T_STD_U64LE_TOKEN { $<hid>$ = H5Tcopy(H5T_STD_U64LE); } + | H5T_NATIVE_CHAR_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_CHAR); } + | H5T_NATIVE_SCHAR_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_SCHAR); } + | H5T_NATIVE_UCHAR_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_UCHAR); } + | H5T_NATIVE_SHORT_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_SHORT); } + | H5T_NATIVE_USHORT_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_USHORT); } + | H5T_NATIVE_INT_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_INT); } + | H5T_NATIVE_UINT_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_UINT); } + | H5T_NATIVE_LONG_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_LONG); } + | H5T_NATIVE_ULONG_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_ULONG); } + | H5T_NATIVE_LLONG_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_LLONG); } + | H5T_NATIVE_ULLONG_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_ULLONG); } ; -fp_type : H5T_IEEE_F32BE_TOKEN { $<ival>$ = H5Tcopy(H5T_IEEE_F32BE); } - | H5T_IEEE_F32LE_TOKEN { $<ival>$ = H5Tcopy(H5T_IEEE_F32LE); } - | H5T_IEEE_F64BE_TOKEN { $<ival>$ = H5Tcopy(H5T_IEEE_F64BE); } - | H5T_IEEE_F64LE_TOKEN { $<ival>$ = H5Tcopy(H5T_IEEE_F64LE); } - | H5T_NATIVE_FLOAT_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_FLOAT); } - | H5T_NATIVE_DOUBLE_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_DOUBLE); } - | H5T_NATIVE_LDOUBLE_TOKEN { $<ival>$ = H5Tcopy(H5T_NATIVE_LDOUBLE); } +fp_type : H5T_IEEE_F32BE_TOKEN { $<hid>$ = H5Tcopy(H5T_IEEE_F32BE); } + | H5T_IEEE_F32LE_TOKEN { $<hid>$ = H5Tcopy(H5T_IEEE_F32LE); } + | H5T_IEEE_F64BE_TOKEN { $<hid>$ = H5Tcopy(H5T_IEEE_F64BE); } + | H5T_IEEE_F64LE_TOKEN { $<hid>$ = H5Tcopy(H5T_IEEE_F64LE); } + | H5T_NATIVE_FLOAT_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_FLOAT); } + | H5T_NATIVE_DOUBLE_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_DOUBLE); } + | H5T_NATIVE_LDOUBLE_TOKEN { $<hid>$ = H5Tcopy(H5T_NATIVE_LDOUBLE); } ; compound_type : H5T_COMPOUND_TOKEN { csindex++; cmpd_stack[csindex].id = H5Tcreate(H5T_COMPOUND, 1); /*temporarily set size to 1*/ } '{' memb_list '}' - { $<ival>$ = cmpd_stack[csindex].id; + { $<hid>$ = cmpd_stack[csindex].id; cmpd_stack[csindex].id = 0; cmpd_stack[csindex].first_memb = 1; csindex--; @@ -170,28 +171,28 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le /*Adjust size and insert member, consider both member size and offset.*/ if(cmpd_stack[csindex].first_memb) { /*reclaim the size 1 temporarily set*/ - new_size = H5Tget_size($<ival>1) + $<ival>6; + new_size = H5Tget_size($<hid>1) + $<ival>6; H5Tset_size(dtype_id, new_size); /*member name is saved in yylval.sval by lexer*/ - H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<ival>1); + H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<hid>1); cmpd_stack[csindex].first_memb = 0; } else { origin_size = H5Tget_size(dtype_id); if($<ival>6 == 0) { - new_size = origin_size + H5Tget_size($<ival>1); + new_size = origin_size + H5Tget_size($<hid>1); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, $<sval>4, origin_size, $<ival>1); + H5Tinsert(dtype_id, $<sval>4, origin_size, $<hid>1); } else { - new_size = $<ival>6 + H5Tget_size($<ival>1); + new_size = $<ival>6 + H5Tget_size($<hid>1); H5Tset_size(dtype_id, new_size); - H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<ival>1); + H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<hid>1); } } cmpd_stack[csindex].is_field = 0; - H5Tclose($<ival>1); + H5Tclose($<hid>1); new_size = H5Tget_size(dtype_id); } @@ -211,10 +212,10 @@ offset : NUMBER array_type : H5T_ARRAY_TOKEN { asindex++; /*pushd onto the stack*/ } '{' dim_list ddl_type '}' { - $<ival>$ = H5Tarray_create2($<ival>5, arr_stack[asindex].ndims, arr_stack[asindex].dims); + $<hid>$ = H5Tarray_create2($<hid>5, arr_stack[asindex].ndims, arr_stack[asindex].dims); arr_stack[asindex].ndims = 0; asindex--; - H5Tclose($<ival>5); + H5Tclose($<hid>5); } ; dim_list : @@ -232,7 +233,7 @@ dimsize : NUMBER ; vlen_type : H5T_VLEN_TOKEN '{' ddl_type '}' - { $<ival>$ = H5Tvlen_create($<ival>3); H5Tclose($<ival>3); } + { $<hid>$ = H5Tvlen_create($<hid>3); H5Tclose($<hid>3); } ; opaque_type : H5T_OPAQUE_TOKEN @@ -240,15 +241,15 @@ opaque_type : H5T_OPAQUE_TOKEN OPQ_SIZE_TOKEN { is_opq_size = 1; } opaque_size ';' { size_t size = (size_t)yylval.ival; - $<ival>$ = H5Tcreate(H5T_OPAQUE, size); + $<hid>$ = H5Tcreate(H5T_OPAQUE, size); is_opq_size = 0; } OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' { - H5Tset_tag($<ival>7, yylval.sval); + H5Tset_tag($<hid>7, yylval.sval); is_opq_tag = 0; } - '}' { $<ival>$ = $<ival>7; } + '}' { $<hid>$ = $<hid>7; } ; opaque_size : NUMBER ; @@ -282,14 +283,14 @@ string_type : H5T_STRING_TOKEN } CTYPE_TOKEN ctype ';' { - if($<ival>17 == H5T_C_S1_TOKEN) - $<ival>$ = H5Tcopy(H5T_C_S1); - else if($<ival>17 == H5T_FORTRAN_S1_TOKEN) - $<ival>$ = H5Tcopy(H5T_FORTRAN_S1); + if($<hid>17 == H5T_C_S1_TOKEN) + $<hid>$ = H5Tcopy(H5T_C_S1); + else if($<hid>17 == H5T_FORTRAN_S1_TOKEN) + $<hid>$ = H5Tcopy(H5T_FORTRAN_S1); } '}' { - hid_t str_id = $<ival>19; + hid_t str_id = $<hid>19; /*set string size*/ if(is_variable) { @@ -302,7 +303,7 @@ string_type : H5T_STRING_TOKEN H5Tset_strpad(str_id, str_pad); H5Tset_cset(str_id, str_cset); - $<ival>$ = str_id; + $<hid>$ = str_id; } ; strsize : H5T_VARIABLE_TOKEN {$<ival>$ = H5T_VARIABLE_TOKEN;} @@ -315,14 +316,14 @@ strpad : H5T_STR_NULLTERM_TOKEN {$<ival>$ = H5T_STR_NULLTERM_TOKE cset : H5T_CSET_ASCII_TOKEN {$<ival>$ = H5T_CSET_ASCII_TOKEN;} | H5T_CSET_UTF8_TOKEN {$<ival>$ = H5T_CSET_UTF8_TOKEN;} ; -ctype : H5T_C_S1_TOKEN {$<ival>$ = H5T_C_S1_TOKEN;} - | H5T_FORTRAN_S1_TOKEN {$<ival>$ = H5T_FORTRAN_S1_TOKEN;} +ctype : H5T_C_S1_TOKEN {$<hid>$ = H5T_C_S1_TOKEN;} + | H5T_FORTRAN_S1_TOKEN {$<hid>$ = H5T_FORTRAN_S1_TOKEN;} ; enum_type : H5T_ENUM_TOKEN '{' integer_type ';' - { is_enum = 1; enum_id = H5Tenum_create($<ival>3); H5Tclose($<ival>3); } + { is_enum = 1; enum_id = H5Tenum_create($<hid>3); H5Tclose($<hid>3); } enum_list '}' - { is_enum = 0; /*reset*/ $<ival>$ = enum_id; } + { is_enum = 0; /*reset*/ $<hid>$ = enum_id; } ; enum_list : | enum_list enum_def diff --git a/hl/src/H5LTprivate.h b/hl/src/H5LTprivate.h index 0ee6b5c..98ac06e 100644 --- a/hl/src/H5LTprivate.h +++ b/hl/src/H5LTprivate.h @@ -48,6 +48,6 @@ H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); H5_HLDLL char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hbool_t no_user_buf); -H5_HLDLL int H5LTyyparse(void); +H5_HLDLL hid_t H5LTyyparse(void); #endif diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 2ed379a..a1456ea 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -3263,7 +3263,7 @@ hid_t H5TB_create_type(hid_t loc_id, hsize_t nfields = 0; char **fnames = NULL; unsigned i; - herr_t ret_val = -1; + hid_t ret_val = -1; /* get the number of fields */ if(H5TBget_table_info(loc_id, dset_name, &nfields, NULL) < 0) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index 08d1c46..bddd162 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -1016,13 +1016,13 @@ test_invalid_parameters(hid_t file) /* Check invalid dataset ID */ H5E_BEGIN_TRY { - if((status = H5DOwrite_chunk(-1, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) + if((status = H5DOwrite_chunk((hid_t)-1, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } H5E_END_TRY; /* Check invalid DXPL ID */ H5E_BEGIN_TRY { - if((status = H5DOwrite_chunk(dataset, -1, filter_mask, offset, buf_size, direct_buf)) != FAIL) + if((status = H5DOwrite_chunk(dataset, (hid_t)-1, filter_mask, offset, buf_size, direct_buf)) != FAIL) goto error; } H5E_END_TRY; @@ -177,17 +177,23 @@ H5A_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_ATTR))>0) { + if(H5I_nmembers(H5I_ATTR) > 0) { (void)H5I_clear_type(H5I_ATTR, FALSE, FALSE); - } else { + n++; /*H5I*/ + } /* end if */ + else { /* Close deprecated interface */ n += H5A__term_deprec_interface(); + /* Destroy the attribute object id group */ (void)H5I_dec_type_ref(H5I_ATTR); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) } /* H5A_term_interface() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 6c61d28..c839df3 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -224,12 +224,12 @@ done: int H5D_term_interface(void) { - int n=0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n=H5I_nmembers(H5I_DATASET))>0) { + if(H5I_nmembers(H5I_DATASET) > 0) { /* The dataset API uses the "force" flag set to true because it * is using the "file objects" (H5FO) API functions to track open * objects in the file. Using the H5FO code means that dataset @@ -252,19 +252,25 @@ H5D_term_interface(void) * * QAK - 5/13/03 */ - H5I_clear_type(H5I_DATASET, TRUE, FALSE); - } else { + (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { /* Close public interface */ n += H5D__term_pub_interface(); /* Close deprecated interface */ n += H5D__term_deprec_interface(); - H5I_dec_type_ref(H5I_DATASET); + /* Destroy the dataset object id group */ + (void)H5I_dec_type_ref(H5I_DATASET); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) } /* end H5D_term_interface() */ @@ -288,22 +288,21 @@ H5E_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - int ncls, nmsg, nstk; + int64_t ncls, nmsg, nstk; /* Check if there are any open error stacks, classes or messages */ ncls = H5I_nmembers(H5I_ERROR_CLASS); nmsg = H5I_nmembers(H5I_ERROR_MSG); nstk = H5I_nmembers(H5I_ERROR_STACK); - n = ncls + nmsg + nstk; - if(n > 0) { + if((ncls + nmsg + nstk) > 0) { /* Clear any outstanding error stacks */ if(nstk > 0) - H5I_clear_type(H5I_ERROR_STACK, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_STACK, FALSE, FALSE); /* Clear all the error classes */ if(ncls > 0) { - H5I_clear_type(H5I_ERROR_CLASS, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_CLASS, FALSE, FALSE); /* Reset the HDF5 error class, if its been closed */ if(H5I_nmembers(H5I_ERROR_CLASS) == 0) @@ -312,7 +311,7 @@ H5E_term_interface(void) /* Clear all the error messages */ if(nmsg > 0) { - H5I_clear_type(H5I_ERROR_MSG, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_MSG, FALSE, FALSE); /* Reset the HDF5 error messages, if they've been closed */ if(H5I_nmembers(H5I_ERROR_MSG) == 0) { @@ -320,19 +319,21 @@ H5E_term_interface(void) #include "H5Eterm.h" } /* end if */ } /* end if */ + + n++; /*H5I*/ } /* end if */ else { /* Close deprecated interface */ n += H5E__term_deprec_interface(); /* Destroy the error class, message, and stack id groups */ - H5I_dec_type_ref(H5I_ERROR_STACK); - H5I_dec_type_ref(H5I_ERROR_CLASS); - H5I_dec_type_ref(H5I_ERROR_MSG); + (void)H5I_dec_type_ref(H5I_ERROR_STACK); + (void)H5I_dec_type_ref(H5I_ERROR_CLASS); + (void)H5I_dec_type_ref(H5I_ERROR_MSG); + n++; /*H5I*/ /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 932b857..17a35d9 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -26,7 +26,7 @@ #include "H5Ipublic.h" /* Value for the default error stack */ -#define H5E_DEFAULT 0 +#define H5E_DEFAULT (hid_t)0 /* Different kinds of error information */ typedef enum H5E_type_t { @@ -168,23 +168,28 @@ H5F_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_FILE)) != 0) { - H5I_clear_type(H5I_FILE, FALSE, FALSE); - } else { + if(H5I_nmembers(H5I_FILE) > 0) { + (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { /* Make certain we've cleaned up all the shared file objects */ H5F_sfile_assert_num(0); /* Close deprecated interface */ n += H5F__term_deprec_interface(); - H5I_dec_type_ref(H5I_FILE); + /* Destroy the file object id group */ + (void)H5I_dec_type_ref(H5I_FILE); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* H5F_term_interface() */ +} /* end H5F_term_interface() */ /*------------------------------------------------------------------------- @@ -200,16 +200,22 @@ H5FD_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n=H5I_nmembers(H5I_VFL))!=0) { - H5I_clear_type(H5I_VFL, FALSE, FALSE); - } else { - H5I_dec_type_ref(H5I_VFL); + if(H5I_nmembers(H5I_VFL) > 0) { + (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { + /* Destroy the VFL driver id group */ + (void)H5I_dec_type_ref(H5I_VFL); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) -} +} /* end H5FD_term_interface() */ /*------------------------------------------------------------------------- @@ -224,18 +224,20 @@ H5G_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_GROUP))) - H5I_clear_type(H5I_GROUP, FALSE, FALSE); + if(H5I_nmembers(H5I_GROUP) > 0) { + (void)H5I_clear_type(H5I_GROUP, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ else { /* Close deprecated interface */ n += H5G__term_deprec_interface(); /* Destroy the group object id group */ - H5I_dec_type_ref(H5I_GROUP); + (void)H5I_dec_type_ref(H5I_GROUP); + n++; /*H5I*/ /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 1efc521..72e3201 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -276,7 +276,7 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, */ if(H5I_dec_ref(cb_return) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") - cb_return = (-1); + cb_return = (hid_t)(-1); done: /* Close location given to callback. */ @@ -64,8 +64,8 @@ /* Local Macros */ /* Combine a Type number and an atom index into an atom */ -#define H5I_MAKE(g,i) ((((hid_t)(g)&TYPE_MASK)<<ID_BITS)| \ - ((hid_t)(i)&ID_MASK)) +#define H5I_MAKE(g,i) ((((hid_t)(g) & TYPE_MASK) << ID_BITS) | \ + ((hid_t)(i) & ID_MASK)) /* Local typedefs */ @@ -81,9 +81,8 @@ typedef struct H5I_id_info_t { typedef struct { const H5I_class_t *cls; /* Pointer to ID class */ unsigned init_count; /* # of times this type has been initialized*/ - hbool_t wrapped; /* Whether the id count has wrapped around */ - unsigned id_count; /* Current number of IDs held */ - unsigned nextid; /* ID to use for the next atom */ + uint64_t id_count; /* Current number of IDs held */ + uint64_t nextid; /* ID to use for the next atom */ H5SL_t *ids; /* Pointer to skip list that stores IDs */ } H5I_id_type_t; @@ -93,11 +92,6 @@ typedef struct { void *ret_obj; /* Object to return */ } H5I_search_ud_t; -/* User data for iterator callback when IDs have wrapped */ -typedef struct { - unsigned nextid; /* Next ID to expect */ -} H5I_wrap_ud_t; - /* User data for iterator callback for ID iteration */ typedef struct { H5I_search_func_t user_func; /* 'User' function to invoke */ @@ -340,7 +334,6 @@ H5I_register_type(const H5I_class_t *cls) /* Initialize the ID type structure for new types */ if(type_ptr->init_count == 0) { type_ptr->cls = cls; - type_ptr->wrapped = FALSE; type_ptr->id_count = 0; type_ptr->nextid = cls->reserved; if(NULL == (type_ptr->ids = H5SL_create(H5SL_TYPE_HID, NULL))) @@ -435,12 +428,12 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "supplied type does not exist") if(num_members) { - int members; + int64_t members; if((members = H5I_nmembers(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTCOUNT, FAIL, "can't compute number of members") - *num_members = (hsize_t)members; + H5_ASSIGN_OVERFLOW(*num_members, members, int64_t, hsize_t); } /* end if */ done: @@ -463,7 +456,7 @@ done: * *------------------------------------------------------------------------- */ -int +int64_t H5I_nmembers(H5I_type_t type) { H5I_id_type_t *type_ptr = NULL; @@ -477,7 +470,7 @@ H5I_nmembers(H5I_type_t type) HGOTO_DONE(0); /* Set return value */ - H5_ASSIGN_OVERFLOW(ret_value, type_ptr->id_count, unsigned, int); + H5_ASSIGN_OVERFLOW(ret_value, type_ptr->id_count, uint64_t, int64_t); done: FUNC_LEAVE_NOAPI(ret_value) @@ -734,47 +727,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5I__wrapped_cb - * - * Purpose: Callback for searching for next free ID, when IDs have wrapped - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Thursday, October 3, 2013 - * - *------------------------------------------------------------------------- - */ -static herr_t -H5I__wrapped_cb(void *_item, void UNUSED *_key, void *_udata) -{ - H5I_id_info_t *item = (H5I_id_info_t *)_item; /* Pointer to the ID node */ - H5I_wrap_ud_t *udata = (H5I_wrap_ud_t *)_udata; /* Pointer to user data */ - int ret_value = H5_ITER_CONT; /* Return value */ - - FUNC_ENTER_STATIC_NOERR - - /* Sanity check */ - HDassert(item); - HDassert(udata); - - /* Break out if we see a free ID */ - if(udata->nextid != item->id) { - /* Sanity check */ - HDassert(item->id > udata->nextid); - - ret_value = H5_ITER_STOP; - } /* end if */ - else - /* Increment to expect the next ID */ - udata->nextid++; - - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I__wrapped_cb() */ - - -/*------------------------------------------------------------------------- * Function: H5I_register * * Purpose: Registers an OBJECT in a TYPE and returns an ID for it. @@ -825,38 +777,9 @@ H5I_register(H5I_type_t type, const void *object, hbool_t app_ref) type_ptr->nextid++; /* - * This next section of code checks for the 'nextid' getting too large and - * wrapping around, thus necessitating checking for duplicate IDs being - * handed out. + * Sanity check for the 'nextid' getting too large and wrapping around. */ - if(type_ptr->nextid > (unsigned)ID_MASK) - type_ptr->wrapped = TRUE; - - /* - * If we've wrapped around then we need to check for duplicate id's being - * handed out. - */ - if(type_ptr->wrapped) { - H5I_wrap_ud_t udata; /* User data for iteration */ - herr_t iter_status; /* Iteration status */ - - /* Set up user data for iteration */ - udata.nextid = type_ptr->cls->reserved; - - /* Iterate over all the ID nodes, looking for a gap in the ID sequence */ - if((iter_status = H5SL_iterate(type_ptr->ids, H5I__wrapped_cb, &udata)) < 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADITER, FAIL, "ID iteration failed") - - /* If we didn't break out of the iteration and we're at the max. ID, we've used all the IDs */ - if(0 == iter_status && udata.nextid >= ID_MASK) - HGOTO_ERROR(H5E_ATOM, H5E_NOIDS, FAIL, "no IDs available in type") - - /* Sanity check */ - HDassert(udata.nextid < ID_MASK); - - /* Retain the next ID for the class */ - type_ptr->nextid = udata.nextid; - } /* end if */ + HDassert(type_ptr->nextid <= ID_MASK); /* Set return value */ ret_value = new_id; @@ -2325,9 +2248,8 @@ H5I__debug(H5I_type_t type) /* Header */ fprintf(stderr, " init_count = %u\n", type_ptr->init_count); fprintf(stderr, " reserved = %u\n", type_ptr->cls->reserved); - fprintf(stderr, " wrapped = %u\n", type_ptr->wrapped); - fprintf(stderr, " id_count = %u\n", type_ptr->id_count); - fprintf(stderr, " nextid = %u\n", type_ptr->nextid); + fprintf(stderr, " id_count = %llu\n", (unsigned long long)type_ptr->id_count); + fprintf(stderr, " nextid = %llu\n", (unsigned long long)type_ptr->nextid); /* List */ fprintf(stderr, " List:\n"); diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index dc8e867..1666b76 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -44,7 +44,7 @@ * field sizes and masks are calculated from TYPE_BITS. */ #define TYPE_BITS 7 -#define TYPE_MASK ((1<<TYPE_BITS)-1) +#define TYPE_MASK (((hid_t)1 << TYPE_BITS) - 1) #define H5I_MAX_NUM_TYPES TYPE_MASK @@ -52,11 +52,11 @@ * Number of bits to use for the Atom index in each atom (assumes 8-bit * bytes). We don't use the sign bit. */ -#define ID_BITS ((sizeof(hid_t)*8)-(TYPE_BITS+1)) -#define ID_MASK ((1<<ID_BITS)-1) +#define ID_BITS ((sizeof(hid_t) * 8) - (TYPE_BITS + 1)) +#define ID_MASK (((hid_t)1 << ID_BITS) - 1) /* Map an atom to an ID type number */ -#define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a)>>ID_BITS) & TYPE_MASK)) +#define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a) >> ID_BITS) & TYPE_MASK)) /****************************/ diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index b8f54f1..f438581 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -66,7 +66,7 @@ typedef struct H5I_class_t { /* Library-private Function Prototypes */ /***************************************/ H5_DLL herr_t H5I_register_type(const H5I_class_t *cls); -H5_DLL int H5I_nmembers(H5I_type_t type); +H5_DLL int64_t H5I_nmembers(H5I_type_t type); H5_DLL herr_t H5I_clear_type(H5I_type_t type, hbool_t force, hbool_t app_ref); H5_DLL hid_t H5I_register(H5I_type_t type, const void *object, hbool_t app_ref); H5_DLL void *H5I_subst(hid_t id, const void *new_object); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 5160434..3bf3c66 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -53,8 +53,8 @@ typedef enum H5I_type_t { } H5I_type_t; /* Type of atoms to return to users */ -typedef int hid_t; -#define H5_SIZEOF_HID_T H5_SIZEOF_INT +typedef int64_t hid_t; +#define H5_SIZEOF_HID_T H5_SIZEOF_INT64_T /* An invalid object ID. This is also negative for error return. */ #define H5I_INVALID_HID (-1) diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 20b57e5..ff2322f 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -40,7 +40,7 @@ #define H5L_MAX_LINK_NAME_LEN ((uint32_t)(-1)) /* (4GB - 1) */ /* Macro to indicate operation occurs on same location */ -#define H5L_SAME_LOC 0 +#define H5L_SAME_LOC (hid_t)0 /* Current version of the H5L_class_t struct */ #define H5L_LINK_CLASS_T_VERS 0 diff --git a/src/H5Pint.c b/src/H5Pint.c index 1545b6a..c71a39b 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -513,28 +513,27 @@ done: int H5P_term_interface(void) { - int nlist=0; - int nclass=0; - int n=0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { + int64_t nlist, nclass; + /* Destroy HDF5 library property classes & lists */ /* Check if there are any open property list classes or lists */ nclass = H5I_nmembers(H5I_GENPROP_CLS); nlist = H5I_nmembers(H5I_GENPROP_LST); - n=nclass+nlist; /* If there are any open classes or groups, attempt to get rid of them. */ - if(n) { + if((nclass + nlist) > 0) { /* Clear the lists */ - if(nlist>0) { - H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); + if(nlist > 0) { + (void)H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); /* Reset the default property lists, if they've been closed */ - if(H5I_nmembers(H5I_GENPROP_LST)==0) { + if(H5I_nmembers(H5I_GENPROP_LST) == 0) { H5P_LST_FILE_CREATE_ID_g = H5P_LST_FILE_ACCESS_ID_g = H5P_LST_DATASET_CREATE_ID_g = @@ -553,11 +552,11 @@ H5P_term_interface(void) } /* end if */ /* Only attempt to close the classes after all the lists are closed */ - if(nlist==0 && nclass>0) { - H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE); + if(nlist == 0 && nclass > 0) { + (void)H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE); /* Reset the default property lists, if they've been closed */ - if(H5I_nmembers(H5I_GENPROP_CLS)==0) { + if(H5I_nmembers(H5I_GENPROP_CLS) == 0) { H5P_CLS_ROOT_g = H5P_CLS_OBJECT_CREATE_g = H5P_CLS_FILE_CREATE_g = @@ -595,6 +594,8 @@ H5P_term_interface(void) H5P_CLS_FILE_MOUNT_ID_g = (-1); } /* end if */ } /* end if */ + + n++; /*H5I*/ } else { /* Close public interface */ n += H5P__term_pub_interface(); @@ -602,16 +603,19 @@ H5P_term_interface(void) /* Close deprecated interface */ n += H5P__term_deprec_interface(); - H5I_dec_type_ref(H5I_GENPROP_LST); + /* Destroy the property list and class id groups */ + (void)H5I_dec_type_ref(H5I_GENPROP_LST); n++; /*H5I*/ - H5I_dec_type_ref(H5I_GENPROP_CLS); + (void)H5I_dec_type_ref(H5I_GENPROP_CLS); n++; /*H5I*/ + /* Mark closed */ H5_interface_initialize_g = 0; - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) -} +} /* end H5P_term_interface() */ /*-------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index a3f13c5..f56692c 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -92,6 +92,9 @@ #define H5P_CRT_ORDER_TRACKED 0x0001 #define H5P_CRT_ORDER_INDEXED 0x0002 +/* Default value for all property list classes */ +#define H5P_DEFAULT (hid_t)0 + #ifdef __cplusplus extern "C" { #endif @@ -157,25 +157,30 @@ done: int H5R_term_interface(void) { - int n=0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5_interface_initialize_g) { - if ((n=H5I_nmembers(H5I_REFERENCE))) { - H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); - } else { + if(H5I_nmembers(H5I_REFERENCE) > 0) { + (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { /* Close deprecated interface */ n += H5R__term_deprec_interface(); - H5I_dec_type_ref(H5I_REFERENCE); + /* Destroy the reference id group */ + (void)H5I_dec_type_ref(H5I_REFERENCE); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ - } - } + } /* end else */ + } /* end if */ FUNC_LEAVE_NOAPI(n) -} +} /* end H5R_term_interface() */ /*-------------------------------------------------------------------------- @@ -145,16 +145,17 @@ H5S_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_DATASPACE))) { - H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); + if(H5I_nmembers(H5I_DATASPACE) > 0) { + (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); + n++; /*H5I*/ } /* end if */ else { - /* Free data types */ - H5I_dec_type_ref(H5I_DATASPACE); + /* Destroy the dataspace object id group */ + (void)H5I_dec_type_ref(H5I_DATASPACE); + n++; /*H5I*/ /* Shut down interface */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 105530a..7b2f61b 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -24,7 +24,7 @@ #include "H5Ipublic.h" /* Define atomic datatypes */ -#define H5S_ALL 0 +#define H5S_ALL (hid_t)0 #define H5S_UNLIMITED ((hsize_t)(hssize_t)(-1)) /* Define user-level maximum number of dimensions */ @@ -1436,20 +1436,23 @@ H5T_unlock_cb(void *_dt, hid_t UNUSED id, void UNUSED *key) int H5T_term_interface(void) { - int i, nprint=0, n=0; - H5T_path_t *path = NULL; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { + int i, nprint = 0; + /* Unregister all conversion functions */ for(i = 0; i < H5T_g.npaths; i++) { + H5T_path_t *path; + path = H5T_g.path[i]; HDassert(path); if(path->func) { H5T__print_stats(path, &nprint/*in,out*/); path->cdata.command = H5T_CONV_FREE; - if((path->func)(FAIL, FAIL, &(path->cdata), (size_t)0, + if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL,H5AC_dxpl_id) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { @@ -1486,7 +1489,9 @@ H5T_term_interface(void) /* Close deprecated interface */ n += H5T__term_deprec_interface(); - H5I_dec_type_ref(H5I_DATATYPE); + /* Destroy the datatype object id group */ + (void)H5I_dec_type_ref(H5I_DATATYPE); + n++; /*H5I*/ /* Reset all the datatype IDs */ H5T_IEEE_F32BE_g = FAIL; @@ -1586,7 +1591,6 @@ H5T_term_interface(void) /* Mark interface as closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end if */ FUNC_LEAVE_NOAPI(n) @@ -2580,7 +2584,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Shut down path */ H5T__print_stats(path, &nprint); path->cdata.command = H5T_CONV_FREE; - if((path->func)(FAIL, FAIL, &(path->cdata), + if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) { @@ -4394,7 +4398,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); H5T_g.path[0]->func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; - if(H5T__conv_noop(FAIL, FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); @@ -4553,7 +4557,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, HDassert(table == H5T_g.path[md]); H5T__print_stats(table, &nprint/*in,out*/); table->cdata.command = H5T_CONV_FREE; - if((table->func)(FAIL, FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if((table->func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) { fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free " @@ -971,7 +971,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, -1, -1, -1, H5Z_PRELUDE_CAN_APPLY) < 0) + if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -1008,7 +1008,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, -1, -1, -1, H5Z_PRELUDE_SET_LOCAL) < 0) + if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: diff --git a/src/H5overflow.h b/src/H5overflow.h index f4064f4..dc4ed2d 100644 --- a/src/H5overflow.h +++ b/src/H5overflow.h @@ -39,6 +39,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: unsigned dst: int */ +/* src: unsigned, dst: int64_t */ +#if H5_SIZEOF_UNSIGNED < H5_SIZEOF_INT64_T + #define ASSIGN_unsigned_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UNSIGNED > H5_SIZEOF_INT64_T + #define ASSIGN_unsigned_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UNSIGNED == H5_SIZEOF_INT64_T */ + #define ASSIGN_unsigned_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: unsigned dst: int64_t */ + /* src: unsigned, dst: uint8_t */ #if H5_SIZEOF_UNSIGNED < H5_SIZEOF_UINT8_T #define ASSIGN_unsigned_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -186,6 +198,18 @@ ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) #endif /* src: int dst: unsigned */ +/* src: int, dst: int64_t */ +#if H5_SIZEOF_INT < H5_SIZEOF_INT64_T + #define ASSIGN_int_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT > H5_SIZEOF_INT64_T + #define ASSIGN_int_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT == H5_SIZEOF_INT64_T */ + #define ASSIGN_int_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: int dst: int64_t */ + /* src: int, dst: uint8_t */ #if H5_SIZEOF_INT < H5_SIZEOF_UINT8_T #define ASSIGN_int_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -319,6 +343,165 @@ #endif /* src: int dst: h5_stat_size_t */ +/* Assignment checks for int64_t */ + +/* src: int64_t, dst: unsigned */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_UNSIGNED + #define ASSIGN_int64_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_UNSIGNED + #define ASSIGN_int64_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_UNSIGNED */ + #define ASSIGN_int64_t_TO_unsigned(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: unsigned */ + +/* src: int64_t, dst: int */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_INT + #define ASSIGN_int64_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_INT + #define ASSIGN_int64_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_INT */ + #define ASSIGN_int64_t_TO_int(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: int */ + +/* src: int64_t, dst: uint8_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_UINT8_T + #define ASSIGN_int64_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_UINT8_T + #define ASSIGN_int64_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_UINT8_T */ + #define ASSIGN_int64_t_TO_uint8_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: uint8_t */ + +/* src: int64_t, dst: uint16_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_UINT16_T + #define ASSIGN_int64_t_TO_uint16_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_UINT16_T + #define ASSIGN_int64_t_TO_uint16_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_UINT16_T */ + #define ASSIGN_int64_t_TO_uint16_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: uint16_t */ + +/* src: int64_t, dst: uint32_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_UINT32_T + #define ASSIGN_int64_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_UINT32_T + #define ASSIGN_int64_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_UINT32_T */ + #define ASSIGN_int64_t_TO_uint32_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: uint32_t */ + +/* src: int64_t, dst: uint64_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_UINT64_T + #define ASSIGN_int64_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_UINT64_T + #define ASSIGN_int64_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_UINT64_T */ + #define ASSIGN_int64_t_TO_uint64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: uint64_t */ + +/* src: int64_t, dst: ptrdiff_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_PTRDIFF_T + #define ASSIGN_int64_t_TO_ptrdiff_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_PTRDIFF_T + #define ASSIGN_int64_t_TO_ptrdiff_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_PTRDIFF_T */ + #define ASSIGN_int64_t_TO_ptrdiff_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: ptrdiff_t */ + +/* src: int64_t, dst: size_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_SIZE_T + #define ASSIGN_int64_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_SIZE_T + #define ASSIGN_int64_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_SIZE_T */ + #define ASSIGN_int64_t_TO_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: size_t */ + +/* src: int64_t, dst: ssize_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_SSIZE_T + #define ASSIGN_int64_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_SSIZE_T + #define ASSIGN_int64_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_SSIZE_T */ + #define ASSIGN_int64_t_TO_ssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: ssize_t */ + +/* src: int64_t, dst: haddr_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_HADDR_T + #define ASSIGN_int64_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_HADDR_T + #define ASSIGN_int64_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_HADDR_T */ + #define ASSIGN_int64_t_TO_haddr_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: haddr_t */ + +/* src: int64_t, dst: hsize_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_HSIZE_T + #define ASSIGN_int64_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_HSIZE_T + #define ASSIGN_int64_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_HSIZE_T */ + #define ASSIGN_int64_t_TO_hsize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: hsize_t */ + +/* src: int64_t, dst: hssize_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_HSSIZE_T + #define ASSIGN_int64_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_HSSIZE_T + #define ASSIGN_int64_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_HSSIZE_T */ + #define ASSIGN_int64_t_TO_hssize_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: hssize_t */ + +/* src: int64_t, dst: h5_stat_size_t */ +#if H5_SIZEOF_INT64_T < H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_int64_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_INT64_T > H5_SIZEOF_H5_STAT_SIZE_T + #define ASSIGN_int64_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_INT64_T == H5_SIZEOF_H5_STAT_SIZE_T */ + #define ASSIGN_int64_t_TO_h5_stat_size_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SIGNED_TO_UNSIGNED(dst, dsttype, src, srctype) +#endif /* src: int64_t dst: h5_stat_size_t */ + + /* Assignment checks for uint8_t */ /* src: uint8_t, dst: unsigned */ @@ -345,6 +528,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: uint8_t dst: int */ +/* src: uint8_t, dst: int64_t */ +#if H5_SIZEOF_UINT8_T < H5_SIZEOF_INT64_T + #define ASSIGN_uint8_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT8_T > H5_SIZEOF_INT64_T + #define ASSIGN_uint8_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT8_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_uint8_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint8_t dst: int64_t */ + /* src: uint8_t, dst: uint16_t */ #if H5_SIZEOF_UINT8_T < H5_SIZEOF_UINT16_T #define ASSIGN_uint8_t_TO_uint16_t(dst, dsttype, src, srctype) \ @@ -492,6 +687,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: uint16_t dst: int */ +/* src: uint16_t, dst: int64_t */ +#if H5_SIZEOF_UINT16_T < H5_SIZEOF_INT64_T + #define ASSIGN_uint16_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT16_T > H5_SIZEOF_INT64_T + #define ASSIGN_uint16_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT16_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_uint16_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint16_t dst: int64_t */ + /* src: uint16_t, dst: uint8_t */ #if H5_SIZEOF_UINT16_T < H5_SIZEOF_UINT8_T #define ASSIGN_uint16_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -639,6 +846,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: uint32_t dst: int */ +/* src: uint32_t, dst: int64_t */ +#if H5_SIZEOF_UINT32_T < H5_SIZEOF_INT64_T + #define ASSIGN_uint32_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT32_T > H5_SIZEOF_INT64_T + #define ASSIGN_uint32_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT32_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_uint32_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint32_t dst: int64_t */ + /* src: uint32_t, dst: uint8_t */ #if H5_SIZEOF_UINT32_T < H5_SIZEOF_UINT8_T #define ASSIGN_uint32_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -786,6 +1005,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: uint64_t dst: int */ +/* src: uint64_t, dst: int64_t */ +#if H5_SIZEOF_UINT64_T < H5_SIZEOF_INT64_T + #define ASSIGN_uint64_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_UINT64_T > H5_SIZEOF_INT64_T + #define ASSIGN_uint64_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_UINT64_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_uint64_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: uint64_t dst: int64_t */ + /* src: uint64_t, dst: uint8_t */ #if H5_SIZEOF_UINT64_T < H5_SIZEOF_UINT8_T #define ASSIGN_uint64_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -933,6 +1164,18 @@ ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) #endif /* src: ptrdiff_t dst: int */ +/* src: ptrdiff_t, dst: int64_t */ +#if H5_SIZEOF_PTRDIFF_T < H5_SIZEOF_INT64_T + #define ASSIGN_ptrdiff_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_PTRDIFF_T > H5_SIZEOF_INT64_T + #define ASSIGN_ptrdiff_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_PTRDIFF_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_ptrdiff_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: ptrdiff_t dst: int64_t */ + /* src: ptrdiff_t, dst: uint8_t */ #if H5_SIZEOF_PTRDIFF_T < H5_SIZEOF_UINT8_T #define ASSIGN_ptrdiff_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -1080,6 +1323,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: size_t dst: int */ +/* src: size_t, dst: int64_t */ +#if H5_SIZEOF_SIZE_T < H5_SIZEOF_INT64_T + #define ASSIGN_size_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SIZE_T > H5_SIZEOF_INT64_T + #define ASSIGN_size_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SIZE_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_size_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: size_t dst: int64_t */ + /* src: size_t, dst: uint8_t */ #if H5_SIZEOF_SIZE_T < H5_SIZEOF_UINT8_T #define ASSIGN_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -1227,6 +1482,18 @@ ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) #endif /* src: ssize_t dst: int */ +/* src: ssize_t, dst: int64_t */ +#if H5_SIZEOF_SSIZE_T < H5_SIZEOF_INT64_T + #define ASSIGN_ssize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_SSIZE_T > H5_SIZEOF_INT64_T + #define ASSIGN_ssize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_SSIZE_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_ssize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: ssize_t dst: int64_t */ + /* src: ssize_t, dst: uint8_t */ #if H5_SIZEOF_SSIZE_T < H5_SIZEOF_UINT8_T #define ASSIGN_ssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -1374,6 +1641,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: haddr_t dst: int */ +/* src: haddr_t, dst: int64_t */ +#if H5_SIZEOF_HADDR_T < H5_SIZEOF_INT64_T + #define ASSIGN_haddr_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HADDR_T > H5_SIZEOF_INT64_T + #define ASSIGN_haddr_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HADDR_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_haddr_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: haddr_t dst: int64_t */ + /* src: haddr_t, dst: uint8_t */ #if H5_SIZEOF_HADDR_T < H5_SIZEOF_UINT8_T #define ASSIGN_haddr_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -1521,6 +1800,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: hsize_t dst: int */ +/* src: hsize_t, dst: int64_t */ +#if H5_SIZEOF_HSIZE_T < H5_SIZEOF_INT64_T + #define ASSIGN_hsize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSIZE_T > H5_SIZEOF_INT64_T + #define ASSIGN_hsize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSIZE_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_hsize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hsize_t dst: int64_t */ + /* src: hsize_t, dst: uint8_t */ #if H5_SIZEOF_HSIZE_T < H5_SIZEOF_UINT8_T #define ASSIGN_hsize_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -1668,6 +1959,18 @@ ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) #endif /* src: hssize_t dst: int */ +/* src: hssize_t, dst: int64_t */ +#if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_INT64_T + #define ASSIGN_hssize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_HSSIZE_T > H5_SIZEOF_INT64_T + #define ASSIGN_hssize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_HSSIZE_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_hssize_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_SAME_SIGNED(dst, dsttype, src, srctype) +#endif /* src: hssize_t dst: int64_t */ + /* src: hssize_t, dst: uint8_t */ #if H5_SIZEOF_HSSIZE_T < H5_SIZEOF_UINT8_T #define ASSIGN_hssize_t_TO_uint8_t(dst, dsttype, src, srctype) \ @@ -1815,6 +2118,18 @@ ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) #endif /* src: h5_stat_size_t dst: int */ +/* src: h5_stat_size_t, dst: int64_t */ +#if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_INT64_T + #define ASSIGN_h5_stat_size_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_LARGER_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#elif H5_SIZEOF_H5_STAT_SIZE_T > H5_SIZEOF_INT64_T + #define ASSIGN_h5_stat_size_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SMALLER_SIZE(dst, dsttype, src, srctype) +#else /* H5_SIZEOF_H5_STAT_SIZE_T == H5_SIZEOF_INT64_T */ + #define ASSIGN_h5_stat_size_t_TO_int64_t(dst, dsttype, src, srctype) \ + ASSIGN_TO_SAME_SIZE_UNSIGNED_TO_SIGNED(dst, dsttype, src, srctype) +#endif /* src: h5_stat_size_t dst: int64_t */ + /* src: h5_stat_size_t, dst: uint8_t */ #if H5_SIZEOF_H5_STAT_SIZE_T < H5_SIZEOF_UINT8_T #define ASSIGN_h5_stat_size_t_TO_uint8_t(dst, dsttype, src, srctype) \ diff --git a/src/H5overflow.txt b/src/H5overflow.txt index c093fd5..3e9f069 100644 --- a/src/H5overflow.txt +++ b/src/H5overflow.txt @@ -32,6 +32,7 @@ unsigned, UNSIGNED; int, SIGNED; +int64_t, SIGNED; uint8_t, UNSIGNED; uint16_t, UNSIGNED; uint32_t, UNSIGNED; diff --git a/src/H5public.h b/src/H5public.h index 91af77f..44f94d4 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -282,9 +282,6 @@ H5_GCC_DIAG_ON(long-long) # error "nothing appropriate for uint64_t" #endif -/* Default value for all property list classes */ -#define H5P_DEFAULT 0 - /* Common iteration orders */ typedef enum { H5_ITER_UNKNOWN = -1, /* Unknown order */ diff --git a/test/cache_api.c b/test/cache_api.c index 66f8143..b1ccef1 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -3038,7 +3038,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pget_mdc_config(-1, &scratch); + result = H5Pget_mdc_config((hid_t)-1, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3109,7 +3109,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { H5E_BEGIN_TRY { - result = H5Pset_mdc_config(-1, &default_config); + result = H5Pset_mdc_config((hid_t)-1, &default_config); } H5E_END_TRY; if ( result >= 0 ) { @@ -3258,7 +3258,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_config(-1, &scratch); + result = H5Fget_mdc_config((hid_t)-1, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -3317,7 +3317,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fset_mdc_config(-1, &default_config); + result = H5Fset_mdc_config((hid_t)-1, &default_config); } H5E_END_TRY; if ( result >= 0 ) { @@ -3385,7 +3385,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_hit_rate(-1, &hit_rate); + result = H5Fget_mdc_hit_rate((hid_t)-1, &hit_rate); } H5E_END_TRY; if ( result >= 0 ) { @@ -3425,7 +3425,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Freset_mdc_hit_rate_stats(-1); + result = H5Freset_mdc_hit_rate_stats((hid_t)-1); } H5E_END_TRY; if ( result >= 0 ) { @@ -3446,7 +3446,7 @@ check_file_mdc_api_errs(void) } H5E_BEGIN_TRY { - result = H5Fget_mdc_size(-1, &max_size, &min_clean_size, + result = H5Fget_mdc_size((hid_t)-1, &max_size, &min_clean_size, &cur_size, &cur_num_entries); } H5E_END_TRY; diff --git a/test/cache_tagging.c b/test/cache_tagging.c index f644235..30ca1de 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -666,7 +666,7 @@ check_file_open_tags(hid_t fcpl, int type) /* =================== */ /* TEST: Open The File */ /* =================== */ - if ( (fid = H5Fopen(FILENAME, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) TEST_ERROR; /* =================================== */ /* Verification of Metadata Tag Values */ diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index b3d17dc..a782fb0 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2183,7 +2183,7 @@ main (int argc, char *argv[]) fprintf(stderr, "usage: %s [--noopt]\n", argv[0]); exit(1); } - H5Tunregister(H5T_PERS_DONTCARE, NULL, -1, -1, H5T__conv_struct_opt); + H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, H5T__conv_struct_opt); } /* Create the file */ diff --git a/test/dangle.c b/test/dangle.c index dfa73ba..4c8ce6b 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -599,7 +599,7 @@ test_dangle_force(void) FAIL_STACK_ERROR /* Get the number of open objects */ - if((count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL)) < 0) + if((count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL)) < 0) FAIL_STACK_ERROR if(0 == count) TEST_ERROR; @@ -608,7 +608,7 @@ test_dangle_force(void) objs = (hid_t*)HDmalloc(sizeof(hid_t) * (size_t)count); /* Get the list of open IDs */ - if(H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)count, objs) < 0) + if(H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)count, objs) < 0) FAIL_STACK_ERROR /* Close all open IDs */ @@ -617,7 +617,7 @@ test_dangle_force(void) H5Idec_ref(objs[u]); /* Get the number of open objects */ - if((count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL)) < 0) + if((count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL)) < 0) FAIL_STACK_ERROR if(0 != count) TEST_ERROR; diff --git a/test/dsets.c b/test/dsets.c index af99ee1..3055943 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -3843,7 +3843,7 @@ test_nbit_compound_3(hid_t file) for(k = 0; k < (i+1); k++) ((unsigned int *)orig_data[i].v.p)[k] = (unsigned int)(i*100 + k); /* Create reference to the dataset "nbit_obj_ref" */ - if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, -1) < 0) goto error; + if(H5Rcreate(&orig_data[i].r, file, "nbit_obj_ref", H5R_OBJECT, (hid_t)-1) < 0) goto error; for(j = 0; j < 5; j++) orig_data[i].o[j] = (unsigned char)(i + j); } diff --git a/test/dt_arith.c b/test/dt_arith.c index 1922f72..a93d1b8 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -1204,8 +1204,8 @@ test_derived_flt(void) src_size = H5Tget_size(tid2); dst_size = H5Tget_size(tid1); endian = H5Tget_order(tid2); - buf = (unsigned char *)HDmalloc(nelmts*(MAX(src_size, dst_size))); - saved_buf = (unsigned char *)HDmalloc(nelmts*src_size); + buf = (unsigned char *)HDmalloc(nelmts * (MAX(src_size, dst_size))); + saved_buf = (unsigned char *)HDmalloc(nelmts * src_size); HDmemset(buf, 0, nelmts * MAX(src_size, dst_size)); HDmemset(saved_buf, 0, nelmts*src_size); diff --git a/test/dtypes.c b/test/dtypes.c index f297b58..33d2bbc 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -65,7 +65,7 @@ FAIL_STACK_ERROR \ if((NMEMBS) != H5I_nmembers(H5I_DATATYPE)) { \ H5_FAILED(); \ - printf(" #dtype ids expected: %d; found: %d\n", NMEMBS, \ + printf(" #dtype ids expected: %lld; found: %d\n", (long long)NMEMBS, \ H5I_nmembers(H5I_DATATYPE)); \ goto error; \ } @@ -688,8 +688,9 @@ test_compound_2(void) const hsize_t four = 4; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - hid_t array_dt; - int i, nmembs; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound element reordering"); @@ -809,8 +810,9 @@ test_compound_3(void) const hsize_t four = 4; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - hid_t array_dt; - int i, nmembs; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound subset conversions"); @@ -931,8 +933,9 @@ test_compound_4(void) const hsize_t four = 4; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - hid_t array_dt; - int i, nmembs; + hid_t array_dt; + int64_t nmembs; + int i; TESTING("compound element shrinking & reordering"); @@ -1066,14 +1069,7 @@ test_compound_5(void) void *bkg = HDcalloc((size_t)2, sizeof(dst_type_t)); int retval = 1; -#if 1 TESTING("optimized struct converter"); -#else - /* Turn off optimized compound conversion function to work around - * the problem. */ - TESTING("optimized struct converter bug workaround"); - H5Tunregister(H5T_PERS_DONTCARE, "struct(opt)", -1, -1, NULL); -#endif /* Build datatypes */ short_array = H5Tcreate(H5T_COMPOUND, 4*sizeof(short)); @@ -1167,7 +1163,8 @@ test_compound_6(void) const size_t nelmts = NTESTELEM; unsigned char *buf=NULL, *orig=NULL, *bkg=NULL; hid_t st=-1, dt=-1; - int i, nmembs; + int64_t nmembs; + int i; TESTING("compound element growing"); @@ -1560,7 +1557,7 @@ test_compound_8(void) if(tsize != (sizeof(char) + sizeof(char) + sizeof(int))) { H5_FAILED(); AT(); - printf("The size of the packed compound datatype is incorrect\n"); + printf("The size of the packed compound datatype is incorrect: tsize = %zu\n", tsize); goto error; } /* end if */ diff --git a/test/err_compat.c b/test/err_compat.c index 346d397..576433e 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -40,7 +40,7 @@ const char *FILENAME[] = { int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; #define DSET_NAME "a_dataset" -#define FAKE_ID -1 +#define FAKE_ID (hid_t)-1 herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void* client_data); herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void* client_data); diff --git a/test/error_test.c b/test/error_test.c index 1ca9686..0d945d2 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -57,7 +57,7 @@ hid_t ERR_MIN_WRITE; hid_t ERR_MIN_GETNUM; #define DSET_NAME "a_dataset" -#define FAKE_ID 0 +#define FAKE_ID (hid_t)0 #define ERR_CLS_NAME "Error Test" #define ERR_CLS2_NAME "Second Test" diff --git a/test/external.c b/test/external.c index ae1008c..cbc9fc6 100644 --- a/test/external.c +++ b/test/external.c @@ -791,7 +791,7 @@ test_3 (hid_t fapl) } /* end if */ } /* end for */ - /* Extend the dataset by another 100 elements */ + /* Extend the dataset by another 100 elements */ if(H5Dset_extent(dset, &max_size) < 0) goto error; if(H5Sclose(file_space) < 0) goto error; if((file_space = H5Dget_space(dset)) < 0) goto error; diff --git a/test/fillval.c b/test/fillval.c index fc44f86..459620d 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -469,7 +469,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* 6. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; H5E_BEGIN_TRY { if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL) @@ -510,7 +510,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; H5E_BEGIN_TRY { if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL) goto error; @@ -1111,34 +1111,34 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0; nerrors += test_rdwr_cases(file, dcpl, "dset1", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset2", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0x4c70f1cd; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset3", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset4", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is undefined */ /* This case has been tested in test_create() function */ /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is undefined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset5", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined * as compound type */ @@ -1164,34 +1164,34 @@ test_rdwr(hid_t fapl, const char *base_name, H5D_layout_t layout) if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0; nerrors += test_rdwr_cases(file, dcpl, "dset6", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value to be default */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset7", &fillval, H5D_FILL_TIME_NEVER, layout, - H5T_INTEGER, -1); + H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; fillval = 0x4c70f1cd; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset8", &fillval, H5D_FILL_TIME_ALLOC, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is user-defined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset9", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is undefined */ /* This case has been tested in test_create() function */ /* case for H5D_FILL_TIME_NEVER as fill write time and fill value is undefined */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error; - if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error; + if(H5Pset_fill_value(dcpl, (hid_t)-1, NULL) < 0) goto error; nerrors += test_rdwr_cases(file, dcpl, "dset10", &fillval, H5D_FILL_TIME_NEVER, - layout, H5T_INTEGER, -1); + layout, H5T_INTEGER, (hid_t)-1); /* case for H5D_FILL_TIME_ALLOC as fill write time and fill value is user-defined * as compound type */ diff --git a/test/getname.c b/test/getname.c index 31440d6..2d999b9 100644 --- a/test/getname.c +++ b/test/getname.c @@ -2487,30 +2487,30 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR /* Create reference to dataset */ - if(H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to dataset */ - if(H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to group */ - if(H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to named datatype */ - if(H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR - if(H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR - if(H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR - if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Create reference to root group */ - if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, -1) < 0) + if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, (hid_t)-1) < 0) FAIL_STACK_ERROR /* Write selection to disk */ diff --git a/test/h5test.c b/test/h5test.c index 769e03f..d25b455 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -623,7 +623,7 @@ h5_fileaccess(void) void h5_no_hwconv(void) { - H5Tunregister(H5T_PERS_HARD, NULL, -1, -1, NULL); + H5Tunregister(H5T_PERS_HARD, NULL, (hid_t)-1, (hid_t)-1, NULL); } @@ -1113,7 +1113,7 @@ getenv_all(MPI_Comm comm, int root, const char* name) * *------------------------------------------------------------------------- */ -hid_t +int h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ diff --git a/test/links.c b/test/links.c index 53c62d4..f1e6daa 100644 --- a/test/links.c +++ b/test/links.c @@ -4145,7 +4145,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format) op_data.target_file = filename2; /* Core file driver has issues when used as the member file driver for a family file */ /* Family file driver cannot be used with family or multi drivers for member files */ - /* Also disable parellel member drivers, because IS_H5FD_MPI whould report FALSE, causing problems */ + /* Also disable parallel member drivers, because IS_H5FD_MPI whould report FALSE, causing problems */ base_driver = H5Pget_driver(fapl); op_data.base_fapl = (base_driver == H5FD_FAMILY || base_driver == H5FD_MULTI || base_driver == H5FD_MPIO || base_driver == H5FD_CORE) ? H5P_DEFAULT : fapl; @@ -6077,7 +6077,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) } H5E_END_TRY /* Test H5Rcreate */ - if(H5Rcreate(&obj_ref, fid1, "elink/elink/elink/type1_moved", H5R_OBJECT, (-1)) < 0) TEST_ERROR + if(H5Rcreate(&obj_ref, fid1, "elink/elink/elink/type1_moved", H5R_OBJECT, (hid_t)(-1)) < 0) TEST_ERROR /* Test unlink */ if(H5Ldelete(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT) < 0) TEST_ERROR @@ -12600,13 +12600,13 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, /* Check for iteration w/bad location ID */ skip = 0; H5E_BEGIN_TRY { - ret = H5Literate((-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); + ret = H5Literate((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL); } H5E_END_TRY; if(ret >= 0) TEST_ERROR #ifndef H5_NO_DEPRECATED_SYMBOLS H5E_BEGIN_TRY { - ret = H5Giterate((-1), ".", &gskip, group_iterate_old_cb, iter_info); + ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_cb, iter_info); } H5E_END_TRY; if(ret >= 0) TEST_ERROR #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/test/ntypes.c b/test/ntypes.c index c52c08f..bb6c973 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -2148,7 +2148,7 @@ test_refer_dtype(hid_t file) TEST_ERROR; /* Create reference to named datatype */ - if(H5Rcreate(wbuf, file, "/Group1/Datatype1", H5R_OBJECT, -1) < 0) + if(H5Rcreate(wbuf, file, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR; if(H5Rget_obj_type2(dataset, H5R_OBJECT, wbuf, &obj_type) < 0) TEST_ERROR; diff --git a/test/objcopy.c b/test/objcopy.c index 1377b96..0a1d7a0 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -269,8 +269,8 @@ attach_ref_attr(hid_t file_id, hid_t loc_id) if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data2) < 0) TEST_ERROR /* create an attribute with two object references */ - if(H5Rcreate(&ref[0], file_id, dsetname1, H5R_OBJECT, -1) < 0) TEST_ERROR - if(H5Rcreate(&ref[1], file_id, dsetname2, H5R_OBJECT, -1) < 0) TEST_ERROR + if(H5Rcreate(&ref[0], file_id, dsetname1, H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR + if(H5Rcreate(&ref[1], file_id, dsetname2, H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR if((aid = H5Acreate2(loc_id, "obj_ref_attr", H5T_STD_REF_OBJ, sid_ref, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR if(H5Awrite(aid, H5T_STD_REF_OBJ, ref) < 0) TEST_ERROR @@ -750,8 +750,8 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ /* Check raw data read in against data written out */ if(wbuf) { - if(!compare_data(aid, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, obj_owner)) TEST_ERROR - if(!compare_data(aid2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, obj_owner)) TEST_ERROR + if(!compare_data(aid, (hid_t)0, pid, tid, (size_t)nelmts, wbuf, rbuf, obj_owner)) TEST_ERROR + if(!compare_data(aid2, (hid_t)0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, obj_owner)) TEST_ERROR } /* end if */ /* Don't have written data, just compare data between the two attributes */ else @@ -1303,8 +1303,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) /* Check raw data read in against data written out */ if(wbuf) { - if(!compare_data(did, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, did)) TEST_ERROR - if(!compare_data(did2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2)) TEST_ERROR + if(!compare_data(did, (hid_t)0, pid, tid, (size_t)nelmts, wbuf, rbuf, did)) TEST_ERROR + if(!compare_data(did2, (hid_t)0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2)) TEST_ERROR } /* end if */ /* Don't have written data, just compare data between the two datasets */ else @@ -8045,8 +8045,8 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* Create references */ - if(H5Rcreate(&obj_buf[0], did1, ".", H5R_OBJECT, -1) < 0) TEST_ERROR - if(H5Rcreate(&obj_buf[1], did2, ".", H5R_OBJECT, -1) < 0) TEST_ERROR + if(H5Rcreate(&obj_buf[0], did1, ".", H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR + if(H5Rcreate(&obj_buf[1], did2, ".", H5R_OBJECT, (hid_t)-1) < 0) TEST_ERROR if(H5Rcreate(®_buf[0], did1, ".", H5R_DATASET_REGION, sid) < 0) TEST_ERROR if(H5Rcreate(®_buf[1], did2, ".", H5R_DATASET_REGION, sid) < 0) diff --git a/test/tattr.c b/test/tattr.c index 962883f..57b3263 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -4086,7 +4086,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) /* Get number of attributes with bad ID */ - ret = H5Aget_num_attrs(-1); + ret = H5Aget_num_attrs((hid_t)-1); VERIFY(ret, FAIL, "H5Aget_num_attrs"); /* Get number of attributes */ diff --git a/test/tfile.c b/test/tfile.c index 797b4fa..4bef41c 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1061,7 +1061,7 @@ test_get_obj_ids(void) H5Fclose(fid); /* Get the number of all opened objects */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, NDSETS, "H5Fget_obj_count"); @@ -1069,7 +1069,7 @@ test_get_obj_ids(void) CHECK(oid_list, NULL, "HDcalloc"); /* Get the list of all opened objects */ - ret_count = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); + ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, NDSETS, "H5Fget_obj_count"); @@ -1121,7 +1121,7 @@ test_get_file_id(void) CHECK(ret, FAIL, "H5Fclose"); /* Test H5Iget_file_id() */ - check_file_id(-1, group_id); + check_file_id((hid_t)-1, group_id); ret = H5Gclose(group_id); CHECK(ret, FAIL, "H5Gclose"); @@ -1260,32 +1260,32 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, CHECK(fid4, FAIL, "H5Fcreate"); /* test object count of all files IDs open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_FILE); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_FILE); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count"); /* test object count of all datasets open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATASET); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATASET); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_1, "H5Fget_obj_count"); /* test object count of all groups open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_GROUP); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_GROUP); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_3, "H5Fget_obj_count"); /* test object count of all named datatypes open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_DATATYPE); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATATYPE); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count"); /* test object count of all attributes open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ATTR); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ATTR); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count"); /* test object count of all objects currently open */ - oid_count = H5Fget_obj_count(H5F_OBJ_ALL, H5F_OBJ_ALL); + oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count"); @@ -1296,7 +1296,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, if(oid_list != NULL) { int i; - ret_count = H5Fget_obj_ids(H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); + ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); for(i = 0; i < oid_count; i++) { @@ -56,7 +56,7 @@ static int basic_id_test(void) /* Try to access IDs with ficticious types */ H5E_BEGIN_TRY - testPtr = H5Iobject_verify(100, (H5I_type_t) 0); + testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0); H5E_END_TRY VERIFY(testPtr, NULL, "H5Iobject_verify"); @@ -64,7 +64,7 @@ static int basic_id_test(void) goto out; H5E_BEGIN_TRY - testPtr = H5Iobject_verify(700, (H5I_type_t) 700); + testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700); H5E_END_TRY VERIFY(testPtr, NULL, "H5Iobject_verify"); @@ -336,8 +336,8 @@ out: static int test_is_valid(void) { hid_t dtype; /* datatype id */ - int nmembs1; /* number of type memnbers */ - int nmembs2; + int64_t nmembs1; /* number of type memnbers */ + int64_t nmembs2; htri_t tri_ret; /* htri_t return value */ herr_t ret; /* return value */ @@ -393,7 +393,7 @@ static int test_is_valid(void) goto out; /* Check that an id of -1 is invalid */ - tri_ret = H5Iis_valid(-1); + tri_ret = H5Iis_valid((hid_t)-1); VERIFY(tri_ret, FALSE, "H4Iis_valid"); if (tri_ret != FALSE) goto out; @@ -427,13 +427,13 @@ static int test_get_type(void) goto out; /* Check that the ID is correct */ - type_ret = H5Iget_type(H5T_STRING); + type_ret = H5Iget_type((hid_t)H5T_STRING); VERIFY(type_ret, H5I_BADID, "H5Iget_type"); if (type_ret != H5I_BADID) goto out; /* Check that the ID is correct */ - type_ret = H5Iget_type(-1); + type_ret = H5Iget_type((hid_t)-1); VERIFY(type_ret, H5I_BADID, "H5Iget_type"); if (type_ret != H5I_BADID) goto out; diff --git a/test/trefer.c b/test/trefer.c index 8f8a28e..7e08018 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -168,25 +168,25 @@ test_reference_params(void) CHECK(ret, FAIL, "H5Dcreate2"); /* Test parameters to H5Rcreate */ - ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate ref"); - ret = H5Rcreate(&wbuf[0], -1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], (hid_t)-1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate loc_id"); - ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate name"); - ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate null name"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, -1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate type"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, -1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, (hid_t)-1); VERIFY(ret, FAIL, "H5Rcreate region space"); - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, 0); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)0); VERIFY(ret, FAIL, "H5Rcreate space"); /* Test parameters to H5Rdereference */ - dset2 = H5Rdereference2(-1, H5P_DEFAULT, H5R_OBJECT, &rbuf[0]); + dset2 = H5Rdereference2((hid_t)-1, H5P_DEFAULT, H5R_OBJECT, &rbuf[0]); VERIFY(dset2, FAIL, "H5Rdereference2 loc_id"); - dset2 = H5Rdereference2(dataset, -1, H5R_OBJECT, &rbuf[0]); + dset2 = H5Rdereference2(dataset, (hid_t)-1, H5R_OBJECT, &rbuf[0]); VERIFY(dset2, FAIL, "H5Rdereference2 oapl_id"); dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, NULL); VERIFY(dset2, FAIL, "H5Rdereference2 ref"); @@ -194,7 +194,7 @@ test_reference_params(void) VERIFY(dset2, FAIL, "H5Rdereference2 type"); /* Test parameters to H5Rget_obj_type2 */ - ret = H5Rget_obj_type2(-1, H5R_OBJECT, &rbuf[0], NULL); + ret = H5Rget_obj_type2((hid_t)-1, H5R_OBJECT, &rbuf[0], NULL); VERIFY(ret, FAIL, "H5Rget_obj_type2 loc_id"); ret = H5Rget_obj_type2(fid1, H5R_OBJECT, NULL, NULL); VERIFY(ret, FAIL, "H5Rget_obj_type2 ref"); @@ -202,7 +202,7 @@ test_reference_params(void) VERIFY(ret, FAIL, "H5Rget_obj_type2 type"); /* Test parameters to H5Rget_name */ - name_size = H5Rget_name(-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0); + name_size = H5Rget_name((hid_t)-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0); VERIFY(name_size, FAIL, "H5Rget_name loc_id"); name_size = H5Rget_name(fid1, H5R_DATASET_REGION, NULL, NULL, 0); VERIFY(name_size, FAIL, "H5Rget_name ref"); @@ -210,7 +210,7 @@ test_reference_params(void) VERIFY(name_size, FAIL, "H5Rget_name type"); /* Test parameters to H5Rget_region */ - ret = H5Rget_region(-1, H5R_OBJECT, &rbuf[0]); + ret = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]); VERIFY(ret, FAIL, "H5Rget_region loc_id"); ret = H5Rget_region(fid1, H5R_OBJECT, NULL); VERIFY(ret, FAIL, "H5Rget_region ref"); @@ -349,28 +349,28 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[0], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[1], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); /* Create reference to group */ - ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[2], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type2"); /* Create reference to named datatype */ - ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[3], &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); @@ -1092,7 +1092,7 @@ test_reference_obj_deleted(void) CHECK(dataset, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &oref, &obj_type); CHECK(ret, FAIL, "H5Rget_obj_type2"); @@ -1247,7 +1247,7 @@ test_reference_group(void) CHECK(did, FAIL, "H5Dcreate2"); /* Create reference to group */ - ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, -1); + ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Write reference to disk */ @@ -1416,19 +1416,19 @@ test_reference_compat(void) CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to dataset */ - ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to group */ - ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Create reference to named datatype */ - ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1); + ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Write references to disk */ diff --git a/test/tunicode.c b/test/tunicode.c index 10ddddd..7dc3391 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -454,7 +454,7 @@ void test_objnames(hid_t fid, const char* string) CHECK(ret, FAIL, "H5Dcreate2"); /* Create reference to named datatype */ - ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, -1); + ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, (hid_t)-1); CHECK(ret, FAIL, "H5Rcreate"); /* Write selection and read it back*/ ret = H5Dwrite(dset_id, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &obj_ref); diff --git a/testpar/t_cache.c b/testpar/t_cache.c index b0fea36..7ce148a 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -2848,7 +2848,7 @@ expunge_entry(H5F_t * file_ptr, if ( nerrors == 0 ) { - result = H5AC_expunge_entry(file_ptr, -1, &(types[0]), + result = H5AC_expunge_entry(file_ptr, (hid_t)-1, &(types[0]), entry_ptr->header.addr, H5AC__NO_FLAGS_SET); if ( result < 0 ) { diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index f51acd4..49204f5 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -454,23 +454,23 @@ static herr_t gen_obj_ref(hid_t loc_id) /*-------------- * add group */ - oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } - H5Gclose(oid); + H5Gclose(oid); - status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, -1); + status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } - status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, -1); + status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index d554abd..80405e9 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -978,8 +978,8 @@ int test_attributes(const char *file, */ write_attr_in(did,"dset",fid,make_diffs); - write_attr_in(gid,NULL,0,make_diffs); - write_attr_in(root_id,NULL,0,make_diffs); + write_attr_in(gid,NULL,(hid_t)0,make_diffs); + write_attr_in(root_id,NULL,(hid_t)0,make_diffs); /* Close */ @@ -4127,9 +4127,9 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset9", tid9_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* obj references */ - status=H5Rcreate(&(comp9_buf.objref1),gid,"Compound_dset2",H5R_OBJECT,-1); - status=H5Rcreate(&(comp9_buf.objref2),gid,"Compound_dset3",H5R_OBJECT,-1); - status=H5Rcreate(&(comp9_buf.objref3),gid,"Compound_dset4",H5R_OBJECT,-1); + status=H5Rcreate(&(comp9_buf.objref1),gid,"Compound_dset2",H5R_OBJECT,(hid_t)-1); + status=H5Rcreate(&(comp9_buf.objref2),gid,"Compound_dset3",H5R_OBJECT,(hid_t)-1); + status=H5Rcreate(&(comp9_buf.objref3),gid,"Compound_dset4",H5R_OBJECT,(hid_t)-1); status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf); if (status < 0) @@ -5416,8 +5416,8 @@ void write_attr_in(hid_t loc_id, /* Create references to dataset */ if (dset_name) { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); + status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); } @@ -5698,7 +5698,7 @@ void write_attr_in(hid_t loc_id, { for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); @@ -6094,7 +6094,7 @@ void write_attr_in(hid_t loc_id, for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); @@ -6460,8 +6460,8 @@ void write_dset_in(hid_t loc_id, /* Create references to dataset */ if (dset_name) { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); + status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); } @@ -6675,7 +6675,7 @@ void write_dset_in(hid_t loc_id, { for (i = 0; i < 3; i++) { for (j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); @@ -6886,7 +6886,7 @@ void write_dset_in(hid_t loc_id, for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index c081ee0..64667cb 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -1937,7 +1937,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU datactx.need_prefix = TRUE; datactx.indent_level = ctx.indent_level; datactx.cur_column = ctx.cur_column; - status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, -1, NULL); + status = h5tools_dump_dset(rawoutstream, outputformat, &datactx, obj_id, NULL); } } else { diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 20fcf73..1a823c4 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -2080,16 +2080,16 @@ static void gent_objref(void) dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Create reference to dataset */ - H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1); + H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1); /* Create reference to dataset */ - H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, -1); + H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1); /* Create reference to group */ - H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, -1); + H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1); /* Create reference to named datatype */ - H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, -1); + H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1); /* Write selection to disk */ H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); @@ -3950,8 +3950,8 @@ static void write_attr_in(hid_t loc_id, /* Create references to dataset */ if(dset_name) { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); + status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); } @@ -4057,7 +4057,7 @@ static void write_attr_in(hid_t loc_id, { for(i = 0; i < 3; i++) { for(j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); @@ -4188,7 +4188,7 @@ static void write_attr_in(hid_t loc_id, for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { for(k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); @@ -4392,8 +4392,8 @@ static void write_dset_in(hid_t loc_id, /* Create references to dataset */ if(dset_name) { - status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1); - status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1); + status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1); write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); } @@ -4499,7 +4499,7 @@ static void write_dset_in(hid_t loc_id, { for(i = 0; i < 3; i++) { for(j = 0; j < 2; j++) { - status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); @@ -4642,7 +4642,7 @@ static void write_dset_in(hid_t loc_id, for(i = 0; i < 4; i++) { for(j = 0; j < 3; j++) { for(k = 0; k < 2; k++) - status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1); } } write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); @@ -4767,8 +4767,8 @@ static void gent_attr_all(void) */ write_attr_in(did,"dset",fid); - write_attr_in(group_id,NULL,0); - write_attr_in(root_id,NULL,0); + write_attr_in(group_id,NULL,(hid_t)0); + write_attr_in(root_id,NULL,(hid_t)0); /*------------------------------------------------------------------------- * write a series of datasets on group 2 diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 2030221..d0dd216 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1460,7 +1460,7 @@ dump_dataset_values(hid_t dset) h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); ctx.need_prefix = TRUE; ctx.cur_column = (size_t)curr_pos; - if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, -1, NULL) < 0) { + if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, NULL) < 0) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Unable to print data."); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, (size_t)info->line_ncols, (hsize_t)0, (hsize_t)0); diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 521b9bd..44bea47 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -39,7 +39,7 @@ #define CHECK_H5DRW_ERROR(_fun, _did, _mtid, _msid, _fsid, _pid, _buf) { \ H5E_BEGIN_TRY { \ if(_fun(_did, _mtid, _msid, _fsid, _pid, _buf) < 0) { \ - int _err_num = 0; \ + hid_t _err_num = 0; \ char _msg[80]; \ H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &_err_num); \ H5Eget_msg(_err_num, NULL, _msg, (size_t)80); \ diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index 2e05024..3f99704 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -189,7 +189,7 @@ int do_copy_refobjs(hid_t fidin, */ if((refname = MapIdToName(refobj_id, travt)) != NULL) { /* create the reference, -1 parameter for objects */ - if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, -1) < 0) + if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0) goto error; if(options->verbose) { diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index ba6b499..5ec9a8d 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -2282,7 +2282,7 @@ int make_deflate(hid_t loc_id) /* create a reference to the dataset, test second seeep of file for references */ - if (H5Rcreate(&bufref[0],loc_id,"dset_deflate",H5R_OBJECT,-1) < 0) + if (H5Rcreate(&bufref[0],loc_id,"dset_deflate",H5R_OBJECT,(hid_t)-1) < 0) goto out; if (write_dset(loc_id,1,dims1r,"ref",H5T_STD_REF_OBJ,bufref) < 0) goto out; @@ -3780,7 +3780,7 @@ int write_dset_in(hid_t loc_id, buf4[1]=0; if (dset_name) { - if (H5Rcreate(&buf4[0],file_id,dset_name,H5R_OBJECT,-1) < 0) + if (H5Rcreate(&buf4[0],file_id,dset_name,H5R_OBJECT,(hid_t)-1) < 0) goto out; if (write_dset(loc_id,1,dims1r,"refobj",H5T_STD_REF_OBJ,buf4) < 0) goto out; @@ -4015,7 +4015,7 @@ int write_dset_in(hid_t loc_id, /* Create references to dataset */ if (dset_name) { - if (H5Rcreate(&buf42[0][0], file_id, dset_name, H5R_OBJECT, -1) < 0) + if (H5Rcreate(&buf42[0][0], file_id, dset_name, H5R_OBJECT, (hid_t)-1) < 0) goto out; if (write_dset(loc_id, 2, dims2r, "refobj2D", H5T_STD_REF_OBJ, buf42) < 0) goto out; @@ -4234,7 +4234,7 @@ int write_dset_in(hid_t loc_id, /* Create references to dataset */ if (dset_name) { - if (H5Rcreate(&buf43[0][0][0], file_id, dset_name, H5R_OBJECT, -1) < 0) + if (H5Rcreate(&buf43[0][0][0], file_id, dset_name, H5R_OBJECT, (hid_t)-1) < 0) goto out; if (write_dset(loc_id, 3, dims3r, "refobj3D", H5T_STD_REF_OBJ, buf43) < 0) goto out; @@ -4692,9 +4692,9 @@ int write_attr_in(hid_t loc_id, /* object references ( H5R_OBJECT */ if (dset_name) { - if (H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1) < 0) + if (H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0) goto out; - if (H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1) < 0) + if (H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0) goto out; if (make_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4) < 0) goto out; @@ -5006,7 +5006,7 @@ int write_attr_in(hid_t loc_id, { for (j = 0; j < 2; j++) { - if (H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1) < 0) + if (H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0) goto out; } } @@ -5441,7 +5441,7 @@ int write_attr_in(hid_t loc_id, for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) - if (H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1) < 0) + if (H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,(hid_t)-1) < 0) goto out; } } @@ -5950,7 +5950,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id) * add attribute with obj ref type */ /* ref to dset */ - status = H5Rcreate(&data_attr_objref[0],file_id,NAME_OBJ_DS1,H5R_OBJECT,-1); + status = H5Rcreate(&data_attr_objref[0],file_id,NAME_OBJ_DS1,H5R_OBJECT,(hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -5959,7 +5959,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id) } /* ref to group */ - status = H5Rcreate(&data_attr_objref[1],file_id,NAME_OBJ_GRP,H5R_OBJECT,-1); + status = H5Rcreate(&data_attr_objref[1],file_id,NAME_OBJ_GRP,H5R_OBJECT,(hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -5968,7 +5968,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id) } /* ref to datatype */ - status = H5Rcreate(&data_attr_objref[2],file_id,NAME_OBJ_NDTYPE,H5R_OBJECT,-1); + status = H5Rcreate(&data_attr_objref[2],file_id,NAME_OBJ_NDTYPE,H5R_OBJECT,(hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6221,7 +6221,7 @@ static herr_t gen_obj_ref(hid_t loc_id) * Passing -1 as reference is an object.*/ /* obj ref to dataset */ - status = H5Rcreate (&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, -1); + status = H5Rcreate (&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6230,7 +6230,7 @@ static herr_t gen_obj_ref(hid_t loc_id) } /* obj ref to group */ - status = H5Rcreate (&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, -1); + status = H5Rcreate (&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6239,7 +6239,7 @@ static herr_t gen_obj_ref(hid_t loc_id) } /* obj ref to named-datatype */ - status = H5Rcreate (&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, -1); + status = H5Rcreate (&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6661,7 +6661,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) * Create the object references into compound type */ /* references to dataset */ - status = H5Rcreate (&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT,-1); + status = H5Rcreate (&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT,(hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6671,7 +6671,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) comp_objref_data[0].val_int = 0; /* references to group */ - status = H5Rcreate (&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT,-1); + status = H5Rcreate (&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT,(hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6681,7 +6681,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) comp_objref_data[1].val_int = 10; /* references to datatype */ - status = H5Rcreate (&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT,-1); + status = H5Rcreate (&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT,(hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6764,7 +6764,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) * create obj references */ /* reference to dataset */ - status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, -1); + status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6772,7 +6772,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) goto out; } /* reference to group */ - status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, -1); + status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); @@ -6780,7 +6780,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) goto out; } /* reference to datatype */ - status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, -1); + status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 3432a8b..8918a97 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1744,11 +1744,11 @@ CATCH */ int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, - hid_t dset, hid_t _p_type, struct subset_t *sset) + hid_t dset, struct subset_t *sset) { - hid_t f_space; - hid_t p_type = _p_type; - hid_t f_type; + hid_t f_space = -1; + hid_t p_type = -1; + hid_t f_type = -1; H5S_class_t space_type; int status = FAIL; h5tool_format_t info_dflt; @@ -1761,26 +1761,26 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * info = &info_dflt; } - if (p_type < 0) { - f_type = H5Dget_type(dset); - - if (info->raw || bin_form == 1) - p_type = H5Tcopy(f_type); - else if (bin_form == 2) - p_type = h5tools_get_little_endian_type(f_type); - else if (bin_form == 3) - p_type = h5tools_get_big_endian_type(f_type); - else - p_type = h5tools_get_native_type(f_type); + f_type = H5Dget_type(dset); + if (f_type < 0) + goto done; - H5Tclose(f_type); + if (info->raw || bin_form == 1) + p_type = H5Tcopy(f_type); + else if (bin_form == 2) + p_type = h5tools_get_little_endian_type(f_type); + else if (bin_form == 3) + p_type = h5tools_get_big_endian_type(f_type); + else + p_type = h5tools_get_native_type(f_type); - if (p_type < 0) - goto done; - } + if (p_type < 0) + goto done; /* Check the data space */ f_space = H5Dget_space(dset); + if (f_space < 0) + goto done; space_type = H5Sget_simple_extent_type(f_space); @@ -1795,12 +1795,13 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t * /* space is H5S_NULL */ status = SUCCEED; - /* Close the dataspace */ - H5Sclose(f_space); - done: - if (p_type != _p_type) + if (f_type > 0) + H5Tclose(f_type); + if (p_type > 0) H5Tclose(p_type); + if (f_space > 0) + H5Sclose(f_space); return status; } @@ -3855,7 +3856,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, } else datactx.need_prefix = TRUE; - status = h5tools_dump_dset(stream, info, &datactx, obj_id, -1, sset); + status = h5tools_dump_dset(stream, info, &datactx, obj_id, sset); if((display_char && H5Tget_size(f_type) == 1) && (H5Tget_class(f_type) == H5T_INTEGER)) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, "\""); diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index 061a3db..b05f226 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -40,7 +40,7 @@ H5TOOLS_DLL void h5tools_dump_init(void); H5TOOLS_DLL int h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t dset, - hid_t p_typ, struct subset_t *sset); + struct subset_t *sset); H5TOOLS_DLL int h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t obj_id, hid_t type, hid_t space, void *mem); diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 3664a29..79cf253 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -20,7 +20,8 @@ * print a warning message *------------------------------------------------------------------------- */ -static void print_warning(const char *dname, const char *fname) { +static void print_warning(const char *dname, const char *fname) +{ fprintf(stderr, "warning: dataset <%s> cannot be read, %s filter is not available\n", dname, fname); diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index 6729ed4..50c18c1 100644 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -395,8 +395,8 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, H5Dclose(did); /* 11 add object refs */ - H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, -1); - H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, -1); + H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1); + H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1); sprintf(name, "%05d obj refs", j); did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref); @@ -533,7 +533,7 @@ int add_attrs(hid_t oid, int idx) /* 4 single point */ sid = H5Screate_simple (1, dims1, NULL); - H5Rcreate(&ref, oid, ".", H5R_OBJECT, -1); + H5Rcreate(&ref, oid, ".", H5R_OBJECT, (hid_t)-1); sprintf(name, "%05d single float", idx); nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f); sprintf(name, "%05d single double", idx); |