cppcheck: further fixes

This commit is contained in:
Ingo Weyrich
2019-08-07 15:32:52 +02:00
parent 4fedfb2b26
commit 4c99c9cf01
6 changed files with 52 additions and 248 deletions

View File

@@ -476,14 +476,14 @@ void tmo_fattal02 (size_t width,
Array2Df* H = new Array2Df (width, height);
float temp = 100.f / maxLum;
float eps = 1e-4f;
#ifdef _OPENMP
#pragma omp parallel if(multithread)
#endif
{
const float eps = 1e-4f;
#ifdef __SSE2__
vfloat epsv = F2V (eps);
vfloat tempv = F2V (temp);
const vfloat epsv = F2V(eps);
const vfloat tempv = F2V(temp);
#endif
#ifdef _OPENMP
#pragma omp for schedule(dynamic,16)
@@ -926,13 +926,13 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/*
// a solution which has no positive values: U_new(x,y)=U(x,y)-max
// (not really needed but good for numerics as we later take exp(U))
//DEBUG_STR << "solve_pde_fft: removing constant from solution" << std::endl;
float max = 0.f;
float maxVal = 0.f;
#ifdef _OPENMP
#pragma omp parallel for reduction(max:max) if(multithread)
#pragma omp parallel for reduction(max:maxVal) if(multithread)
#endif
for (int i = 0; i < width * height; i++) {
max = std::max (max, (*U) (i));
maxVal = std::max(maxVal, (*U)(i));
}
#ifdef _OPENMP
@@ -940,7 +940,7 @@ void solve_pde_fft (Array2Df *F, Array2Df *U, Array2Df *buf, bool multithread)/*
#endif
for (int i = 0; i < width * height; i++) {
(*U) (i) -= max;
(*U) (i) -= maxVal;
}
}