From 5563599c6dfb4c7e5335c2f30c9347ab4c9fefa7 Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:46:05 -0400 Subject: [PATCH] Make writeUnitName() const-correct Changed the writeUnitName() parameter from "char* name" to "const char* name". This will prevent warnings or errors when a string literal or an array of type "const char" is passed to it. --- src/Arduboy2.cpp | 2 +- src/Arduboy2.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Arduboy2.cpp b/src/Arduboy2.cpp index df39798..df18e2c 100644 --- a/src/Arduboy2.cpp +++ b/src/Arduboy2.cpp @@ -1099,7 +1099,7 @@ uint8_t Arduboy2Base::readUnitName(char* name) return dest; } -void Arduboy2Base::writeUnitName(char* name) +void Arduboy2Base::writeUnitName(const char* name) { bool done = false; uint8_t dest = eepromUnitName; diff --git a/src/Arduboy2.h b/src/Arduboy2.h index d348cf6..775d0bb 100644 --- a/src/Arduboy2.h +++ b/src/Arduboy2.h @@ -1207,7 +1207,7 @@ class Arduboy2Base : public Arduboy2Core * \see readUnitName() writeUnitID() Arduboy2::bootLogoExtra() * ARDUBOY_UNIT_NAME_BUFFER_SIZE ARDUBOY_UNIT_NAME_LEN Arduboy2::font5x7 */ - void writeUnitName(char* name); + void writeUnitName(const char* name); /** \brief * Read the "Show Boot Logo" flag in system EEPROM.