diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-09 18:27:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-09 18:27:51 +0400 |
commit | 15d0d3f41e51a29f79f40600fdd3d856e9c525c4 (patch) | |
tree | 57fb8a72f22650d0dcdc1fb65bd1d99ce42107c1 | |
parent | d4ae38cc6c4ec8e3d13f26d12f85bca561f64f0f (diff) |
replace log() calls with constants
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/sunsky.c | 2 | ||||
-rw-r--r-- | source/gameengine/Converter/KX_ConvertActuators.cpp | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 5802bb2b697..d833c184274 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -1020,7 +1020,7 @@ static void old_mdisps_rotate(int S, int UNUSED(newside), int oldside, int x, in static void old_mdisps_convert(MFace *mface, MDisps *mdisp) { - int newlvl = log(sqrt(mdisp->totdisp)-1)/log(2); + int newlvl = log(sqrt(mdisp->totdisp)-1)/M_LN2; int oldlvl = newlvl+1; int oldside = multires_side_tot[oldlvl]; int newside = multires_side_tot[newlvl]; diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index c19a74deff6..fbb5a77fa04 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1582,7 +1582,7 @@ typedef struct WipeZone { static void precalc_wipe_zone(WipeZone *wipezone, WipeVars *wipe, int xo, int yo) { wipezone->flip = (wipe->angle < 0); - wipezone->angle = pow(fabsf(wipe->angle)/45.0f, log(xo)/log(2.0f)); + wipezone->angle = pow(fabsf(wipe->angle)/45.0f, log(xo)/M_LN2); wipezone->xo = xo; wipezone->yo = yo; wipezone->width = (int)(wipe->edgeWidth*((xo+yo)/2.0f)); diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index d37f1d6c5f0..2a2b1100fd9 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -114,7 +114,7 @@ MINLINE float shell_angle_to_dist(const float angle) /* used for zoom values*/ MINLINE float power_of_2(float val) { - return (float)pow(2.0, ceil(log((double)val) / log(2.0))); + return (float)pow(2.0, ceil(log((double)val) / M_LN2)); } MINLINE float minf(float a, float b) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 99b4b68b42d..37e4cc7616b 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1733,7 +1733,7 @@ void ui_set_but_default(bContext *C, short all) static double soft_range_round_up(double value, double max) { /* round up to .., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, .. */ - double newmax= pow(10.0, ceil(log(value)/log(10.0))); + double newmax= pow(10.0, ceil(log(value)/M_LN10)); if(newmax*0.2 >= max && newmax*0.2 >= value) return newmax*0.2; @@ -1746,7 +1746,7 @@ static double soft_range_round_up(double value, double max) static double soft_range_round_down(double value, double max) { /* round down to .., 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, .. */ - double newmax= pow(10.0, floor(log(value)/log(10.0))); + double newmax= pow(10.0, floor(log(value)/M_LN10)); if(newmax*5.0 <= max && newmax*5.0 <= value) return newmax*5.0; diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 43e46d485ee..2c1ba148643 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -436,7 +436,7 @@ static void outliner_sort(SpaceOops *soops, ListBase *lb) static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *idv, TreeElement *parent, short type, short index); -#define LOG2I(x) (int)(log(x)/log(2.0)) +#define LOG2I(x) (int)(log(x)/M_LN2) static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, SceneRenderLayer *srl) { diff --git a/source/blender/render/intern/source/sunsky.c b/source/blender/render/intern/source/sunsky.c index f645c29a7a5..5877fa42292 100644 --- a/source/blender/render/intern/source/sunsky.c +++ b/source/blender/render/intern/source/sunsky.c @@ -460,7 +460,7 @@ void AtmospherePixleShader( struct SunSky* sunSky, float view[3], float s, float vec3opv(sunSky->atm_BetaRM, sunSky->atm_BetaRay, +, sunSky->atm_BetaMie); //e^(-(beta_1 + beta_2) * s) = E1 - vec3opf(E1, sunSky->atm_BetaRM, *, -s/log(2)); + vec3opf(E1, sunSky->atm_BetaRM, *, -s/M_LN2); E1[0] = exp(E1[0]); E1[1] = exp(E1[1]); E1[2] = exp(E1[2]); diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 01516a24182..41136f837f5 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -397,7 +397,7 @@ void BL_ConvertActuators(char* maggiename, new KX_SoundActuator(gameobj, snd_sound, soundact->volume, - (float)(exp((soundact->pitch / 12.0) * log(2.0))), + (float)(exp((soundact->pitch / 12.0) * M_LN2)), is3d, settings, soundActuatorType); |