Commit 15306268 authored by Tom Titcombe's avatar Tom Titcombe
Browse files

Apply clang-tidy readability-named-parameter to Framework

re #15452
parent 7a75fb03
......@@ -1623,7 +1623,7 @@ Poco::ActiveResult<bool> Algorithm::executeAsync() {
* @param i :: Unused argument
* @return true if executed successfully.
*/
bool Algorithm::executeAsyncImpl(const Poco::Void &) {
bool Algorithm::executeAsyncImpl(const Poco::Void & /*unused*/) {
AsyncFlagHolder running(m_runningAsync);
return this->execute();
}
......
......@@ -39,15 +39,17 @@ void Column::setPlotType(int t) {
/**
* No implementation by default.
*/
void Column::sortIndex(bool, size_t, size_t, std::vector<size_t> &,
std::vector<std::pair<size_t, size_t>> &) const {
void Column::sortIndex(
bool /*unused*/, size_t /*unused*/, size_t /*unused*/,
std::vector<size_t> & /*unused*/,
std::vector<std::pair<size_t, size_t>> & /*unused*/) const {
throw std::runtime_error("Cannot sort column of type " + m_type);
}
/**
* No implementation by default.
*/
void Column::sortValues(const std::vector<size_t> &) {
void Column::sortValues(const std::vector<size_t> & /*unused*/) {
throw std::runtime_error("Cannot sort column of type " + m_type);
}
......
......@@ -78,25 +78,30 @@ public:
};
// SAX content handler for grapping stuff quickly from IDF
class myContentHandler : public Poco::XML::ContentHandler {
void startElement(const XMLString &, const XMLString &localName,
const XMLString &, const Attributes &attrList) override {
void startElement(const XMLString & /*uri*/, const XMLString &localName,
const XMLString & /*qname*/,
const Attributes &attrList) override {
if (localName == "instrument" || localName == "parameter-file") {
throw DummyException(
static_cast<std::string>(attrList.getValue("", "valid-from")),
static_cast<std::string>(attrList.getValue("", "valid-to")));
}
}
void endElement(const XMLString &, const XMLString &,
const XMLString &) override {}
void endElement(const XMLString & /*uri*/, const XMLString & /*localName*/,
const XMLString & /*qname*/) override {}
void startDocument() override {}
void endDocument() override {}
void characters(const XMLChar[], int, int) override {}
void endPrefixMapping(const XMLString &) override {}
void ignorableWhitespace(const XMLChar[], int, int) override {}
void processingInstruction(const XMLString &, const XMLString &) override {}
void setDocumentLocator(const Locator *) override {}
void skippedEntity(const XMLString &) override {}
void startPrefixMapping(const XMLString &, const XMLString &) override {}
void characters(const XMLChar /*ch*/[], int /*start*/,
int /*length*/) override {}
void endPrefixMapping(const XMLString & /*prefix*/) override {}
void ignorableWhitespace(const XMLChar /*ch*/[], int /*start*/,
int /*length*/) override {}
void processingInstruction(const XMLString & /*target*/,
const XMLString & /*data*/) override {}
void setDocumentLocator(const Locator * /*loc*/) override {}
void skippedEntity(const XMLString & /*name*/) override {}
void startPrefixMapping(const XMLString & /*prefix*/,
const XMLString & /*uri*/) override {}
};
} // namespace
......@@ -557,7 +562,8 @@ void ExperimentInfo::setDetectorGrouping(
* implementation throws, since no grouping information for update is available
* when grouping comes from a call to `cacheDetectorGroupings`. This method is
* overridden in MatrixWorkspace. */
void ExperimentInfo::updateCachedDetectorGrouping(const size_t) const {
void ExperimentInfo::updateCachedDetectorGrouping(
const size_t /*unused*/) const {
throw std::runtime_error("ExperimentInfo::updateCachedDetectorGrouping: "
"Cannot update -- grouping information not "
"available");
......
......@@ -17,7 +17,7 @@ namespace {
//----------------------------------------------------------------------------------------------
/// @cond
template <typename T> struct DescriptorCallback {
void apply(T &) {} // general one does nothing
void apply(T & /*unused*/) {} // general one does nothing
};
template <> struct DescriptorCallback<Kernel::FileDescriptor> {
void apply(Kernel::FileDescriptor &descriptor) {
......
......@@ -203,8 +203,9 @@ void FunctionGenerator::setUpForFit() {
}
/// Declare a new parameter
void FunctionGenerator::declareParameter(const std::string &, double,
const std::string &) {
void FunctionGenerator::declareParameter(const std::string & /*name*/,
double /*initValue*/,
const std::string & /*description*/) {
throw Kernel::Exception::NotImplementedError(
"FunctionGenerator cannot not have its own parameters.");
}
......
......@@ -48,7 +48,8 @@ operator=(const boost::shared_ptr<IFunction> &value) {
//--------------------------------------------------------------------------------------
/// Add the value of another property
FunctionProperty &FunctionProperty::operator+=(Kernel::Property const *) {
FunctionProperty &FunctionProperty::
operator+=(Kernel::Property const * /*right*/) {
throw Kernel::Exception::NotImplementedError(
"+= operator is not implemented for FunctionProperty.");
return *this;
......
......@@ -586,17 +586,17 @@ namespace {
class AttType : public IFunction::ConstAttributeVisitor<std::string> {
protected:
/// Apply if string
std::string apply(const std::string &) const override {
std::string apply(const std::string & /*str*/) const override {
return "std::string";
}
/// Apply if int
std::string apply(const int &) const override { return "int"; }
std::string apply(const int & /*i*/) const override { return "int"; }
/// Apply if double
std::string apply(const double &) const override { return "double"; }
std::string apply(const double & /*d*/) const override { return "double"; }
/// Apply if bool
std::string apply(const bool &) const override { return "bool"; }
std::string apply(const bool & /*i*/) const override { return "bool"; }
/// Apply if vector
std::string apply(const std::vector<double> &) const override {
std::string apply(const std::vector<double> & /*unused*/) const override {
return "std::vector<double>";
}
};
......
......@@ -206,16 +206,16 @@ void ISpectrum::invalidateSpectrumDefinition() const {
}
/// Override in child classes for polymorphic copying of data.
void ISpectrum::copyDataInto(DataObjects::EventList &) const {
void ISpectrum::copyDataInto(DataObjects::EventList & /*unused*/) const {
throw std::runtime_error("Incompatible types in ISpectrum::copyDataFrom");
}
/// Override in child classes for polymorphic copying of data.
void ISpectrum::copyDataInto(DataObjects::Histogram1D &) const {
void ISpectrum::copyDataInto(DataObjects::Histogram1D & /*unused*/) const {
throw std::runtime_error("Incompatible types in ISpectrum::copyDataFrom");
}
/// Override in child classes for polymorphic copying of data.
void ISpectrum::copyDataInto(SpectrumTester &) const {
void ISpectrum::copyDataInto(SpectrumTester & /*unused*/) const {
throw std::runtime_error("Incompatible types in ISpectrum::copyDataFrom");
}
......
......@@ -1695,7 +1695,8 @@ signal_t MatrixWorkspace::getSignalWithMaskAtCoord(
MDMasking for a Matrix Workspace has not been implemented.
@param :
*/
void MatrixWorkspace::setMDMasking(Mantid::Geometry::MDImplicitFunction *) {
void MatrixWorkspace::setMDMasking(
Mantid::Geometry::MDImplicitFunction * /*maskingRegion*/) {
throw std::runtime_error(
"MatrixWorkspace::setMDMasking has no implementation");
}
......@@ -2023,14 +2024,15 @@ void MatrixWorkspace::invalidateCachedSpectrumNumbers() {
/// Cache a lookup of grouped detIDs to member IDs. Always throws
/// std::runtime_error since MatrixWorkspace supports detector grouping via
/// spectra instead of the caching mechanism.
void MatrixWorkspace::cacheDetectorGroupings(const det2group_map &) {
void MatrixWorkspace::cacheDetectorGroupings(
const det2group_map & /*mapping*/) {
throw std::runtime_error("Cannot cache detector groupings in a "
"MatrixWorkspace -- grouping must be defined via "
"spectra");
}
/// Throws an exception. This method is only for MDWorkspaces.
size_t MatrixWorkspace::groupOfDetectorID(const detid_t) const {
size_t MatrixWorkspace::groupOfDetectorID(const detid_t /*detID*/) const {
throw std::runtime_error("ExperimentInfo::groupOfDetectorID can not be used "
"for MatrixWorkspace, only for MDWorkspaces");
}
......
......@@ -303,7 +303,7 @@ size_t MatrixWorkspaceMDIterator::getLinearIndex() const {
"MatrixWorkspaceMDIterator does not implement getLinearIndex");
}
bool MatrixWorkspaceMDIterator::isWithinBounds(const size_t) const {
bool MatrixWorkspaceMDIterator::isWithinBounds(const size_t /*index*/) const {
throw std::runtime_error(
"MatrixWorkspaceMDIterator does not implement isWithinBounds");
}
......
......@@ -47,7 +47,7 @@ double gaussian(const double time, const double decayConstant) {
* @param :: [input] the decay constant (tau)
* @returns :: Function evaluation
*/
double none(const double, const double) { return 1.; }
double none(const double /*unused*/, const double /*unused*/) { return 1.; }
} // namespace ApodizationFunctions
} // namespace Algorithms
} // namespace Mantid
......@@ -260,7 +260,8 @@ void profile(std::vector<double> &Xs, std::vector<double> &Ys,
* @param n Number of summed points.
* @return The average.
*/
double averageMode(const double sum, const size_t n, const size_t) noexcept {
double averageMode(const double sum, const size_t n,
const size_t /*unused*/) noexcept {
return sum / static_cast<double>(n);
}
......
......@@ -57,7 +57,7 @@ using VecCommands = std::vector<boost::shared_ptr<Command>>;
*/
class NullCommand : public Command {
bool isValid() const override { return false; }
MatrixWorkspace_sptr execute(MatrixWorkspace_sptr) const override {
MatrixWorkspace_sptr execute(MatrixWorkspace_sptr /*input*/) const override {
throw std::runtime_error(
"Should not be attempting ::execute on a NullCommand");
}
......
......@@ -48,7 +48,7 @@ TimeAtSampleStrategyDirect::TimeAtSampleStrategyDirect(
* @return Correction struct
*/
Correction Mantid::Algorithms::TimeAtSampleStrategyDirect::calculate(
const size_t &) const {
const size_t & /*workspace_index*/) const {
// Correction is L1 and Ei dependent only. Detector positions are not
// required.
......
......@@ -34,8 +34,8 @@ WeightingStrategy::WeightingStrategy() : m_cutOff(0) {}
Calculate the weight at distance from epicenter. Always returns 1 for this
implementation
*/
double FlatWeighting::weightAt(const double &, const double &, const double &,
const double &) {
double FlatWeighting::weightAt(const double & /*adjX*/, const double & /*ix*/,
const double & /*adjY*/, const double & /*iy*/) {
return 1;
}
......@@ -43,7 +43,9 @@ double FlatWeighting::weightAt(const double &, const double &, const double &,
Calculate the weight at distance from epicenter. Always returns 1
@return 1
*/
double FlatWeighting::weightAt(const Mantid::Kernel::V3D &) { return 1; }
double FlatWeighting::weightAt(const Mantid::Kernel::V3D & /*distance*/) {
return 1;
}
//----------------------------------------------------------------------------
// Linear Weighting Implementations
......@@ -121,7 +123,7 @@ double ParabolicWeighting::weightAt(const double &adjX, const double &ix,
Calculate the weight at distance from epicenter. Always throws.
@throw runtime_error if used
*/
double NullWeighting::weightAt(const Mantid::Kernel::V3D &) {
double NullWeighting::weightAt(const Mantid::Kernel::V3D & /*distance*/) {
throw std::runtime_error(
"NullWeighting strategy cannot be used to evaluate weights.");
}
......@@ -130,8 +132,8 @@ double NullWeighting::weightAt(const Mantid::Kernel::V3D &) {
Calculate the weight at distance from epicenter. Always throws.
@throws runtime_error if called
*/
double NullWeighting::weightAt(const double &, const double &, const double &,
const double &) {
double NullWeighting::weightAt(const double & /*adjX*/, const double & /*ix*/,
const double & /*adjY*/, const double & /*iy*/) {
throw std::runtime_error(
"NullWeighting strategy cannot be used to evaluate weights.");
}
......
......@@ -90,7 +90,7 @@ size_t CompositeCluster::size() const {
}
/// Add an index. This method does not apply to composite clusters.
void CompositeCluster::addIndex(const size_t &) {
void CompositeCluster::addIndex(const size_t & /*index*/) {
throw std::runtime_error("addIndex not implemented on CompositeCluster");
}
......
......@@ -252,7 +252,7 @@ AbsoluteBackgroundStrategy::AbsoluteBackgroundStrategy(const double background)
: m_background(background) {}
bool AbsoluteBackgroundStrategy::isBelowBackground(
const double intensity, const HistogramData::HistogramY &) const {
const double intensity, const HistogramData::HistogramY & /*y*/) const {
return intensity < m_background;
}
......@@ -545,9 +545,9 @@ SimpleReduceStrategy::SimpleReduceStrategy(
const CompareStrategy *compareStrategy)
: ReducePeakListStrategy(compareStrategy) {}
std::vector<SXPeak>
SimpleReduceStrategy::reduce(const std::vector<SXPeak> &peaks,
Mantid::Kernel::ProgressBase &) const {
std::vector<SXPeak> SimpleReduceStrategy::reduce(
const std::vector<SXPeak> &peaks,
Mantid::Kernel::ProgressBase & /*progress*/) const {
// If the peaks are empty then do nothing
if (peaks.empty()) {
return peaks;
......
......@@ -2335,7 +2335,7 @@ bool IntegratePeakTimeSlices::isGoodFit(std::vector<double> const &params,
* @return true if there is enough data, otherwise false
*/
bool DataModeHandler::IsEnoughData(const double *ParameterValues,
Kernel::Logger &) {
Kernel::Logger & /*unused*/) {
// Check if flat
double Varx, Vary, Cov;
......
......@@ -62,7 +62,8 @@ bool PeakBackground::isBackground(Mantid::API::IMDIterator *iterator) const {
return true;
}
void PeakBackground::configureIterator(Mantid::API::IMDIterator *const) const {}
void PeakBackground::configureIterator(
Mantid::API::IMDIterator *const /*iterator*/) const {}
} // namespace Crystal
} // namespace Mantid
......@@ -85,8 +85,8 @@ bool PeaksInRegion::pointOutsideAnyExtents(const V3D &testPoint) const {
testPoint[2] < m_extents[4] || testPoint[2] > m_extents[5];
}
bool PeaksInRegion::pointInsideAllExtents(const V3D &testPoint,
const Mantid::Kernel::V3D &) const {
bool PeaksInRegion::pointInsideAllExtents(
const V3D &testPoint, const Mantid::Kernel::V3D & /*peakCenter*/) const {
return testPoint[0] >= m_extents[0] && testPoint[0] <= m_extents[1] &&
testPoint[1] >= m_extents[2] && testPoint[1] <= m_extents[3] &&
testPoint[2] >= m_extents[4] && testPoint[2] <= m_extents[5];
......
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