diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-10-06 19:09:59 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-10-06 19:09:59 (GMT) |
commit | 8e9b142d9cd347432d400b4f9b3b88a3f047c06d (patch) | |
tree | 47f400406beacaac0a987619ee17a7f4ef0bb44d /src/H5S.c | |
parent | 8d131aca15bca2d042ef175af5cf5a642d4c1152 (diff) | |
parent | 58db7babe40a10916a1c3b7667eaaeb5d48c2fb8 (diff) | |
download | hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.zip hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.tar.gz hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.tar.bz2 |
[svn-r27976] merge from trunk.
Diffstat (limited to 'src/H5S.c')
-rw-r--r-- | src/H5S.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -50,8 +50,6 @@ /* Local Prototypes */ /********************/ static htri_t H5S_is_simple(const H5S_t *sdim); -static herr_t H5S_encode(H5S_t *obj, unsigned char **p, size_t *nalloc); -static H5S_t *H5S_decode(const unsigned char **p); /*********************/ @@ -1575,11 +1573,10 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +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 */ @@ -1602,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; @@ -1693,7 +1692,7 @@ done: * *------------------------------------------------------------------------- */ -static H5S_t* +H5S_t* H5S_decode(const unsigned char **p) { H5F_t *f = NULL; /* Fake file structure*/ |