Commit 16793a5f authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Fixing cppcheck warnings

parent 029a7ea6
......@@ -304,7 +304,7 @@ void Logger::setLevelForAll(const int level) {
* @param message :: The message to log
* @param priority :: The priority level
*/
void Logger::log(const std::string &message, Logger::Priority priority) {
void Logger::log(const std::string &message, const Logger::Priority &priority) {
if (!m_enabled)
return;
......@@ -349,7 +349,7 @@ void Logger::log(const std::string &message, Logger::Priority priority) {
* @param priority :: The priority level
* @return :: the stream
*/
std::ostream &Logger::getLogStream(Logger::Priority priority) {
std::ostream &Logger::getLogStream(const Logger::Priority &priority) {
if (!m_enabled)
return NULL_STREAM;
......
......@@ -26,7 +26,7 @@ namespace Kernel {
* Direction::InOut (Input & Output) property
* @throws std::invalid_argument if the name is empty
*/
Property::Property(std::string name, const std::type_info &type, const unsigned int direction)
Property::Property(std::string name, const std::type_info &type, const unsigned int &direction)
: m_name(std::move(name)), m_documentation(""), m_typeinfo(&type), m_direction(direction), m_units(""), m_group(""),
m_remember(true), m_autotrim(true) {
if (m_name.empty()) {
......
......@@ -1064,7 +1064,7 @@ template <typename TYPE> std::vector<double> TimeSeriesProperty<TYPE>::timesAsVe
* @param value The associated value
*/
template <typename TYPE>
void TimeSeriesProperty<TYPE>::addValue(const Types::Core::DateAndTime &time, const TYPE value) {
void TimeSeriesProperty<TYPE>::addValue(const Types::Core::DateAndTime &time, const TYPE &value) {
TimeValueUnit<TYPE> newvalue(time, value);
// Add the value to the back of the vector
m_values.emplace_back(newvalue);
......@@ -1094,7 +1094,7 @@ void TimeSeriesProperty<TYPE>::addValue(const Types::Core::DateAndTime &time, co
* @param value :: The associated value
* @return True if insertion successful (i.e. identical time not already in map
*/
template <typename TYPE> void TimeSeriesProperty<TYPE>::addValue(const std::string &time, const TYPE value) {
template <typename TYPE> void TimeSeriesProperty<TYPE>::addValue(const std::string &time, const TYPE &value) {
return addValue(Types::Core::DateAndTime(time), value);
}
......@@ -1104,7 +1104,7 @@ template <typename TYPE> void TimeSeriesProperty<TYPE>::addValue(const std::stri
* @param value :: The associated value
* @return True if insertion successful (i.e. identical time not already in map
*/
template <typename TYPE> void TimeSeriesProperty<TYPE>::addValue(const std::time_t &time, const TYPE value) {
template <typename TYPE> void TimeSeriesProperty<TYPE>::addValue(const std::time_t &time, const TYPE &value) {
Types::Core::DateAndTime dt;
dt.set_from_time_t(time);
return addValue(dt, value);
......
......@@ -86,10 +86,12 @@ template <> std::string dtype(TimeSeriesProperty<std::string> &self) {
.add_property("filtered_times", make_function(&Mantid::Kernel::TimeSeriesProperty<TYPE>::filteredTimesAsVector, \
return_value_policy<VectorToNumpy>())) \
.def("addValue", \
(void (TimeSeriesProperty<TYPE>::*)(const DateAndTime &, const TYPE)) & TimeSeriesProperty<TYPE>::addValue, \
(void (TimeSeriesProperty<TYPE>::*)(const DateAndTime &, const TYPE &)) & \
TimeSeriesProperty<TYPE>::addValue, \
(arg("self"), arg("time"), arg("value"))) \
.def("addValue", \
(void (TimeSeriesProperty<TYPE>::*)(const std::string &, const TYPE)) & TimeSeriesProperty<TYPE>::addValue, \
(void (TimeSeriesProperty<TYPE>::*)(const std::string &, const TYPE &)) & \
TimeSeriesProperty<TYPE>::addValue, \
(arg("self"), arg("time"), arg("value"))) \
.def("addValue", &addPyTimeValue<TYPE>, (arg("self"), arg("time"), arg("value"))) \
.def("clear", &TimeSeriesProperty<TYPE>::clear, arg("self")) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment