Commit e2fea299 authored by Josh Coalson's avatar Josh Coalson
parent 367c1587
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<li>Fixed bug where sometimes an existing installation of flac could interfere with the build process (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1763690&amp;group_id=13478&amp;atid=113478">SF #1763690</a>).</li> <li>Fixed bug where sometimes an existing installation of flac could interfere with the build process (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1763690&amp;group_id=13478&amp;atid=113478">SF #1763690</a>).</li>
<li>Some MinGW fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1684879&amp;group_id=13478&amp;atid=113478">SF #1684879</a>).</li> <li>Some MinGW fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1684879&amp;group_id=13478&amp;atid=113478">SF #1684879</a>).</li>
<li>Solaris 10 fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1783225&amp;group_id=13478&amp;atid=113478">SF #1783225</a>).</li> <li>Solaris 10 fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1783225&amp;group_id=13478&amp;atid=113478">SF #1783225</a>).</li>
<li>OS/2 fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1771378&amp;group_id=13478&amp;atid=113478">SF #1771378</a>).</li> <li>OS/2 fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1771378&amp;group_id=13478&amp;atid=113478">SF #1771378</a> <a href="https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1229495&amp;group_id=13478&amp;atid=113478">SF #1229495</a>).</li>
</ul> </ul>
</li> </li>
<li> <li>
......
...@@ -36,12 +36,6 @@ ...@@ -36,12 +36,6 @@
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
#if defined _WIN32 || defined __EMX__
static const char *mode = "wb";
#else
static const char *mode = "w";
#endif
#if !defined _MSC_VER && !defined __MINGW32__ #if !defined _MSC_VER && !defined __MINGW32__
#define GET_RANDOM_BYTE (((unsigned)random()) & 0xff) #define GET_RANDOM_BYTE (((unsigned)random()) & 0xff)
#else #else
...@@ -211,7 +205,7 @@ static FLAC__bool generate_01(void) ...@@ -211,7 +205,7 @@ static FLAC__bool generate_01(void)
FILE *f; FILE *f;
FLAC__int16 x = -32768; FLAC__int16 x = -32768;
if(0 == (f = fopen("test01.raw", mode))) if(0 == (f = fopen("test01.raw", "wb")))
return false; return false;
if(!write_little_endian_int16(f, x)) if(!write_little_endian_int16(f, x))
...@@ -230,7 +224,7 @@ static FLAC__bool generate_02(void) ...@@ -230,7 +224,7 @@ static FLAC__bool generate_02(void)
FILE *f; FILE *f;
FLAC__int16 xl = -32768, xr = 32767; FLAC__int16 xl = -32768, xr = 32767;
if(0 == (f = fopen("test02.raw", mode))) if(0 == (f = fopen("test02.raw", "wb")))
return false; return false;
if(!write_little_endian_int16(f, xl)) if(!write_little_endian_int16(f, xl))
...@@ -252,7 +246,7 @@ static FLAC__bool generate_03(void) ...@@ -252,7 +246,7 @@ static FLAC__bool generate_03(void)
FLAC__int16 x[] = { -25, 0, 25, 50, 100 }; FLAC__int16 x[] = { -25, 0, 25, 50, 100 };
unsigned i; unsigned i;
if(0 == (f = fopen("test03.raw", mode))) if(0 == (f = fopen("test03.raw", "wb")))
return false; return false;
for(i = 0; i < 5; i++) for(i = 0; i < 5; i++)
...@@ -273,7 +267,7 @@ static FLAC__bool generate_04(void) ...@@ -273,7 +267,7 @@ static FLAC__bool generate_04(void)
FLAC__int16 x[] = { -25, 500, 0, 400, 25, 300, 50, 200, 100, 100 }; FLAC__int16 x[] = { -25, 500, 0, 400, 25, 300, 50, 200, 100, 100 };
unsigned i; unsigned i;
if(0 == (f = fopen("test04.raw", mode))) if(0 == (f = fopen("test04.raw", "wb")))
return false; return false;
for(i = 0; i < 10; i++) for(i = 0; i < 10; i++)
...@@ -295,7 +289,7 @@ static FLAC__bool generate_fsd8(const char *fn, const int pattern[], unsigned re ...@@ -295,7 +289,7 @@ static FLAC__bool generate_fsd8(const char *fn, const int pattern[], unsigned re
FLAC__ASSERT(pattern != 0); FLAC__ASSERT(pattern != 0);
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(rep = 0; rep < reps; rep++) { for(rep = 0; rep < reps; rep++) {
...@@ -321,7 +315,7 @@ static FLAC__bool generate_fsd16(const char *fn, const int pattern[], unsigned r ...@@ -321,7 +315,7 @@ static FLAC__bool generate_fsd16(const char *fn, const int pattern[], unsigned r
FLAC__ASSERT(pattern != 0); FLAC__ASSERT(pattern != 0);
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(rep = 0; rep < reps; rep++) { for(rep = 0; rep < reps; rep++) {
...@@ -345,7 +339,7 @@ static FLAC__bool generate_wbps16(const char *fn, unsigned samples) ...@@ -345,7 +339,7 @@ static FLAC__bool generate_wbps16(const char *fn, unsigned samples)
FILE *f; FILE *f;
unsigned sample; unsigned sample;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(sample = 0; sample < samples; sample++) { for(sample = 0; sample < samples; sample++) {
...@@ -372,7 +366,7 @@ static FLAC__bool generate_fsd24(const char *fn, const int pattern[], unsigned r ...@@ -372,7 +366,7 @@ static FLAC__bool generate_fsd24(const char *fn, const int pattern[], unsigned r
FLAC__ASSERT(pattern != 0); FLAC__ASSERT(pattern != 0);
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(rep = 0; rep < reps; rep++) { for(rep = 0; rep < reps; rep++) {
...@@ -400,7 +394,7 @@ static FLAC__bool generate_sine8_1(const char *fn, const double sample_rate, con ...@@ -400,7 +394,7 @@ static FLAC__bool generate_sine8_1(const char *fn, const double sample_rate, con
double theta1, theta2; double theta1, theta2;
unsigned i; unsigned i;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
...@@ -427,7 +421,7 @@ static FLAC__bool generate_sine8_2(const char *fn, const double sample_rate, con ...@@ -427,7 +421,7 @@ static FLAC__bool generate_sine8_2(const char *fn, const double sample_rate, con
double theta1, theta2; double theta1, theta2;
unsigned i; unsigned i;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
...@@ -458,7 +452,7 @@ static FLAC__bool generate_sine16_1(const char *fn, const double sample_rate, co ...@@ -458,7 +452,7 @@ static FLAC__bool generate_sine16_1(const char *fn, const double sample_rate, co
double theta1, theta2; double theta1, theta2;
unsigned i; unsigned i;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
...@@ -485,7 +479,7 @@ static FLAC__bool generate_sine16_2(const char *fn, const double sample_rate, co ...@@ -485,7 +479,7 @@ static FLAC__bool generate_sine16_2(const char *fn, const double sample_rate, co
double theta1, theta2; double theta1, theta2;
unsigned i; unsigned i;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
...@@ -516,7 +510,7 @@ static FLAC__bool generate_sine24_1(const char *fn, const double sample_rate, co ...@@ -516,7 +510,7 @@ static FLAC__bool generate_sine24_1(const char *fn, const double sample_rate, co
double theta1, theta2; double theta1, theta2;
unsigned i; unsigned i;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
...@@ -543,7 +537,7 @@ static FLAC__bool generate_sine24_2(const char *fn, const double sample_rate, co ...@@ -543,7 +537,7 @@ static FLAC__bool generate_sine24_2(const char *fn, const double sample_rate, co
double theta1, theta2; double theta1, theta2;
unsigned i; unsigned i;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
...@@ -569,7 +563,7 @@ static FLAC__bool generate_noise(const char *fn, unsigned bytes) ...@@ -569,7 +563,7 @@ static FLAC__bool generate_noise(const char *fn, unsigned bytes)
FILE *f; FILE *f;
unsigned b; unsigned b;
if(0 == (f = fopen(fn, mode))) if(0 == (f = fopen(fn, "wb")))
return false; return false;
for(b = 0; b < bytes; b++) { for(b = 0; b < bytes; b++) {
...@@ -599,7 +593,7 @@ static FLAC__bool generate_raw(const char *filename, unsigned channels, unsigned ...@@ -599,7 +593,7 @@ static FLAC__bool generate_raw(const char *filename, unsigned channels, unsigned
FILE *f; FILE *f;
unsigned i, j; unsigned i, j;
if(0 == (f = fopen(filename, mode))) if(0 == (f = fopen(filename, "wb")))
return false; return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) { for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
...@@ -632,7 +626,7 @@ static FLAC__bool generate_aiff(const char *filename, unsigned sample_rate, unsi ...@@ -632,7 +626,7 @@ static FLAC__bool generate_aiff(const char *filename, unsigned sample_rate, unsi
FILE *f; FILE *f;
unsigned i, j; unsigned i, j;
if(0 == (f = fopen(filename, mode))) if(0 == (f = fopen(filename, "wb")))
return false; return false;
if(fwrite("FORM", 1, 4, f) < 4) if(fwrite("FORM", 1, 4, f) < 4)
goto foo; goto foo;
...@@ -693,7 +687,7 @@ static FLAC__bool generate_wav(const char *filename, unsigned sample_rate, unsig ...@@ -693,7 +687,7 @@ static FLAC__bool generate_wav(const char *filename, unsigned sample_rate, unsig
FILE *f; FILE *f;
unsigned i, j; unsigned i, j;
if(0 == (f = fopen(filename, mode))) if(0 == (f = fopen(filename, "wb")))
return false; return false;
if(fwrite("RIFF", 1, 4, f) < 4) if(fwrite("RIFF", 1, 4, f) < 4)
goto foo; goto foo;
...@@ -768,14 +762,14 @@ static FLAC__bool generate_wackywavs(void) ...@@ -768,14 +762,14 @@ static FLAC__bool generate_wackywavs(void)
4, 0, 0, 0, 'b', 'l', 'a', 'h' 4, 0, 0, 0, 'b', 'l', 'a', 'h'
}; };
if(0 == (f = fopen("wacky1.wav", mode))) if(0 == (f = fopen("wacky1.wav", "wb")))
return false; return false;
if(fwrite(wav, 1, 84, f) < 84) if(fwrite(wav, 1, 84, f) < 84)
goto foo; goto foo;
fclose(f); fclose(f);
wav[4] += 12; wav[4] += 12;
if(0 == (f = fopen("wacky2.wav", mode))) if(0 == (f = fopen("wacky2.wav", "wb")))
return false; return false;
if(fwrite(wav, 1, 96, f) < 96) if(fwrite(wav, 1, 96, f) < 96)
goto foo; goto foo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment