From fb11859178747ceebc826311908a723ae442db71 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Tue, 8 Oct 2024 13:41:19 +0300 Subject: [PATCH 1/2] Instantiate the shared pointer using the raw pointer --- src/sensesp/signalk/signalk_output.cpp | 2 +- src/sensesp/signalk/signalk_output.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sensesp/signalk/signalk_output.cpp b/src/sensesp/signalk/signalk_output.cpp index 9a483370a..e1724fc8f 100644 --- a/src/sensesp/signalk/signalk_output.cpp +++ b/src/sensesp/signalk/signalk_output.cpp @@ -6,7 +6,7 @@ template SKOutputNumeric::SKOutputNumeric(String sk_path, String config_path, SKMetadata* meta) : SKOutput(sk_path, config_path, meta) { - if (this->meta_ == NULL && !this->sk_path_.isEmpty()) { + if (this->meta_ == nullptr && !this->sk_path_.isEmpty()) { ESP_LOGW( __FILENAME__, "WARNING - No metadata for %s. Numeric values should specify units", diff --git a/src/sensesp/signalk/signalk_output.h b/src/sensesp/signalk/signalk_output.h index 274bfaad7..7d0a90634 100644 --- a/src/sensesp/signalk/signalk_output.h +++ b/src/sensesp/signalk/signalk_output.h @@ -32,7 +32,7 @@ class SKOutput : public SKEmitter, public SymmetricTransform { * Signal K specification) */ SKOutput(String sk_path, String config_path = "", SKMetadata* meta = nullptr) - : SKOutput(sk_path, config_path, std::make_shared(*meta)) {} + : SKOutput(sk_path, config_path, std::shared_ptr(meta)) {} SKOutput(String sk_path, String config_path, std::shared_ptr meta) : SKEmitter(sk_path), SymmetricTransform(config_path), meta_{meta} { @@ -112,7 +112,7 @@ template class SKOutputNumeric : public SKOutput { public: SKOutputNumeric(String sk_path, String config_path = "", - SKMetadata* meta = NULL); + SKMetadata* meta = nullptr); SKOutputNumeric(String sk_path, SKMetadata* meta) : SKOutputNumeric(sk_path, "", meta) {} From f1ba243c666bd5046e40e37fcf3ec86b312f9ba7 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Tue, 8 Oct 2024 13:47:12 +0300 Subject: [PATCH 2/2] Remove some leftover debug logging --- src/sensesp/system/stream_producer.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sensesp/system/stream_producer.h b/src/sensesp/system/stream_producer.h index 0fc96fd42..3fcd7a17a 100644 --- a/src/sensesp/system/stream_producer.h +++ b/src/sensesp/system/stream_producer.h @@ -56,7 +56,6 @@ class StreamLineProducer : public ValueProducer { // Include the newline character in the output buf_[buf_pos++] = c; buf_[buf_pos] = '\0'; - ESP_LOGV("StreamLineProducer", "About to emit line: %s", buf_); this->emit(buf_); buf_pos = 0; } else {