Showing the changes to Spectacle/SpectacleBase.cpp (1 of 6 files). Show all
Unified · Split
| @@ -36,6 +36,15 @@ · 35 unmodified lines | ||
| 36 | 36 | #define atan2f(y, x) atan2((y), (x)) |
| 37 | 37 | #endif |
| 38 | 38 | |
| 39 | +#ifdef WIN32 | |
| 40 | +#include <stdlib.h> | |
| 41 | +#define random() rand() | |
| 42 | +#endif | |
| 43 | +#ifndef M_PI | |
| 44 | +#define M_PI 3.14159265358979323846 | |
| 45 | +#endif | |
| 46 | + | |
| 47 | + | |
| 39 | 48 | const int kMaxWindowLen = kMaxFFTLen * 8; |
| 40 | 49 | const int kMinOverlap = 1; |
| 41 | 50 | const int kMaxOverlap = 64; |
| @@ -522,7 +531,7 @@ void SpectacleBase::update_bin_groups( · 480 unmodified lines | ||
| 522 | 531 | const int extrabins = (highshelfbin - lowshelfbin) - cntltablen; |
| 523 | 532 | //if (extrabins <= 0) |
| 524 | 533 | //error("%s: program error - contact johgibso@gmail.com", instname()); |
| 525 | − const int nsums = int(sqrt(2 * extrabins) + 2); | |
| 534 | + const int nsums = int(sqrt(2.0 * extrabins) + 2.0); | |
| 526 | 535 | |
| 527 | 536 | // Compute the sum of integers for n in [nsums-2, nsums); |
| 528 | 537 | // formula is the closed-form equation: x = n * (n + 1) / 2. |