aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-12-17 15:56:30 -0800
committerChris Robinson <[email protected]>2017-12-17 15:56:30 -0800
commit8253014fe9e8cc6b7e1ea0b839e7c1a11e1524c1 (patch)
tree3a0dc563bc81c46a592b9c810a6a21bb9a12d903 /examples
parent57e516720e6e91978360853ee37c2bbb28fbdc8f (diff)
Fix some types to make MSVC happy
Diffstat (limited to 'examples')
-rw-r--r--examples/alrecord.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/alrecord.c b/examples/alrecord.c
index 0835b468..c21ba30b 100644
--- a/examples/alrecord.c
+++ b/examples/alrecord.c
@@ -63,13 +63,13 @@ typedef struct Recorder {
FILE *mFile;
long mDataSizeOffset;
- size_t mDataSize;
+ ALuint mDataSize;
float mRecTime;
int mChannels;
int mBits;
int mSampleRate;
- size_t mFrameSize;
+ ALuint mFrameSize;
ALbyte *mBuffer;
ALsizei mBufferSize;
} Recorder;
@@ -184,7 +184,7 @@ int main(int argc, char **argv)
return 1;
}
- recorder.mRecTime = strtod(argv[1], &end);
+ recorder.mRecTime = strtof(argv[1], &end);
if(!(recorder.mRecTime >= 1.0f && recorder.mRecTime <= 10.0f) || (end && *end != '\0'))
{
fprintf(stderr, "Invalid record time: %s\n", argv[1]);
@@ -314,7 +314,7 @@ int main(int argc, char **argv)
(err=alcGetError(recorder.mDevice)) == ALC_NO_ERROR && !ferror(recorder.mFile))
{
ALCint count = 0;
- fprintf(stderr, "\rCaptured "SZFMT" samples", recorder.mDataSize);
+ fprintf(stderr, "\rCaptured %u samples", recorder.mDataSize);
alcGetIntegerv(recorder.mDevice, ALC_CAPTURE_SAMPLES, 1, &count);
if(count < 1)
{
@@ -357,10 +357,11 @@ int main(int argc, char **argv)
}
}
#endif
- recorder.mDataSize += fwrite(recorder.mBuffer, recorder.mFrameSize, count, recorder.mFile);
+ recorder.mDataSize += (ALuint)fwrite(recorder.mBuffer, recorder.mFrameSize, count,
+ recorder.mFile);
}
alcCaptureStop(recorder.mDevice);
- fprintf(stderr, "\rCaptured "SZFMT" samples\n", recorder.mDataSize);
+ fprintf(stderr, "\rCaptured %u samples\n", recorder.mDataSize);
if(err != ALC_NO_ERROR)
fprintf(stderr, "Got device error 0x%04x: %s\n", err, alcGetString(recorder.mDevice, err));