summaryrefslogtreecommitdiffstats
path: root/src/H5HGcache.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-11-25 21:43:56 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-11-25 21:43:56 (GMT)
commitf2f8a554e65ee3e3ca501adf80fbdfd0225dac3f (patch)
treeef83cbaf3c9949a3ee9819a4a231ad3514c43735 /src/H5HGcache.c
parentedd529714302f9ed218d1e61d5f496fa788d10b4 (diff)
downloadhdf5-f2f8a554e65ee3e3ca501adf80fbdfd0225dac3f.zip
hdf5-f2f8a554e65ee3e3ca501adf80fbdfd0225dac3f.tar.gz
hdf5-f2f8a554e65ee3e3ca501adf80fbdfd0225dac3f.tar.bz2
Don't use C99 designated initializers, they're not compatible with
Visual Studio 2010.
Diffstat (limited to 'src/H5HGcache.c')
-rw-r--r--src/H5HGcache.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index a6c9996..e3d0f4c 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -205,11 +205,7 @@ static herr_t
H5HG__cache_heap_get_final_load_size(const void *image, size_t image_len,
void *udata, size_t *actual_len)
{
- /* Global heap, initialized because GCC 5.5 cannot see that
- * H5HG__hdr_deserialize() initializes. TBD condition on compiler
- * version.
- */
- H5HG_heap_t heap = {.size = 0};
+ H5HG_heap_t heap = {.size = 0}; /* Global heap */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -221,6 +217,12 @@ H5HG__cache_heap_get_final_load_size(const void *image, size_t image_len,
HDassert(*actual_len == image_len);
HDassert(image_len == H5HG_MINSIZE);
+ /* Initialize because GCC 5.5 cannot see that
+ * H5HG__hdr_deserialize() initializes.
+ *
+ * TBD condition on compiler version.
+ */
+ heap.size = 0;
/* Deserialize the heap's header */
if(H5HG__hdr_deserialize(&heap, (const uint8_t *)image, (const H5F_t *)udata) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, FAIL, "can't decode global heap prefix")