Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-04-11 12:15:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-04-11 12:15:13 +0400
commitb4a0152e76683dfb170c3e2796e15e1b5b67e2ab (patch)
tree15466a4e658f8fd42d55b9748bbeb6f02c12ba30 /source/blender
parent9ae0523921fa4baeb37bcdd36f208da952f4337f (diff)
code cleanup: float formatting was confusing in some cases - eg: (0.,0.,0.)
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_particle.h2
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c2
-rw-r--r--source/blender/blenkernel/intern/action.c4
-rw-r--r--source/blender/blenkernel/intern/object.c4
-rw-r--r--source/blender/blenkernel/intern/sequencer.c2
-rw-r--r--source/blender/blenkernel/intern/smoke.c6
-rw-r--r--source/blender/blenlib/intern/math_base.c4
-rw-r--r--source/blender/blenlib/intern/noise.c8
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/bmesh/intern/bmesh_operator_api.h2
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c4
-rw-r--r--source/blender/editors/screen/area.c4
-rw-r--r--source/blender/editors/space_logic/logic_window.c2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c4
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_tonemap.c6
-rw-r--r--source/blender/render/intern/source/convertblender.c4
18 files changed, 32 insertions, 32 deletions
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 08f9dfb05f3..3e0180a84aa 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -64,7 +64,7 @@ struct BVHTreeRayHit;
#define LOOP_EXISTING_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & PARS_UNEXIST))
#define LOOP_SHOWN_PARTICLES for(p=0, pa=psys->particles; p<psys->totpart; p++, pa++) if(!(pa->flag & (PARS_UNEXIST|PARS_NO_DISP)))
/* OpenMP: Can only advance one variable within loop definition. */
-#define LOOP_DYNAMIC_PARTICLES for(p=0; p<psys->totpart; p++ ) if((pa=psys->particles+p)->state.time > 0.f)
+#define LOOP_DYNAMIC_PARTICLES for(p=0; p<psys->totpart; p++ ) if((pa=psys->particles+p)->state.time > 0.0f)
#define PSYS_FRAND_COUNT 1024
#define PSYS_FRAND(seed) psys->frand[(seed) % PSYS_FRAND_COUNT]
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index f0075217102..9b55785d1a4 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -744,7 +744,7 @@ static void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no,
length = sqrtf(no[0] * no[0] + no[1] * no[1] + no[2] * no[2]);
if (length > EPSILON) {
- float invLength = 1.f/length;
+ float invLength = 1.0f / length;
no[0] *= invLength;
no[1] *= invLength;
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 78668a5a2e4..c77e384a264 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -546,8 +546,8 @@ void init_pose_itasc(bItasc *itasc)
itasc->numstep = 4;
itasc->precision = 0.005f;
itasc->flag = ITASC_AUTO_STEP|ITASC_INITIAL_REITERATION;
- itasc->feedback = 20.f;
- itasc->maxvel = 50.f;
+ itasc->feedback = 20.0f;
+ itasc->maxvel = 50.0f;
itasc->solver = ITASC_SOLVER_SDLS;
itasc->dampmax = 0.5;
itasc->dampeps = 0.15;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c62653b29e7..237d268e307 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -847,8 +847,8 @@ Object *add_only_object(int type, const char *name)
ob->init_state=1;
ob->state=1;
/* ob->pad3 == Contact Processing Threshold */
- ob->m_contactProcessingThreshold = 1.;
- ob->obstacleRad = 1.;
+ ob->m_contactProcessingThreshold = 1.0f;
+ ob->obstacleRad = 1.0f;
/* NT fluid sim defaults */
ob->fluidsimSettings = NULL;
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 10cc64890b9..99fc2242f9f 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -592,7 +592,7 @@ void calc_sequence(Scene *scene, Sequence *seq)
if (seq->seq1) {
/* XXX These resets should not be necessary, but users used to be able to
- * edit effect's length, leading to strange results. See #29190. */
+ * edit effect's length, leading to strange results. See [#29190] */
seq->startofs = seq->endofs = seq->startstill = seq->endstill = 0;
seq->start = seq->startdisp = MAX3(seq->seq1->startdisp, seq->seq2->startdisp, seq->seq3->startdisp);
seq->enddisp = MIN3(seq->seq1->enddisp, seq->seq2->enddisp, seq->seq3->enddisp);
diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 00cac3b58d7..9d13397859d 100644
--- a/source/blender/blenkernel/intern/smoke.c
+++ b/source/blender/blenkernel/intern/smoke.c
@@ -134,7 +134,7 @@ struct Scene;
struct DerivedMesh;
struct SmokeModifierData;
-#define TRI_UVOFFSET (1./4.)
+#define TRI_UVOFFSET (1.0 / 4.0)
/* forward declerations */
static void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len);
@@ -949,8 +949,8 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
if (usqr>maxusqr) {
// cutoff at maxVelVal
for (int jj=0; jj<3; jj++) {
- if (objvel[jj]>0.) objvel[jj] = maxVelVal;
- if (objvel[jj]<0.) objvel[jj] = -maxVelVal;
+ if (objvel[jj] > 0.0) objvel[jj] = maxVelVal;
+ if (objvel[jj] < 0.0) objvel[jj] = -maxVelVal;
}
}
}
diff --git a/source/blender/blenlib/intern/math_base.c b/source/blender/blenlib/intern/math_base.c
index 9efcb3dbcae..6bb238ac612 100644
--- a/source/blender/blenlib/intern/math_base.c
+++ b/source/blender/blenlib/intern/math_base.c
@@ -37,8 +37,8 @@
/* from python 3.1 pymath.c */
double copysign(double x, double y)
{
- /* use atan2 to distinguish -0. from 0. */
- if (y > 0. || (y == 0. && atan2(y, -1.) > 0.)) {
+ /* use atan2 to distinguish -0.0 from 0.0 */
+ if (y > 0.0 || (y == 0.0 && atan2(y, -1.0) > 0.0)) {
return fabs(x);
}
else {
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index f1749d0b7cd..5db42c35f5c 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -1002,11 +1002,11 @@ static float turbulence_perlin(float *point, float lofreq, float hifreq)
p[2] = point[2];
t = 0;
- for (freq = lofreq ; freq < hifreq ; freq *= 2.) {
+ for (freq = lofreq ; freq < hifreq ; freq *= 2.0) {
t += fabsf(noise3_perlin(p)) / freq;
- p[0] *= 2.;
- p[1] *= 2.;
- p[2] *= 2.;
+ p[0] *= 2.0f;
+ p[1] *= 2.0f;
+ p[2] *= 2.0f;
}
return t - 0.3; /* readjust to make mean value = 0.0 */
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 46ff416f4ab..5114be4f785 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -10778,7 +10778,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
Object *ob;
World *wrld;
for (ob = main->object.first; ob; ob= ob->id.next) {
- ob->m_contactProcessingThreshold = 1.; //pad3 is used for m_contactProcessingThreshold
+ ob->m_contactProcessingThreshold = 1.0f; //pad3 is used for m_contactProcessingThreshold
if (ob->parent) {
/* check if top parent has compound shape set and if yes, set this object
to compound shaper as well (was the behavior before, now it's optional) */
diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h
index 7cba66995c9..b01b80f1ef4 100644
--- a/source/blender/bmesh/intern/bmesh_operator_api.h
+++ b/source/blender/bmesh/intern/bmesh_operator_api.h
@@ -90,7 +90,7 @@ BLI_INLINE void _bmo_elem_flag_set( BMesh *bm, BMFlagLayer *oflags, const
BLI_INLINE void _bmo_elem_flag_toggle( BMesh *bm, BMFlagLayer *oflags, const short oflag);
/* slot type arrays are terminated by the last member
- * having a slot type of 0.*/
+ * having a slot type of 0 */
enum {
BMO_OP_SLOT_SENTINEL = 0,
BMO_OP_SLOT_BOOL = 1,
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 8f0ea378a2a..7726e707f08 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -196,9 +196,9 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short dfl
gluQuadricDrawStyle(qobj, GLU_FILL);
/* need to translate drawing position, but must reset after too! */
- glTranslatef(co[0], co[1], 0.);
+ glTranslatef(co[0], co[1], 0.0);
gluDisk(qobj, 0.0, thickness, 32, 1);
- glTranslatef(-co[0], -co[1], 0.);
+ glTranslatef(-co[0], -co[1], 0.0);
gluDeleteQuadric(qobj);
}
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 43b917c2186..bed17048ea1 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -204,8 +204,8 @@ static void region_draw_azone_icon(AZone *az)
qobj = gluNewQuadric();
- glPushMatrix();
- glTranslatef(midx, midy, 0.);
+ glPushMatrix();
+ glTranslatef(midx, midy, 0.0);
/* outlined circle */
glEnable(GL_LINE_SMOOTH);
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index 37b284a030d..0467579d0f2 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -1051,7 +1051,7 @@ static void draw_default_sensor_header(bSensor *sens,
/* Pulsing and frequency */
uiBlockBeginAlign(block);
uiDefIconButBitS(block, TOG, SENS_PULSE_REPEAT, 1, ICON_DOTSUP,
- (short)(x + 10 + 0. * (w-20)), (short)(y - 21), (short)(0.1 * (w-20)), 19,
+ (short)(x + 10 + 0.0 * (w - 20)), (short)(y - 21), (short)(0.1 * (w - 20)), 19,
&sens->pulse, 0.0, 0.0, 0, 0,
"Activate TRUE level triggering (pulse mode)");
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 97e52a21e25..29b12708e2d 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5624,7 +5624,7 @@ static void draw_empty_cone(float size)
radius = size;
glTranslatef(cent, cent, cent);
glScalef(radius, size * 2.0f, radius);
- glRotatef(-90., 1.0, 0.0, 0.0);
+ glRotatef(-90.0, 1.0, 0.0, 0.0);
gluCylinder(qobj, 1.0, 0.0, 1.0, 8, 1);
glPopMatrix();
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 2289216c2a8..0e520a511fe 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -166,7 +166,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
float d /*, d0 */ /* UNUSED */, dd, ds;
float *points = NULL;
int numpoints = 0;
- float cor[3] = {1., 1., 1.};
+ float cor[3] = {1.0f, 1.0f, 1.0f};
int gl_depth = 0, gl_blend = 0;
/* draw slices of smoke is adapted from c++ code authored
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 9e5bd1c860c..95a9d58c36e 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -119,7 +119,7 @@ void circf(float x, float y, float rad)
glPushMatrix();
- glTranslatef(x, y, 0.);
+ glTranslatef(x, y, 0.0);
gluDisk(qobj, 0.0, rad, 32, 1);
@@ -136,7 +136,7 @@ void circ(float x, float y, float rad)
glPushMatrix();
- glTranslatef(x, y, 0.);
+ glTranslatef(x, y, 0.0);
gluDisk(qobj, 0.0, rad, 32, 1);
diff --git a/source/blender/nodes/composite/nodes/node_composite_tonemap.c b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
index baa5ba046dd..0696c2ba848 100644
--- a/source/blender/nodes/composite/nodes/node_composite_tonemap.c
+++ b/source/blender/nodes/composite/nodes/node_composite_tonemap.c
@@ -118,9 +118,9 @@ static void tonemap(NodeTonemap* ntm, CompBuf* dst, CompBuf* src)
dp[x][1] /= ((dg == 0.f) ? 1.f : dg);
dp[x][2] /= ((db == 0.f) ? 1.f : db);
if (igm != 0.f) {
- dp[x][0] = pow((double)MAX2(dp[x][0], 0.), igm);
- dp[x][1] = pow((double)MAX2(dp[x][1], 0.), igm);
- dp[x][2] = pow((double)MAX2(dp[x][2], 0.), igm);
+ dp[x][0] = pow((double)MAX2(dp[x][0], 0.0), igm);
+ dp[x][1] = pow((double)MAX2(dp[x][1], 0.0), igm);
+ dp[x][2] = pow((double)MAX2(dp[x][2], 0.0), igm);
}
}
}
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 9b12d556320..21cfb8b6db7 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -5478,8 +5478,8 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float *
ver++;
// get fluid velocity
- fsvec[3] = 0.;
- //fsvec[0] = fsvec[1] = fsvec[2] = fsvec[3] = 0.; fsvec[2] = 2.; // NT fixed test
+ fsvec[3] = 0.0f;
+ //fsvec[0] = fsvec[1] = fsvec[2] = fsvec[3] = 0.0; fsvec[2] = 2.0f; // NT fixed test
for (j=0;j<3;j++) fsvec[j] = velarray[a].vel[j];
/* (bad) HACK insert average velocity if none is there (see previous comment) */