Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting of filters #1173

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion filters/H5Zbitshuffle/src/H5Zbitshuffle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ function H5Z_filter_bitshuffle(
end

size = nbytes_uncomp ÷ elem_size
buf_size_out <= 0 && error("bitshuffle_h5plugin: Non-positive buf_size_out for malloc: $buf_size_out")
buf_size_out <= 0 && error(
"bitshuffle_h5plugin: Non-positive buf_size_out for malloc: $buf_size_out"
)
out_buf = Libc.malloc(buf_size_out)
if out_buf == C_NULL
error(
Expand Down
6 changes: 4 additions & 2 deletions filters/H5Zbzip2/src/H5Zbzip2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function H5Z_filter_bzip2(
# Decompress

outbuflen = nbytes * 3 + 1
outbuflen <= 0 && error("H5Zbzip2: Non-positive outbuflen for malloc: $outbuflen.")
outbuflen <= 0 &&
error("H5Zbzip2: Non-positive outbuflen for malloc: $outbuflen.")
outbuf = Libc.malloc(outbuflen)
if outbuf == C_NULL
error("H5Zbzip2: memory allocation failed for bzip2 decompression.")
Expand Down Expand Up @@ -107,7 +108,8 @@ function H5Z_filter_bzip2(

# Prepare the output buffer
outbuflen = nbytes + nbytes ÷ 100 + 600 # worse case (bzip2 docs)
outbuflen <= 0 && error("H5Zbzip2: Non-positive outbuflen for malloc: $outbuflen.")
outbuflen <= 0 &&
error("H5Zbzip2: Non-positive outbuflen for malloc: $outbuflen.")
outbuf = Libc.malloc(outbuflen)
@debug "Allocated" outbuflen outbuf
if outbuf == C_NULL
Expand Down
3 changes: 2 additions & 1 deletion filters/H5Zlz4/src/H5Zlz4.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ function H5Z_filter_lz4(
nBlocks = (nbytes - 1) ÷ blockSize + 1
maxDestSize =
nBlocks * CodecLz4.LZ4_compressBound(blockSize) + 4 + 8 + nBlocks * 4
maxDestSize <= 0 && error("H5Zlz4: Non-positive maxDestSize for malloc: $maxDestSize")
maxDestSize <= 0 &&
error("H5Zlz4: Non-positive maxDestSize for malloc: $maxDestSize")
outBuf = Libc.malloc(maxDestSize)
outBuf == C_NULL && error("H5Zlz4: Could not allocate memory via malloc")

Expand Down
Loading