diff options
Diffstat (limited to 'source/blender/blenkernel/intern/unit.c')
-rw-r--r-- | source/blender/blenkernel/intern/unit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index aa914998a72..81c526e45a6 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -299,7 +299,8 @@ static bUnitDef *unit_best_fit(double value, bUnitCollection *usys, bUnitDef *un if(suppress && (unit->flag & B_UNIT_DEF_SUPPRESS)) continue; - if (value_abs >= unit->scalar*(1.0-EPS)) /* scale down scalar so 1cm doesnt convert to 10mm because of float error */ + /* scale down scalar so 1cm doesnt convert to 10mm because of float error */ + if (value_abs >= unit->scalar*(1.0-EPS)) return unit; } @@ -481,11 +482,14 @@ static int ch_is_op(char op) } } -static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str) +static int unit_scale_str(char *str, int len_max, char *str_tmp, + double scale_pref, bUnitDef *unit, const char *replace_str) { char *str_found; - if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { /* XXX - investigate, does not respect len_max properly */ + if((len_max>0) && (str_found= (char *)unit_find_str(str, replace_str))) { + /* XXX - investigate, does not respect len_max properly */ + int len, len_num, len_name, len_move, found_ofs; found_ofs = (int)(str_found-str); |