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

Відкрити
7 роки тому відкрито orbea · 0 коментарів
orbea відкоментовано 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.
Підпишіться щоб приєднатися до обговорення.
Етап відсутній
Немає відповідального
1 учасників
Завантажується...
Скасувати
Зберегти
Тут ще немає жодного вмісту.