Kaydet (Commit) 1ab27f9a authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constfields in scaddins,sccomp

Change-Id: I4d21cfcc65c099fbddbe5146fc1b8a6257971e32
Reviewed-on: https://gerrit.libreoffice.org/61555
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 453879cf
...@@ -198,11 +198,11 @@ struct FuncDataBase ...@@ -198,11 +198,11 @@ struct FuncDataBase
const sal_Char* pIntName; const sal_Char* pIntName;
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // resource ID to description, parameter names and ~ description const char** pDescrID; // resource ID to description, parameter names and ~ description
bool bDouble; // name already exist in Calc bool const bDouble; // name already exist in Calc
bool bWithOpt; // first parameter is internal bool const bWithOpt; // first parameter is internal
const char** pCompListID; // list of valid names const char** pCompListID; // list of valid names
sal_uInt16 nNumOfParams; // number of named / described parameters sal_uInt16 const nNumOfParams; // number of named / described parameters
FDCategory eCat; // function category FDCategory const eCat; // function category
const char* pSuffix; // if bDouble, append a suffix other than "_ADD" for UI const char* pSuffix; // if bDouble, append a suffix other than "_ADD" for UI
}; };
...@@ -210,15 +210,15 @@ struct FuncDataBase ...@@ -210,15 +210,15 @@ struct FuncDataBase
class FuncData final class FuncData final
{ {
private: private:
OUString aIntName; OUString const aIntName;
const char* pUINameID; const char* pUINameID;
const char** pDescrID; // leads also to parameter descriptions! const char** pDescrID; // leads also to parameter descriptions!
bool bDouble; // flag for names that already exist in Calc bool const bDouble; // flag for names that already exist in Calc
bool bWithOpt; // has internal parameter on first position bool const bWithOpt; // has internal parameter on first position
sal_uInt16 nParam; // num of parameters sal_uInt16 const nParam; // num of parameters
std::vector<OUString> aCompList; // list of all valid names std::vector<OUString> aCompList; // list of all valid names
FDCategory eCat; // function category FDCategory const eCat; // function category
OUString aSuffix; // if bDouble and not empty, append a suffix other than "_ADD" for UI OUString aSuffix; // if bDouble and not empty, append a suffix other than "_ADD" for UI
public: public:
...@@ -521,10 +521,10 @@ class ConvertData ...@@ -521,10 +521,10 @@ class ConvertData
{ {
protected: protected:
friend class ConvertDataList; friend class ConvertDataList;
double fConst; double const fConst;
OUString aName; OUString const aName;
ConvertDataClass eClass; ConvertDataClass const eClass;
bool bPrefixSupport; bool const bPrefixSupport;
public: public:
ConvertData( ConvertData(
const sal_Char pUnitName[], const sal_Char pUnitName[],
...@@ -551,7 +551,7 @@ public: ...@@ -551,7 +551,7 @@ public:
class ConvertDataLinear final : public ConvertData class ConvertDataLinear final : public ConvertData
{ {
double fOffs; double const fOffs;
public: public:
inline ConvertDataLinear( inline ConvertDataLinear(
const sal_Char pUnitName[], const sal_Char pUnitName[],
......
...@@ -50,23 +50,23 @@ struct ScaFuncDataBase ...@@ -50,23 +50,23 @@ struct ScaFuncDataBase
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // resource ID to description, parameter names and ~ description const char** pDescrID; // resource ID to description, parameter names and ~ description
const char** pCompListID; // list of valid names const char** pCompListID; // list of valid names
sal_uInt16 nParamCount; // number of named / described parameters sal_uInt16 const nParamCount; // number of named / described parameters
ScaCategory eCat; // function category ScaCategory const eCat; // function category
bool bDouble; // name already exist in Calc bool const bDouble; // name already exist in Calc
bool bWithOpt; // first parameter is internal bool const bWithOpt; // first parameter is internal
}; };
class ScaFuncData final class ScaFuncData final
{ {
private: private:
OUString aIntName; // internal name (get***) OUString const aIntName; // internal name (get***)
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // leads also to parameter descriptions! const char** pDescrID; // leads also to parameter descriptions!
sal_uInt16 nParamCount; // num of parameters sal_uInt16 const nParamCount; // num of parameters
std::vector<OUString> aCompList; // list of all valid names std::vector<OUString> aCompList; // list of all valid names
ScaCategory eCat; // function category ScaCategory const eCat; // function category
bool bDouble; // name already exist in Calc bool const bDouble; // name already exist in Calc
bool bWithOpt; // first parameter is internal bool const bWithOpt; // first parameter is internal
public: public:
ScaFuncData(const ScaFuncDataBase& rBaseData); ScaFuncData(const ScaFuncDataBase& rBaseData);
......
...@@ -66,23 +66,23 @@ struct ScaFuncDataBase ...@@ -66,23 +66,23 @@ struct ScaFuncDataBase
// (English) function names again. // (English) function names again.
// see also: GetExcelName() or GetCompNames() or getCompatibilityNames() // see also: GetExcelName() or GetCompNames() or getCompatibilityNames()
const char* pCompName; const char* pCompName;
sal_uInt16 nParamCount; // number of named / described parameters sal_uInt16 const nParamCount; // number of named / described parameters
ScaCategory eCat; // function category ScaCategory const eCat; // function category
bool bDouble; // name already exist in Calc bool const bDouble; // name already exist in Calc
bool bWithOpt; // first parameter is internal bool const bWithOpt; // first parameter is internal
}; };
class ScaFuncData final class ScaFuncData final
{ {
private: private:
OUString aIntName; // internal name (get***) OUString const aIntName; // internal name (get***)
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // leads also to parameter descriptions! const char** pDescrID; // leads also to parameter descriptions!
sal_uInt16 nParamCount; // num of parameters sal_uInt16 const nParamCount; // num of parameters
std::vector<OUString> aCompList; // list of all valid names std::vector<OUString> aCompList; // list of all valid names
ScaCategory eCat; // function category ScaCategory const eCat; // function category
bool bDouble; // name already exist in Calc bool const bDouble; // name already exist in Calc
bool bWithOpt; // first parameter is internal bool const bWithOpt; // first parameter is internal
public: public:
ScaFuncData(const ScaFuncDataBase& rBaseData); ScaFuncData(const ScaFuncDataBase& rBaseData);
......
...@@ -29,12 +29,12 @@ template <typename DataProvider> class DifferentialEvolutionAlgorithm ...@@ -29,12 +29,12 @@ template <typename DataProvider> class DifferentialEvolutionAlgorithm
DataProvider& mrDataProvider; DataProvider& mrDataProvider;
size_t mnPopulationSize; size_t const mnPopulationSize;
std::vector<Individual> maPopulation; std::vector<Individual> maPopulation;
std::random_device maRandomDevice; std::random_device maRandomDevice;
std::mt19937 maGenerator; std::mt19937 maGenerator;
size_t mnDimensionality; size_t const mnDimensionality;
std::uniform_int_distribution<> maRandomPopulation; std::uniform_int_distribution<> maRandomPopulation;
std::uniform_int_distribution<> maRandomDimensionality; std::uniform_int_distribution<> maRandomDimensionality;
......
...@@ -49,7 +49,7 @@ private: ...@@ -49,7 +49,7 @@ private:
DataProvider& mrDataProvider; DataProvider& mrDataProvider;
size_t mnNumOfParticles; size_t const mnNumOfParticles;
std::vector<Particle> maSwarm; std::vector<Particle> maSwarm;
......
...@@ -116,7 +116,6 @@ private: ...@@ -116,7 +116,6 @@ private:
// results // results
bool mbSuccess; bool mbSuccess;
double mfResultValue;
uno::Sequence<double> maSolution; uno::Sequence<double> maSolution;
OUString maStatus; OUString maStatus;
...@@ -140,7 +139,6 @@ public: ...@@ -140,7 +139,6 @@ public:
, mnTimeout(60000) , mnTimeout(60000)
, mnAlgorithm(0) , mnAlgorithm(0)
, mbSuccess(false) , mbSuccess(false)
, mfResultValue(0.0)
{ {
registerProperty("NonNegative", PROP_NONNEGATIVE, 0, &mbNonNegative, registerProperty("NonNegative", PROP_NONNEGATIVE, 0, &mbNonNegative,
cppu::UnoType<decltype(mbNonNegative)>::get()); cppu::UnoType<decltype(mbNonNegative)>::get());
...@@ -212,7 +210,7 @@ public: ...@@ -212,7 +210,7 @@ public:
virtual void SAL_CALL setMaximize(sal_Bool bMaximize) override { mbMaximize = bMaximize; } virtual void SAL_CALL setMaximize(sal_Bool bMaximize) override { mbMaximize = bMaximize; }
virtual sal_Bool SAL_CALL getSuccess() override { return mbSuccess; } virtual sal_Bool SAL_CALL getSuccess() override { return mbSuccess; }
virtual double SAL_CALL getResultValue() override { return mfResultValue; } virtual double SAL_CALL getResultValue() override { return 0; }
virtual uno::Sequence<double> SAL_CALL getSolution() override { return maSolution; } virtual uno::Sequence<double> SAL_CALL getSolution() override { return maSolution; }
......
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