diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-05-28 16:11:39 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-05-28 16:11:39 +0400 |
commit | 43385394ed1fae8b83a09a1418f0b4a9a4ea301b (patch) | |
tree | 7218ecaa12bb5be016c233157fe6168a4f0c632b /source | |
parent | 97d553c471555cf290aae64e45717f22f0382222 (diff) |
Introduce vars before using them, otherwise compile fails (reminder: with C, present all
your vars at the begin of the scope _before any other statement_).
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 012d3fa675a..97f6b902c46 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -170,8 +170,9 @@ static void rna_Brush_set_size(PointerRNA *ptr, int value) // set unprojected radius, so they remain consistent double size= (double)brush_size(me); + float unprojected_radius = 0.0f; assert(size != 0); // paranoia: sanity checks during load and rna make sure we don't divide by zero here - float unprojected_radius= (float)(brush_unprojected_radius(me) * (double)value / size); + unprojected_radius= (float)(brush_unprojected_radius(me) * (double)value / size); brush_set_unprojected_radius(me, unprojected_radius); brush_set_size(me, value); @@ -225,8 +226,9 @@ static void rna_Brush_set_unprojected_radius(PointerRNA *ptr, float value) // set size, so they remain consistent double unprojected_radius= (double)brush_unprojected_radius(me); + int size = 0; assert(unprojected_radius != 0); // paranoia: sanity checks during load and rna make sure we don't divide by zero here - int size= (int)((double)brush_size(me) * (double)value / unprojected_radius); + size= (int)((double)brush_size(me) * (double)value / unprojected_radius); brush_set_size(me, size); brush_set_unprojected_radius(me, value); |