[Bf-blender-cvs] [c1a477b497c] master: Cleanup: use C++ comments or 'if 0' for commented code

Campbell Barton noreply at git.blender.org
Tue Aug 3 07:38:34 CEST 2021


Commit: c1a477b497c8d57ff9b402fdd285ea0f8d91d221
Author: Campbell Barton
Date:   Tue Aug 3 15:27:20 2021 +1000
Branches: master
https://developer.blender.org/rBc1a477b497c8d57ff9b402fdd285ea0f8d91d221

Cleanup: use C++ comments or 'if 0' for commented code

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

M	intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
M	intern/ghost/intern/GHOST_SystemSDL.cpp
M	intern/ghost/intern/GHOST_WindowX11.cpp
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/mask_rasterize.c
M	source/blender/blenkernel/intern/mesh_normals.cc
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenkernel/intern/screen.c
M	source/blender/blenkernel/intern/softbody.c
M	source/blender/blenlib/intern/boxpack_2d.c
M	source/blender/blenlib/intern/path_util.c
M	source/blender/blenlib/intern/scanfill.c
M	source/blender/bmesh/intern/bmesh_mesh_normals.c
M	source/blender/bmesh/tools/bmesh_bevel.c
M	source/blender/editors/gpencil/annotate_paint.c
M	source/blender/editors/interface/interface_ops.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/gpu/intern/gpu_immediate.cc
M	source/blender/io/collada/SceneExporter.cpp
M	source/blender/makesrna/intern/rna_access.c
M	source/blender/python/intern/bpy_app_translations.c
M	source/blender/windowmanager/intern/wm_window.c

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

diff --git a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
index b983f5a9a4d..96898a15f62 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
+++ b/intern/ghost/intern/GHOST_DisplayManagerCocoa.mm
@@ -141,22 +141,26 @@ GHOST_TSuccess GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(
   printf("  setting.frequency=%d\n", setting.frequency);
 #endif  // GHOST_DEBUG
 
-  // Display configuration is no more available in 10.6
-
-  /*  CFDictionaryRef displayModeValues = ::CGDisplayBestModeForParametersAndRefreshRate(
-    m_displayIDs[display],
-    (size_t)setting.bpp,
-    (size_t)setting.xPixels,
-    (size_t)setting.yPixels,
-    (CGRefreshRate)setting.frequency,
-    NULL);*/
+  /* Display configuration is no more available in 10.6. */
+
+#if 0
+  CFDictionaryRef displayModeValues = ::CGDisplayBestModeForParametersAndRefreshRate(
+      m_displayIDs[display],
+      (size_t)setting.bpp,
+      (size_t)setting.xPixels,
+      (size_t)setting.yPixels,
+      (CGRefreshRate)setting.frequency,
+      NULL);
+#endif
 
 #ifdef GHOST_DEBUG
-/*  printf("GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(): switching to:\n");
+#  if 0
+  printf("GHOST_DisplayManagerCocoa::setCurrentDisplaySetting(): switching to:\n");
   printf("  setting.xPixels=%d\n", getValue(displayModeValues, kCGDisplayWidth));
   printf("  setting.yPixels=%d\n", getValue(displayModeValues, kCGDisplayHeight));
   printf("  setting.bpp=%d\n", getValue(displayModeValues, kCGDisplayBitsPerPixel));
-  printf("  setting.frequency=%d\n", getValue(displayModeValues, kCGDisplayRefreshRate)); */
+  printf("  setting.frequency=%d\n", getValue(displayModeValues, kCGDisplayRefreshRate));
+#  endif
 #endif  // GHOST_DEBUG
 
   // CGDisplayErr err = ::CGDisplaySwitchToMode(m_displayIDs[display], displayModeValues);
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp
index 0309a4f9c52..35c7a7ef463 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.cpp
+++ b/intern/ghost/intern/GHOST_SystemSDL.cpp
@@ -473,7 +473,7 @@ void GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
       GHOST_TKey gkey = convertSDLKey(sdl_sub_evt.keysym.scancode);
       /* NOTE: the `sdl_sub_evt.keysym.sym` is truncated,
        * for unicode support ghost has to be modified. */
-      /* printf("%d\n", sym); */
+      // printf("%d\n", sym);
       if (sym > 127) {
         switch (sym) {
           case SDLK_KP_DIVIDE:
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 0ade7a52891..185d12717e7 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -403,7 +403,7 @@ GHOST_WindowX11::GHOST_WindowX11(GHOST_SystemX11 *system,
     }
 
     if (natom) {
-      /* printf("Register atoms: %d\n", natom); */
+      // printf("Register atoms: %d\n", natom);
       XSetWMProtocols(m_display, m_window, atoms, natom);
     }
   }
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index b8ed519e8d1..434d696f9bd 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2663,7 +2663,7 @@ void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, const bool do_id_
     }
   }
 
-  /* printf("rebuild pose %s, %d bones\n", ob->id.name, counter); */
+  // printf("rebuild pose %s, %d bones\n", ob->id.name, counter);
 
   /* synchronize protected layers with proxy */
   /* HACK! To preserve 2.7x behavior that you always can pose even locked bones,
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 81c161a4a7d..00ed7d86975 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -106,7 +106,7 @@
 
 /* for debugging add... */
 #ifndef NDEBUG
-/* printf("%u %u %u %u\n", _t[0], _t[1], _t[2], _t[3]); \ */
+// printf("%u %u %u %u\n", _t[0], _t[1], _t[2], _t[3]);
 #  define FACE_ASSERT(face, vert_max) \
     { \
       unsigned int *_t = face; \
@@ -1213,7 +1213,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle,
         layer->falloff = masklay->falloff;
       }
 
