From c77e556b23e8df10a829bdeebe86d718bd5e5ca6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 11 Aug 2009 19:20:31 +0000 Subject: - missing a decref for new pytypes - remove needless strlen --- source/blender/blenkernel/intern/unit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/unit.c') diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index 04b0530073e..87a21cc9798 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -37,7 +37,7 @@ typedef struct bUnitDef { char *name_alt; /* alternative name */ double mul; - double bias; + double bias; /* not used yet, needed for converting temperature */ } bUnitDef; /* define a single unit */ @@ -175,6 +175,7 @@ static int unit_as_string(char *str, double value, int prec, bUnitCollection *us return i; } + /* Used for drawing number buttons, try keep fast */ void bUnit_AsString(char *str, double value, int prec, int system, int type, int split, int pad) { @@ -189,13 +190,12 @@ void bUnit_AsString(char *str, double value, int prec, int system, int type, int /* check the 2 is a smaller unit */ if(unit_b > unit_a) { - i= unit_as_string(str, value_a, prec, usys, unit_a, '\0'); - i= strlen(str); + i= unit_as_string(str, value_a, prec, usys, unit_a, '\0'); str[i++]= ','; str[i++]= ' '; /* use low precision since this is a smaller unit */ - unit_as_string(str+i, value_b, prec?1:0, usys, unit_b, '\0'); + unit_as_string(str+i, value_b, prec?1:0, usys, unit_b, '\0'); return; } } -- cgit v1.2.3