Fixed some warnings
All checks were successful
Test And Build / Lint (push) Successful in 6s
Test And Build / Build (push) Successful in 5s

This commit is contained in:
2025-09-17 11:24:15 +02:00
parent d7c9d009ee
commit cb4adb068c
2 changed files with 10 additions and 14 deletions

View File

@@ -23,7 +23,7 @@ class HIDDEN msgPrintControlKey {
// -1 indicates a non-axis specific message
int axisNo_;
const char *functionName_;
std::string functionName_;
int line_;
/**
@@ -38,7 +38,7 @@ class HIDDEN msgPrintControlKey {
bool operator==(const msgPrintControlKey &other) const {
return axisNo_ == other.axisNo_ && line_ == other.line_ &&
strcmp(functionName_, other.functionName_) == 0 &&
functionName_ == other.functionName_ &&
controller_ == other.controller_;
}
@@ -55,7 +55,7 @@ template <> struct hash<msgPrintControlKey> {
// Combine the hashes of the members (x and y)
size_t h1 = std::hash<std::string>{}(obj.controller_);
size_t h2 = hash<int>{}(obj.axisNo_);
size_t h3 = std::hash<const char *>{}(obj.functionName_);
size_t h3 = std::hash<std::string>{}(obj.functionName_);
size_t h4 = hash<int>{}(obj.line_);
// Combine the hashes (simple XOR and shifting technique)
return h1 ^ (h2 << 1) ^ (h3 << 2) ^ (h4 << 3);