Use nullptr instead of NULL when shared_ptr is used
This commit is contained in:
parent
37712c7a81
commit
3c3939e0b7
|
@ -16,12 +16,12 @@
|
|||
#define MAX_BLOCKING_DURATION_MICROS (1000 * 1000)
|
||||
|
||||
SDRPostThread::SDRPostThread() : IOThread(), buffers("SDRPostThreadBuffers"), visualDataBuffers("SDRPostThreadVisualDataBuffers"), frequency(0) {
|
||||
iqDataInQueue = NULL;
|
||||
iqDataOutQueue = NULL;
|
||||
iqVisualQueue = NULL;
|
||||
iqDataInQueue = nullptr;
|
||||
iqDataOutQueue = nullptr;
|
||||
iqVisualQueue = nullptr;
|
||||
|
||||
numChannels = 0;
|
||||
channelizer = NULL;
|
||||
channelizer = nullptr;
|
||||
|
||||
sampleRate = 0;
|
||||
nRunDemods = 0;
|
||||
|
@ -92,7 +92,7 @@ void SDRPostThread::updateActiveDemodulators() {
|
|||
}
|
||||
} else if (!demod->isActive()) { // in range, activate if not activated
|
||||
demod->setActive(true);
|
||||
if (wxGetApp().getDemodMgr().getLastActiveDemodulator() == NULL) {
|
||||
if (wxGetApp().getDemodMgr().getLastActiveDemodulator() == nullptr) {
|
||||
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(demod);
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ void SDRPostThread::runSingleCH(SDRThreadIQData *data_in) {
|
|||
|
||||
size_t refCount = nRunDemods;
|
||||
bool doIQDataOut = (iqDataOutQueue != nullptr && !iqDataOutQueue->full());
|
||||
bool doDemodVisOut = (nRunDemods && iqActiveDemodVisualQueue != NULL && !iqActiveDemodVisualQueue->full());
|
||||
bool doDemodVisOut = (nRunDemods && iqActiveDemodVisualQueue != nullptr && !iqActiveDemodVisualQueue->full());
|
||||
bool doVisOut = (iqVisualQueue != nullptr && !iqVisualQueue->full());
|
||||
|
||||
if (doIQDataOut) {
|
||||
|
@ -309,7 +309,7 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||
|
||||
bool doVis = false;
|
||||
|
||||
if (iqVisualQueue != NULL && !iqVisualQueue->full()) {
|
||||
if (iqVisualQueue != nullptr && !iqVisualQueue->full()) {
|
||||
doVis = true;
|
||||
}
|
||||
|
||||
|
@ -371,7 +371,7 @@ void SDRPostThread::runPFBCH(SDRThreadIQData *data_in) {
|
|||
|
||||
// Run channels
|
||||
for (int i = 0; i < numChannels+1; i++) {
|
||||
int doDemodVis = ((activeDemodChannel == i) && (iqActiveDemodVisualQueue != NULL) && !iqActiveDemodVisualQueue->full())?1:0;
|
||||
int doDemodVis = ((activeDemodChannel == i) && (iqActiveDemodVisualQueue != nullptr) && !iqActiveDemodVisualQueue->full())?1:0;
|
||||
|
||||
if (!doDemodVis && demodChannelActive[i] == 0) {
|
||||
continue;
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
#define TARGET_DISPLAY_FPS 60
|
||||
|
||||
SDRThread::SDRThread() : IOThread(), buffers("SDRThreadBuffers") {
|
||||
device = NULL;
|
||||
device = nullptr;
|
||||
|
||||
deviceConfig.store(NULL);
|
||||
deviceInfo.store(NULL);
|
||||
deviceConfig.store(nullptr);
|
||||
deviceInfo.store(nullptr);
|
||||
|
||||
sampleRate.store(DEFAULT_SAMPLE_RATE);
|
||||
frequency.store(0);
|
||||
|
|
|
@ -331,7 +331,7 @@ void TuningCanvas::OnMouseMoved(wxMouseEvent& event) {
|
|||
if (hoverState == TUNING_HOVER_BW || hoverState == TUNING_HOVER_FREQ) {
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(wxGetApp().getDemodMgr().getLastActiveDemodulator());
|
||||
} else {
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(NULL);
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,7 @@ void TuningCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
|||
SetCursor(wxCURSOR_CROSS);
|
||||
hoverIndex = 0;
|
||||
hoverState = TUNING_HOVER_NONE;
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(NULL);
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(nullptr);
|
||||
|
||||
if (currentPPM != lastPPM) {
|
||||
wxGetApp().saveConfig();
|
||||
|
|
|
@ -309,9 +309,9 @@ void WaterfallCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) {
|
|||
}
|
||||
} else {
|
||||
if (lastActiveDemodulator) {
|
||||
glContext->DrawDemod(lastActiveDemodulator, ((isNew && activeDemodulator == NULL) || (activeDemodulator != NULL))?currentTheme->waterfallHighlight:currentTheme->waterfallDestroy, currentCenterFreq, currentBandwidth);
|
||||
glContext->DrawDemod(lastActiveDemodulator, ((isNew && activeDemodulator == nullptr) || (activeDemodulator != nullptr))?currentTheme->waterfallHighlight:currentTheme->waterfallDestroy, currentCenterFreq, currentBandwidth);
|
||||
}
|
||||
if (activeDemodulator == NULL) {
|
||||
if (activeDemodulator == nullptr) {
|
||||
glContext->DrawFreqSelector(mouseTracker.getMouseX(), ((isNew && lastActiveDemodulator) || (!lastActiveDemodulator) )?currentTheme->waterfallNew:currentTheme->waterfallHover, 0, currentCenterFreq, currentBandwidth);
|
||||
} else {
|
||||
glContext->DrawDemod(activeDemodulator, currentTheme->waterfallHover, currentCenterFreq, currentBandwidth);
|
||||
|
@ -539,7 +539,7 @@ void WaterfallCanvas::updateHoverState() {
|
|||
}
|
||||
}
|
||||
|
||||
if (activeDemodulator == NULL) {
|
||||
if (activeDemodulator == nullptr) {
|
||||
nextDragState = WF_DRAG_NONE;
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
return;
|
||||
|
@ -593,7 +593,7 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) {
|
|||
auto demod = wxGetApp().getDemodMgr().getActiveDemodulator();
|
||||
|
||||
if (mouseTracker.mouseDown()) {
|
||||
if (demod == NULL) {
|
||||
if (demod == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (dragState == WF_DRAG_BANDWIDTH_LEFT || dragState == WF_DRAG_BANDWIDTH_RIGHT) {
|
||||
|
@ -672,7 +672,7 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
|
|||
InteractiveCanvas::OnMouseReleased(event);
|
||||
wxGetApp().getDemodMgr().updateLastState();
|
||||
|
||||
bool isNew = shiftDown || (wxGetApp().getDemodMgr().getLastActiveDemodulator() == NULL)
|
||||
bool isNew = shiftDown || (wxGetApp().getDemodMgr().getLastActiveDemodulator() == nullptr)
|
||||
|| (wxGetApp().getDemodMgr().getLastActiveDemodulator() && !wxGetApp().getDemodMgr().getLastActiveDemodulator()->isActive());
|
||||
|
||||
mouseTracker.setVertDragLock(false);
|
||||
|
@ -832,7 +832,7 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
|
|||
wxGetApp().notifyDemodulatorsChanged();
|
||||
}
|
||||
|
||||
if (demod == NULL) {
|
||||
if (demod == nullptr) {
|
||||
dragState = WF_DRAG_NONE;
|
||||
return;
|
||||
}
|
||||
|
@ -852,7 +852,7 @@ void WaterfallCanvas::OnMouseReleased(wxMouseEvent& event) {
|
|||
void WaterfallCanvas::OnMouseLeftWindow(wxMouseEvent& event) {
|
||||
InteractiveCanvas::OnMouseLeftWindow(event);
|
||||
SetCursor(wxCURSOR_CROSS);
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(NULL);
|
||||
wxGetApp().getDemodMgr().setActiveDemodulator(nullptr);
|
||||
mouseZoom = 1.0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue