[Bf-blender-cvs] [4bf56b37ca9] master: Cleanup: Use C-style comments in outliner files

Nathan Craddock noreply at git.blender.org
Fri Jul 3 21:43:59 CEST 2020


Commit: 4bf56b37ca98637c94bc1fc66c78f136ed709afb
Author: Nathan Craddock
Date:   Fri Jul 3 13:31:42 2020 -0600
Branches: master
https://developer.blender.org/rB4bf56b37ca98637c94bc1fc66c78f136ed709afb

Cleanup: Use C-style comments in outliner files

No functional changes. Convert all C++ style comments to C comments.
Also capitalize and add full stops.

The comments themselves were not cleaned up. Some could be removed or
reworded.

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

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/editors/space_outliner/outliner_tools.c
M	source/blender/editors/space_outliner/outliner_tree.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 783a13d45d5..47215f3ccda 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -80,8 +80,8 @@
 
 #include "outliner_intern.h"
 
-/* disable - this is far too slow - campbell */
-// #define USE_GROUP_SELECT
+/* Disable - this is far too slow - campbell. */
+/* #define USE_GROUP_SELECT */
 
 /* ****************************************************** */
 /* Tree Size Functions */
@@ -731,7 +731,7 @@ static void namebutton_fn(bContext *C, void *tsep, char *oldname)
     else {
       switch (tselem->type) {
         case TSE_DEFGROUP:
-          BKE_object_defgroup_unique_name(te->directdata, (Object *)tselem->id);  //  id = object
+          BKE_object_defgroup_unique_name(te->directdata, (Object *)tselem->id); /* id = object. */
           break;
         case TSE_NLA_ACTION:
           BLI_libblock_ensure_unique_name(bmain, tselem->id->name);
@@ -790,7 +790,7 @@ static void namebutton_fn(bContext *C, void *tsep, char *oldname)
           break;
         }
         case TSE_POSEGRP: {
-          Object *ob = (Object *)tselem->id;  // id = object
+          Object *ob = (Object *)tselem->id; /* id = object. */
           bActionGroup *grp = te->directdata;
 
           BLI_uniquename(&ob->pose->agroups,
@@ -809,7 +809,7 @@ static void namebutton_fn(bContext *C, void *tsep, char *oldname)
           /* always make layer active */
           BKE_gpencil_layer_active_set(gpd, gpl);
 
-          // XXX: name needs translation stuff
+          /* XXX: name needs translation stuff. */
           BLI_uniquename(
               &gpd->layers, gpl, "GP Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
 
@@ -3069,7 +3069,7 @@ static void outliner_draw_tree_element(bContext *C,
                           icon_border);
       GPU_blend(true); /* roundbox disables it */
 
-      te->flag |= TE_ACTIVE;  // for lookup in display hierarchies
+      te->flag |= TE_ACTIVE; /* For lookup in display hierarchies. */
     }
 
     if (tselem->type == TSE_VIEW_COLLECTION_BASE) {
@@ -3080,7 +3080,7 @@ static void outliner_draw_tree_element(bContext *C,
       /* open/close icon, only when sublevels, except for scene */
       int icon_x = startx;
 
-      // icons a bit higher
+      /* Icons a bit higher. */
       if (TSELEM_OPEN(tselem, soops)) {
         UI_icon_draw_alpha((float)icon_x + 2 * ufac,
                            (float)*starty + 1 * ufac,
@@ -3487,7 +3487,7 @@ static void outliner_draw_tree(bContext *C,
   int starty, startx;
 
   GPU_blend_set_func_separate(
-      GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);  // only once
+      GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); /* Only once. */
 
   if (soops->outlinevis == SO_DATA_API) {
     /* struct marks */
@@ -3510,13 +3510,12 @@ static void outliner_draw_tree(bContext *C,
     GPU_scissor(0, 0, mask_x, region->winy);
   }
 
-  // gray hierarchy lines
-
+  /* Gray hierarchy lines. */
   starty = (int)region->v2d.tot.ymax - UI_UNIT_Y / 2 - OL_Y_OFFSET;
   startx = UI_UNIT_X / 2 - (U.pixelsize + 1) / 2;
   outliner_draw_hierarchy_lines(soops, &soops->tree, startx, &starty);
 
-  // items themselves
+  /* Items themselves. */
   starty = (int)region->v2d.tot.ymax - UI_UNIT_Y - OL_Y_OFFSET;
   startx = 0;
   LISTBASE_FOREACH (TreeElement *, te, &soops->tree) {
@@ -3621,7 +3620,7 @@ void draw_outliner(const bContext *C)
   TreeViewContext tvc;
   outliner_viewcontext_init(C, &tvc);
 
-  outliner_build_tree(mainvar, tvc.scene, tvc.view_layer, soops, region);  // always
+  outliner_build_tree(mainvar, tvc.scene, tvc.view_layer, soops, region); /* Always. */
 
   /* If global sync select is dirty, flag other outliners */
   if (ED_outliner_select_sync_is_dirty(C)) {
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index bead8ddcc42..4fe3d5b0df7 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1475,7 +1475,7 @@ void OUTLINER_OT_scroll_page(wmOperatorType *ot)
 
 /** \} */
 
-#if 0  // TODO: probably obsolete now with filtering?
+#if 0 /* TODO: probably obsolete now with filtering? */
 
 /* -------------------------------------------------------------------- */
 /** \name Search
@@ -1519,7 +1519,7 @@ static TreeElement *outliner_find_name(
 static void outliner_find_panel(
     Scene *UNUSED(scene), ARegion *region, SpaceOutliner *soops, int again, int flags)
 {
-  ReportList *reports = NULL;  // CTX_wm_reports(C);
+  ReportList *reports = NULL;  /* CTX_wm_reports(C); */
   TreeElement *te = NULL;
   TreeElement *last_find;
   TreeStoreElem *tselem;
@@ -1546,10 +1546,10 @@ static void outliner_find_panel(
   else {
     /* pop up panel - no previous, or user didn't want search after previous */
     name[0] = '\0';
-    // XXX      if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) {
-    //          te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound);
-    //      }
-    //      else return; /* XXX RETURN! XXX */
+    /* XXX      if (sbutton(name, 0, sizeof(name) - 1, "Find: ") && name[0]) { */
+    /*          te = outliner_find_name(soops, &soops->tree, name, flags, NULL, &prevFound); */
+    /*      } */
+    /*      else return; XXX RETURN! XXX */
   }
 
   /* do selection and reveal */
@@ -1764,7 +1764,7 @@ void OUTLINER_OT_show_hierarchy(wmOperatorType *ot)
 
   /* callbacks */
   ot->exec = outliner_show_hierarchy_exec;
-  ot->poll = ED_operator_outliner_active;  //  TODO: shouldn't be allowed in RNA views...
+  ot->poll = ED_operator_outliner_active; /* TODO: shouldn't be allowed in RNA views... */
 
   /* no undo or registry, UI option */
 }
@@ -2050,7 +2050,7 @@ static int outliner_drivers_addsel_exec(bContext *C, wmOperator *op)
   do_outliner_drivers_editop(soutliner, &soutliner->tree, op->reports, DRIVERS_EDITMODE_ADD);
 
   /* send notifiers */
-  WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL);  // XXX
+  WM_event_add_notifier(C, NC_ANIMATION | ND_FCURVES_ORDER, NULL); /* XXX */
 
   return OPERATOR_FINISHED;
 }
@@ -2089,7 +2089,7 @@ static int outliner_drivers_deletesel_exec(bContext *C, wmOperator *op)
   do_outliner_drivers_editop(soutliner, &soutliner->tree, op->reports, DRIVERS_EDITMODE_REMOVE);
 
   /* send notifiers */
-  WM_event_add_notifier(C, ND_KEYS, NULL);  // XXX
+  WM_event_add_notifier(C, ND_KEYS, NULL); /* XXX */
 
   return OPERATOR_FINISHED;
 }
@@ -2126,8 +2126,8 @@ enum {
   KEYINGSET_EDITMODE_REMOVE,
 } /*eKeyingSet_EditModes*/;
 
-/* find the 'active' KeyingSet, and add if not found (if adding is allowed) */
-// TODO: should this be an API func?
+/* Find the 'active' KeyingSet, and add if not found (if adding is allowed). */
+/* TODO: should this be an API func? */
 static KeyingSet *verify_active_keyingset(Scene *scene, short add)
 {
   KeyingSet *ks = NULL;
@@ -2142,8 +2142,8 @@ static KeyingSet *verify_active_keyingset(Scene *scene, short add)
     ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1);
   }
 
-  /* add if none found */
-  // XXX the default settings have yet to evolve
+  /* Add if none found */
+  /* XXX the default settings have yet to evolve. */
   if ((add) && (ks == NULL)) {
     ks = BKE_keyingset_add(&scene->keyingsets, NULL, NULL, KEYINGSET_ABSOLUTE, 0);
     scene->active_keyingset = BLI_listbase_count(&scene->keyingsets);
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index b6fff3a1022..186a66a95c0 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -63,15 +63,15 @@ typedef TreeTraversalAction (*TreeTraversalFunc)(struct TreeElement *te, void *c
 typedef struct TreeElement {
   struct TreeElement *next, *prev, *parent;
   ListBase subtree;
-  int xs, ys;                 // do selection
-  TreeStoreElem *store_elem;  // element in tree store
-  short flag;                 // flag for non-saved stuff
-  short index;                // index for data arrays
-  short idcode;               // from TreeStore id
-  short xend;                 // width of item display, for select
+  int xs, ys;                /* Do selection. */
+  TreeStoreElem *store_elem; /* Element in tree store. */
+  short flag;                /* Flag for non-saved stuff. */
+  short index;               /* Index for data arrays. */
+  short idcode;              /* From TreeStore id. */
+  short xend;                /* Width of item display, for select. */
   const char *name;
-  void *directdata;   // Armature Bones, Base, Sequence, Strip...
-  PointerRNA rnaptr;  // RNA Pointer
+  void *directdata;  /* Armature Bones, Base, Sequence, Strip... */
+  PointerRNA rnaptr; /* RNA Pointer. */
 } TreeElement;
 
 typedef struct TreeElementIcon {
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 638f63cce62..8bf05c3018a 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -455,7 +455,7 @@ static eOLDrawState tree_element_active_material(bContext *C,
 
   /* we search for the object parent */
   ob = (Object *)outliner_search_back(te, ID_OB);
-  // note: ob->matbits can be NULL when a local object points to a library mesh.
+  /* Note : ob->matbits can be NULL when a local object points to a library mesh. */
   if (ob == NULL || ob != OBACT(view_layer) || ob->matbits == NULL) {
     return OL_DRAWSEL_NONE; /* just paranoia */
   }
@@ -465,7 +465,7 @@ static eOLDrawState tree_element_active_material(bContext *C,
   if (tes->idcode == ID_OB) {
     if (set != OL_SETSEL_NONE) {
       ob->actcol = te->index + 1;
-      ob->matbits[te->index] = 1;  // make ob material active too
+      ob->matbits[te->index] = 1; /* Make ob material active too. */
     }
     else {
       if (ob->actcol == t

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list