Mercurial > hg > libxtract
comparison src/scalar.c @ 209:2bd416a4a0de
Set result value before return
author | Jamie Bullock <jamie@jamiebullock.com> |
---|---|
date | Tue, 11 Mar 2014 20:18:10 +0000 |
parents | d85e4b9aeb82 |
children | c99c00e1c508 |
comparison
equal
deleted
inserted
replaced
208:d85e4b9aeb82 | 209:2bd416a4a0de |
---|---|
989 double note = 0.0; | 989 double note = 0.0; |
990 | 990 |
991 note = 69 + log(f0 / 440.f) * 17.31234; | 991 note = 69 + log(f0 / 440.f) * 17.31234; |
992 note *= 100; | 992 note *= 100; |
993 note = round(note); | 993 note = round(note); |
994 | |
995 *result = note; | |
994 | 996 |
995 if (note > 12700 || note < 0) | 997 if (note > 12700 || note < 0) |
996 { | 998 { |
997 return XTRACT_ARGUMENT_ERROR; | 999 return XTRACT_ARGUMENT_ERROR; |
998 } | 1000 } |
999 | 1001 |
1000 *result = note; | 1002 return XTRACT_SUCCESS; |
1001 | 1003 } |
1002 return XTRACT_SUCCESS; | 1004 |
1003 } | |
1004 |