diff --git a/FileIO/GMSInterface.cpp b/FileIO/GMSInterface.cpp index 6208fa0a532126f8ef2d08424dbbdcc3dd8cce96..e29c90bb4305b025d74e8b9d157b76989872405b 100644 --- a/FileIO/GMSInterface.cpp +++ b/FileIO/GMSInterface.cpp @@ -218,7 +218,7 @@ std::vector<std::string> GMSInterface::readSoilIDfromFile(const std::string &fil return soilID; } -MeshLib::Mesh* GMSInterface::readGMS3DMMesh(std::string filename) +MeshLib::Mesh* GMSInterface::readGMS3DMMesh(const std::string &filename) { std::string line(""); diff --git a/FileIO/GMSInterface.h b/FileIO/GMSInterface.h index e5f3ba0e1fd92b8c61eb10dd02f08b5bf0d43015..6bc2a568f55b979b970a674ef82664c73063fa13 100644 --- a/FileIO/GMSInterface.h +++ b/FileIO/GMSInterface.h @@ -63,7 +63,7 @@ public: const std::string &filename); /// Reads a GMS *.3dm file and converts it to an CFEMesh. - static MeshLib::Mesh* readGMS3DMMesh(std::string file_name); + static MeshLib::Mesh* readGMS3DMMesh(const std::string &file_name); private: /** diff --git a/FileIO/SHPInterface.cpp b/FileIO/SHPInterface.cpp index 0eb579220a2fd7aca89a782fb6bb0f5c2270fe08..e403bcab1eb4dfa22da05ab3b33befbd2f072080 100644 --- a/FileIO/SHPInterface.cpp +++ b/FileIO/SHPInterface.cpp @@ -52,7 +52,7 @@ bool SHPInterface::readSHPInfo(const std::string &filename, int &shapeType, int return true; } -void SHPInterface::readSHPFile(const std::string &filename, OGSType choice, std::string listName) +void SHPInterface::readSHPFile(const std::string &filename, OGSType choice, const std::string &listName) { int shapeType, numberOfElements; double padfMinBound[4], padfMaxBound[4]; @@ -158,7 +158,7 @@ void SHPInterface::readPolylines(const SHPHandle &hSHP, int numberOfElements, st } } -void SHPInterface::readPolygons(const SHPHandle &hSHP, int numberOfElements, std::string listName) +void SHPInterface::readPolygons(const SHPHandle &hSHP, int numberOfElements, const std::string &listName) { this->readPolylines(hSHP, numberOfElements, listName); @@ -180,7 +180,7 @@ void SHPInterface::readPolygons(const SHPHandle &hSHP, int numberOfElements, std } void SHPInterface::adjustPolylines(std::vector<GeoLib::Polyline*>* lines, - std::vector<std::size_t> id_map) + const std::vector<std::size_t> &id_map) { for (std::size_t i = 0; i < lines->size(); i++) { diff --git a/FileIO/SHPInterface.h b/FileIO/SHPInterface.h index 7614d62b44da6b9b4cb8e090fc59a1c62691e4d4..438a8f4ec156edb31eb763cb3177548ada98234f 100644 --- a/FileIO/SHPInterface.h +++ b/FileIO/SHPInterface.h @@ -58,7 +58,7 @@ public: bool readSHPInfo(const std::string &filename, int &shapeType, int &numberOfEntities); /// Reads data from the shape file. - void readSHPFile(const std::string &filename, OGSType choice, std::string listName); + void readSHPFile(const std::string &filename, OGSType choice, const std::string &listName); /// Writes a 2D mesh into a shapefile using one polygon for every element /// (based on request by AS, open for discussion) @@ -76,10 +76,10 @@ private: void readPolylines (const SHPHandle &hSHP, int numberOfElements, std::string listName); /// Reads lines into a vector of Polyline and Surface objects. - void readPolygons (const SHPHandle &hSHP, int numberOfElements, std::string listName); + void readPolygons (const SHPHandle &hSHP, int numberOfElements, const std::string& listName); void adjustPolylines (std::vector<GeoLib::Polyline*>* lines, - std::vector<std::size_t> id_map); + const std::vector<std::size_t> &id_map); GeoLib::GEOObjects* _geoObjects; }; diff --git a/FileIO/XmlIO/Qt/XmlGspInterface.cpp b/FileIO/XmlIO/Qt/XmlGspInterface.cpp index f9acea1e89f482e31dd3b13ce0232494c6eb1bcc..60cba5d4d915799e0c9be6046f23451f29188daa 100644 --- a/FileIO/XmlIO/Qt/XmlGspInterface.cpp +++ b/FileIO/XmlIO/Qt/XmlGspInterface.cpp @@ -107,7 +107,7 @@ int XmlGspInterface::readFile(const QString &fileName) return 1; } -int XmlGspInterface::writeToFile(std::string filename) +int XmlGspInterface::writeToFile(const std::string& filename) { _filename = filename; return FileIO::Writer::writeToFile(filename); diff --git a/FileIO/XmlIO/Qt/XmlGspInterface.h b/FileIO/XmlIO/Qt/XmlGspInterface.h index 67546adc1c001f531ce8d399f30fffeefe3383d6..7975f2f416d014789bdebb74a4f0b03aad034543 100644 --- a/FileIO/XmlIO/Qt/XmlGspInterface.h +++ b/FileIO/XmlIO/Qt/XmlGspInterface.h @@ -41,7 +41,7 @@ public: bool readFile(std::string const& fname) { return readFile(QString(fname.c_str())) != 0; } - int writeToFile(std::string filename); + int writeToFile(const std::string& filename); protected: bool write(); diff --git a/GeoLib/Station.cpp b/GeoLib/Station.cpp index 1e3edc22259b50dec21222d1bc82e46516ace516..455827fd14476d8add4e4035536a43957017d0a8 100644 --- a/GeoLib/Station.cpp +++ b/GeoLib/Station.cpp @@ -54,7 +54,7 @@ Station::Station(Station const& src) : addProperty("z", &getZ, &Station::setZ); } -void Station::addProperty(std::string pname, double (* getFct)(void*), void (* set)(void*, double)) +void Station::addProperty(const std::string &pname, double (* getFct)(void*), void (* set)(void*, double)) { STNProperty p; p.name = pname; diff --git a/GeoLib/Station.h b/GeoLib/Station.h index d6dd7a5a1d04b6cb8385cabeb646c21cae7cda02..54d9bea3d23b8df25f31a9c583167aaee027e6b4 100644 --- a/GeoLib/Station.h +++ b/GeoLib/Station.h @@ -120,7 +120,7 @@ public: * \param get A function pointer to a static read function for the variable referred to by pname * \param set A function pointer to a static write function for the variable referred to by pname */ - void addProperty(std::string pname, double (* get)(void*), void (* set)(void*, double)); + void addProperty(const std::string &pname, double (* get)(void*), void (* set)(void*, double)); /// Returns a map containing all the properties of that station type. const std::map<std::string, double> getProperties(); diff --git a/GeoLib/StationBorehole.cpp b/GeoLib/StationBorehole.cpp index 25991a725c53114de3611452886a2c0c2887b22e..ae045c80e8ff588768fec9fff46e5c9b1954595e 100644 --- a/GeoLib/StationBorehole.cpp +++ b/GeoLib/StationBorehole.cpp @@ -243,7 +243,7 @@ StationBorehole* StationBorehole::createStation(const std::string &name, double y, double z, double depth, - std::string date) + const std::string &date) { StationBorehole* station = new StationBorehole(); station->_name = name; diff --git a/GeoLib/StationBorehole.h b/GeoLib/StationBorehole.h index 691eb99fa385ae3769c0b894b63227ea3cdb42ae..36a7e31bad6474f540a8878d517ca18c402ae621 100644 --- a/GeoLib/StationBorehole.h +++ b/GeoLib/StationBorehole.h @@ -42,7 +42,7 @@ public: double y, double z, double depth, - std::string date = ""); + const std::string &date = ""); /// Adds a stratigraphy to a borehole given a vector of points of length "n" and a vector of soil names of length "n-1". int addStratigraphy(const std::vector<Point*> &profile, const std::vector<std::string> &soil_names); diff --git a/MathLib/LinAlg/LinAlgEnums.cpp b/MathLib/LinAlg/LinAlgEnums.cpp index 01ea03a24ea1740b2502e96e9250bf82d5e74ef2..dc0fbed2d490685ff092d2dc21a8076ddbde6db0 100644 --- a/MathLib/LinAlg/LinAlgEnums.cpp +++ b/MathLib/LinAlg/LinAlgEnums.cpp @@ -25,7 +25,7 @@ std::string convertVecNormTypeToString(VecNormType normType) } } -VecNormType convertVecNormTypeToString(std::string str) +VecNormType convertVecNormTypeToString(const std::string &str) { if (str.compare("NORM1")==0) return VecNormType::NORM1; if (str.compare("NORM2")==0) return VecNormType::NORM2; diff --git a/MathLib/LinAlg/LinAlgEnums.h b/MathLib/LinAlg/LinAlgEnums.h index 14c4758635a4dd85274698bd9075fce1e7fffadd..822c470611385f35768b2cccaccf86402eaee1af 100644 --- a/MathLib/LinAlg/LinAlgEnums.h +++ b/MathLib/LinAlg/LinAlgEnums.h @@ -30,7 +30,7 @@ enum class VecNormType std::string convertVecNormTypeToString(VecNormType normType); /// convert string to VecNormType -VecNormType convertVecNormTypeToString(std::string str); +VecNormType convertVecNormTypeToString(const std::string &str); } // end namespace MathLib