From a4c88cea0a435acbc3567fabf924aa79147f5d5c Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Nov 2022 13:03:55 -0500 Subject: [PATCH] Fix warning about parentheses around assignment used as truth value --- src/zm_monitor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 93a0a0c5a..4ea14e5bb 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -2201,7 +2201,7 @@ bool Monitor::Analyse() { event->updateNotes(noteSetMap); } } else if (shared_data->recording != RECORDING_NONE) { - if (event = openEvent(snap, cause, noteSetMap)) { + if ((event = openEvent(snap, cause, noteSetMap)) != nullptr) { Info("%s: %03d - Opening new event %" PRIu64 ", alarm start", name.c_str(), analysis_image_count, event->Id()); if (alarm_frame_count) { Debug(1, "alarm frame count so SavePreAlarmFrames"); @@ -2248,7 +2248,7 @@ bool Monitor::Analyse() { } // end if event if (!event and (shared_data->recording == RECORDING_ALWAYS)) { - if (event = openEvent(snap, cause.empty() ? "Continuous" : cause, noteSetMap)) { + if ((event = openEvent(snap, cause.empty() ? "Continuous" : cause, noteSetMap)) != nullptr) { Info("%s: %03d - Opened new event %" PRIu64 ", continuous section start", name.c_str(), analysis_image_count, event->Id()); /* To prevent cancelling out an existing alert\prealarm\alarm state */