Commit: 3e7feaff44b70972751c9a62b83bde50a9c09592
Author: Hans Goudey
Date:   Mon Aug 31 14:18:06 2020 -0500
Branches: master
https://developer.blender.org/rB3e7feaff44b70972751c9a62b83bde50a9c09592

Cleanup: Comment formatting in unit.c

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

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

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

diff --git a/source/blender/blenkernel/intern/unit.c 
b/source/blender/blenkernel/intern/unit.c
index 9b78c9e5fc3..ce4ed05b10e 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -37,7 +37,7 @@
 #  include "BLI_winstuff.h"
 #endif
 
-/* no BKE or DNA includes! */
+/* No BKE or DNA includes! */
 
 /* Keep alignment. */
 /* clang-format off */
@@ -66,7 +66,7 @@
 #define UN_SC_IN    0.0254f
 #define UN_SC_MIL   0.0000254f
 
-#define UN_SC_MTON  1000.0f /* metric ton */
+#define UN_SC_MTON  1000.0f /* Metric ton. */
 #define UN_SC_QL    100.0f
 #define UN_SC_KG    1.0f
 #define UN_SC_HG    0.1f
@@ -74,7 +74,7 @@
 #define UN_SC_G     0.001f
 #define UN_SC_MG    0.000001f
 
-#define UN_SC_ITON  907.18474f /* imperial ton */
+#define UN_SC_ITON  907.18474f /* Imperial ton. */
 #define UN_SC_CWT   45.359237f
 #define UN_SC_ST    6.35029318f
 #define UN_SC_LB    0.45359237f
@@ -82,20 +82,22 @@
 
 /* clang-format on */
 