-      /* printf("tris %d, feather tris %d\n", sf_tri_tot, tot_feather_quads); */
+      // printf("tris %d, feather tris %d\n", sf_tri_tot, tot_feather_quads);
     }
 
     /* add trianges */
diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc
index 1438d737b79..87b11904f90 100644
--- a/source/blender/blenkernel/intern/mesh_normals.cc
+++ b/source/blender/blenkernel/intern/mesh_normals.cc
@@ -1195,7 +1195,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon *common_data, LoopSpli
     }
   }
 
-  //  printf("FAN: vert %d, start edge %d\n", mv_pivot_index, ml_curr->e);
+  // printf("FAN: vert %d, start edge %d\n", mv_pivot_index, ml_curr->e);
 
   while (true) {
     const MEdge *me_curr = &medges[mlfan_curr->e];
@@ -1212,7 +1212,7 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon *common_data, LoopSpli
       normalize_v3(vec_curr);
     }
 
-    //      printf("\thandling edge %d / loop %d\n", mlfan_curr->e, mlfan_curr_index);
+    // printf("\thandling edge %d / loop %d\n", mlfan_curr->e, mlfan_curr_index);
 
     {
       /* Code similar to accumulate_vertex_normals_poly_v3. */
@@ -1252,9 +1252,8 @@ static void split_loop_nor_fan_do(LoopSplitTaskDataCommon *common_data, LoopSpli
 
     if (IS_EDGE_SHARP(e2lfan_curr) || (me_curr == me_org)) {
       /* Current edge is sharp and we have finished with this fan of faces around this vert,
-       * or this vert is smooth, and we have completed a full turn around it.
-       */
-      //          printf("FAN: Finished!\n");
+       * or this vert is smooth, and we have completed a full turn around it. */
+      // printf("FAN: Finished!\n");
       break;
     }
 
@@ -1537,12 +1536,12 @@ static void loop_split_generator(TaskPool *pool, LoopSplitTaskDataCommon *common
                                                                                      ml_curr_index,
                                                                                      ml_prev_index,
                                                                                      mp_index))) {
-        //              printf("SKIPPING!\n");
+        // printf("SKIPPING!\n");
       }
       else {
         LoopSplitTaskData *data, data_local;
 
-        //              printf("PROCESSING!\n");
+        // printf("PROCESSING!\n");
 
         if (pool) {
           if (data_idx == 0) {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 89de37d6e4b..a6796d0513c 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -922,7 +922,7 @@ static void object_blend_read_lib(BlendLibReader *reader, ID *id)
     const short *totcol_data = BKE_object_material_len_p(ob);
     /* Only expand so as not to lose any object materials that might be set. */
     if (totcol_data && (*totcol_data > ob->totcol)) {
-      /* printf("'%s' %d -> %d\n", ob->id.name, ob->totcol, *totcol_data); */
+      // printf("'%s' %d -> %d\n", ob->id.name, ob->totcol, *totcol_data);
       BKE_object_material_resize(BLO_read_lib_get_main(reader), ob, *totcol_data, false);
     }
   }
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 06d3daaf4d6..9c0c5639777 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3112,7 +3112,7 @@ static void collision_fail(ParticleData *pa, ParticleCollision *col)
   copy_v3_v3(pa->state.vel, col->pce.vel);
   mul_v3_fl(pa->state.vel, col->inv_timestep);
 
-  /* printf("max iterations\n"); */
+  // printf("max iterations\n");
 }
 
 /* Particle - Mesh collision detection and response
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index c3885b5dcf7..e44c5a6b40e 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -766,7 +766,7 @@ void BKE_screen_remove_double_scrverts(bScreen *screen)
       while (v1) {
         if (v1->newv == NULL) { /* !?! */
           if (v1->vec.x == verg->vec.x && v1->vec.y == verg->vec.y) {
-            /* printf("doublevert\n"); */
+            // printf("doublevert\n");
             v1->newv = verg;
           }
         }
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index e4e2ed94b41..1a408aceeb2 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -2225,7 +2225,7 @@ static void sb_cf_threads_run(Scene *scene,
     totthread--;
   }
 
-  /* printf("sb_cf_threads_run spawning %d threads\n", totthread); */
+  // printf("sb_cf_threads_run spawning %d threads\n", totthread);
 
   sb_threads = MEM_callocN(sizeof(SB_thread_context) * totthread, "SBThread");
   memset(sb_threads, 0, sizeof(SB_thread_context) * totthread);
@@ -2812,7 +2812,7 @@ static void reference_to_scratch(Object *ob)
   }
   mul_v3_fl(accu_pos, 1.0f / accu_mass);
   copy_v3_v3(sb->scratch->Ref.com, accu_pos);
-  /* printf("reference_to_scratch\n"); */
+  // printf("reference_to_scratch\n");
 }
 
 /*
diff --git a/source/blender/blenlib/intern/boxpack_2d.c b/source/blender/blenlib/intern/boxpack_2d.c
index ea6c2d8d498..4a07f1134d0 100644
--- a/source/blender/blenlib/intern/boxpack_2d.c
+++ b/source/blender/blenlib/intern/boxpack_2d.c
@@ -409,8 +409,8 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r
 
     for (i = 0; i < verts_pack_len && isect; i++) {
       vert = &vs_ctx.vertarray[vertex_pack_indices[i]];
-      /* printf("\ttesting vert %i %i %i %f %f\n", i,
-       *        vert->free, verts_pack_len, vert->x, vert->y); */
+      // printf("\ttesting vert %i %i %i %f %f\n", i,
+      //        vert->free, verts_pack_len, vert->x, vert->y);
 
       /*

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list