#2 (Shellcheck) SC2017: Increase precision by replacing a/b*c with a*c/b.

開啟中
orbea7 年之前創建 · 0 條評論
orbea commented 7 年之前

Shellcheck prints the following warning.

Line 305:
  asize="$(((${fline%%[ ]*}+512)/1024*${math:?}))"
                                ^-- SC2017: Increase precision by replacing a/b*c with a*c/b.

https://github.com/koalaman/shellcheck/wiki/SC2017

https://www.shellcheck.net/

This code does not necessarily require being precise, but it would be good to make it more precise anyways. The idea is that it should return a value in MB that is ~equivalent to the size of the .wav or .au files plus 100-200 MB to provide a safe cushion so that this script will not run out of space in $TMP. The problem is accounting for the size difference between the source files which could be a format such as flac and the output files which will likely be wav. If the source files are wav orSun/NeXT audio files there will be no conversion and this does not need to be accounted for. Additionally it should not cause new shellcheck warnings and should be done with pure/portable shell.

Shellcheck prints the following warning. ``` Line 305: asize="$(((${fline%%[ ]*}+512)/1024*${math:?}))" ^-- SC2017: Increase precision by replacing a/b*c with a*c/b. ``` https://github.com/koalaman/shellcheck/wiki/SC2017 https://www.shellcheck.net/ This code does not necessarily require being precise, but it would be good to make it more precise anyways. The idea is that it should return a value in `MB` that is ~equivalent to the size of the `.wav` or `.au` files plus 100-200 MB to provide a safe cushion so that this script will not run out of space in `$TMP`. The problem is accounting for the size difference between the source files which could be a format such as `flac` and the output files which will likely be `wav`. If the source files are `wav` or`Sun/NeXT` audio files there will be no conversion and this does not need to be accounted for. Additionally it should not cause new shellcheck warnings and should be done with pure/portable shell.
Sign in to join this conversation.
未選擇里程碑
未指派成員
1 參與者
正在加載...
取消
保存
尚未有任何內容