comparison plugin/DSSIPluginInstance.cpp @ 1582:70e172e6cc59 fix-static-analysis

Use nullptr throughout
author Chris Cannam
date Mon, 26 Nov 2018 14:33:41 +0000
parents 48e9f538e6e9
children f803d3c33f76
comparison
equal deleted inserted replaced
1581:ad5f892c0c4d 1582:70e172e6cc59
45 return o; 45 return o;
46 } 46 }
47 #endif 47 #endif
48 48
49 DSSIPluginInstance::GroupMap DSSIPluginInstance::m_groupMap; 49 DSSIPluginInstance::GroupMap DSSIPluginInstance::m_groupMap;
50 snd_seq_event_t **DSSIPluginInstance::m_groupLocalEventBuffers = 0; 50 snd_seq_event_t **DSSIPluginInstance::m_groupLocalEventBuffers = nullptr;
51 size_t DSSIPluginInstance::m_groupLocalEventBufferCount = 0; 51 size_t DSSIPluginInstance::m_groupLocalEventBufferCount = 0;
52 Scavenger<ScavengerArrayWrapper<snd_seq_event_t *> > DSSIPluginInstance::m_bufferScavenger(2, 10); 52 Scavenger<ScavengerArrayWrapper<snd_seq_event_t *> > DSSIPluginInstance::m_bufferScavenger(2, 10);
53 std::map<LADSPA_Handle, std::set<DSSIPluginInstance::NonRTPluginThread *> > DSSIPluginInstance::m_threads; 53 std::map<LADSPA_Handle, std::set<DSSIPluginInstance::NonRTPluginThread *> > DSSIPluginInstance::m_threads;
54 54
55 55
62 int idealChannelCount, 62 int idealChannelCount,
63 const DSSI_Descriptor* descriptor) : 63 const DSSI_Descriptor* descriptor) :
64 RealTimePluginInstance(factory, identifier), 64 RealTimePluginInstance(factory, identifier),
65 m_client(clientId), 65 m_client(clientId),
66 m_position(position), 66 m_position(position),
67 m_instanceHandle(0), 67 m_instanceHandle(nullptr),
68 m_descriptor(descriptor), 68 m_descriptor(descriptor),
69 m_programCacheValid(false), 69 m_programCacheValid(false),
70 m_eventBuffer(EVENT_BUFFER_SIZE), 70 m_eventBuffer(EVENT_BUFFER_SIZE),
71 m_blockSize(blockSize), 71 m_blockSize(blockSize),
72 m_idealChannelCount(idealChannelCount), 72 m_idealChannelCount(idealChannelCount),
73 m_sampleRate(sampleRate), 73 m_sampleRate(sampleRate),
74 m_latencyPort(0), 74 m_latencyPort(nullptr),
75 m_run(false), 75 m_run(false),
76 m_bypassed(false), 76 m_bypassed(false),
77 m_grouped(false), 77 m_grouped(false),
78 m_haveLastEventSendTime(false) 78 m_haveLastEventSendTime(false)
79 { 79 {
298 } 298 }
299 299
300 void 300 void
301 DSSIPluginInstance::silence() 301 DSSIPluginInstance::silence()
302 { 302 {
303 if (m_instanceHandle != 0) { 303 if (m_instanceHandle != nullptr) {
304 deactivate(); 304 deactivate();
305 activate(); 305 activate();
306 } 306 }
307 } 307 }
308 308
323 if (channels == m_idealChannelCount) { 323 if (channels == m_idealChannelCount) {
324 silence(); 324 silence();
325 return; 325 return;
326 } 326 }
327 327
328 if (m_instanceHandle != 0) { 328 if (m_instanceHandle != nullptr) {
329 deactivate(); 329 deactivate();
330 } 330 }
331 331
332 m_idealChannelCount = channels; 332 m_idealChannelCount = channels;
333 333
348 } 348 }
349 349
350 connectPorts(); 350 connectPorts();
351 } 351 }
352 352
353 if (m_instanceHandle != 0) { 353 if (m_instanceHandle != nullptr) {
354 activate(); 354 activate();
355 } 355 }
356 } 356 }
357 357
358 void 358 void
421 m_threads.erase(m_instanceHandle); 421 m_threads.erase(m_instanceHandle);
422 } 422 }
423 423
424 detachFromGroup(); 424 detachFromGroup();
425 425
426 if (m_instanceHandle != 0) { 426 if (m_instanceHandle != nullptr) {
427 deactivate(); 427 deactivate();
428 } 428 }
429 429
430 cleanup(); 430 cleanup();
431 431
1338 << " has no cleanup method!" << endl; 1338 << " has no cleanup method!" << endl;
1339 return; 1339 return;
1340 } 1340 }
1341 1341
1342 m_descriptor->LADSPA_Plugin->cleanup(m_instanceHandle); 1342 m_descriptor->LADSPA_Plugin->cleanup(m_instanceHandle);
1343 m_instanceHandle = 0; 1343 m_instanceHandle = nullptr;
1344 #ifdef DEBUG_DSSI 1344 #ifdef DEBUG_DSSI
1345 SVDEBUG << "DSSIPluginInstance::cleanup " << m_identifier << " done" << endl; 1345 SVDEBUG << "DSSIPluginInstance::cleanup " << m_identifier << " done" << endl;
1346 #endif 1346 #endif
1347 } 1347 }
1348 1348