diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2018-10-15 17:35:32 (GMT) |
---|---|---|
committer | Larry Knox <lrknox@hdfgroup.org> | 2018-10-15 17:35:32 (GMT) |
commit | 5eef94f83f4875b64ffe7f9cea05d965bddbd802 (patch) | |
tree | 98e19e98333de2fcdf6f8f9a777528dde879733d /hl/src | |
parent | 6569f208b8f39ace9e442e94ab110bec94c67d37 (diff) | |
parent | f3f29dc7df5f3cc41a5e9462d8c415e540cda3d6 (diff) | |
download | hdf5-5eef94f83f4875b64ffe7f9cea05d965bddbd802.zip hdf5-5eef94f83f4875b64ffe7f9cea05d965bddbd802.tar.gz hdf5-5eef94f83f4875b64ffe7f9cea05d965bddbd802.tar.bz2 |
Merge pull request #1296 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.10/master to 1.10/master
* commit 'f3f29dc7df5f3cc41a5e9462d8c415e540cda3d6': (42 commits)
Commit version string changes for HDF5 1.10.4 release.
Merge hdf5_1_10 changes to hdf5_1_10_4.
Merge in changes from hdf5_1_10.
Commit release date change.
Update RELEASE.txt for HDF5 1.10.4 release.
Add notes about unsupported options
Add contents of HDF5 1.10.3 RELEASE.txt to HISTORY-1_10.txt and update RELEASE.txt for continuing development.
Switch maintainer mode to disable, build mode to production, version to 1.10.4, and commit files generated by autogen.sh for release branch hdf5_1_10_4.
HDFFV-10568 fix hdf5_java library dependency
Fix Java library location for testing
Java groups example fix
Update system commands with HD prefix and whitespace
Merge pull request #1224 in HDFFV/hdf5 from ~JHENDERSON/hdf5:develop to develop
Disable failing tests because of execution issue
Add testfiles to data copy
Same changes needed for examples as test
Correct name of test jar
Only remove test jars
Remove obsolete var
Change prefix in example scripts to relative path to bin. This was done for 1.8, and works wherever installed without the need to replace the original prefix.
...
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5DS.c | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index d86cc98..067992f 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -241,7 +241,7 @@ herr_t H5DSattach_scale(hid_t did, if (has_dimlist == 0) { - dims[0] = (hsize_t)rank; + dims[0] = (hsize_t)rank; /* space for the attribute */ if((sid = H5Screate_simple(1, dims, NULL)) < 0) @@ -556,9 +556,9 @@ out: * * Date: December 20, 2004 * -* Comments: +* Comments: * -* Modifications: Function didn't delete DIMENSION_LIST attribute, when +* Modifications: Function didn't delete DIMENSION_LIST attribute, when * all dimension scales were detached from a dataset; added. * 2010/05/13 EIP * @@ -706,24 +706,24 @@ herr_t H5DSdetach_scale(hid_t did, /* same object, reset */ if(dsid_oi.fileno == tmp_oi.fileno && dsid_oi.addr == tmp_oi.addr) { - /* If there are more than one reference in the VL element + /* If there are more than one reference in the VL element and the reference we found is not the last one, copy the last one to replace the found one since the order - of the references doesn't matter according to the spec; - reduce the size of the VL element by 1; - if the length of the element becomes 0, free the pointer + of the references doesn't matter according to the spec; + reduce the size of the VL element by 1; + if the length of the element becomes 0, free the pointer and reset to NULL */ size_t len = buf[idx].len; - if(j < len - 1) - ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1]; + if(j < len - 1) + ((hobj_ref_t *)buf[idx].p)[j] = ((hobj_ref_t *)buf[idx].p)[len-1]; len = --buf[idx].len; if(len == 0) { - HDfree(buf[idx].p); + HDfree(buf[idx].p); buf[idx].p = NULL; } - /* Since a reference to a dim. scale can be inserted only once, + /* Since a reference to a dim. scale can be inserted only once, we do not need to continue the search if it is found */ found_ds = 1; break; @@ -736,16 +736,16 @@ herr_t H5DSdetach_scale(hid_t did, goto out; /* Write the attribute, but check first, if we have any scales left, - because if not, we should delete the attribute according to the spec */ + because if not, we should delete the attribute according to the spec */ for(i = 0; i < rank; i++) { if(buf[i].len > 0) { have_ds = 1; - break; + break; } } - if(have_ds) { + if(have_ds) { if(H5Awrite(aid, tid, buf) < 0) - goto out; + goto out; } else { if(H5Adelete(did, DIMENSION_LIST) < 0) @@ -1123,7 +1123,7 @@ htri_t H5DSis_attached(hid_t did, if (dsbuf == NULL) goto out; - if (H5Aread(aid,ntid,dsbuf) < 0) + if (H5Aread(aid,ntid,dsbuf) < 0) goto out; /*------------------------------------------------------------------------- @@ -1445,7 +1445,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) if (H5I_DATASET != it) return FAIL; - if (label == NULL) + if (label == NULL) return FAIL; /* get dataset space */ @@ -1502,7 +1502,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) goto out; for (i = 0; i < (unsigned int) rank; i++) - u.const_buf[i] = NULL; + u.const_buf[i] = NULL; /* store the label information in the required index */ u.const_buf[idx] = label; @@ -1532,7 +1532,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; @@ -1541,7 +1541,7 @@ herr_t H5DSset_label(hid_t did, unsigned int idx, const char *label) /* allocate and initialize */ u.buf = (char **) HDmalloc((size_t) rank * sizeof(char *)); - + if (u.buf == NULL) goto out; @@ -1626,7 +1626,7 @@ out: * Comments: * * Modifications: -* JIRA HDFFV-7673: Added a check to see if the label name exists, +* JIRA HDFFV-7673: Added a check to see if the label name exists, * if not then returns zero. July 30, 2011. MSB * *------------------------------------------------------------------------- @@ -1714,26 +1714,26 @@ ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) if (buf[idx] != NULL) { /* get the real string length */ - nbytes = strlen(buf[idx]); + nbytes = HDstrlen(buf[idx]); - /* compute the string length which will fit into the user's buffer */ - copy_len = MIN(size-1, nbytes); + /* compute the string length which will fit into the user's buffer */ + copy_len = MIN(size-1, nbytes); - /* copy all/some of the name */ - if (label) - { - memcpy(label, buf[idx], copy_len); - - /* terminate the string */ - label[copy_len] = '\0'; - } + /* copy all/some of the name */ + if (label) + { + HDmemcpy(label, buf[idx], copy_len); + + /* terminate the string */ + label[copy_len] = '\0'; + } } /* free all the ptr's from the H5Aread() */ for (i = 0; i < rank; i++) { if (buf[i]) - HDfree(buf[i]); + HDfree(buf[i]); } /* close */ @@ -1867,7 +1867,7 @@ ssize_t H5DSget_scale_name(hid_t did, /* copy all/some of the name */ if (name) { - memcpy(name, buf, copy_len); + HDmemcpy(name, buf, copy_len); /* terminate the string */ name[copy_len]='\0'; @@ -1951,33 +1951,33 @@ htri_t H5DSis_scale(hid_t did) if((tid = H5Aget_type(aid)) < 0) goto out; - /* check to make sure attribute is a string */ - if(H5T_STRING != H5Tget_class(tid)) - goto out; + /* check to make sure attribute is a string */ + if(H5T_STRING != H5Tget_class(tid)) + goto out; - /* check to make sure string is null-terminated */ - if(H5T_STR_NULLTERM != H5Tget_strpad(tid)) - goto out; + /* check to make sure string is null-terminated */ + if(H5T_STR_NULLTERM != H5Tget_strpad(tid)) + goto out; - /* allocate buffer large enough to hold string */ - if((storage_size = H5Aget_storage_size(aid)) == 0) - goto out; + /* allocate buffer large enough to hold string */ + if((storage_size = H5Aget_storage_size(aid)) == 0) + goto out; - buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1); - if(buf == NULL) - goto out; + buf = (char*)HDmalloc( (size_t)storage_size * sizeof(char) + 1); + if(buf == NULL) + goto out; - /* Read the attribute */ + /* Read the attribute */ if(H5Aread(aid, tid, buf) < 0) - goto out; + goto out; - /* compare strings */ + /* compare strings */ if(HDstrncmp(buf, DIMENSION_SCALE_CLASS, MIN(HDstrlen(DIMENSION_SCALE_CLASS),HDstrlen(buf)))==0) is_ds = 1; else is_ds = 0; - HDfree(buf); + HDfree(buf); if(H5Tclose(tid) < 0) goto out; @@ -2236,8 +2236,8 @@ out: static hid_t H5DS_get_REFLIST_type(void) { - hid_t ntid_t = -1; - + hid_t ntid_t = -1; + /* Build native type that corresponds to compound datatype used to store ds_list_t structure in the REFERENCE_LIST attribute */ @@ -2257,5 +2257,5 @@ out: H5Tclose(ntid_t); } H5E_END_TRY; return FAIL; -} +} |