[Bf-blender-cvs] [77e927b58fc] master: Cleanup: reserve C++ comments for disabled code

Campbell Barton noreply at git.blender.org
Tue Jul 20 07:02:45 CEST 2021


Commit: 77e927b58fca272d1d336a9def63678fb28c0632
Author: Campbell Barton
Date:   Tue Jul 20 15:01:05 2021 +1000
Branches: master
https://developer.blender.org/rB77e927b58fca272d1d336a9def63678fb28c0632

Cleanup: reserve C++ comments for disabled code

Use C comments for plain text.

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

M	intern/ghost/intern/GHOST_ContextCGL.mm
M	intern/ghost/intern/GHOST_ContextEGL.cpp
M	intern/ghost/intern/GHOST_ContextWGL.cpp
M	intern/ghost/intern/GHOST_DisplayManager.cpp
M	intern/ghost/intern/GHOST_DropTargetX11.cpp
M	intern/ghost/intern/GHOST_EventDragnDrop.h
M	intern/ghost/intern/GHOST_EventManager.cpp
M	intern/ghost/intern/GHOST_NDOFManager.cpp
M	intern/ghost/intern/GHOST_NDOFManager.h
M	intern/ghost/intern/GHOST_Rect.cpp
M	intern/ghost/intern/GHOST_System.cpp
M	intern/ghost/intern/GHOST_SystemSDL.cpp
M	intern/ghost/intern/GHOST_SystemX11.cpp
M	intern/ghost/intern/GHOST_TimerManager.cpp
M	intern/ghost/intern/GHOST_WindowManager.cpp
M	intern/ghost/intern/GHOST_WindowWayland.cpp
M	intern/rigidbody/RBI_api.h
M	source/blender/blenkernel/BKE_cloth.h
M	source/blender/blenkernel/intern/armature_pose.cc
M	source/blender/blenkernel/intern/boids.c
M	source/blender/blenkernel/intern/effect.c
M	source/blender/blenkernel/intern/fluid.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenlib/BLI_dlrbTree.h
M	source/blender/blenlib/intern/BLI_mmap.c
M	source/blender/blenlib/intern/math_base_inline.c
M	source/blender/blenlib/intern/winstuff.c
M	source/blender/blenloader/intern/versioning_250.c
M	source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc
M	source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc
M	source/blender/depsgraph/intern/builder/deg_builder_rna.cc
M	source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M	source/blender/editors/physics/particle_edit.c
M	source/blender/freestyle/intern/application/Controller.cpp
M	source/blender/imbuf/intern/oiio/openimageio_api.cpp
M	source/blender/makesdna/DNA_anim_types.h
M	source/blender/makesdna/DNA_constraint_types.h
M	source/blender/nodes/texture/nodes/node_texture_rotate.c
M	source/blender/sequencer/intern/strip_transform.c

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

diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm
index 687173ded09..7af243846c2 100644
--- a/intern/ghost/intern/GHOST_ContextCGL.mm
+++ b/intern/ghost/intern/GHOST_ContextCGL.mm
@@ -217,7 +217,7 @@ static void makeAttribList(std::vector<NSOpenGLPixelFormatAttribute> &attribs,
   attribs.push_back(NSOpenGLPFAOpenGLProfile);
   attribs.push_back(coreProfile ? NSOpenGLProfileVersion3_2Core : NSOpenGLProfileVersionLegacy);
 
-  // Pixel Format Attributes for the windowed NSOpenGLContext
+  /* Pixel Format Attributes for the windowed NSOpenGLContext. */
   attribs.push_back(NSOpenGLPFADoubleBuffer);
 
   if (softwareGL) {
@@ -250,7 +250,8 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
   static const bool needAlpha = false;
 #endif
 
-  static bool softwareGL = getenv("BLENDER_SOFTWAREGL");  // command-line argument would be better
+  /* Command-line argument would be better. */
+  static bool softwareGL = getenv("BLENDER_SOFTWAREGL");
 
   std::vector<NSOpenGLPixelFormatAttribute> attribs;
   attribs.reserve(40);
@@ -287,7 +288,7 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext()
 
   if (m_metalView) {
     if (m_defaultFramebuffer == 0) {
-      // Create a virtual framebuffer
+      /* Create a virtual frame-buffer. */
       [m_openGLContext makeCurrentContext];
       metalInitFramebuffer();
       initClearGL();
@@ -342,11 +343,11 @@ void GHOST_ContextCGL::metalInit()
     /* clang-format on */
     id<MTLDevice> device = m_metalLayer.device;
 
-    // Create a command queue for blit/present operation
+    /* Create a command queue for blit/present operation. */
     m_metalCmdQueue = (MTLCommandQueue *)[device newCommandQueue];
     [m_metalCmdQueue retain];
 
-    // Create shaders for blit operation
+    /* Create shaders for blit operation. */
     NSString *source = @R"msl(
       using namespace metal;
 
@@ -387,7 +388,7 @@ void GHOST_ContextCGL::metalInit()
           "GHOST_ContextCGL::metalInit: newLibraryWithSource:options:error: failed!");
     }
 
-    // Create a render pipeline for blit operation
+    /* Create a render pipeline for blit operation. */
     MTLRenderPipelineDescriptor *desc = [[[MTLRenderPipelineDescriptor alloc] init] autorelease];
 
     desc.fragmentFunction = [library newFunctionWithName:@"fragment_shader"];
@@ -460,7 +461,7 @@ void GHOST_ContextCGL::metalUpdateFramebuffer()
         "GHOST_ContextCGL::metalUpdateFramebuffer: CVPixelBufferCreate failed!");
   }
 
