comparison data/fileio/WavFileReader.cpp @ 1582:70e172e6cc59 fix-static-analysis

Use nullptr throughout
author Chris Cannam
date Mon, 26 Nov 2018 14:33:41 +0000
parents 954d0cf29ca7
children ce185d4dd408
comparison
equal deleted inserted replaced
1581:ad5f892c0c4d 1582:70e172e6cc59
26 using namespace std; 26 using namespace std;
27 27
28 WavFileReader::WavFileReader(FileSource source, 28 WavFileReader::WavFileReader(FileSource source,
29 bool fileUpdating, 29 bool fileUpdating,
30 Normalisation normalisation) : 30 Normalisation normalisation) :
31 m_file(0), 31 m_file(nullptr),
32 m_source(source), 32 m_source(source),
33 m_path(source.getLocalFilename()), 33 m_path(source.getLocalFilename()),
34 m_seekable(false), 34 m_seekable(false),
35 m_lastStart(0), 35 m_lastStart(0),
36 m_lastCount(0), 36 m_lastCount(0),
268 void 268 void
269 WavFileReader::getSupportedExtensions(set<QString> &extensions) 269 WavFileReader::getSupportedExtensions(set<QString> &extensions)
270 { 270 {
271 int count; 271 int count;
272 272
273 if (sf_command(0, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof(count))) { 273 if (sf_command(nullptr, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof(count))) {
274 extensions.insert("wav"); 274 extensions.insert("wav");
275 extensions.insert("aiff"); 275 extensions.insert("aiff");
276 extensions.insert("aifc"); 276 extensions.insert("aifc");
277 extensions.insert("aif"); 277 extensions.insert("aif");
278 return; 278 return;
279 } 279 }
280 280
281 SF_FORMAT_INFO info; 281 SF_FORMAT_INFO info;
282 for (int i = 0; i < count; ++i) { 282 for (int i = 0; i < count; ++i) {
283 info.format = i; 283 info.format = i;
284 if (!sf_command(0, SFC_GET_FORMAT_MAJOR, &info, sizeof(info))) { 284 if (!sf_command(nullptr, SFC_GET_FORMAT_MAJOR, &info, sizeof(info))) {
285 QString ext = QString(info.extension).toLower(); 285 QString ext = QString(info.extension).toLower();
286 extensions.insert(ext); 286 extensions.insert(ext);
287 if (ext == "oga") { 287 if (ext == "oga") {
288 // libsndfile is awfully proper, it says it only 288 // libsndfile is awfully proper, it says it only
289 // supports .oga but lots of Ogg audio files in the 289 // supports .oga but lots of Ogg audio files in the