correct too-big allocation in mesh beautify.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 1 Apr 2013 07:57:33 +0000 (07:57 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 1 Apr 2013 07:57:33 +0000 (07:57 +0000)
GNUmakefile
build_files/cmake/cmake_static_check_cppcheck.py
source/blender/bmesh/operators/bmo_beautify.c
source/blender/editors/sculpt_paint/paint_stroke.c

index c1b67c86ed2662a5d706facbd3f49d44751f5fb8..c7db7ab947a90988b6086f60fde01c73bf334737 100644 (file)
@@ -272,7 +272,9 @@ project_eclipse:
 check_cppcheck:
        $(CMAKE_CONFIG)
        cd $(BUILD_DIR) ; \
-       python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
+       python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py 2> \
+       $(BLENDER_DIR)/check_cppcheck.txt
+       @echo "written: check_cppcheck.txt"
 
 check_clang_array:
        $(CMAKE_CONFIG)
index 2f7ffa5c240381f7f31c341e9dbcfe7fbeab1ae5..25e39376dd24d597897037db2a863ea0e5bf0d84 100644 (file)
@@ -41,9 +41,9 @@ CHECKER_ARGS = [
     # not sure why this is needed, but it is.
     "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
     "--suppress=*:%s/extern/glew/include/GL/glew.h:241" % project_source_info.SOURCE_DIR,
-    "--max-configs=1",  # speeds up execution
+    "--max-configs=1",  # speeds up execution
     #  "--check-config", # when includes are missing
-    #  "--enable=all",  # if you want sixty hundred pedantic suggestions
+    "--enable=all",  # if you want sixty hundred pedantic suggestions
     ]
 
 if USE_QUIET:
index 3e968f9250da4839b0c63c5ad151d0363a64e623..68d0c662b2c2f1c2ee444bb3b03f664a585aa898 100644 (file)
@@ -33,8 +33,6 @@
  *
  * TODO
  * - Take face normals into account.
- * - Use a stack of rotations to perform the best onces first
- *   similar to edge-collapse-decimate.
  */
 
 #include "BLI_math.h"
@@ -305,7 +303,7 @@ static void bm_mesh_beautify_fill(BMesh *bm, BMEdge **edge_array, const int edge
 #endif
 
        eheap = BLI_heap_new_ex(edge_array_len);
-       eheap_table = MEM_mallocN(sizeof(HeapNode *) * bm->totedge, __func__);
+       eheap_table = MEM_mallocN(sizeof(HeapNode *) * edge_array_len, __func__);
 
        /* build heap */
        for (i = 0; i < edge_array_len; i++) {
index d5ece4830af190c0915d69f09e43f48ebe8e472c..1c0830a8158970faf543f86853d8f6b264500ac0 100644 (file)
@@ -185,7 +185,7 @@ static void paint_brush_update(bContext *C, Brush *brush, PaintMode mode,
                                ups->brush_rotation = 0.0f;
                }
 
-               if ((brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM))
+               if (brush->mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM)
                        BKE_brush_randomize_texture_coordinates(ups);
                else
                        copy_v2_v2(ups->tex_mouse, mouse);