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

Otevřený
otevřeno před 7 roky uživatelem orbea · 0 komentářů
orbea okomentoval před 7 roky

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.
Přihlaste se pro zapojení do konverzace.
Bez milníku
Bez zpracovatele
1 účastníků
Načítání...
Zrušit
Uložit
Není zde žádný obsah.