mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-11 16:01:00 +08:00
Don't use C99 designated initializers, they're not compatible with
Visual Studio 2010.
This commit is contained in:
parent
edd5297143
commit
f2f8a554e6
@ -349,11 +349,7 @@ H5F__cache_superblock_get_final_load_size(const void *_image, size_t image_len,
|
|||||||
{
|
{
|
||||||
const uint8_t *image = _image; /* Pointer into raw data buffer */
|
const uint8_t *image = _image; /* Pointer into raw data buffer */
|
||||||
H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */
|
H5F_superblock_cache_ud_t *udata = (H5F_superblock_cache_ud_t *)_udata; /* User data */
|
||||||
/* Temporary file superblock, initialized because GCC 5.5 does not
|
H5F_super_t sblock; /* Temporary file superblock */
|
||||||
* realize that H5F__superblock_prefix_decode() initializes it.
|
|
||||||
* TBD condition on compiler version.
|
|
||||||
*/
|
|
||||||
H5F_super_t sblock = {.super_vers = 0, .sizeof_addr = 0, .sizeof_size = 0};
|
|
||||||
htri_t ret_value = SUCCEED; /* Return value */
|
htri_t ret_value = SUCCEED; /* Return value */
|
||||||
|
|
||||||
FUNC_ENTER_STATIC
|
FUNC_ENTER_STATIC
|
||||||
@ -365,6 +361,15 @@ H5F__cache_superblock_get_final_load_size(const void *_image, size_t image_len,
|
|||||||
HDassert(*actual_len == image_len);
|
HDassert(*actual_len == image_len);
|
||||||
HDassert(image_len >= H5F_SUPERBLOCK_FIXED_SIZE + 6);
|
HDassert(image_len >= H5F_SUPERBLOCK_FIXED_SIZE + 6);
|
||||||
|
|
||||||
|
/* Initialize because GCC 5.5 does not realize that
|
||||||
|
* H5F__superblock_prefix_decode() initializes it.
|
||||||
|
*
|
||||||
|
* TBD condition on compiler version.
|
||||||
|
*/
|
||||||
|
sblock.super_vers = 0;
|
||||||
|
sblock.sizeof_addr = 0;
|
||||||
|
sblock.sizeof_size = 0;
|
||||||
|
|
||||||
/* Deserialize the file superblock's prefix */
|
/* Deserialize the file superblock's prefix */
|
||||||
if(H5F__superblock_prefix_decode(&sblock, &image, udata, TRUE) < 0)
|
if(H5F__superblock_prefix_decode(&sblock, &image, udata, TRUE) < 0)
|
||||||
HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, FAIL, "can't decode file superblock prefix")
|
HGOTO_ERROR(H5E_FILE, H5E_CANTDECODE, FAIL, "can't decode file superblock prefix")
|
||||||
|
@ -406,12 +406,7 @@ static herr_t
|
|||||||
H5HF__cache_hdr_get_final_load_size(const void *_image, size_t image_len,
|
H5HF__cache_hdr_get_final_load_size(const void *_image, size_t image_len,
|
||||||
void *_udata, size_t *actual_len)
|
void *_udata, size_t *actual_len)
|
||||||
{
|
{
|
||||||
/* Temporary fractal heap header, initialized because GCC 5.5 does
|
H5HF_hdr_t hdr; /* Temporary fractal heap header */
|
||||||
* not realize that the H5HF__hdr_prefix_decode() call is sufficient
|
|
||||||
* to initialize. GCC 8 is clever enough to see that the variable
|
|
||||||
* is initialized. TBD condition on compiler version.
|
|
||||||
*/
|
|
||||||
H5HF_hdr_t hdr = {.filter_len = 0};
|
|
||||||
const uint8_t *image = (const uint8_t *)_image; /* Pointer into into supplied image */
|
const uint8_t *image = (const uint8_t *)_image; /* Pointer into into supplied image */
|
||||||
H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; /* User data for callback */
|
H5HF_hdr_cache_ud_t *udata = (H5HF_hdr_cache_ud_t *)_udata; /* User data for callback */
|
||||||
herr_t ret_value = SUCCEED; /* Return value */
|
herr_t ret_value = SUCCEED; /* Return value */
|
||||||
@ -424,6 +419,12 @@ H5HF__cache_hdr_get_final_load_size(const void *_image, size_t image_len,
|
|||||||
HDassert(actual_len);
|
HDassert(actual_len);
|
||||||
HDassert(*actual_len == image_len);
|
HDassert(*actual_len == image_len);
|
||||||
|
|
||||||
|
/* Initialize because GCC 5.5 does not realize that the
|
||||||
|
* H5HF__hdr_prefix_decode() call is sufficient to initialize.
|
||||||
|
* GCC 8 is clever enough to see that the variable is initialized.
|
||||||
|
* TBD condition on compiler version.
|
||||||
|
*/
|
||||||
|
hdr.filter_len = 0;
|
||||||
/* Deserialize the fractal heap header's prefix */
|
/* Deserialize the fractal heap header's prefix */
|
||||||
if(H5HF__hdr_prefix_decode(&hdr, &image) < 0)
|
if(H5HF__hdr_prefix_decode(&hdr, &image) < 0)
|
||||||
HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, FAIL, "can't decode fractal heap header prefix")
|
HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, FAIL, "can't decode fractal heap header prefix")
|
||||||
|
@ -205,11 +205,7 @@ static herr_t
|
|||||||
H5HG__cache_heap_get_final_load_size(const void *image, size_t image_len,
|
H5HG__cache_heap_get_final_load_size(const void *image, size_t image_len,
|
||||||
void *udata, size_t *actual_len)
|
void *udata, size_t *actual_len)
|
||||||
{
|
{
|
||||||
/* Global heap, initialized because GCC 5.5 cannot see that
|
H5HG_heap_t heap = {.size = 0}; /* Global heap */
|
||||||
* H5HG__hdr_deserialize() initializes. TBD condition on compiler
|
|
||||||
* version.
|
|
||||||
*/
|
|
||||||
H5HG_heap_t heap = {.size = 0};
|
|
||||||
herr_t ret_value = SUCCEED; /* Return value */
|
herr_t ret_value = SUCCEED; /* Return value */
|
||||||
|
|
||||||
FUNC_ENTER_STATIC
|
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(*actual_len == image_len);
|
||||||
HDassert(image_len == H5HG_MINSIZE);
|
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 */
|
/* Deserialize the heap's header */
|
||||||
if(H5HG__hdr_deserialize(&heap, (const uint8_t *)image, (const H5F_t *)udata) < 0)
|
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")
|
HGOTO_ERROR(H5E_HEAP, H5E_CANTDECODE, FAIL, "can't decode global heap prefix")
|
||||||
|
Loading…
Reference in New Issue
Block a user