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

オープン
7 年 前orbea によって開かれました · 0 コメント
orbea7 年 前 にコメントしました

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 参加者
読み込み中…
キャンセル
保存
まだコンテンツがありません