OS/2 fixes (SF#1229495: https://sourceforge.net/tracker/index.php?func=detail&aid=1229495&group_id=13478&atid=113478)
diff --git a/doc/html/changelog.html b/doc/html/changelog.html
index e303096..f620e3d 100644
--- a/doc/html/changelog.html
+++ b/doc/html/changelog.html
@@ -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&aid=1763690&group_id=13478&atid=113478">SF #1763690</a>).</li>
<li>Some MinGW fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1684879&group_id=13478&atid=113478">SF #1684879</a>).</li>
<li>Solaris 10 fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1783225&group_id=13478&atid=113478">SF #1783225</a>).</li>
- <li>OS/2 fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1771378&group_id=13478&atid=113478">SF #1771378</a>).</li>
+ <li>OS/2 fixes (<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1771378&group_id=13478&atid=113478">SF #1771378</a> <a href="https://sourceforge.net/tracker/index.php?func=detail&aid=1229495&group_id=13478&atid=113478">SF #1229495</a>).</li>
</ul>
</li>
<li>
diff --git a/src/test_streams/main.c b/src/test_streams/main.c
index f3f14ec..c335776 100644
--- a/src/test_streams/main.c
+++ b/src/test_streams/main.c
@@ -36,12 +36,6 @@
#define M_PI 3.14159265358979323846
#endif
-#if defined _WIN32 || defined __EMX__
- static const char *mode = "wb";
-#else
- static const char *mode = "w";
-#endif
-
#if !defined _MSC_VER && !defined __MINGW32__
#define GET_RANDOM_BYTE (((unsigned)random()) & 0xff)
#else
@@ -211,7 +205,7 @@
FILE *f;
FLAC__int16 x = -32768;
- if(0 == (f = fopen("test01.raw", mode)))
+ if(0 == (f = fopen("test01.raw", "wb")))
return false;
if(!write_little_endian_int16(f, x))
@@ -230,7 +224,7 @@
FILE *f;
FLAC__int16 xl = -32768, xr = 32767;
- if(0 == (f = fopen("test02.raw", mode)))
+ if(0 == (f = fopen("test02.raw", "wb")))
return false;
if(!write_little_endian_int16(f, xl))
@@ -252,7 +246,7 @@
FLAC__int16 x[] = { -25, 0, 25, 50, 100 };
unsigned i;
- if(0 == (f = fopen("test03.raw", mode)))
+ if(0 == (f = fopen("test03.raw", "wb")))
return false;
for(i = 0; i < 5; i++)
@@ -273,7 +267,7 @@
FLAC__int16 x[] = { -25, 500, 0, 400, 25, 300, 50, 200, 100, 100 };
unsigned i;
- if(0 == (f = fopen("test04.raw", mode)))
+ if(0 == (f = fopen("test04.raw", "wb")))
return false;
for(i = 0; i < 10; i++)
@@ -295,7 +289,7 @@
FLAC__ASSERT(pattern != 0);
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(rep = 0; rep < reps; rep++) {
@@ -321,7 +315,7 @@
FLAC__ASSERT(pattern != 0);
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(rep = 0; rep < reps; rep++) {
@@ -345,7 +339,7 @@
FILE *f;
unsigned sample;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(sample = 0; sample < samples; sample++) {
@@ -372,7 +366,7 @@
FLAC__ASSERT(pattern != 0);
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(rep = 0; rep < reps; rep++) {
@@ -400,7 +394,7 @@
double theta1, theta2;
unsigned i;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -427,7 +421,7 @@
double theta1, theta2;
unsigned i;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -458,7 +452,7 @@
double theta1, theta2;
unsigned i;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -485,7 +479,7 @@
double theta1, theta2;
unsigned i;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -516,7 +510,7 @@
double theta1, theta2;
unsigned i;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -543,7 +537,7 @@
double theta1, theta2;
unsigned i;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -569,7 +563,7 @@
FILE *f;
unsigned b;
- if(0 == (f = fopen(fn, mode)))
+ if(0 == (f = fopen(fn, "wb")))
return false;
for(b = 0; b < bytes; b++) {
@@ -599,7 +593,7 @@
FILE *f;
unsigned i, j;
- if(0 == (f = fopen(filename, mode)))
+ if(0 == (f = fopen(filename, "wb")))
return false;
for(i = 0, theta1 = theta2 = 0.0; i < samples; i++, theta1 += delta1, theta2 += delta2) {
@@ -632,7 +626,7 @@
FILE *f;
unsigned i, j;
- if(0 == (f = fopen(filename, mode)))
+ if(0 == (f = fopen(filename, "wb")))
return false;
if(fwrite("FORM", 1, 4, f) < 4)
goto foo;
@@ -693,7 +687,7 @@
FILE *f;
unsigned i, j;
- if(0 == (f = fopen(filename, mode)))
+ if(0 == (f = fopen(filename, "wb")))
return false;
if(fwrite("RIFF", 1, 4, f) < 4)
goto foo;
@@ -768,14 +762,14 @@
4, 0, 0, 0, 'b', 'l', 'a', 'h'
};
- if(0 == (f = fopen("wacky1.wav", mode)))
+ if(0 == (f = fopen("wacky1.wav", "wb")))
return false;
if(fwrite(wav, 1, 84, f) < 84)
goto foo;
fclose(f);
wav[4] += 12;
- if(0 == (f = fopen("wacky2.wav", mode)))
+ if(0 == (f = fopen("wacky2.wav", "wb")))
return false;
if(fwrite(wav, 1, 96, f) < 96)
goto foo;