diff options
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | hl/src/H5DS.c | 79 | ||||
-rw-r--r-- | hl/src/H5DSprivate.h | 2 | ||||
-rw-r--r-- | hl/src/H5IM.c | 12 | ||||
-rw-r--r-- | hl/src/H5LT.c | 19 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.c | 19 | ||||
-rw-r--r-- | hl/src/H5LTparse.c | 19 | ||||
-rw-r--r-- | hl/src/H5PT.c | 3 | ||||
-rw-r--r-- | hl/src/Makefile.in | 12 |
9 files changed, 107 insertions, 60 deletions
diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index f4d5a96..3c24e40 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -34,7 +34,7 @@ set (HL_HEADERS ) add_library (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} ${HL_SRCS} ${HL_HEADERS}) -TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} " " " ") +TARGET_C_PROPERTIES (${HDF5_HL_LIB_TARGET} ${LIB_TYPE} " " " ") target_link_libraries (${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET}) H5_SET_LIB_OPTIONS (${HDF5_HL_LIB_TARGET} ${HDF5_HL_LIB_NAME} ${LIB_TYPE}) set_target_properties (${HDF5_HL_LIB_TARGET} PROPERTIES diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index f4b754a..de6e66c 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -144,7 +144,8 @@ herr_t H5DSattach_scale(hid_t did, hid_t dsid_j; /* DS dataset ID in DIMENSION_LIST */ H5O_info_t oi1, oi2; H5I_type_t it1, it2; - int i, len; + int i; + size_t len; int found_ds=0; htri_t is_scale; @@ -242,7 +243,7 @@ herr_t H5DSattach_scale(hid_t did, if (has_dimlist == 0) { - dims[0] = rank; + dims[0] = (hsize_t)rank; /* space for the attribute */ if((sid = H5Screate_simple(1, dims, NULL)) < 0) @@ -477,7 +478,7 @@ herr_t H5DSattach_scale(hid_t did, dsbuf[nelmts - 1] = dsl; /* create a new data space for the new references array */ - dims[0] = nelmts; + dims[0] = (hsize_t)nelmts; if((sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; @@ -798,7 +799,7 @@ herr_t H5DSdetach_scale(hid_t did, for(ii=0; ii<nelmts; ii++) { /* First check if we have the same dimension index */ - if((int)idx == dsbuf[ii].dim_idx) { + if(idx == dsbuf[ii].dim_idx) { /* get the reference to the dataset */ ref = dsbuf[ii].ref; @@ -853,7 +854,7 @@ herr_t H5DSdetach_scale(hid_t did, if(nelmts) { /* create a new data space for the new references array */ - dims[0] = nelmts; + dims[0] = (hsize_t)nelmts; if((sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; @@ -1153,7 +1154,7 @@ htri_t H5DSis_attached(hid_t did, goto out; /* same object */ - if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && (int)idx==dsbuf[i].dim_idx) + if(oi3.fileno == oi4.fileno && oi3.addr == oi4.addr && idx==dsbuf[i].dim_idx) found_dset=1; /* close the dereferenced dataset */ @@ -1429,10 +1430,12 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) hid_t aid = -1; /* attribute ID */ int rank; /* rank of dataset */ hsize_t dims[1]; /* dimensions of dataset */ - const char **buf = NULL; /* buffer to store in the attribute */ H5I_type_t it; /* ID type */ unsigned int i; - + union { /* union is needed to eliminate compiler warnings about */ + char ** buf; /* discarding the 'const' qualifier in the free */ + char const ** const_buf; /* buf calls */ + } u; /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- @@ -1478,7 +1481,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) if (has_labels == 0) { - dims[0] = rank; + dims[0] = (hsize_t)rank; /* space for the attribute */ if ((sid = H5Screate_simple(1, dims, NULL)) < 0) @@ -1495,19 +1498,19 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; /* allocate and initialize */ - buf = (const char **) HDmalloc((size_t) rank * sizeof(char *)); + u.const_buf = (char const **) HDmalloc((size_t) rank * sizeof(char *)); - if (buf == NULL) + if (u.const_buf == NULL) goto out; for (i = 0; i < (unsigned int) rank; i++) - buf[i] = NULL; + u.const_buf[i] = NULL; /* store the label information in the required index */ - buf[idx] = label; + u.const_buf[idx] = label; /* write the attribute with the label */ - if (H5Awrite(aid, tid, buf) < 0) + if (H5Awrite(aid, tid, u.const_buf) < 0) goto out; /* close */ @@ -1517,10 +1520,10 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; if (H5Aclose(aid) < 0) goto out; - if (buf) + if (u.const_buf) { - HDfree(buf); - buf = NULL; + HDfree(u.const_buf); + u.const_buf = NULL; } } @@ -1531,6 +1534,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) else { + if ((aid = H5Aopen(did, DIMENSION_LABELS, H5P_DEFAULT)) < 0) goto out; @@ -1538,34 +1542,34 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; /* allocate and initialize */ - buf = (const char **) HDmalloc((size_t) rank * sizeof(char *)); - - if (buf == NULL) + u.buf = (char **) HDmalloc((size_t) rank * sizeof(char *)); + + if (u.buf == NULL) goto out; /* read */ - if (H5Aread(aid, tid, (void *) buf) < 0) + if (H5Aread(aid, tid, (void *)u.buf) < 0) goto out; /* free the ptr that will be replaced by label */ - if (buf[idx]) - HDfree(buf[idx]); + if (u.buf[idx]) + HDfree(u.buf[idx]); /* store the label information in the required index */ - buf[idx] = label; + u.const_buf[idx] = label; /* write the attribute with the new references */ - if (H5Awrite(aid, tid, buf) < 0) + if (H5Awrite(aid, tid, u.buf) < 0) goto out; /* label was brought in, so don't free */ - buf[idx] = NULL; + u.buf[idx] = NULL; /* free all the ptr's from the H5Aread() */ for (i = 0; i < (unsigned int) rank; i++) { - if (buf[i]) - HDfree(buf[i]); + if (u.buf[i]) + HDfree(u.buf[i]); } /* close */ @@ -1573,28 +1577,29 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; if (H5Aclose(aid) < 0) goto out; - if (buf) + if (u.buf) { - HDfree(buf); - buf = NULL; + HDfree(u.buf); + u.buf = NULL; } } return SUCCEED; /* error zone */ + out: - if (buf) + if (u.buf) { - if (buf[idx]) /* check if we errored during H5Awrite */ - buf[idx] = NULL; /* don't free label */ + if (u.buf[idx]) /* check if we errored during H5Awrite */ + u.buf[idx] = NULL; /* don't free label */ /* free all the ptr's from the H5Aread() */ for (i = 0; i < (unsigned int) rank; i++) { - if (buf[i]) - HDfree(buf[i]); + if (u.buf[i]) + HDfree(u.buf[i]); } - HDfree(buf); + HDfree(u.buf); } H5E_BEGIN_TRY { diff --git a/hl/src/H5DSprivate.h b/hl/src/H5DSprivate.h index 61c0a1c..39c3e74 100644 --- a/hl/src/H5DSprivate.h +++ b/hl/src/H5DSprivate.h @@ -28,7 +28,7 @@ /* attribute type of a DS dataset */ typedef struct ds_list_t { hobj_ref_t ref; /* object reference */ - int dim_idx; /* dimension index of the dataset */ + unsigned int dim_idx; /* dimension index of the dataset */ } ds_list_t; diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index aeda6ab..6fa548d 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -628,9 +628,9 @@ herr_t H5IMlink_palette( hid_t loc_id, n_refs = H5Sget_simple_extent_npoints(asid); - dim_ref = n_refs + 1; + dim_ref = (hsize_t)n_refs + 1; - refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (int)dim_ref ); + refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (size_t)dim_ref ); if ( H5Aread( aid, atid, refbuf ) < 0) goto out; @@ -949,9 +949,9 @@ herr_t H5IMget_palette_info( hid_t loc_id, n_refs = H5Sget_simple_extent_npoints(asid); - dim_ref = n_refs; + dim_ref = (hsize_t)n_refs; - refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (int)dim_ref ); + refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (size_t)dim_ref ); if ( H5Aread( aid, atid, refbuf ) < 0) goto out; @@ -1067,9 +1067,9 @@ herr_t H5IMget_palette( hid_t loc_id, n_refs = H5Sget_simple_extent_npoints(asid); - dim_ref = n_refs; + dim_ref = (hsize_t)n_refs; - refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (int)dim_ref ); + refbuf = (hobj_ref_t*)HDmalloc( sizeof(hobj_ref_t) * (size_t)dim_ref ); if ( H5Aread( aid, atid, refbuf ) < 0) goto out; diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 9d6123b..8541cfe 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -2398,7 +2398,7 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) for (i = 0; i < nmembs; i++) { if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL) goto out; - if(H5Tget_member_value(type, (unsigned)i, value + i * super_size) < 0) + if(H5Tget_member_value(type, (unsigned)i, value + (size_t)i * super_size) < 0) goto out; } @@ -2426,7 +2426,7 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) /*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size" *strangely, unless use another pointer "copy".*/ - copy = value+i*dst_size; + copy = value + (size_t)i * dst_size; if (H5T_SGN_NONE == H5Tget_sign(native)) HDsnprintf(tmp_str, TMP_LEN, "%u", *((unsigned int*)((void *)copy))); else @@ -2557,6 +2557,7 @@ char* H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *sl switch (tcls) { case H5T_INTEGER: + case H5T_BITFIELD: if (H5Tequal(dtype, H5T_STD_I8BE)) { HDsnprintf(dt_str, *slen, "H5T_STD_I8BE"); } else if (H5Tequal(dtype, H5T_STD_I8LE)) { @@ -3053,9 +3054,19 @@ next: case H5T_TIME: HDsnprintf(dt_str, *slen, "H5T_TIME: not yet implemented"); break; - case H5T_BITFIELD: - HDsnprintf(dt_str, *slen, "H5T_BITFIELD: not yet implemented"); + case H5T_NO_CLASS: + HDsnprintf(dt_str, *slen, "H5T_NO_CLASS"); break; + case H5T_REFERENCE: + if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == TRUE) { + HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }"); + } + else { + HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }"); + } + break; + case H5T_NCLASSES: + break; default: HDsnprintf(dt_str, *slen, "unknown data type"); } diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index d9ffb36..54e443d 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1,3 +1,22 @@ +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif #line 2 "H5LTanalyze.c" #line 4 "H5LTanalyze.c" diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c index aa12185..6ca95c54 100644 --- a/hl/src/H5LTparse.c +++ b/hl/src/H5LTparse.c @@ -1,3 +1,22 @@ +#if __GNUC__ >= 4 && __GNUC_MINOR__ >=2 +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" +#pragma GCC diagnostic ignored "-Wlarger-than=" +#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#pragma GCC diagnostic ignored "-Wnested-externs" +#pragma GCC diagnostic ignored "-Wold-style-definition" +#pragma GCC diagnostic ignored "-Wsign-compare" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wstrict-prototypes" +#pragma GCC diagnostic ignored "-Wswitch-default" +#pragma GCC diagnostic ignored "-Wunused-function" +#pragma GCC diagnostic ignored "-Wunused-macros" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#elif defined __SUNPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif /* A Bison parser, made by GNU Bison 2.7. */ /* Bison implementation for Yacc-like parsers in C diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index 7a0bc20..6ed1ac0 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -130,6 +130,9 @@ hid_t H5PTcreate_fl ( hid_t loc_id, if((table->type_id = H5Tcopy(dtype_id)) < 0) goto out; + if((table->type_id = H5Tget_native_type(table->type_id, H5T_DIR_DEFAULT)) < 0) + goto out; + H5PT_create_index(table); table->size = 0; diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index ee3ef49..8685b9e 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -407,7 +407,6 @@ AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ AM_LDFLAGS = @AM_LDFLAGS@ @H5_LDFLAGS@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -439,7 +438,6 @@ DIRECT_VFD = @DIRECT_VFD@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ -DYNAMIC_DIRS = @DYNAMIC_DIRS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -458,17 +456,14 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ -H5_CXX_SHARED = @H5_CXX_SHARED@ H5_FCFLAGS = @H5_FCFLAGS@ H5_FORTRAN_SHARED = @H5_FORTRAN_SHARED@ H5_LDFLAGS = @H5_LDFLAGS@ -H5_LONE_COLON = @H5_LONE_COLON@ H5_VERSION = @H5_VERSION@ HADDR_T = @HADDR_T@ HAVE_DMALLOC = @HAVE_DMALLOC@ @@ -531,7 +526,6 @@ R_INTEGER = @R_INTEGER@ R_LARGE = @R_LARGE@ SEARCH = @SEARCH@ SED = @SED@ -SETX = @SETX@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIZE_T = @SIZE_T@ @@ -546,10 +540,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ @@ -671,7 +661,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # After making changes, run bin/reconfigure to update other configure related # files like Makefile.in. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 205 +LT_VERS_REVISION = 206 LT_VERS_AGE = 0 # This library is our main target. |