summaryrefslogtreecommitdiff
path: root/source/application/main/PlatformMath.cc
diff options
context:
space:
mode:
authoralexander <alexander.efremov@arm.com>2021-04-29 20:36:09 +0100
committerAlexander Efremov <alexander.efremov@arm.com>2021-05-04 19:57:44 +0000
commitc350cdced0a8a2ca17376f58813e6d48d796ac7c (patch)
treef732cde664837a7cb9429b17e1366bb31a635b15 /source/application/main/PlatformMath.cc
parent6448932cc1c612d78e62c778ebb228b3cbe96a58 (diff)
downloadml-embedded-evaluation-kit-c350cdced0a8a2ca17376f58813e6d48d796ac7c.tar.gz
MLECO-1868: Code static analyzer warnings fixes
Signed-off-by: alexander <alexander.efremov@arm.com> Change-Id: Ie423e9cad3fabec6ab077ded7236813fe4933dea
Diffstat (limited to 'source/application/main/PlatformMath.cc')
-rw-r--r--source/application/main/PlatformMath.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/application/main/PlatformMath.cc b/source/application/main/PlatformMath.cc
index a9f5049..9d18151 100644
--- a/source/application/main/PlatformMath.cc
+++ b/source/application/main/PlatformMath.cc
@@ -121,7 +121,7 @@ namespace math {
float sumReal = 0, sumImag = 0;
for (int t = 0; t < inputLength; t++) {
- float angle = 2 * M_PI * t * k / inputLength;
+ auto angle = static_cast<float>(2 * M_PI * t * k / inputLength);
sumReal += input[t] * cosf(angle);
sumImag += -input[t] * sinf(angle);
}
@@ -147,7 +147,7 @@ namespace math {
output.size());
#else /* ARM_DSP_AVAILABLE */
for (auto in = input.begin(), out = output.begin();
- in != input.end(); ++in, ++out) {
+ in != input.end() && out != output.end(); ++in, ++out) {
*out = logf(*in);
}
#endif /* ARM_DSP_AVAILABLE */