mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-15 03:20:08 +01:00
Repaired int-to-string conversion in exception message formatting
This commit is contained in:
parent
6b2befd571
commit
629a1bbc14
@ -48,6 +48,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@ -283,10 +284,11 @@ int WavInFile::read(short *buffer, int maxElems)
|
|||||||
// 16 bit format
|
// 16 bit format
|
||||||
if (header.format.bits_per_sample != 16)
|
if (header.format.bits_per_sample != 16)
|
||||||
{
|
{
|
||||||
string msg = "WAV file bits per sample format not supported: ";
|
stringstream ss;
|
||||||
msg += (int)header.format.bits_per_sample;
|
ss << "\nOnly 8/16 bit sample WAV files supported. Can't open WAV file with ";
|
||||||
msg += " bits per sample.";
|
ss << (int)header.format.bits_per_sample;
|
||||||
throw runtime_error(msg);
|
ss << " bit sample format. ";
|
||||||
|
throw runtime_error(ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(sizeof(short) == 2);
|
assert(sizeof(short) == 2);
|
||||||
@ -711,10 +713,11 @@ void WavOutFile::write(const short *buffer, int numElems)
|
|||||||
|
|
||||||
if (header.format.bits_per_sample != 16)
|
if (header.format.bits_per_sample != 16)
|
||||||
{
|
{
|
||||||
string msg = "WAV file bits per sample format not supported: ";
|
stringstream ss;
|
||||||
msg += (int)header.format.bits_per_sample;
|
ss << "\nOnly 8/16 bit sample WAV files supported. Can't open WAV file with ";
|
||||||
msg += " bits per sample.";
|
ss << (int)header.format.bits_per_sample;
|
||||||
throw runtime_error(msg);
|
ss << " bit sample format. ";
|
||||||
|
throw runtime_error(ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate temp buffer to swap byte order if necessary
|
// allocate temp buffer to swap byte order if necessary
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user