-/* define a single unit */
+/* Define a single unit. */
 typedef struct bUnitDef {
   const char *name;
-  /** abused a bit for the display name */
+  /** Abused a bit for the display name. */
   const char *name_plural;
-  /** this is used for display*/
+  /** This is used for display. */
   const char *name_short;
-  /** keyboard-friendly ASCII-only version of name_short, can be NULL */
+  /**
+   * Keyboard-friendly ASCII-only version of name_short, can be NULL.
+   * If name_short has non-ASCII chars, name_alt should be present.
+   */
   const char *name_alt;
-  /* if name_short has non-ASCII chars, name_alt should be present */
 
-  /** can be NULL */
+  /** Can be NULL. */
   const char *name_display;
-  /** when NULL, a transformed version of the name will be taken */
+  /** When NULL, a transformed version of the name will be taken in some 
cases. */
   const char *identifier;
 
   double scalar;
@@ -106,28 +108,28 @@ typedef struct bUnitDef {
 
 enum {
   B_UNIT_DEF_NONE = 0,
-  /** Use for units that are not used enough to be translated into for common 
use */
+  /** Use for units that are not used enough to be translated into for common 
use. */
   B_UNIT_DEF_SUPPRESS = 1,
-  /** Display a unit even if its value is 0.1, eg 0.1mm instead of 100um */
+  /** Display a unit even if its value is 0.1, eg 0.1mm instead of 100um. */
   B_UNIT_DEF_TENTH = 2,
-  /** Short unit name is case sensitive, for example to distinguish mW and MW 
*/
+  /** Short unit name is case sensitive, for example to distinguish mW and MW. 
*/
   B_UNIT_DEF_CASE_SENSITIVE = 4,
-  /** Short unit name does not have space between it and preceding number */
+  /** Short unit name does not have space between it and preceding number. */
   B_UNIT_DEF_NO_SPACE = 8,
 };
 
-/* define a single unit */
+/* Define a single unit system. */
 typedef struct bUnitCollection {
   const struct bUnitDef *units;
-  /** basic unit index (when user doesn't specify unit explicitly) */
+  /** Basic unit index (when user doesn't specify unit explicitly). */
   int base_unit;
-  /** options for this system */
+  /** Options for this system. */
   int flag;
-  /** to quickly find the last item */
+  /** To quickly find the last item. */
   int length;
 } bUnitCollection;
 
-/* Keep table lignment. */
+/* Keep table Alignment. */
 /* clang-format off */
 
 #define UNIT_COLLECTION_LENGTH(def) (ARRAY_SIZE(def) - 1)
@@ -142,14 +144,14 @@ static struct bUnitDef buMetricLenDef[] = {
   {"kilometer",  "kilometers",  "km",  NULL, "Kilometers",     "KILOMETERS",  
UN_SC_KM,  0.0, B_UNIT_DEF_NONE},
   {"hectometer", "hectometers", "hm",  NULL, "100 Meters",     "HECTOMETERS", 
UN_SC_HM,  0.0, B_UNIT_DEF_SUPPRESS},
   {"dekameter",  "dekameters",  "dam", NULL, "10 Meters",      "DEKAMETERS",  
UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},
-  {"meter",      "meters",      "m",   NULL, "Meters",         "METERS",      
UN_SC_M,   0.0, B_UNIT_DEF_NONE},     /* base unit */
+  {"meter",      "meters",      "m",   NULL, "Meters",         "METERS",      
UN_SC_M,   0.0, B_UNIT_DEF_NONE},     /* Base unit. */
   {"decimeter",  "decimeters",  "dm",  NULL, "10 Centimeters", "DECIMETERS",  
UN_SC_DM,  0.0, B_UNIT_DEF_SUPPRESS},
   {"centimeter", "centimeters", "cm",  NULL, "Centimeters",    "CENTIMETERS", 
UN_SC_CM,  0.0, B_UNIT_DEF_NONE},
   {"millimeter", "millimeters", "mm",  NULL, "Millimeters",    "MILLIMETERS", 
UN_SC_MM,  0.0, B_UNIT_DEF_NONE | B_UNIT_DEF_TENTH},
   {"micrometer", "micrometers", "µm",  "um", "Micrometers",    "MICROMETERS", 
UN_SC_UM,  0.0, B_UNIT_DEF_NONE},
 
   /* These get displayed because of float precision problems in the transform 
header,
-   * could work around, but for now probably people wont use these */
+   * could work around, but for now probably people wont use these. */
 #if 0
   {"nanometer", "Nanometers",     "nm", NULL, 0.000000001, 0.0,   
B_UNIT_DEF_NONE},
   {"picometer", "Picometers",     "pm", NULL, 0.000000000001, 0.0, 
B_UNIT_DEF_NONE},
@@ -163,19 +165,19 @@ static struct bUnitDef buImperialLenDef[] = {
   {"furlong", "furlongs", "fur",  NULL, "Furlongs", "FURLONGS", UN_SC_FUR, 
0.0, B_UNIT_DEF_SUPPRESS},
   {"chain",   "chains",   "ch",   NULL, "Chains",   "CHAINS",   UN_SC_CH,  
0.0, B_UNIT_DEF_SUPPRESS},
   {"yard",    "yards",    "yd",   NULL, "Yards",    "YARDS",    UN_SC_YD,  
0.0, B_UNIT_DEF_SUPPRESS},
-  {"foot",    "feet",     "'",    "ft", "Feet",     "FEET",     UN_SC_FT,  
0.0, B_UNIT_DEF_NONE | B_UNIT_DEF_NO_SPACE}, /* base unit */
+  {"foot",    "feet",     "'",    "ft", "Feet",     "FEET",     UN_SC_FT,  
0.0, B_UNIT_DEF_NONE | B_UNIT_DEF_NO_SPACE}, /* Base unit. */
   {"inch",    "inches",   "\"",   "in", "Inches",   "INCHES",   UN_SC_IN,  
0.0, B_UNIT_DEF_NONE | B_UNIT_DEF_NO_SPACE},
-  {"thou",    "thou",     "thou", "mil", "Thou",    "THOU",     UN_SC_MIL, 
0.0, B_UNIT_DEF_NONE}, /* plural for thou has no 's' */
+  {"thou",    "thou",     "thou", "mil", "Thou",    "THOU",     UN_SC_MIL, 
0.0, B_UNIT_DEF_NONE}, /* Plural for "thou" has no 's'. */
   NULL_UNIT,
 };
 static struct bUnitCollection buImperialLenCollection = {buImperialLenDef, 4, 
0, UNIT_COLLECTION_LENGTH(buImperialLenDef)};
 
-/* Areas */
+/* Areas. */
 static struct bUnitDef buMetricAreaDef[] = {
   {"square kilometer",  "square kilometers",  "km²",  "km2",  "Square 
Kilometers",  NULL, UN_SC_KM * UN_SC_KM,   0.0, B_UNIT_DEF_NONE},
-  {"square hectometer", "square hectometers", "hm²",  "hm2",  "Square 
Hectometers", NULL, UN_SC_HM * UN_SC_HM,   0.0, B_UNIT_DEF_SUPPRESS},   /* 
hectare */
+  {"square hectometer", "square hectometers", "hm²",  "hm2",  "Square 
Hectometers", NULL, UN_SC_HM * UN_SC_HM,   0.0, B_UNIT_DEF_SUPPRESS},   /* 
Hectare. */
   {"square dekameter",  "square dekameters",  "dam²", "dam2", "Square 
Dekameters",  NULL, UN_SC_DAM * UN_SC_DAM, 0.0, B_UNIT_DEF_SUPPRESS},  /* are */
-  {"square meter",      "square meters",      "m²",   "m2",   "Square Meters", 
     NULL, UN_SC_M * UN_SC_M,     0.0, B_UNIT_DEF_NONE},   /* base unit */
+  {"square meter",      "square meters",      "m²",   "m2",   "Square Meters", 
     NULL, UN_SC_M * UN_SC_M,     0.0, B_UNIT_DEF_NONE},   /* Base unit. */
   {"square decimeter",  "square decimetees",  "dm²",  "dm2",  "Square 
Decimeters",  NULL, UN_SC_DM * UN_SC_DM,   0.0, B_UNIT_DEF_SUPPRESS},
   {"square centimeter", "square centimeters", "cm²",  "cm2",  "Square 
Centimeters", NULL, UN_SC_CM * UN_SC_CM,   0.0, B_UNIT_DEF_NONE},
   {"square millimeter", "square millimeters", "mm²",  "mm2",  "Square 
Millimeters", NULL, UN_SC_MM * UN_SC_MM,   0.0, B_UNIT_DEF_NONE | 
B_UNIT_DEF_TENTH},
@@ -189,19 +191,19 @@ static struct bUnitDef buImperialAreaDef[] = {
   {"square furlong", "square furlongs", "sq fur", NULL,  "Square Furlongs", 
NULL, UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_SUPPRESS},
   {"square chain",   "square chains",   "sq ch",  NULL,  "Square Chains",   
NULL, UN_SC_CH * UN_SC_CH,   0.0, B_UNIT_DEF_SUPPRESS},
   {"square yard",    "square yards",    "sq yd",  NULL,  "Square Yards",    
NULL, UN_SC_YD * UN_SC_YD,   0.0, B_UNIT_DEF_NONE},
-  {"square foot",    "square feet",     "sq ft",  NULL,  "Square Feet",     
NULL, UN_SC_FT * UN_SC_FT,   0.0, B_UNIT_DEF_NONE}, /* base unit */
+  {"square foot",    "square feet",     "sq ft",  NULL,  "Square Feet",     
NULL, UN_SC_FT * UN_SC_FT,   0.0, B_UNIT_DEF_NONE}, /* Base unit. */
   {"square inch",    "square inches",   "sq in",  NULL,  "Square Inches",   
NULL, UN_SC_IN * UN_SC_IN,   0.0, B_UNIT_DEF_NONE},
   {"square thou",    "square thou",     "sq mil", NULL,  "Square Thou",     
NULL, UN_SC_MIL * UN_SC_MIL, 0.0, B_UNIT_DEF_NONE},
   NULL_UNIT,
 };
 static struct bUnitCollection buImperialAreaCollection = {buImperialAreaDef, 
4, 0, UNIT_COLLECTION_LENGTH(buImperialAreaDef)};
 
-/* Volumes */
+/* Volumes. */
 static struct bUnitDef buMetricVolDef[] = {
   {"cubic kilometer",  "cubic kilometers",  "km³",  "km3",  "Cubic 
Kilometers",  NULL, UN_SC_KM * UN_SC_KM * UN_SC_KM,    0.0, B_UNIT_DEF_NONE},
   {"cubic hectometer", "cubic hectometers", "hm³",  "hm3",  "Cubic 
Hectometers", NULL, UN_SC_HM * UN_SC_HM * UN_SC_HM,    0.0, 
B_UNIT_DEF_SUPPRESS},
   {"cubic dekameter",  "cubic dekameters",  "dam³", "dam3", "Cubic 
Dekameters",  NULL, UN_SC_DAM * UN_SC_DAM * UN_SC_DAM, 0.0, 
B_UNIT_DEF_SUPPRESS},
-  {"cubic meter",      "cubic meters",      "m³",   "m3",   "Cubic Meters",    
  NULL, UN_SC_M * UN_SC_M * UN_SC_M,       0.0, B_UNIT_DEF_NONE}, /* base unit 
*/
+  {"cubic meter",      "cubic meters",      "m³",   "m3",   "Cubic Meters",    
  NULL, UN_SC_M * UN_SC_M * UN_SC_M,       0.0, B_UNIT_DEF_NONE}, /* Base unit. 
*/
   {"cubic decimeter",  "cubic decimeters",  "dm³",  "dm3",  "Cubic 
Decimeters",  NULL, UN_SC_DM * UN_SC_DM * UN_SC_DM,    0.0, 
B_UNIT_DEF_SUPPRESS},
   {"cubic centimeter", "cubic centimeters", "cm³",  "cm3",  "Cubic 
Centimeters", NULL, UN_SC_CM * UN_SC_CM * UN_SC_CM,    0.0, B_UNIT_DEF_NONE},
   {"cubic millimeter", "cubic millimeters", "mm³",  "mm3",  "Cubic 
Millimeters", NULL, UN_SC_MM * UN_SC_MM * UN_SC_MM,    0.0, B_UNIT_DEF_NONE | 
B_UNIT_DEF_TENTH},
@@ -215,18 +217,18 @@ static struct bUnitDef buImperialVolDef[] = {
   {"cubic furlong", "cubic furlongs", "cu fur", NULL,   "Cubic Furlongs", 
NULL, UN_SC_FUR * UN_SC_FUR * UN_SC_FUR, 0.0, B_UNIT_DEF_S

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to