diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-04-25 13:53:21 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2013-04-25 14:17:22 +1000 |
commit | 69c44a51de295a6eb91ab0fdb1777d222395dab0 (patch) | |
tree | 09af8f8189757e9eed9fff16169bb2bb920af96e | |
parent | 4f24161246f986453034d779e9ddaa1be9b5d336 (diff) | |
download | flac-69c44a51de295a6eb91ab0fdb1777d222395dab0.tar.gz |
test/test_metaflac.sh: POSIXify embedded awk script.
The embedded awk script was using the 'lshift' function which
apparently only exists in GNU auk (gawk) and definitely does not
exist in mawk.
Thanks to Martijn van Beurden <mvanb1@gmail.com> for reporting
this issue.
-rwxr-xr-x | test/test_metaflac.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_metaflac.sh b/test/test_metaflac.sh index 113e19fc..9a132918 100755 --- a/test/test_metaflac.sh +++ b/test/test_metaflac.sh @@ -399,6 +399,7 @@ echo OK tonegenerator () { + # When using GAWK, use --lint=posix to identify non-POSIX awk usages. awk -- ' BEGIN { samplerate = '$1'; @@ -407,7 +408,11 @@ tonegenerator () duration = 1; bitspersample = 24; - samplemidpoint = lshift(1, (bitspersample-1)); + samplemidpoint = 1; + for (sps = 0 ; sps < bitspersample - 1 ; sps++) { + samplemidpoint *= 2; + } + samplerange = samplemidpoint - 1; pi = 4 * atan2(1,1); |