From 7b336cfc7f6d7a2539539bd1d0f0b1e23351298e Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Wed, 8 Nov 2023 00:18:55 +0100 Subject: [PATCH] fix const char warnings --- src/communication/Commander.cpp | 4 ++-- src/communication/Commander.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/communication/Commander.cpp b/src/communication/Commander.cpp index ee6be9f9..d2822b04 100644 --- a/src/communication/Commander.cpp +++ b/src/communication/Commander.cpp @@ -11,10 +11,10 @@ Commander::Commander(char eol, bool echo){ } -void Commander::add(char id, CommandCallback onCommand, char* label ){ +void Commander::add(char id, CommandCallback onCommand, const char* label ){ call_list[call_count] = onCommand; call_ids[call_count] = id; - call_label[call_count] = label; + call_label[call_count] = (char*)label; call_count++; } diff --git a/src/communication/Commander.h b/src/communication/Commander.h index 91e3dc45..4ec2b281 100644 --- a/src/communication/Commander.h +++ b/src/communication/Commander.h @@ -91,7 +91,7 @@ class Commander * @param onCommand - function pointer void function(char*) * @param label - string label to be displayed when scan command sent */ - void add(char id , CommandCallback onCommand, char* label = nullptr); + void add(char id , CommandCallback onCommand, const char* label = nullptr); // printing variables VerboseMode verbose = VerboseMode::user_friendly; //!< flag signaling that the commands should output user understanable text