diff options
author | Han-Lin Chen <hanlinchen@chromium.org> | 2021-10-14 15:05:32 +0800 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-10-18 10:02:08 +0100 |
commit | 427f4b7f0dc6fc1d8cf263568a270d65c484acf3 (patch) | |
tree | 26bd105ce1b87248b779552449f350cfeb26b25e /aiq/aiq_input_parameters.cpp | |
parent | 32db420d739f48930d6fa901503481e84ef040d4 (diff) |
ipu3: Change Macro migrated from Chrome OS to its std version accordingly
Change the Macro STDCOPY, MEMCPY_S and CLEAR to its std version to better
suit the style. The patch also fix misusage of STDCOPY as memcpy, which
leads to copying overflown in PA and SA results.
Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'aiq/aiq_input_parameters.cpp')
-rw-r--r-- | aiq/aiq_input_parameters.cpp | 50 |
1 files changed, 21 insertions, 29 deletions
diff --git a/aiq/aiq_input_parameters.cpp b/aiq/aiq_input_parameters.cpp index 56301f6..8a53849 100644 --- a/aiq/aiq_input_parameters.cpp +++ b/aiq/aiq_input_parameters.cpp @@ -14,11 +14,6 @@ #include <libcamera/base/log.h> -/* Macros used by imported code */ -#define STDCOPY(dst, src, size) std::copy((src), ((src) + (size)), (dst)) -#define MEMCPY_S(dest, dmax, src, smax) memcpy((dest), (src), std::min((size_t)(dmax), (size_t)(smax))) -#define CLEAR(x) memset(&(x), 0, sizeof(x)) - namespace libcamera { LOG_DEFINE_CATEGORY(AIQInputParameters) @@ -27,26 +22,26 @@ namespace ipa::ipu3::aiq { void AiqInputParameters::init() { - CLEAR(aeInputParams); - CLEAR(afParams); - CLEAR(afBracketParams); - CLEAR(awbParams); - CLEAR(gbceParams); - CLEAR(paParams); - CLEAR(saParams); - CLEAR(sensorDescriptor); - CLEAR(exposureWindow); - CLEAR(exposureCoordinate); - CLEAR(aeFeatures); - CLEAR(aeManualLimits); - CLEAR(manualFocusParams); - CLEAR(focusRect); - CLEAR(manualCctRange); - CLEAR(manualWhiteCoordinate); - CLEAR(awbResults); - CLEAR(colorGains); - CLEAR(exposureParams); - CLEAR(sensorFrameParams); + aeInputParams = {}; + afParams = {}; + afBracketParams = {}; + awbParams = {}; + gbceParams = {}; + paParams = {}; + saParams = {}; + sensorDescriptor = {}; + exposureWindow = {}; + exposureCoordinate = {}; + aeFeatures = {}; + aeManualLimits = {}; + manualFocusParams = {}; + focusRect = {}; + manualCctRange = {}; + manualWhiteCoordinate = {}; + awbResults = {}; + colorGains = {}; + exposureParams = {}; + sensorFrameParams = {}; aeLock = false; awbLock = false; blackLevelLock = false; @@ -102,10 +97,7 @@ AiqInputParameters &AiqInputParameters::operator=(const AiqInputParameters &othe if (this == &other) return *this; - MEMCPY_S(this, - sizeof(AiqInputParameters), - &other, - sizeof(AiqInputParameters)); + memcpy(this, &other, sizeof(AiqInputParameters)); reset(); /* Exposure coordinate is nullptr in other than SPOT mode. */ |