[Bf-blender-cvs] [a509e79a4c7] master: Cleanup: Comment formatting, grammar

Hans Goudey noreply at git.blender.org
Wed Oct 14 22:04:55 CEST 2020


Commit: a509e79a4c772a48dee0e2bf56e2b4df97b170f0
Author: Hans Goudey
Date:   Wed Oct 14 15:04:49 2020 -0500
Branches: master
https://developer.blender.org/rBa509e79a4c772a48dee0e2bf56e2b4df97b170f0

Cleanup: Comment formatting, grammar

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

M	source/blender/windowmanager/intern/wm.c
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/creator/creator.c

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

diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 12ccd2134cf..f25044b5df7 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -20,9 +20,9 @@
 /** \file
  * \ingroup wm
  *
- * Internal functions for managing UI registrable types (operator, UI and menu types)
+ * Internal functions for managing UI registrable types (operator, UI and menu types).
  *
- * Also Blenders main event loop (WM_main)
+ * Also Blender's main event loop (WM_main).
  */
 
 #include <stddef.h>
@@ -87,7 +87,7 @@ static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
     if (win->workspace_hook != NULL) {
       ID *workspace = (ID *)BKE_workspace_active_get(win->workspace_hook);
       BKE_LIB_FOREACHID_PROCESS_ID(data, workspace, IDWALK_CB_NOP);
-      /* allow callback to set a different workspace */
+      /* Allow callback to set a different workspace. */
       BKE_workspace_active_set(win->workspace_hook, (WorkSpace *)workspace);
     }
     if (BKE_lib_query_foreachid_process_flags_get(data) & IDWALK_INCLUDE_UI) {
@@ -129,8 +129,7 @@ void WM_operator_free(wmOperator *op)
 
 #ifdef WITH_PYTHON
   if (op->py_instance) {
-    /* do this first in case there are any __del__ functions or
-     * similar that use properties */
+    /* Do this first in case there are any __del__ functions or similar that use properties. */
     BPY_DECREF_RNA_INVALIDATE(op->py_instance);
   }
 #endif
@@ -180,13 +179,13 @@ void WM_operator_free_all_after(wmWindowManager *wm, struct wmOperator *op)
  */
 void WM_operator_type_set(wmOperator *op, wmOperatorType *ot)
 {
-  /* not supported for Python */
+  /* Not supported for Python. */
   BLI_assert(op->py_instance == NULL);
 
   op->type = ot;
   op->ptr->type = ot->srna;
 
-  /* ensure compatible properties */
+  /* Ensure compatible properties. */
   if (op->properties) {
     PointerRNA ptr;
 
@@ -208,8 +207,8 @@ static void wm_reports_free(wmWindowManager *wm)
   WM_event_remove_timer(wm, NULL, wm->reports.reporttimer);
 }
 
-/* all operations get registered in the windowmanager here */
-/* called on event handling by event_system.c */
+/* All operations get registered in the windowmanager here. */
+/* Called on event handling by event_system.c. */
 void wm_operator_register(bContext *C, wmOperator *op)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
@@ -217,7 +216,7 @@ void wm_operator_register(bContext *C, wmOperator *op)
 
   BLI_addtail(&wm->operators, op);
 
-  /* only count registered operators */
+  /* Only count registered operators. */
   while (op) {
     wmOperator *op_prev = op->prev;
     if (op->type->flag & OPTYPE_REGISTER) {
@@ -230,7 +229,7 @@ void wm_operator_register(bContext *C, wmOperator *op)
     op = op_prev;
   }
 
-  /* so the console is redrawn */
+  /* So the console is redrawn. */
   WM_event_add_notifier(C, NC_SPACE | ND_SPACE_INFO_REPORT, NULL);
   WM_event_add_notifier(C, NC_WM | ND_HISTORY, NULL);
 }
@@ -287,7 +286,7 @@ void WM_keyconfig_init(bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
 
-  /* create standard key configs */
+  /* Create standard key configs. */
   if (wm->defaultconf == NULL) {
     /* Keep lowercase to match the preset filename. */
     wm->defaultconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT, false);
@@ -299,8 +298,7 @@ void WM_keyconfig_init(bContext *C)
     wm->userconf = WM_keyconfig_new(wm, WM_KEYCONFIG_STR_DEFAULT " user", false);
   }
 
-  /* initialize only after python init is done, for keymaps that
-   * use python operators */
+  /* Initialize only after python init is done, for keymaps that use python operators. */
   if (CTX_py_init_get(C) && (wm->initialized & WM_KEYCONFIG_IS_INIT) == 0) {
     /* create default key config, only initialize once,
      * it's persistent across sessions */
@@ -325,7 +323,7 @@ void WM_check(bContext *C)
   Main *bmain = CTX_data_main(C);
   wmWindowManager *wm = CTX_wm_manager(C);
 
-  /* wm context */
+  /* WM context. */
   if (wm == NULL) {
     wm = bmain->wm.first;
     CTX_wm_manager_set(C, wm);
@@ -341,18 +339,18 @@ void WM_check(bContext *C)
   }
 
   if (!G.background) {
-    /* case: fileread */
+    /* Case: fileread. */
     if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
       WM_keyconfig_init(C);
       WM_autosave_init(wm);
     }
 
-    /* case: no open windows at all, for old file reads */
+    /* Case: no open windows at all, for old file reads. */
     wm_window_ghostwindows_ensure(wm);
   }
 
-  /* case: fileread */
-  /* note: this runs in bg mode to set the screen context cb */
+  /* Case: fileread. */
+  /* Note: this runs in background mode to set the screen context cb. */
   if ((wm->initialized & WM_WINDOW_IS_INIT) == 0) {
     ED_screens_init(bmain, wm);
     wm->initialized |= WM_WINDOW_IS_INIT;
@@ -364,7 +362,7 @@ void wm_clear_default_size(bContext *C)
   wmWindowManager *wm = CTX_wm_manager(C);
   wmWindow *win;
 
-  /* wm context */
+  /* WM context. */
   if (wm == NULL) {
     wm = CTX_data_main(C)->wm.first;
     CTX_wm_manager_set(C, wm);
@@ -382,7 +380,7 @@ void wm_clear_default_size(bContext *C)
   }
 }
 
-/* on startup, it adds all data, for matching */
+/* On startup, it adds all data, for matching. */
 void wm_add_default(Main *bmain, bContext *C)
 {
   wmWindowManager *wm = BKE_libblock_alloc(bmain, ID_WM, "WinMan", 0);
@@ -404,7 +402,7 @@ void wm_add_default(Main *bmain, bContext *C)
   wm_window_make_drawable(wm, win);
 }
 
-/* context is allowed to be NULL, do not free wm itself (lib_id.c) */
+/* Context is allowed to be NULL, do not free wm itself (lib_id.c). */
 void wm_close_and_free(bContext *C, wmWindowManager *wm)
 {
   wmWindow *win;
@@ -421,7 +419,7 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm)
 #endif
 
   while ((win = BLI_pophead(&wm->windows))) {
-    /* prevent draw clear to use screen */
+    /* Prevent draw clear to use screen. */
     BKE_workspace_active_set(win->workspace_hook, NULL);
     wm_window_free(C, wm, win);
   }
@@ -476,16 +474,16 @@ void WM_main(bContext *C)
 
   while (1) {
 
-    /* get events from ghost, handle window events, add to window queues */
+    /* Get events from ghost, handle window events, add to window queues. */
     wm_window_process_events(C);
 
-    /* per window, all events to the window, screen, area and region handlers */
+    /* Per window, all events to the window, screen, area and region handlers. */
     wm_event_do_handlers(C);
 
-    /* events have left notes about changes, we handle and cache it */
+    /* Wvents have left notes about changes, we handle and cache it. */
     wm_event_do_notifiers(C);
 
-    /* execute cached changes draw */
+    /* Wxecute cached changes draw. */
     wm_draw_update(C);
   }
 }
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index afd88d6a680..2a8b102a369 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -157,7 +157,7 @@ void wm_event_free(wmEvent *event)
 {
   if (event->customdata) {
     if (event->customdatafree) {
-      /* note: pointer to listbase struct elsewhere */
+      /* Note: pointer to listbase struct elsewhere. */
       if (event->custom == EVT_DATA_DRAGDROP) {
         ListBase *lb = event->customdata;
         WM_drag_free_list(lb);
@@ -268,8 +268,8 @@ void WM_main_remove_notifier_reference(const void *reference)
       note_next = note->next;
 
       if (note->reference == reference) {
-        /* don't remove because this causes problems for #wm_event_do_notifiers
-         * which may be looping on the data (deleting screens) */
+        /* Don't remove because this causes problems for #wm_event_do_notifiers
+         * which may be looping on the data (deleting screens). */
         wm_notifier_clear(note);
       }
     }
@@ -314,7 +314,7 @@ void WM_main_remap_editor_id_reference(ID *old_id, ID *new_id)
 
 static void wm_notifier_clear(wmNotifier *note)
 {
-  /* NULL the entire notifier, only leaving (next, prev) members intact */
+  /* NULL the entire notifier, only leaving (next, prev) members intact. */
   memset(((char *)note) + sizeof(Link), 0, sizeof(*note) - sizeof(Link));
 }
 
@@ -322,13 +322,13 @@ void wm_event_do_depsgraph(bContext *C, bool is_after_open_file)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
   /* The whole idea of locked interface is to prevent viewport and whatever
-   * thread to modify the same data. Because of this, we can not perform
+   * thread from modifying the same data. Because of this, we can not perform
    * dependency graph update.
    */
   if (wm->is_interface_locked) {
     return;
   }
-  /* Combine datamasks so 1 win doesn't disable UV's in another T26448. */
+  /* Combine datamasks so one window doesn't disable UV's in another T26448. */
   CustomData_MeshMasks win_combine_v3d_datamask = {0};
   LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
     const Scene *scene = WM_window_get_active_scene(win);
@@ -369,7 +369,7 @@ void wm_event_do_depsgraph(bContext *C, bool is_after_open_file)
 void wm_event_do_refresh_wm_and_depsgraph(bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
-  /* cached: editor refresh callbacks now, they get context */
+  /* Cached: editor refresh callbacks now, they get context. */
   LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
     const bScreen *screen = WM_window_get_active_screen(win);
     ScrArea *area;
@@ -403,7 +403,7 @@ static void wm_event_execute_timers(bContext *C)
   CTX_wm_window_set(C, NULL);
 }
 
-/* called in mainloop */
+/* Called in mainloop. */
 void wm_event_do_notifiers(bContext *C)
 {
   wmNotifier *note, *next;
@@ -417,9 +417,9 @@ void wm_event_do_notifiers(bContext *C)
     return;
   }
 
-  /* disable? - keep for now since its used for window level notifiers. */
+  /* Disable? - Keep for now since its used for window level notifiers. */
 #if 1
-  /* cache & catch WM level notifiers, such as frame change, scene/screen set */
+  /* Cache & catch WM level notifiers, such as frame change, scene/screen set. */
   for (win = wm->windows.first; win; win = win->next)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list