diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-11 16:00:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-11 16:00:08 +0400 |
commit | 094c9799f9926ae37515a1fe0380403ce3298a77 (patch) | |
tree | 780f06d65010a80ae7d3c67000af00db89d11a32 /source/blender/nodes | |
parent | eb7bccb39a639683275ed0b80b927cd5eb8264fa (diff) |
quiet -Wdouble-promotion warnings
Diffstat (limited to 'source/blender/nodes')
23 files changed, 121 insertions, 118 deletions
diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index 10b062977b2..1a1d744fb1b 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -603,7 +603,7 @@ void ntreeCompositExecTree(bNodeTree *ntree, RenderData *rd, int do_preview) if(nodeexec) { node = nodeexec->node; if(ntree->progress && totnode) - ntree->progress(ntree->prh, (1.0 - curnode/(float)totnode)); + ntree->progress(ntree->prh, (1.0f - curnode/(float)totnode)); if(ntree->stats_draw) { char str[64]; sprintf(str, "Compositing %d %s", curnode, node->name); diff --git a/source/blender/nodes/composite/node_composite_util.c b/source/blender/nodes/composite/node_composite_util.c index 0356ed394f1..ddd55790436 100644 --- a/source/blender/nodes/composite/node_composite_util.c +++ b/source/blender/nodes/composite/node_composite_util.c @@ -762,7 +762,7 @@ void premul_compbuf(CompBuf *img, int inversed) drect= img->rect; if(inversed) { for(x=img->x*img->y; x>0; x--, drect+=4) { - if(fabs(drect[3]) < 1e-5f) { + if(fabsf(drect[3]) < 1e-5f) { drect[0]= 0.0f; drect[1]= 0.0f; drect[2]= 0.0f; @@ -1314,7 +1314,7 @@ void IIR_gauss(CompBuf* src, float sigma, int chan, int xy) int i, x, y, sz; // <0.5 not valid, though can have a possibly useful sort of sharpening effect - if (sigma < 0.5) return; + if (sigma < 0.5f) return; if ((xy < 1) || (xy > 3)) xy = 3; @@ -1326,10 +1326,10 @@ void IIR_gauss(CompBuf* src, float sigma, int chan, int xy) // see "Recursive Gabor Filtering" by Young/VanVliet // all factors here in double.prec. Required, because for single.prec it seems to blow up if sigma > ~200 - if (sigma >= 3.556) - q = 0.9804*(sigma - 3.556) + 2.5091; + if (sigma >= 3.556f) + q = 0.9804f*(sigma - 3.556f) + 2.5091f; else // sigma >= 0.5 - q = (0.0561*sigma + 0.5784)*sigma - 0.2568; + q = (0.0561f*sigma + 0.5784f)*sigma - 0.2568f; q2 = q*q; sc = (1.1668 + q)*(3.203729649 + (2.21566 + q)*q); // no gabor filtering here, so no complex multiplies, just the regular coefs. diff --git a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c index 17038fd6780..0f341335783 100644 --- a/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c +++ b/source/blender/nodes/composite/nodes/node_composite_bilateralblur.c @@ -62,13 +62,14 @@ static bNodeSocketTemplate cmp_node_bilateralblur_out[]= { #define KERNEL_ELEMENT_C3(k) \ temp_color = src + deltas[k]; \ ref_color = ref + deltas[k]; \ - w = weight_tab[k] + COLOR_DISTANCE_C3(ref, ref_color )*i2sigma_color; \ + w = weight_tab[k] + \ + (double)COLOR_DISTANCE_C3(ref, ref_color ) * i2sigma_color; \ w = 1.0/(w*w + 1); \ mean0 += w; \ - mean1[0] += temp_color[0]*w; \ - mean1[1] += temp_color[1]*w; \ - mean1[2] += temp_color[2]*w; \ - mean1[3] += temp_color[3]*w; + mean1[0] += (double)temp_color[0]*w; \ + mean1[1] += (double)temp_color[1]*w; \ + mean1[2] += (double)temp_color[2]*w; \ + mean1[3] += (double)temp_color[3]*w; /* write blurred values to image */ #define UPDATE_OUTPUT_C3 \ @@ -137,8 +138,8 @@ static void node_composit_exec_bilateralblur(void *UNUSED(data), bNode *node, bN sigma_color= nbbd->sigma_color; sigma_space= nbbd->sigma_space; - i2sigma_color= 1. / (sigma_color * sigma_color); - i2sigma_space= 1. / (sigma_space * sigma_space); + i2sigma_color= 1.0f / (sigma_color * sigma_color); + i2sigma_space= 1.0f / (sigma_space * sigma_space); INIT_3X3_DELTAS(deltas, step, pix); diff --git a/source/blender/nodes/composite/nodes/node_composite_blur.c b/source/blender/nodes/composite/nodes/node_composite_blur.c index d0ddfb47f08..816aacbe61c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_blur.c +++ b/source/blender/nodes/composite/nodes/node_composite_blur.c @@ -77,7 +77,7 @@ static float *make_bloomtab(int rad) bloomtab = (float *) MEM_mallocN(n * sizeof(float), "bloom"); for (i = -rad; i <= rad; i++) { - val = pow(1.0 - fabs((float)i)/((float)rad), 4.0); + val = powf(1.0f - fabsf((float)i)/((float)rad), 4.0f); bloomtab[i+rad] = val; } diff --git a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c index 10f0afb6cf6..6597ceaeee2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c @@ -49,18 +49,18 @@ static void do_normalized_rgba_to_ycca2(bNode *UNUSED(node), float *out, float * { /*normalize to the range 0.0 to 1.0) */ rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); - out[0]=(out[0])/255.0; - out[1]=(out[1])/255.0; - out[2]=(out[2])/255.0; + out[0]=(out[0])/255.0f; + out[1]=(out[1])/255.0f; + out[2]=(out[2])/255.0f; out[3]=in[3]; } static void do_normalized_ycca_to_rgba2(bNode *UNUSED(node), float *out, float *in) { /*un-normalize the normalize from above */ - in[0]=in[0]*255.0; - in[1]=in[1]*255.0; - in[2]=in[2]*255.0; + in[0]=in[0]*255.0f; + in[1]=in[1]*255.0f; + in[2]=in[2]*255.0f; ycc_to_rgb(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); out[3]=in[3]; } diff --git a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c index 25891aeaa68..9aadfdf363b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_chromaMatte.c @@ -50,14 +50,14 @@ static void do_rgba_to_ycca_normalized(bNode *UNUSED(node), float *out, float *i rgb_to_ycc(in[0],in[1],in[2], &out[0], &out[1], &out[2], BLI_YCC_ITU_BT601); //normalize to 0..1.0 - out[0]=out[0]/255.0; - out[1]=out[1]/255.0; - out[2]=out[2]/255.0; + out[0]=out[0]/255.0f; + out[1]=out[1]/255.0f; + out[2]=out[2]/255.0f; //rescale to -1.0..1.0 - out[0]=(out[0]*2.0)-1.0; - out[1]=(out[1]*2.0)-1.0; - out[2]=(out[2]*2.0)-1.0; + out[0]=(out[0]*2.0f)-1.0f; + out[1]=(out[1]*2.0f)-1.0f; + out[2]=(out[2]*2.0f)-1.0f; // out[0]=((out[0])-16)/255.0; // out[1]=((out[1])-128)/255.0; @@ -68,13 +68,13 @@ static void do_rgba_to_ycca_normalized(bNode *UNUSED(node), float *out, float *i static void do_ycca_to_rgba_normalized(bNode *UNUSED(node), float *out, float *in) { /*un-normalize the normalize from above */ - in[0]=(in[0]+1.0)/2.0; - in[1]=(in[1]+1.0)/2.0; - in[2]=(in[2]+1.0)/2.0; + in[0]=(in[0]+1.0f)/2.0f; + in[1]=(in[1]+1.0f)/2.0f; + in[2]=(in[2]+1.0f)/2.0f; - in[0]=(in[0]*255.0); - in[1]=(in[1]*255.0); - in[2]=(in[2]*255.0); + in[0]=(in[0]*255.0f); + in[1]=(in[1]*255.0f); + in[2]=(in[2]*255.0f); // in[0]=(in[0]*255.0)+16; // in[1]=(in[1]*255.0)+128; @@ -98,27 +98,27 @@ static void do_chroma_key(bNode *node, float *out, float *in) theta=atan2(c->key[2], c->key[1]); /*rotate the cb and cr into x/z space */ - x=in[1]*cos(theta)+in[2]*sin(theta); - z=in[2]*cos(theta)-in[1]*sin(theta); + x=in[1]*cosf(theta)+in[2]*sinf(theta); + z=in[2]*cosf(theta)-in[1]*sinf(theta); /*if within the acceptance angle */ - angle=c->t1*M_PI/180.0; /* convert to radians */ + angle=c->t1*(float)M_PI/180.0f; /* convert to radians */ /* if kfg is <0 then the pixel is outside of the key color */ - kfg=x-(fabs(z)/tan(angle/2.0)); + kfg= x-(fabsf(z)/tanf(angle/2.0f)); out[0]=in[0]; out[1]=in[1]; out[2]=in[2]; - if(kfg>0.0) { /* found a pixel that is within key color */ - alpha=(1.0-kfg)*(c->fstrength); + if(kfg>0.0f) { /* found a pixel that is within key color */ + alpha=(1.0f-kfg)*(c->fstrength); beta=atan2(z,x); - angle2=c->t2*M_PI/180.0; + angle2=c->t2*(float)(M_PI/180.0); /* if beta is within the cutoff angle */ - if(fabs(beta)<(angle2/2.0)) { + if(fabsf(beta) < (angle2/2.0f)) { alpha=0.0; } diff --git a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c index b226e562799..66dc9ff0304 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorMatte.c @@ -57,13 +57,13 @@ static void do_color_key(bNode *node, float *out, float *in) if( /* do hue last because it needs to wrap, and does some more checks */ - /* sat */ (fabs(in[1]-c->key[1]) < c->t2) && - /* val */ (fabs(in[2]-c->key[2]) < c->t3) && + /* sat */ (fabsf(in[1]-c->key[1]) < c->t2) && + /* val */ (fabsf(in[2]-c->key[2]) < c->t3) && /* multiply by 2 because it wraps on both sides of the hue, * otherwise 0.5 would key all hue's */ - /* hue */ ((h_wrap= 2.0f * fabs(in[0]-c->key[0])) < c->t1 || (2.0f - h_wrap) < c->t1) + /* hue */ ((h_wrap= 2.0f * fabsf(in[0]-c->key[0])) < c->t1 || (2.0f - h_wrap) < c->t1) ) { out[3]=0.0; /*make transparent*/ } diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c index eb75802c0a6..f7de5801a5e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c +++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c @@ -61,7 +61,7 @@ DO_INLINE float colorbalance_cdl(float in, float offset, float power, float slop float x = in * slope + offset; /* prevent NaN */ - CLAMP(x, 0.0, 1.0); + CLAMP(x, 0.0f, 1.0f); return powf(x, power); } diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.c b/source/blender/nodes/composite/nodes/node_composite_curves.c index 6f4d32f6573..2e54836e042 100644 --- a/source/blender/nodes/composite/nodes/node_composite_curves.c +++ b/source/blender/nodes/composite/nodes/node_composite_curves.c @@ -141,9 +141,9 @@ static void do_curves(bNode *node, float *out, float *in) static void do_curves_fac(bNode *node, float *out, float *in, float *fac) { - if(*fac>=1.0) + if(*fac >= 1.0f) curvemapping_evaluate_premulRGBF(node->storage, out, in); - else if(*fac<=0.0) { + else if(*fac <= 0.0f) { copy_v3_v3(out, in); } else { @@ -175,7 +175,7 @@ static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeS curvemapping_set_black_white(node->storage, in[2]->vec, in[3]->vec); - if(in[0]->data==NULL && in[0]->vec[0] == 1.0) + if(in[0]->data==NULL && in[0]->vec[0] == 1.0f) composit1_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, do_curves, CB_RGBA); else composit2_pixel_processor(node, stackbuf, in[1]->data, in[1]->vec, in[0]->data, in[0]->vec, do_curves_fac, CB_RGBA, CB_VAL); diff --git a/source/blender/nodes/composite/nodes/node_composite_defocus.c b/source/blender/nodes/composite/nodes/node_composite_defocus.c index 2232c4a489e..9b32e0f6f3f 100644 --- a/source/blender/nodes/composite/nodes/node_composite_defocus.c +++ b/source/blender/nodes/composite/nodes/node_composite_defocus.c @@ -58,8 +58,8 @@ typedef struct BokehCoeffs { static void makeBokeh(char bktype, char ro, int* len_bkh, float* inradsq, BokehCoeffs BKH[8], float bkh_b[4]) { float x0, x1, y0, y1, dx, dy, iDxy; - float w = MAX2(1e-5f, ro)*M_PI/180.f; // never reported stangely enough, but a zero offset causes missing center line... - float wi = (360.f/bktype)*M_PI/180.f; + float w = MAX2(1e-5f, ro)*(float)(M_PI/180); // never reported stangely enough, but a zero offset causes missing center line... + float wi = (360.f/bktype)*(float)(M_PI/180); int i, ov, nv; // bktype must be at least 3 & <= 8 @@ -81,7 +81,7 @@ static void makeBokeh(char bktype, char ro, int* len_bkh, float* inradsq, BokehC BKH[i].x0 = x0; BKH[i].y0 = y0; dx = x1-x0, dy = y1-y0; - iDxy = 1.f / sqrt(dx*dx + dy*dy); + iDxy = 1.f / sqrtf(dx*dx + dy*dy); dx *= iDxy; dy *= iDxy; BKH[i].dx = dx; @@ -146,6 +146,7 @@ static float RI_vdC(unsigned int bits, unsigned int r) // single channel IIR gaussian filtering // much faster than anything else, constant time independent of width // should extend to multichannel and make this a node, could be useful +// note: this is an almost exact copy of 'IIR_gauss' static void IIR_gauss_single(CompBuf* buf, float sigma) { double q, q2, sc, cf[4], tsM[9], tsu[3], tsv[3]; @@ -156,14 +157,14 @@ static void IIR_gauss_single(CompBuf* buf, float sigma) if (buf->type != CB_VAL) return; // <0.5 not valid, though can have a possibly useful sort of sharpening effect - if (sigma < 0.5) return; + if (sigma < 0.5f) return; // see "Recursive Gabor Filtering" by Young/VanVliet // all factors here in double.prec. Required, because for single.prec it seems to blow up if sigma > ~200 - if (sigma >= 3.556) - q = 0.9804*(sigma - 3.556) + 2.5091; + if (sigma >= 3.556f) + q = 0.9804f*(sigma - 3.556f) + 2.5091f; else // sigma >= 0.5 - q = (0.0561*sigma + 0.5784)*sigma - 0.2568; + q = (0.0561f*sigma + 0.5784f)*sigma - 0.2568f; q2 = q*q; sc = (1.1668 + q)*(3.203729649 + (2.21566 + q)*q); // no gabor filtering here, so no complex multiplies, just the regular coefs. @@ -260,7 +261,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, Camera* cam = (Camera*)camob->data; cam_lens = cam->lens; cam_fdist = dof_camera(camob); - if (cam_fdist==0.0) cam_fdist = 1e10f; /* if the dof is 0.0 then set it be be far away */ + if (cam_fdist==0.0f) cam_fdist = 1e10f; /* if the dof is 0.0 then set it be be far away */ cam_invfdist = 1.f/cam_fdist; } @@ -362,7 +363,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, // scale crad back to original maximum and blend crad->rect[px] = bcrad + wts->rect[px]*(scf*crad->rect[px] - bcrad); */ - crad->rect[px] = 0.5f*fabs(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f)); + crad->rect[px] = 0.5f*fabsf(aperture*(dof_sp*(cam_invfdist - iZ) - 1.f)); // 'bug' #6615, limit minimum radius to 1 pixel, not really a solution, but somewhat mitigates the problem crad->rect[px] = MAX2(crad->rect[px], 0.5f); @@ -530,12 +531,13 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, }\ }\ } + i = ceil(ct_crad); j = 0; T = 0; while (i > j) { Dj = sqrt(cR2 - j*j); - Dj -= floor(Dj); + Dj -= floorf(Dj); di = 0; if (Dj > T) { i--; di = 1; } T = Dj; @@ -548,26 +550,26 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, lwt = wt*Dj; if (i!=j) { // outer pixels - AAPIX(x+j, y+i); - AAPIX(x+j, y-i); + AAPIX(x+j, y+i) + AAPIX(x+j, y-i) if (j) { - AAPIX(x-j, y+i); // BL - AAPIX(x-j, y-i); // TL + AAPIX(x-j, y+i) // BL + AAPIX(x-j, y-i) // TL } if (di) { // only when i changed, interior of outer section - CSCAN(j, i); // bottom - CSCAN(j, -i); // top + CSCAN(j, i) // bottom + CSCAN(j, -i) // top } } // lower mid section - AAPIX(x+i, y+j); - if (i) AAPIX(x-i, y+j); - CSCAN(i, j); + AAPIX(x+i, y+j) + if (i) AAPIX(x-i, y+j) + CSCAN(i, j) // upper mid section if (j) { - AAPIX(x+i, y-j); - if (i) AAPIX(x-i, y-j); - CSCAN(i, -j); + AAPIX(x+i, y-j) + if (i) AAPIX(x-i, y-j) + CSCAN(i, -j) } j++; } @@ -600,7 +602,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, fxe = fxe*ct_crad + x; xs = (int)floor(fxs), xe = (int)ceil(fxe); // AA hack for first and last x pixel, near vertical edges only - if (fabs(mind) <= 1.f) { + if (fabsf(mind) <= 1.f) { if ((xs >= 0) && (xs < new->x)) { lwt = 1.f-(fxs - xs); aacol[0] = wtcol[0]*lwt; @@ -619,7 +621,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, } } } - if (fabs(maxd) <= 1.f) { + if (fabsf(maxd) <= 1.f) { if ((xe >= 0) && (xe < new->x)) { lwt = 1.f-(xe - fxe); aacol[0] = wtcol[0]*lwt; @@ -676,7 +678,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, fys = fys*ct_crad + y; fye = fye*ct_crad + y; // near horizontal edges only, line slope <= 1 - if (fabs(mind) <= 1.f) { + if (fabsf(mind) <= 1.f) { int iys = (int)floor(fys); if ((iys >= 0) && (iys < new->y)) { lwt = 1.f - (fys - iys); @@ -696,7 +698,7 @@ static void defocus_blur(bNode *node, CompBuf *new, CompBuf *img, CompBuf *zbuf, } } } - if (fabs(maxd) <= 1.f) { + if (fabsf(maxd) <= 1.f) { int iye = ceil(fye); if ((iye >= 0) && (iye < new->y)) { lwt = 1.f - (iye - fye); diff --git a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c index 17156ab3492..5ca38b74420 100644 --- a/source/blender/nodes/composite/nodes/node_composite_diffMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_diffMatte.c @@ -58,7 +58,7 @@ static void do_diff_matte(bNode *node, float *outColor, float *inColor1, float * fabs(inColor2[2]-inColor1[2]); /*average together the distances*/ - difference=difference/3.0; + difference=difference/3.0f; copy_v3_v3(outColor, inColor1); diff --git a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c index 591870d0911..802ef2d8e12 100644 --- a/source/blender/nodes/composite/nodes/node_composite_directionalblur.c +++ b/source/blender/nodes/composite/nodes/node_composite_directionalblur.c @@ -48,7 +48,7 @@ static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap, if ((dist != 0.f) || (spin != 0.f) || (zoom != 0.f)) { void (*getpix)(CompBuf*, float, float, float*) = wrap ? qd_getPixelLerpWrap : qd_getPixelLerp; const float a= angle * (float)M_PI / 180.f; - const float itsc= 1.f / pow(2.f, (float)iterations); + const float itsc= 1.f / powf(2.f, (float)iterations); float D; float center_x_pix, center_y_pix; float tx, ty; @@ -62,14 +62,14 @@ static CompBuf *dblur(bNode *node, CompBuf *img, int iterations, int wrap, center_x_pix= center_x * img->x; center_y_pix= center_y * img->y; - tx= itsc * D * cos(a); - ty= -itsc * D * sin(a); + tx= itsc * D * cosf(a); + ty= -itsc * D * sinf(a); sc= itsc * zoom; rot= itsc * spin * (float)M_PI / 180.f; /* blur the image */ for(i= 0; i < iterations; ++i) { - const float cs= cos(rot), ss= sin(rot); + const float cs= cosf(rot), ss= sinf(rot); const float isc= 1.f / (1.f + sc); unsigned int x, y; float col[4]= {0,0,0,0}; diff --git a/source/blender/nodes/composite/nodes/node_composite_displace.c b/source/blender/nodes/composite/nodes/node_composite_displace.c index 02a1d203bef..a55a6093f12 100644 --- a/source/blender/nodes/composite/nodes/node_composite_displace.c +++ b/source/blender/nodes/composite/nodes/node_composite_displace.c @@ -49,7 +49,7 @@ static bNodeSocketTemplate cmp_node_displace_out[]= { /* minimum distance (in pixels) a pixel has to be displaced * in order to take effect */ -#define DISPLACE_EPSILON 0.01 +#define DISPLACE_EPSILON 0.01f static void do_displace(bNode *node, CompBuf *stackbuf, CompBuf *cbuf, CompBuf *vecbuf, float *UNUSED(veccol), CompBuf *xbuf, CompBuf *ybuf, float *xscale, float *yscale) { diff --git a/source/blender/nodes/composite/nodes/node_composite_gamma.c b/source/blender/nodes/composite/nodes/node_composite_gamma.c index 2bb600db99d..ad377799dea 100644 --- a/source/blender/nodes/composite/nodes/node_composite_gamma.c +++ b/source/blender/nodes/composite/nodes/node_composite_gamma.c @@ -50,7 +50,7 @@ static void do_gamma(bNode *UNUSED(node), float *out, float *in, float *fac) int i=0; for(i=0; i<3; i++) { /* check for negative to avoid nan's */ - out[i] = (in[i] > 0.0f)? pow(in[i],fac[0]): in[i]; + out[i] = (in[i] > 0.0f)? powf(in[i],fac[0]): in[i]; } out[3] = in[3]; } diff --git a/source/blender/nodes/composite/nodes/node_composite_glare.c b/source/blender/nodes/composite/nodes/node_composite_glare.c index f4391a1af77..b7cc1d3c92d 100644 --- a/source/blender/nodes/composite/nodes/node_composite_glare.c +++ b/source/blender/nodes/composite/nodes/node_composite_glare.c @@ -253,7 +253,7 @@ static void streaks(NodeGlare* ndg, CompBuf* dst, CompBuf* src) const float p4 = pow(4.0, (double)n); const float vxp = vx*p4, vyp = vy*p4; const float wt = pow((double)ndg->fade, (double)p4); - const float cmo = 1.f - pow((double)ndg->colmod, (double)n+1); // colormodulation amount relative to current pass + const float cmo = 1.f - (float)pow((double)ndg->colmod, (double)n+1); // colormodulation amount relative to current pass float* tdstcol = tdst->rect; for (y=0; y<tsrc->y; ++y) { for (x=0; x<tsrc->x; ++x, tdstcol+=4) { diff --git a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c index 3c73d07d96c..711560a0a94 100644 --- a/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c +++ b/source/blender/nodes/composite/nodes/node_composite_hueSatVal.c @@ -48,12 +48,12 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac) { NodeHueSat *nhs= node->storage; - if(*fac!=0.0f && (nhs->hue!=0.5f || nhs->sat!=1.0 || nhs->val!=1.0)) { + if(*fac!=0.0f && (nhs->hue!=0.5f || nhs->sat!=1.0f || nhs->val!=1.0f)) { float col[3], hsv[3], mfac= 1.0f - *fac; rgb_to_hsv(in[0], in[1], in[2], hsv, hsv+1, hsv+2); hsv[0]+= (nhs->hue - 0.5f); - if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0; + if(hsv[0]>1.0f) hsv[0]-=1.0f; else if(hsv[0]<0.0f) hsv[0]+= 1.0f; hsv[1]*= nhs->sat; hsv[2]*= nhs->val; hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2); diff --git a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c index f18eca3dfcc..acb70f13ec2 100644 --- a/source/blender/nodes/composite/nodes/node_composite_huecorrect.c +++ b/source/blender/nodes/composite/nodes/node_composite_huecorrect.c @@ -61,7 +61,7 @@ static void do_huecorrect(bNode *node, float *out, float *in) f = curvemapping_evaluateF(node->storage, 2, hsv[0]); hsv[2] *= (f * 2.f); - hsv[0] = hsv[0] - floor(hsv[0]); /* mod 1.0 */ + hsv[0] = hsv[0] - floorf(hsv[0]); /* mod 1.0 */ CLAMP(hsv[1], 0.f, 1.f); /* convert back to rgb */ @@ -89,7 +89,7 @@ static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac) f = curvemapping_evaluateF(node->storage, 2, hsv[0]); hsv[2] *= (f * 2.f); - hsv[0] = hsv[0] - floor(hsv[0]); /* mod 1.0 */ + hsv[0] = hsv[0] - floorf(hsv[0]); /* mod 1.0 */ CLAMP(hsv[1], 0.f, 1.f); /* convert back to rgb */ diff --git a/source/blender/nodes/composite/nodes/node_composite_invert.c b/source/blender/nodes/composite/nodes/node_composite_invert.c index daf2ee0cbe7..d98f5a1c64b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_invert.c +++ b/source/blender/nodes/composite/nodes/node_composite_invert.c @@ -65,7 +65,7 @@ static void do_invert_fac(bNode *node, float *out, float *in, float *fac) do_invert(node, col, in); /* blend inverted result against original input with fac */ - facm = 1.0 - fac[0]; + facm = 1.0f - fac[0]; if(node->custom1 & CMP_CHAN_RGB) { col[0] = fac[0]*col[0] + (facm*in[0]); diff --git a/source/blender/nodes/composite/nodes/node_composite_levels.c b/source/blender/nodes/composite/nodes/node_composite_levels.c index 54e48bb749d..f3e4f0db8b6 100644 --- a/source/blender/nodes/composite/nodes/node_composite_levels.c +++ b/source/blender/nodes/composite/nodes/node_composite_levels.c @@ -63,7 +63,7 @@ static void fill_bins(bNode* node, CompBuf* in, int* bins) /* get the pixel */ qd_getPixel(in, x, y, value); - if(value[3] > 0.0) { /* don't count transparent pixels */ + if(value[3] > 0.0f) { /* don't count transparent pixels */ switch(node->custom1) { case 1: { /* all colors */ rgb_tobw(value[0],value[1],value[2], &value[0]); @@ -120,7 +120,7 @@ static float brightness_mean(bNode* node, CompBuf* in) /* get the pixel */ qd_getPixel(in, x, y, value); - if(value[3] > 0.0) { /* don't count transparent pixels */ + if(value[3] > 0.0f) { /* don't count transparent pixels */ numPixels++; switch(node->custom1) { @@ -172,7 +172,7 @@ static float brightness_standard_deviation(bNode* node, CompBuf* in, float mean) /* get the pixel */ qd_getPixel(in, x, y, value); - if(value[3] > 0.0) { /* don't count transparent pixels */ + if(value[3] > 0.0f) { /* don't count transparent pixels */ numPixels++; switch(node->custom1) { @@ -233,7 +233,7 @@ static void draw_histogram(bNode *node, CompBuf *out, int* bins) for(y=0;y<out->y; y++) { /* get normalized value (0..255) */ - value=((float)bins[x]/(float)max)*255.0; + value=((float)bins[x]/(float)max)*255.0f; if(y < (int)value) { /*if the y value is below the height of the bar for this line then draw with the color */ switch (node->custom1) { diff --git a/source/blender/nodes/composite/nodes/node_composite_mapUV.c b/source/blender/nodes/composite/nodes/node_composite_mapUV.c index 5dc6d1c3aaa..b596f67a886 100644 --- a/source/blender/nodes/composite/nodes/node_composite_mapUV.c +++ b/source/blender/nodes/composite/nodes/node_composite_mapUV.c @@ -73,40 +73,40 @@ static void do_mapuv(CompBuf *stackbuf, CompBuf *cbuf, CompBuf *uvbuf, float thr /* adaptive sampling, red (U) channel */ /* prevent alpha zero UVs to be used */ - uv_l= uv[-1]!=0.0f? fabs(uv[0]-uv[-3]) : 0.0f; - uv_r= uv[ 5]!=0.0f? fabs(uv[0]-uv[ 3]) : 0.0f; + uv_l= uv[-1]!=0.0f? fabsf(uv[0]-uv[-3]) : 0.0f; + uv_r= uv[ 5]!=0.0f? fabsf(uv[0]-uv[ 3]) : 0.0f; //dx= 0.5f*(fabs(uv[0]-uv[-3]) + fabs(uv[0]-uv[3])); dx= 0.5f*(uv_l + uv_r); - uv_l= uvprev[-1]!=0.0f? fabs(uv[0]-uvprev[-3]) : 0.0f; - uv_r= uvnext[-1]!=0.0f? fabs(uv[0]-uvnext[-3]) : 0.0f; + uv_l= uvprev[-1]!=0.0f? fabsf(uv[0]-uvprev[-3]) : 0.0f; + uv_r= uvnext[-1]!=0.0f? fabsf(uv[0]-uvnext[-3]) : 0.0f; //dx+= 0.25f*(fabs(uv[0]-uvprev[-3]) + fabs(uv[0]-uvnext[-3])); dx+= 0.25f*(uv_l + uv_r); - uv_l= uvprev[ 5]!=0.0f? fabs(uv[0]-uvprev[+3]) : 0.0f; - uv_r= uvnext[ 5]!=0.0f? fabs(uv[0]-uvnext[+3]) : 0.0f; + uv_l= uvprev[ 5]!=0.0f? fabsf(uv[0]-uvprev[+3]) : 0.0f; + uv_r= uvnext[ 5]!=0.0f? fabsf(uv[0]-uvnext[+3]) : 0.0f; //dx+= 0.25f*(fabs(uv[0]-uvprev[+3]) + fabs(uv[0]-uvnext[+3])); dx+= 0.25f*(uv_l + uv_r); /* adaptive sampling, green (V) channel */ - uv_l= uv[-row+2]!=0.0f? fabs(uv[1]-uv[-row+1]) : 0.0f; - uv_r= uv[ row+2]!=0.0f? fabs(uv[1]-uv[ row+1]) : 0.0f; + uv_l= uv[-row+2]!=0.0f? fabsf(uv[1]-uv[-row+1]) : 0.0f; + uv_r= uv[ row+2]!=0.0f? fabsf(uv[1]-uv[ row+1]) : 0.0f; //dy= 0.5f*(fabs(uv[1]-uv[-row+1]) + fabs(uv[1]-uv[row+1])); dy= 0.5f*(uv_l + uv_r); - uv_l= uvprev[-1]!=0.0f? fabs(uv[1]-uvprev[+1-3]) : 0.0f; - uv_r= uvnext[-1]!=0.0f? fabs(uv[1]-uvnext[+1-3]) : 0.0f; + uv_l= uvprev[-1]!=0.0f? fabsf(uv[1]-uvprev[+1-3]) : 0.0f; + uv_r= uvnext[-1]!=0.0f? fabsf(uv[1]-uvnext[+1-3]) : 0.0f; //dy+= 0.25f*(fabs(uv[1]-uvprev[+1-3]) + fabs(uv[1]-uvnext[+1-3])); dy+= 0.25f*(uv_l + uv_r); - uv_l= uvprev[ 5]!=0.0f? fabs(uv[1]-uvprev[+1+3]) : 0.0f; - uv_r= uvnext[ 5]!=0.0f? fabs(uv[1]-uvnext[+1+3]) : 0.0f; + uv_l= uvprev[ 5]!=0.0f? fabsf(uv[1]-uvprev[+1+3]) : 0.0f; + uv_r= uvnext[ 5]!=0.0f? fabsf(uv[1]-uvnext[+1+3]) : 0.0f; //dy+= 0.25f*(fabs(uv[1]-uvprev[+1+3]) + fabs(uv[1]-uvnext[+1+3])); dy+= 0.25f*(uv_l + uv_r); diff --git a/source/blender/nodes/composite/nodes/node_composite_math.c b/source/blender/nodes/composite/nodes/node_composite_math.c index a0e7beff1ab..27fdcfc1d4e 100644 --- a/source/blender/nodes/composite/nodes/node_composite_math.c +++ b/source/blender/nodes/composite/nodes/node_composite_math.c @@ -103,10 +103,10 @@ static void do_math(bNode *node, float *out, float *in, float *in2) } else { float y_mod_1 = fmod(in2[0], 1); /* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */ - if (y_mod_1 > 0.999 || y_mod_1 < 0.001) { - out[0]= pow(in[0], floor(in2[0] + 0.5)); + if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) { + out[0]= powf(in[0], floorf(in2[0] + 0.5f)); } else { - out[0] = 0.0; + out[0] = 0.0f; } } } diff --git a/source/blender/nodes/composite/nodes/node_composite_rotate.c b/source/blender/nodes/composite/nodes/node_composite_rotate.c index 96712baf8b0..730c53a1a29 100644 --- a/source/blender/nodes/composite/nodes/node_composite_rotate.c +++ b/source/blender/nodes/composite/nodes/node_composite_rotate.c @@ -58,7 +58,7 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac int x, y, yo, xo; ImBuf *ibuf, *obuf; - rad= (M_PI*in[1]->vec[0])/180.0f; + rad= ((float)M_PI*in[1]->vec[0])/180.0f; s= sin(rad); diff --git a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c index 3b3d57bf442..7944176c5d3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c +++ b/source/blender/nodes/composite/nodes/node_composite_sepcombYCCA.c @@ -53,9 +53,9 @@ static void do_sepycca_601(bNode *UNUSED(node), float *out, float *in) rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT601); /*divided by 255 to normalize for viewing in */ - out[0]= y/255.0; - out[1]= cb/255.0; - out[2]= cr/255.0; + out[0]= y/255.0f; + out[1]= cb/255.0f; + out[2]= cr/255.0f; out[3]= in[3]; } @@ -66,9 +66,9 @@ static void do_sepycca_709(bNode *UNUSED(node), float *out, float *in) rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT709); /*divided by 255 to normalize for viewing in */ - out[0]= y/255.0; - out[1]= cb/255.0; - out[2]= cr/255.0; + out[0]= y/255.0f; + out[1]= cb/255.0f; + out[2]= cr/255.0f; out[3]= in[3]; } @@ -79,9 +79,9 @@ static void do_sepycca_jfif(bNode *UNUSED(node), float *out, float *in) rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_JFIF_0_255); /*divided by 255 to normalize for viewing in */ - out[0]= y/255.0; - out[1]= cb/255.0; - out[2]= cr/255.0; + out[0]= y/255.0f; + out[1]= cb/255.0f; + out[2]= cr/255.0f; out[3]= in[3]; } @@ -106,9 +106,9 @@ static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeSta } /*divided by 255 to normalize for viewing in */ - out[0]->vec[0] = y/255.0; - out[1]->vec[0] = cb/255.0; - out[2]->vec[0] = cr/255.0; + out[0]->vec[0] = y/255.0f; + out[1]->vec[0] = cb/255.0f; + out[2]->vec[0] = cr/255.0f; out[3]->vec[0] = in[0]->vec[3]; } else if ((out[0]->hasoutput) || (out[1]->hasoutput) || (out[2]->hasoutput) || (out[3]->hasoutput)) { |