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

Açık
orbea tarafından 7 yıl önce kere açıldı · 0 yorum
orbea 7 yıl önce olarak yorumlandı

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.
Giriş yap bu konuşmaya katılmak için.
Kilometre Taşı Yok
Atanan Kişi Yok
1 Katılımcı
Yükleniyor...
İptal
Kaydet
Henüz bir içerik yok.