Fixed some warnings
This commit is contained in:
@@ -5,17 +5,13 @@
|
|||||||
|
|
||||||
msgPrintControlKey::msgPrintControlKey(char *controller, int axisNo,
|
msgPrintControlKey::msgPrintControlKey(char *controller, int axisNo,
|
||||||
const char *functionName, int line,
|
const char *functionName, int line,
|
||||||
size_t maxRepetitions) {
|
size_t maxRepetitions)
|
||||||
controller_ = controller;
|
: controller_(controller), axisNo_(axisNo), functionName_(functionName),
|
||||||
axisNo_ = axisNo;
|
line_(line), maxRepetitions_(maxRepetitions) {}
|
||||||
line_ = line;
|
|
||||||
functionName_ = functionName;
|
|
||||||
maxRepetitions_ = maxRepetitions;
|
|
||||||
}
|
|
||||||
|
|
||||||
void msgPrintControlKey::format(char *buffer, size_t bufferSize) {
|
void msgPrintControlKey::format(char *buffer, size_t bufferSize) {
|
||||||
snprintf(buffer, bufferSize, "controller %s, axis %d, function %s, line %d",
|
snprintf(buffer, bufferSize, "controller %s, axis %d, function %s, line %d",
|
||||||
controller_.c_str(), axisNo_, functionName_, line_);
|
controller_.c_str(), axisNo_, functionName_.c_str(), line_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
@@ -78,8 +74,8 @@ bool msgPrintControl::shouldBePrinted(msgPrintControlKey &key, bool wantToPrint,
|
|||||||
pasynUser, ASYN_TRACE_ERROR,
|
pasynUser, ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nError "
|
"Controller \"%s\", axis %d => %s, line %d\nError "
|
||||||
"associated with key \"%s\" has been resolved.\n",
|
"associated with key \"%s\" has been resolved.\n",
|
||||||
key.controller_.c_str(), key.axisNo_, key.functionName_,
|
key.controller_.c_str(), key.axisNo_,
|
||||||
key.line_, formattedKey);
|
key.functionName_.c_str(), key.line_, formattedKey);
|
||||||
}
|
}
|
||||||
map_[key] = 0;
|
map_[key] = 0;
|
||||||
}
|
}
|
||||||
@@ -107,7 +103,7 @@ void msgPrintControl::resetCount(msgPrintControlKey &key, asynUser *pasynUser) {
|
|||||||
"Controller \"%s\", axis %d => %s, line %d\nError "
|
"Controller \"%s\", axis %d => %s, line %d\nError "
|
||||||
"associated with key \"%s\" has been resolved.\n",
|
"associated with key \"%s\" has been resolved.\n",
|
||||||
key.controller_.c_str(), key.axisNo_,
|
key.controller_.c_str(), key.axisNo_,
|
||||||
key.functionName_, key.line_, formattedKey);
|
key.functionName_.c_str(), key.line_, formattedKey);
|
||||||
}
|
}
|
||||||
map_[key] = 0;
|
map_[key] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class HIDDEN msgPrintControlKey {
|
|||||||
// -1 indicates a non-axis specific message
|
// -1 indicates a non-axis specific message
|
||||||
int axisNo_;
|
int axisNo_;
|
||||||
|
|
||||||
const char *functionName_;
|
std::string functionName_;
|
||||||
int line_;
|
int line_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +38,7 @@ class HIDDEN msgPrintControlKey {
|
|||||||
|
|
||||||
bool operator==(const msgPrintControlKey &other) const {
|
bool operator==(const msgPrintControlKey &other) const {
|
||||||
return axisNo_ == other.axisNo_ && line_ == other.line_ &&
|
return axisNo_ == other.axisNo_ && line_ == other.line_ &&
|
||||||
strcmp(functionName_, other.functionName_) == 0 &&
|
functionName_ == other.functionName_ &&
|
||||||
controller_ == other.controller_;
|
controller_ == other.controller_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ template <> struct hash<msgPrintControlKey> {
|
|||||||
// Combine the hashes of the members (x and y)
|
// Combine the hashes of the members (x and y)
|
||||||
size_t h1 = std::hash<std::string>{}(obj.controller_);
|
size_t h1 = std::hash<std::string>{}(obj.controller_);
|
||||||
size_t h2 = hash<int>{}(obj.axisNo_);
|
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_);
|
size_t h4 = hash<int>{}(obj.line_);
|
||||||
// Combine the hashes (simple XOR and shifting technique)
|
// Combine the hashes (simple XOR and shifting technique)
|
||||||
return h1 ^ (h2 << 1) ^ (h3 << 2) ^ (h4 << 3);
|
return h1 ^ (h2 << 1) ^ (h3 << 2) ^ (h4 << 3);
|
||||||
|
|||||||
Reference in New Issue
Block a user