code cleanup: style and replace (float)sin, (float)cos with sinf, cosf

This commit is contained in:
2013-01-12 14:28:23 +00:00
parent aab01c86cf
commit c93e127e7a
11 changed files with 34 additions and 34 deletions

View File

@@ -1746,7 +1746,7 @@ static void calc_bevel_sin_cos(float x1, float y1, float x2, float y2, float *si
else
t02 = (saacos(t02)) / 2.0f;
t02 = (float)sin(t02);
t02 = sinf(t02);
if (t02 == 0.0f)
t02 = 1.0f;

View File

@@ -962,9 +962,9 @@ makebreak:
float si, co;
ct = chartransdata + cu->pos;
si = (float)sin(ct->rot);
co = (float)cos(ct->rot);
si = sinf(ct->rot);
co = cosf(ct->rot);
f = cu->editfont->textcurs[0];
f[0] = cu->fsize * (-0.1f * co + ct->xof);

View File

@@ -1360,7 +1360,7 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob, ListBase *dispbase,
int i;
for (i = 0; i < 3; i++, mloopuv++) {
mloopuv->uv[0] = (mloop[i].v - startvert)/(float)(dl->nr - 1);
mloopuv->uv[0] = (mloop[i].v - startvert) / (float)(dl->nr - 1);
mloopuv->uv[1] = 0.0f;
}
}
@@ -1430,8 +1430,8 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob, ListBase *dispbase,
/* find uv based on vertex index into grid array */
int v = mloop[i].v - startvert;
mloopuv->uv[0] = (v / dl->nr)/(float)orco_sizev;
mloopuv->uv[1] = (v % dl->nr)/(float)orco_sizeu;
mloopuv->uv[0] = (v / dl->nr) / (float)orco_sizev;
mloopuv->uv[1] = (v % dl->nr) / (float)orco_sizeu;
/* cyclic correction */
if ((i == 0 || i == 1) && mloopuv->uv[1] == 0.0f)

View File

