diff options
author | Sean McBride <sean@rogue-research.com> | 2023-08-02 13:39:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-02 13:39:15 (GMT) |
commit | 2b0badb90e4e516d0758efbd8ec96449188c7249 (patch) | |
tree | 074e38039b95ca7121a0117069974eff52a04519 /src/H5Zdeflate.c | |
parent | 56451503c55ef6e5f67fc3bb710f9e5b649b1af2 (diff) | |
download | hdf5-2b0badb90e4e516d0758efbd8ec96449188c7249.zip hdf5-2b0badb90e4e516d0758efbd8ec96449188c7249.tar.gz hdf5-2b0badb90e4e516d0758efbd8ec96449188c7249.tar.bz2 |
Made HGOTO_ERROR a do-while loop (#3308)
* Made HGOTO_ERROR a do-while loop
Diffstat (limited to 'src/H5Zdeflate.c')
-rw-r--r-- | src/H5Zdeflate.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index dccdf2c..b7a372b 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -72,7 +72,7 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] /* Check arguments */ if (cd_nelmts != 1 || cd_values[0] > 9) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level"); if (flags & H5Z_FLAG_REVERSE) { /* Input; uncompress */ @@ -81,7 +81,7 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] /* Allocate space for the compressed buffer */ if (NULL == (outbuf = H5MM_malloc(nalloc))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for deflate uncompression") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for deflate uncompression"); /* Set the uncompression parameters */ memset(&z_strm, 0, sizeof(z_strm)); @@ -92,7 +92,7 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] /* Initialize the uncompression routines */ if (Z_OK != inflateInit(&z_strm)) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflateInit() failed") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflateInit() failed"); /* Loop to uncompress the buffer */ do { @@ -106,7 +106,7 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] /* Check for error */ if (Z_OK != status) { (void)inflateEnd(&z_strm); - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflate() failed") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflate() failed"); } else { /* If we're not done and just ran out of buffer space, get more */ @@ -118,7 +118,7 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] if (NULL == (new_outbuf = H5MM_realloc(outbuf, nalloc))) { (void)inflateEnd(&z_strm); HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, - "memory allocation failed for deflate uncompression") + "memory allocation failed for deflate uncompression"); } /* end if */ outbuf = new_outbuf; @@ -158,7 +158,7 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] /* Allocate output (compressed) buffer */ if (NULL == (outbuf = H5MM_malloc(z_dst_nbytes))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate deflate destination buffer") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate deflate destination buffer"); z_dst = (Bytef *)outbuf; /* Perform compression from the source to the destination buffer */ @@ -166,11 +166,11 @@ H5Z__filter_deflate(unsigned flags, size_t cd_nelmts, const unsigned cd_values[] /* Check for various zlib errors */ if (Z_BUF_ERROR == status) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow"); else if (Z_MEM_ERROR == status) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "deflate memory error") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "deflate memory error"); else if (Z_OK != status) - HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "other deflate error") + HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "other deflate error"); /* Successfully uncompressed the buffer */ else { /* Free the input buffer */ |