[Bf-blender-cvs] [a0d0d37ecd9] master: Fix T61666: missing NULL_UNIT that stops iteration over units

Jacques Lucke noreply at git.blender.org
Mon Feb 18 15:26:31 CET 2019


Commit: a0d0d37ecd9f9d0b6503f89f9587ad44eeab43ca
Author: Jacques Lucke
Date:   Mon Feb 18 14:20:55 2019 +0100
Branches: master
https://developer.blender.org/rBa0d0d37ecd9f9d0b6503f89f9587ad44eeab43ca

Fix T61666: missing NULL_UNIT that stops iteration over units

===================================================================

M	source/blender/blenkernel/intern/unit.c

===================================================================

diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index bfcdbe48f5a..8843c14b95e 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -307,10 +307,11 @@ static struct bUnitDef buPowerDef[] = {
 	{"gigawatt",  "gigawatts",  "GW", NULL, "Gigawatts",  NULL, 1e9f,  0.0, B_UNIT_DEF_NONE},
 	{"megawatt",  "megawatts",  "MW", NULL, "Megawatts",  NULL, 1e6f,  0.0, B_UNIT_DEF_CASE_SENSITIVE},
 	{"kilowatt",  "kilowatts",  "kW", NULL, "Kilowatts",  NULL, 1e3f,  0.0, B_UNIT_DEF_SUPPRESS},
-	{"watt",      "watts",      "W",  NULL, "Watts",      NULL, 1.0f,  0.0, B_UNIT_DEF_NONE},
+	{"watt",      "watts",      "W",  NULL, "Watts",      NULL, 1.0f,  0.0, B_UNIT_DEF_NONE}, /* base unit */
 	{"milliwatt", "milliwatts", "mW", NULL, "Milliwatts", NULL, 1e-3f, 0.0, B_UNIT_DEF_CASE_SENSITIVE},
 	{"microwatt", "microwatts", "µW", "uW", "Microwatts", NULL, 1e-6f, 0.0, B_UNIT_DEF_NONE},
 	{"nanowatt",  "nanowatts",  "nW", NULL, "Nannowatts", NULL, 1e-9f, 0.0, B_UNIT_DEF_NONE},
+	NULL_UNIT,
 };
 static struct bUnitCollection buPowerCollection = {buPowerDef, 3, 0, UNIT_COLLECTION_LENGTH(buPowerDef)};



More information about the Bf-blender-cvs mailing list