From 6e7ff34a331c500228bf5f8bb81c16f85ea7ecc1 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer <reinhold@kainhofer.com> Date: Sun, 29 Oct 2017 20:17:20 +0100 Subject: [PATCH] Fix compiler warnings: Use const char* for description (is read-only anyway) --- NodeManager.cpp | 2 +- NodeManager.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NodeManager.cpp b/NodeManager.cpp index 1302c1a..83f54d8 100644 --- a/NodeManager.cpp +++ b/NodeManager.cpp @@ -249,7 +249,7 @@ void Sensor::setType(int value) { int Sensor::getType() { return _type; } -void Sensor::setDescription(char* value) { +void Sensor::setDescription(const char* value) { _description = value; } void Sensor::setSamples(int value) { diff --git a/NodeManager.h b/NodeManager.h index 7660dee..7418300 100644 --- a/NodeManager.h +++ b/NodeManager.h @@ -515,7 +515,7 @@ class Sensor { void setType(int value); int getType(); // [4] description of the sensor (default: '') - void setDescription(char *value); + void setDescription(const char *value); // [5] For some sensors, the measurement can be queried multiple times and an average is returned (default: 1) void setSamples(int value); // [6] If more then one sample has to be taken, set the interval in milliseconds between measurements (default: 0) @@ -584,7 +584,7 @@ class Sensor { int _child_id; int _presentation = S_CUSTOM; int _type = V_CUSTOM; - char* _description = ""; + const char* _description = ""; int _samples = 1; int _samples_interval = 0; bool _track_last_value = false; -- GitLab