Mercurial > hg > svcore
comparison data/fileio/MIDIFileWriter.cpp @ 1582:70e172e6cc59 fix-static-analysis
Use nullptr throughout
author | Chris Cannam |
---|---|
date | Mon, 26 Nov 2018 14:33:41 +0000 |
parents | 48e9f538e6e9 |
children | 24dc8cb42755 |
comparison
equal
deleted
inserted
replaced
1581:ad5f892c0c4d | 1582:70e172e6cc59 |
---|---|
44 sv_samplerate_t sampleRate, float tempo) : | 44 sv_samplerate_t sampleRate, float tempo) : |
45 m_path(path), | 45 m_path(path), |
46 m_exportable(exportable), | 46 m_exportable(exportable), |
47 m_sampleRate(sampleRate), | 47 m_sampleRate(sampleRate), |
48 m_tempo(tempo), | 48 m_tempo(tempo), |
49 m_midiFile(0) | 49 m_midiFile(nullptr) |
50 { | 50 { |
51 if (!convert()) { | 51 if (!convert()) { |
52 m_error = "Conversion from model to internal MIDI format failed"; | 52 m_error = "Conversion from model to internal MIDI format failed"; |
53 } | 53 } |
54 } | 54 } |
286 new ofstream(m_path.toLocal8Bit().data(), ios::out | ios::binary); | 286 new ofstream(m_path.toLocal8Bit().data(), ios::out | ios::binary); |
287 | 287 |
288 if (!(*m_midiFile)) { | 288 if (!(*m_midiFile)) { |
289 m_error = "Can't open file for writing."; | 289 m_error = "Can't open file for writing."; |
290 delete m_midiFile; | 290 delete m_midiFile; |
291 m_midiFile = 0; | 291 m_midiFile = nullptr; |
292 return false; | 292 return false; |
293 } | 293 } |
294 | 294 |
295 if (!writeHeader()) { | 295 if (!writeHeader()) { |
296 retOK = false; | 296 retOK = false; |
302 } | 302 } |
303 } | 303 } |
304 | 304 |
305 m_midiFile->close(); | 305 m_midiFile->close(); |
306 delete m_midiFile; | 306 delete m_midiFile; |
307 m_midiFile = 0; | 307 m_midiFile = nullptr; |
308 | 308 |
309 if (!retOK) { | 309 if (!retOK) { |
310 m_error = "MIDI file write failed"; | 310 m_error = "MIDI file write failed"; |
311 } | 311 } |
312 | 312 |