comparison data/midi/MIDIInput.cpp @ 1582:70e172e6cc59 fix-static-analysis

Use nullptr throughout
author Chris Cannam
date Mon, 26 Nov 2018 14:33:41 +0000
parents cee1be4fb8c1
children 157c62ff0056
comparison
equal deleted inserted replaced
1581:ad5f892c0c4d 1582:70e172e6cc59
18 #include "rtmidi/RtMidi.h" 18 #include "rtmidi/RtMidi.h"
19 19
20 #include "system/System.h" 20 #include "system/System.h"
21 21
22 MIDIInput::MIDIInput(QString name, FrameTimer *timer) : 22 MIDIInput::MIDIInput(QString name, FrameTimer *timer) :
23 m_rtmidi(0), 23 m_rtmidi(nullptr),
24 m_frameTimer(timer), 24 m_frameTimer(timer),
25 m_buffer(1023) 25 m_buffer(1023)
26 { 26 {
27 try { 27 try {
28 std::vector<RtMidi::Api> apis; 28 std::vector<RtMidi::Api> apis;
45 45
46 if (n == 0) { 46 if (n == 0) {
47 47
48 SVDEBUG << "NOTE: MIDIInput: No input ports available" << endl; 48 SVDEBUG << "NOTE: MIDIInput: No input ports available" << endl;
49 delete m_rtmidi; 49 delete m_rtmidi;
50 m_rtmidi = 0; 50 m_rtmidi = nullptr;
51 51
52 } else { 52 } else {
53 53
54 m_rtmidi->setCallback(staticCallback, this); 54 m_rtmidi->setCallback(staticCallback, this);
55 55
65 } 65 }
66 66
67 } catch (const RtMidiError &e) { 67 } catch (const RtMidiError &e) {
68 SVCERR << "ERROR: RtMidi error: " << e.getMessage() << endl; 68 SVCERR << "ERROR: RtMidi error: " << e.getMessage() << endl;
69 delete m_rtmidi; 69 delete m_rtmidi;
70 m_rtmidi = 0; 70 m_rtmidi = nullptr;
71 } 71 }
72 } 72 }
73 73
74 MIDIInput::~MIDIInput() 74 MIDIInput::~MIDIInput()
75 { 75 {