Fix LGTM multiplication alerts
This commit is contained in:
parent
f16773eb3f
commit
65e76df279
@ -1462,8 +1462,8 @@ static int line_detect(float *in, const int width, const int height, const int x
|
||||
ashift_lines[lct].length = sqrt((px2 - px1) * (px2 - px1) + (py2 - py1) * (py2 - py1));
|
||||
ashift_lines[lct].width = lsd_lines[n * 7 + 4] / scale;
|
||||
|
||||
// ... and weight (= length * width * angle precision)
|
||||
const float weight = ashift_lines[lct].length * ashift_lines[lct].width * lsd_lines[n * 7 + 5];
|
||||
// ... and weight (= angle precision * length * width)
|
||||
const float weight = lsd_lines[n * 7 + 5] * ashift_lines[lct].length * ashift_lines[lct].width;
|
||||
ashift_lines[lct].weight = weight;
|
||||
|
||||
|
||||
@ -2083,10 +2083,10 @@ static double model_fitness(double *params, void *data)
|
||||
float s = vec3scalar(L, A);
|
||||
|
||||
// sum up weighted s^2 for both directions individually
|
||||
sumsq_v += isvertical ? s * s * lines[n].weight : 0.0;
|
||||
sumsq_v += isvertical ? (double)s * s * lines[n].weight : 0.0;
|
||||
weight_v += isvertical ? lines[n].weight : 0.0;
|
||||
count_v += isvertical ? 1 : 0;
|
||||
sumsq_h += !isvertical ? s * s * lines[n].weight : 0.0;
|
||||
sumsq_h += !isvertical ? (double)s * s * lines[n].weight : 0.0;
|
||||
weight_h += !isvertical ? lines[n].weight : 0.0;
|
||||
count_h += !isvertical ? 1 : 0;
|
||||
count++;
|
||||
@ -2128,7 +2128,7 @@ static dt_iop_ashift_nmsresult_t nmsfit(dt_iop_module_t *module, dt_iop_ashift_p
|
||||
fit.lines_count = g->lines_count;
|
||||
fit.width = g->lines_in_width;
|
||||
fit.height = g->lines_in_height;
|
||||
fit.f_length_kb = (p->mode == ASHIFT_MODE_GENERIC) ? DEFAULT_F_LENGTH : p->f_length * p->crop_factor;
|
||||
fit.f_length_kb = (p->mode == ASHIFT_MODE_GENERIC) ? (float)DEFAULT_F_LENGTH : p->f_length * p->crop_factor;
|
||||
fit.orthocorr = (p->mode == ASHIFT_MODE_GENERIC) ? 0.0f : p->orthocorr;
|
||||
fit.aspect = (p->mode == ASHIFT_MODE_GENERIC) ? 1.0f : p->aspect;
|
||||
fit.rotation = p->rotation;
|
||||
|
@ -319,7 +319,7 @@ static ntuple_list new_ntuple_list(unsigned int dim)
|
||||
n_tuple->dim = dim;
|
||||
|
||||
/* get memory for tuples */
|
||||
n_tuple->values = (double *) malloc( dim*n_tuple->max_size * sizeof(double) );
|
||||
n_tuple->values = (double *) malloc( sizeof(double) * dim*n_tuple->max_size );
|
||||
if( n_tuple->values == NULL ) error("not enough memory.");
|
||||
|
||||
return n_tuple;
|
||||
@ -339,7 +339,7 @@ static void enlarge_ntuple_list(ntuple_list n_tuple)
|
||||
|
||||
/* realloc memory */
|
||||
n_tuple->values = (double *) realloc( (void *) n_tuple->values,
|
||||
n_tuple->dim * n_tuple->max_size * sizeof(double) );
|
||||
sizeof(double) * n_tuple->dim * n_tuple->max_size );
|
||||
if( n_tuple->values == NULL ) error("not enough memory.");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user