-  // Create an OpenGL texture
+  /* Create an OpenGL texture. */
   CVOpenGLTextureCacheRef cvGLTexCache = nil;
   cvret = CVOpenGLTextureCacheCreate(kCFAllocatorDefault,
                                      nil,
@@ -485,7 +486,7 @@ void GHOST_ContextCGL::metalUpdateFramebuffer()
   unsigned int glTex;
   glTex = CVOpenGLTextureGetName(cvGLTex);
 
-  // Create a Metal texture
+  /* Create a Metal texture. */
   CVMetalTextureCacheRef cvMetalTexCache = nil;
   cvret = CVMetalTextureCacheCreate(
       kCFAllocatorDefault, nil, m_metalLayer.device, nil, &cvMetalTexCache);
diff --git a/intern/ghost/intern/GHOST_ContextEGL.cpp b/intern/ghost/intern/GHOST_ContextEGL.cpp
index 0fee200ea1a..a64b2aef6a5 100644
--- a/intern/ghost/intern/GHOST_ContextEGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextEGL.cpp
@@ -283,8 +283,8 @@ GHOST_TSuccess GHOST_ContextEGL::setSwapInterval(int interval)
 
 GHOST_TSuccess GHOST_ContextEGL::getSwapInterval(int &intervalOut)
 {
-  // This is a bit of a kludge because there does not seem to
-  // be a way to query the swap interval with EGL.
+  /* This is a bit of a kludge because there does not seem to
+   * be a way to query the swap interval with EGL. */
   intervalOut = m_swap_interval;
 
   return GHOST_kSuccess;
@@ -365,21 +365,21 @@ static const std::string &api_string(EGLenum api)
 
 GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
 {
-  // objects have to be declared here due to the use of goto
+  /* Objects have to be declared here due to the use of `goto`. */
   std::vector<EGLint> attrib_list;
   EGLint num_config = 0;
 
   if (m_stereoVisual)
     fprintf(stderr, "Warning! Stereo OpenGL ES contexts are not supported.\n");
 
-  m_stereoVisual = false;  // It doesn't matter what the Window wants.
+  m_stereoVisual = false; /* It doesn't matter what the Window wants. */
 
   if (!initContextEGLEW()) {
     return GHOST_kFailure;
   }
 
 #ifdef WITH_GL_ANGLE
-  // d3dcompiler_XX.dll needs to be loaded before ANGLE will work
+  /* `d3dcompiler_XX.dll` needs to be loaded before ANGLE will work. */
   if (s_d3dcompiler == NULL) {
     s_d3dcompiler = LoadLibrary(D3DCOMPILER);
 
@@ -410,13 +410,13 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
   if (!bindAPI(m_api))
     goto error;
 
-  // build attribute list
+  /* Build attribute list. */
 
   attrib_list.reserve(20);
 
   if (m_api == EGL_OPENGL_ES_API && EGLEW_VERSION_1_2) {
-    // According to the spec it seems that you are required to set EGL_RENDERABLE_TYPE,
-    // but some implementations (ANGLE) do not seem to care.
+    /* According to the spec it seems that you are required to set EGL_RENDERABLE_TYPE,
+     * but some implementations (ANGLE) do not seem to care. */
 
     if (m_contextMajorVersion == 1) {
       attrib_list.push_back(EGL_RENDERABLE_TYPE);
@@ -469,7 +469,7 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
 #endif
 
   if (m_nativeWindow == 0) {
-    // off-screen surface
+    /* Off-screen surface. */
     attrib_list.push_back(EGL_SURFACE_TYPE);
     attrib_list.push_back(EGL_PBUFFER_BIT);
   }
@@ -479,8 +479,8 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext()
   if (!EGL_CHK(::eglChooseConfig(m_display, &(attrib_list[0]), &m_config, 1, &num_config)))
     goto error;
 
-  // A common error is to assume that ChooseConfig worked because it returned EGL_TRUE
-  if (num_config != 1)  // num_config should be exactly 1
+  /* A common error is to assume that ChooseConfig worked because it returned EGL_TRUE. */
+  if (num_config != 1) /* `num_config` should be exactly 1. */
     goto error;
 
   if (m_nativeWindow != 0) {
diff --git a/intern/ghost/intern/GHOST_ContextWGL.cpp b/intern/ghost/intern/GHOST_ContextWGL.cpp
index ddb34a8afd9..b5b3fab838d 100644
--- a/intern/ghost/intern/GHOST_ContextWGL.cpp
+++ b/intern/ghost/intern/GHOST_ContextWGL.cpp
@@ -335,10 +335,11 @@ void GHOST_ContextWGL::initContextWGLEW(PIXELFORMATDESCRIPTOR &preferredPFD)
   if (!WIN32_CHK(::wglMakeCurrent(dummyHDC, dummyHGLRC)))
     goto finalize;
 
-  if (GLEW_CHK(glewInit()) != GLEW_OK)
+  if (GLEW_CHK(glewInit()) != GLEW_OK) {
     fprintf(stderr, "Warning! Dummy GLEW/WGLEW failed to initialize properly.\n");
+  }
 
-    // the following are not technially WGLEW, but they also require a context to work
+  /* The following are not technically WGLEW, but they also require a context to work. */
 
 #ifndef NDEBUG
   free((void *)m_dummyRenderer);
diff --git a/intern/ghost/intern/GHOST_DisplayManager.cpp b/intern/ghost/intern/GHOST_DisplayManager.cpp
index fe12a76753d..9abc652378a 100644
--- a/intern/ghost/intern/GHOST_DisplayManager.cpp
+++ b/intern/ghost/intern/GHOST_DisplayManager.cpp
@@ -51,7 +51,7 @@ GHOST_TSuccess GHOST_DisplayManager::initialize(void)
 
 GHOST_TSuccess GHOST_DisplayManager::getNumDisplays(uint8_t & /*numDisplays*/) const
 {
-  // Don't know if we have a display...
+  /* Don't know if we have a display. */
   return GHOST_kFailure;
 }
 
@@ -120,18 +120,18 @@ GHOST_TSuccess GHOST_DisplayManager::findMatch(uint8_t display,
       (int)setting.xPixels, (int)setting.yPixels, (int)setting.bpp, (int)setting.frequency};
   int capabilities[4];
   double field, score;
-  double best = 1e12;  // A big number
+  double best = 1e12; /* A big number. */
   int found = 0;
 
-  // Look at all the display modes
+  /* Look at all the display modes. */
   for (int i = 0; (i < (int)m_settings[display].size()); i++) {
-    // Store the capabilities of the display device
+    /* Store the capabilities of the display device. */
     capabilities[0] = m_settings[display][i].xPixels;
     capabilities[1] = m_settings[display][i].yPixels;
     capabilities[2] = m_settings[display][i].bpp;
     capabilities[3] = m_settings[display][i].frequency;
 
-    // Match against all the fields of the display settings
+    /* Match against all the fields of the display settings. */
     score = 0;
     for (int j = 0; j < 4; j++) {
       field = capabilities[j] - criteria[j];
diff --git a/intern/ghost/intern/GHOST_DropTargetX11.cpp b/intern/ghost/intern/GHOST_DropTargetX11.cpp
index 8758a27930e..dba1d305144 100644
--- a/intern/ghost/intern/GHOST_DropTargetX11.cpp
+++ b/intern/ghost/intern/GHOST_DropTargetX11.cpp
@@ -115,8 +115,10 @@ GHOST_DropTargetX11::~GHOST_DropTargetX11()
 /* Based on: https://stackoverflow.com/a/2766963/432509 */
 
 typedef enum DecodeState_e {
-  STATE_SEARCH = 0,  ///< searching for an ampersand to convert
-  STATE_CONVERTING   ///< convert the two proceeding characters from hex
+  /** Searching for an ampersand to convert. */
+  STATE_SEARCH = 0,
+  /** Convert the two proceeding characters from hex. */
+  STATE_CONVERTING
 } DecodeState_e;
 
 void GHOST_DropTargetX11::UrlDecode(char *decodedOut, int bufferSize, const char *encodedIn)
diff --git a/intern/ghost/intern/GHOST_EventDragnDrop.h b/intern/ghost/intern/GHOST_EventDragnDrop.h
index 537717b1717..0095cedb8c8 100644
--- a/intern/ghost/intern/GHOST_EventDragnDrop.h
+++ b/intern/ghost/intern/GHOST_EventDragnDrop.h
@@ -90,7 +90,7 @@ class GHOST_EventDragnDrop : public GHOST_Event {
 
   ~GHOST_EventDragnDrop()
   {
-    // Free the dropped object data
+    /* Free the dropped object data. */
     if (m_dragnDropEventData.data == NULL)
       return;
 
diff --git a/intern/ghost/intern/GHOST_EventManager.cpp b/intern/ghost/intern/GHOST_EventManager.cpp
index 15befb9afcb..6ddc362ac77 100644
--- a/intern/ghost/intern/GHOST_EventManager.cpp
+++ b/intern/ghost/intern/GHOST_EventManager.cpp
@@ -108,12 +108,12 @@ GHOST_TSuccess GHOST_EventManager::addConsumer(GHOST_IEventConsumer *consumer)
   GHOST_TSuccess success;
   GHOST_ASSERT(consumer, "invalid consumer");
 
-  // Check to see whether the 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list