From 971ab57c7df0b0ecdc948bc47a9bc133e35fb94f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 4 Oct 2018 09:23:58 +1000 Subject: Cleanup: style --- source/blender/blenkernel/intern/unit.c | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 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 c132053a82b..bca7b3dd357 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -346,7 +346,7 @@ static void unit_dual_convert( double value, const bUnitCollection *usys, bUnitDef const **r_unit_a, bUnitDef const **r_unit_b, double *r_value_a, double *r_value_b, - const bUnitDef *main_unit) + const bUnitDef *main_unit) { const bUnitDef *unit; if (main_unit) unit = main_unit; @@ -500,25 +500,24 @@ static const bUnitDef *get_preferred_unit_if_used(int type, PreferredUnits units int max_offset = usys->length - 1; - switch (type) - { - case B_UNIT_LENGTH: - case B_UNIT_AREA: - case B_UNIT_VOLUME: - if (units.length == USER_UNIT_ADAPTIVE) return NULL; - return usys->units + MIN2(units.length, max_offset); - case B_UNIT_MASS: - if (units.mass == USER_UNIT_ADAPTIVE) return NULL; - return usys->units + MIN2(units.mass, max_offset); - case B_UNIT_TIME: - if (units.time == USER_UNIT_ADAPTIVE) return NULL; - return usys->units + MIN2(units.time, max_offset); - case B_UNIT_ROTATION: - if (units.rotation == 0) return usys->units + 0; - else if (units.rotation == USER_UNIT_ROT_RADIANS) return usys->units + 3; - break; - default: - break; + switch (type) { + case B_UNIT_LENGTH: + case B_UNIT_AREA: + case B_UNIT_VOLUME: + if (units.length == USER_UNIT_ADAPTIVE) return NULL; + return usys->units + MIN2(units.length, max_offset); + case B_UNIT_MASS: + if (units.mass == USER_UNIT_ADAPTIVE) return NULL; + return usys->units + MIN2(units.mass, max_offset); + case B_UNIT_TIME: + if (units.time == USER_UNIT_ADAPTIVE) return NULL; + return usys->units + MIN2(units.time, max_offset); + case B_UNIT_ROTATION: + if (units.rotation == 0) return usys->units + 0; + else if (units.rotation == USER_UNIT_ROT_RADIANS) return usys->units + 3; + break; + default: + break; } return NULL; } @@ -964,4 +963,4 @@ double bUnit_GetScaler(const void *usys_pt, int index) bool bUnit_IsSuppressed(const void *usys_pt, int index) { return (((bUnitCollection *)usys_pt)->units[index].flag & B_UNIT_DEF_SUPPRESS) != 0; -} \ No newline at end of file +} -- cgit v1.2.3