@@ -1660,7 +1660,7 @@ ImBuf *BKE_tracking_sample_pattern(int frame_width, int frame_height, ImBuf *sea
/* real sampling requires libmv, but areas are supposing pattern would be
* sampled if search area does exists, so we'll need to create empty
* pattern area here to prevent adding NULL-checks all over just to deal
* with situation when lubmv is disabled
* with situation when libmv is disabled
*/
(void) frame_width;

View File

@@ -1245,8 +1245,8 @@ void rotate_m4(float mat[4][4], const char axis, const float angle)
assert(axis >= 'X' && axis <= 'Z');
cosine = (float)cos(angle);
sine = (float)sin(angle);
cosine = cosf(angle);
sine = sinf(angle);
switch (axis) {
case 'X':
for (col = 0; col < 4; col++)

View File

@@ -589,10 +589,10 @@ void interp_qt_qtqt(float result[4], const float quat1[4], const float quat2[4],
}
if ((1.0f - cosom) > 0.0001f) {
omega = (float)acos(cosom);
sinom = (float)sin(omega);
sc1 = (float)sin((1 - t) * omega) / sinom;
sc2 = (float)sin(t * omega) / sinom;
omega = acosf(cosom);
sinom = sinf(omega);
sc1 = sinf((1.0f - t) * omega) / sinom;
sc2 = sinf(t * omega) / sinom;
}
else {
sc1 = 1.0f - t;

View File

@@ -1750,7 +1750,7 @@ static void knife_snap_angle(KnifeTool_OpData *kcd)
if (dx == 0.0f) {
kcd->angle_snapping = ANGLE_90;
kcd->curr.mval[0] =kcd->prev.mval[0];
kcd->curr.mval[0] = kcd->prev.mval[0];
}
w = dy / dx;

View File

@@ -454,8 +454,8 @@ static void node_update_hidden(bNode *node)
for (nsock = node->outputs.first; nsock; nsock = nsock->next) {
if (!nodeSocketIsHidden(nsock)) {
nsock->locx = node->totr.xmax - hiddenrad + (float)sin(rad) * hiddenrad;
nsock->locy = node->totr.ymin + hiddenrad + (float)cos(rad) * hiddenrad;
nsock->locx = node->totr.xmax - hiddenrad + sinf(rad) * hiddenrad;
nsock->locy = node->totr.ymin + hiddenrad + cosf(rad) * hiddenrad;
rad += drad;
}
}
@@ -465,8 +465,8 @@ static void node_update_hidden(bNode *node)
for (nsock = node->inputs.first; nsock; nsock = nsock->next) {
if (!nodeSocketIsHidden(nsock)) {
nsock->locx = node->totr.xmin + hiddenrad + (float)sin(rad) * hiddenrad;
nsock->locy = node->totr.ymin + hiddenrad + (float)cos(rad) * hiddenrad;
nsock->locx = node->totr.xmin + hiddenrad + sinf(rad) * hiddenrad;
nsock->locy = node->totr.ymin + hiddenrad + cosf(rad) * hiddenrad;
rad += drad;
}
}

View File

@@ -734,8 +734,8 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i
float cos_phi, sin_phi, dist;
phi += side_delta;
cos_phi = (float)cos(phi);
sin_phi = (float)sin(phi);
cos_phi = cosf(phi);
sin_phi = sinf(phi);
dist = radhole + radring * cos_phi;
glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi);
@@ -749,8 +749,8 @@ static void partial_doughnut(float radring, float radhole, int start, int end, i
float cos_phi, sin_phi, dist;
phi += side_delta;
cos_phi = (float)cos(phi);
sin_phi = (float)sin(phi);
cos_phi = cosf(phi);
sin_phi = sinf(phi);
dist = radhole + radring * cos_phi;
glVertex3f(cos_theta1 * dist, -sin_theta1 * dist, radring * sin_phi);

View File

@@ -965,18 +965,18 @@ static void uv_map_rotation_matrix(float result[4][4], RegionView3D *rv3d, Objec
/* this is "kanonen gegen spatzen", a few plus minus 1 will do here */
/* i wanted to keep the reason here, so we're rotating*/
sideangle = (float)M_PI * (sideangledeg + 180.0f) / 180.0f;
rotside[0][0] = (float)cos(sideangle);
rotside[0][1] = -(float)sin(sideangle);
rotside[1][0] = (float)sin(sideangle);
rotside[1][1] = (float)cos(sideangle);
rotside[2][2] = 1.0f;
rotside[0][0] = cosf(sideangle);
rotside[0][1] = -sinf(sideangle);
rotside[1][0] = sinf(sideangle);
rotside[1][1] = cosf(sideangle);
rotside[2][2] = 1.0f;
upangle = (float)M_PI * upangledeg / 180.0f;
rotup[1][1] = (float)cos(upangle) / radius;
rotup[1][2] = -(float)sin(upangle) / radius;
rotup[2][1] = (float)sin(upangle) / radius;
rotup[2][2] = (float)cos(upangle) / radius;
rotup[0][0] = (float)1.0f / radius;
rotup[1][1] = cosf(upangle) / radius;
rotup[1][2] = -sinf(upangle) / radius;
rotup[2][1] = sinf(upangle) / radius;
rotup[2][2] = cosf(upangle) / radius;
rotup[0][0] = 1.0f / radius;
/* calculate transforms*/
mul_serie_m4(result, rotup, rotside, viewmatrix, rotobj, NULL, NULL, NULL, NULL);

View File

@@ -516,7 +516,7 @@ static void blender_crash_handler(int signum)
fp = BLI_fopen(fname, "wb");
if (fp == NULL) {
fprintf(stderr, "Unable to save '%s': %s\n",
fname, errno ? strerror(errno) : "Unknown error opening file");
fname, errno ? strerror(errno) : "Unknown error opening file");
}
else {
if (wm) {