mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[svn-r27956] Description:
Minor code cleanups, preparing to merge to trunk. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest not required on this branch)
This commit is contained in:
parent
914643490a
commit
c7c6623f28
@ -455,9 +455,6 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size)
|
||||
/* number of entries */
|
||||
*size += (size_t)8;
|
||||
|
||||
/* NULL pointer to pass to H5S_encode */
|
||||
tmp_p = NULL;
|
||||
|
||||
/* Iterate over entries */
|
||||
for(u = 0; u < layout->storage.u.virt.list_nused; u++) {
|
||||
/* Source file name */
|
||||
@ -470,12 +467,14 @@ H5P__dcrt_layout_enc(const void *value, void **_pp, size_t *size)
|
||||
|
||||
/* Source selection */
|
||||
tmp_size = (size_t)0;
|
||||
tmp_p = NULL;
|
||||
if(H5S_encode(layout->storage.u.virt.list[u].source_select, &tmp_p, &tmp_size) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize source selection")
|
||||
*size += tmp_size;
|
||||
|
||||
/* Virtual dataset selection */
|
||||
tmp_size = (size_t)0;
|
||||
tmp_p = NULL;
|
||||
if(H5S_encode(layout->storage.u.virt.list[u].source_dset.virtual_select, &tmp_p, &tmp_size) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTENCODE, FAIL, "unable to serialize virtual selection")
|
||||
*size += tmp_size;
|
||||
|
@ -1577,7 +1577,6 @@ herr_t
|
||||
H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc)
|
||||
{
|
||||
H5F_t *f = NULL; /* Fake file structure*/
|
||||
unsigned char *pp = (*p); /* Local pointer for decoding */
|
||||
size_t extent_size; /* Size of serialized dataspace extent */
|
||||
hssize_t sselect_size; /* Signed size of serialized dataspace selection */
|
||||
size_t select_size; /* Size of serialized dataspace selection */
|
||||
@ -1600,9 +1599,11 @@ H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc)
|
||||
|
||||
/* Verify the size of buffer. If it's not big enough, simply return the
|
||||
* right size without filling the buffer. */
|
||||
if(!pp || *nalloc < (extent_size + select_size + 1 + 1 + 1 + 4))
|
||||
if(!*p || *nalloc < (extent_size + select_size + 1 + 1 + 1 + 4))
|
||||
*nalloc = extent_size + select_size + 1 + 1 + 1 + 4;
|
||||
else {
|
||||
unsigned char *pp = (*p); /* Local pointer for decoding */
|
||||
|
||||
/* Encode the type of the information */
|
||||
*pp++ = H5O_SDSPACE_ID;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user