From 8a6d5d9ace06e08a9ba43cb1fe681fb15be2b339 Mon Sep 17 00:00:00 2001 From: Julien Michel <julien.michel@cnes.fr> Date: Tue, 21 Feb 2017 12:01:58 +0100 Subject: [PATCH] STY: Avoid passing long int by const reference (from RFC review) --- .../Adapters/OSSIMAdapters/include/otbSarSensorModelAdapter.h | 4 ++-- .../Adapters/OSSIMAdapters/src/otbSarSensorModelAdapter.cxx | 4 ++-- .../ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp | 4 ++-- .../ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/Adapters/OSSIMAdapters/include/otbSarSensorModelAdapter.h b/Modules/Adapters/OSSIMAdapters/include/otbSarSensorModelAdapter.h index a1a4c9d80e..b3276c5aa7 100644 --- a/Modules/Adapters/OSSIMAdapters/include/otbSarSensorModelAdapter.h +++ b/Modules/Adapters/OSSIMAdapters/include/otbSarSensorModelAdapter.h @@ -75,9 +75,9 @@ public: /** Deburst metadata if possible and return lines to keep in image file */ bool Deburst(std::vector<std::pair<unsigned long, unsigned long>> & lines); - static bool ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & imageLine, unsigned long & deburstLine); + static bool ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine); - static void DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & deburstLine, unsigned long & imageLine); + static void DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine); protected: diff --git a/Modules/Adapters/OSSIMAdapters/src/otbSarSensorModelAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbSarSensorModelAdapter.cxx index ce386833a4..4e75d0ddbc 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbSarSensorModelAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbSarSensorModelAdapter.cxx @@ -109,12 +109,12 @@ bool SarSensorModelAdapter::Deburst(std::vector<std::pair<unsigned long, unsigne return false; } -bool SarSensorModelAdapter::ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & imageLine, unsigned long & deburstLine) +bool SarSensorModelAdapter::ImageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine) { return ossimplugins::ossimSarSensorModel::imageLineToDeburstLine(lines,imageLine,deburstLine); } -void SarSensorModelAdapter::DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & deburstLine, unsigned long & imageLine) +void SarSensorModelAdapter::DeburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine) { ossimplugins::ossimSarSensorModel::deburstLineToImageLine(lines,deburstLine,imageLine); } diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp index 1f922db751..b3e0a3e055 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.cpp @@ -1267,7 +1267,7 @@ bool ossimSarSensorModel::deburst(std::vector<std::pair<unsigned long, unsigned return true; } -bool ossimSarSensorModel::imageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & imageLine, unsigned long & deburstLine) +bool ossimSarSensorModel::imageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine) { std::vector<std::pair<unsigned long,unsigned long>>::const_iterator vit = lines.begin(); std::vector<std::pair<unsigned long,unsigned long>>::const_iterator nit = vit+1; @@ -1293,7 +1293,7 @@ bool ossimSarSensorModel::imageLineToDeburstLine(const std::vector<std::pair<uns return false; } -void ossimSarSensorModel::deburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & deburstLine, unsigned long & imageLine) +void ossimSarSensorModel::deburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine) { std::vector<std::pair<unsigned long,unsigned long>>::const_iterator vit = lines.begin(); std::vector<std::pair<unsigned long,unsigned long>>::const_iterator nit = vit+1; diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.h b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.h index 2d73f0c73c..cb5d6e0630 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.h +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSarSensorModel.h @@ -264,7 +264,7 @@ public: * \param deburstLine The output deburst line * \return True if imageLine is within a preserved range, false otherwise */ - static bool imageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & imageLine, unsigned long & deburstLine); + static bool imageLineToDeburstLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long imageLine, unsigned long & deburstLine); /** * This is a helper function to convert deburst line to input image @@ -273,7 +273,7 @@ public: * \param imageLine The input deburst line * \param deburstLine The output original image line */ - static void deburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, const unsigned long & deburstLine, unsigned long & imageLine); + static void deburstLineToImageLine(const std::vector<std::pair<unsigned long,unsigned long> >& lines, unsigned long deburstLine, unsigned long & imageLine); /** * Returns pointer to a new instance, copy of this. -- GitLab