code cleanup: misc warnings/style
authorCampbell Barton <ideasman42@gmail.com>
Thu, 21 Mar 2013 02:58:21 +0000 (02:58 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 21 Mar 2013 02:58:21 +0000 (02:58 +0000)
CMakeLists.txt
extern/wcwidth/CMakeLists.txt
intern/rigidbody/CMakeLists.txt
source/blender/blenkernel/intern/node.c
source/blender/compositor/CMakeLists.txt
source/blender/editors/mesh/editmesh_knife_project.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/space_node/drawnode.c
source/blender/render/CMakeLists.txt
source/creator/CMakeLists.txt

index d01fd5d..9c0e0ae 100644 (file)
@@ -124,7 +124,7 @@ mark_as_advanced(WITH_PYTHON_SECURITY)  # some distributions see this as a secur
 
 option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
 option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
-if (APPLE)
+if(APPLE)
        option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
 endif()
 
@@ -294,9 +294,9 @@ if(APPLE)
        endif()
        
        execute_process(COMMAND uname -r OUTPUT_VARIABLE MAC_SYS) # check for actual system-version
-       if (${MAC_SYS} MATCHES 12)
+       if(${MAC_SYS} MATCHES 12)
                set(OSX_SYSTEM 10.8)
-       elseif (${MAC_SYS} MATCHES 11)
+       elseif(${MAC_SYS} MATCHES 11)
                set(OSX_SYSTEM 10.7)
        elseif(${MAC_SYS} MATCHES 10)
                set(OSX_SYSTEM 10.6)
@@ -536,7 +536,7 @@ set(PLATFORM_LINKFLAGS_DEBUG "")
 
 if(UNIX AND NOT APPLE)
        macro(find_package_wrapper)
-               STRING(TOUPPER ${ARGV0} _NAME_UPPER)
+               string(TOUPPER ${ARGV0} _NAME_UPPER)
                if(${WITH_STATIC_LIBS})
                        set(_cmake_find_library_suffixes_back ${CMAKE_FIND_LIBRARY_SUFFIXES})
                        set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
@@ -666,7 +666,7 @@ if(UNIX AND NOT APPLE)
                endif()
        endif()
 
-       if (WITH_INPUT_NDOF)
+       if(WITH_INPUT_NDOF)
                find_package_wrapper(Spacenav)
                if(NOT SPACENAV_FOUND)
                        set(WITH_INPUT_NDOF OFF)
@@ -687,10 +687,11 @@ if(UNIX AND NOT APPLE)
                        endif()
                        set(Boost_USE_MULTITHREADED ON)
                        set(__boost_packages filesystem regex system thread date_time)
-                       if (WITH_INTERNATIONAL)
+                       if(WITH_INTERNATIONAL)
                                list(APPEND __boost_packages locale)
                        endif()
                        find_package(Boost 1.48 COMPONENTS ${__boost_packages})
+                       unset(__boost_packages)
                        if(Boost_USE_STATIC_LIBS AND WITH_BOOST_ICU)
                                find_package(IcuLinux)
                        endif()
@@ -708,7 +709,7 @@ if(UNIX AND NOT APPLE)
 
                set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES})
                set(OPENIMAGEIO_LIBPATH)  # TODO, remove and reference the absolute path everywhere
-               set(OPENIMAGEIO_DEFINITIONS)
+               set(OPENIMAGEIO_DEFINITIONS "")
 
                if(WITH_IMAGE_TIFF)
                        list(APPEND OPENIMAGEIO_LIBRARIES "${TIFF_LIBRARY}")
@@ -899,7 +900,7 @@ elseif(WIN32)
 
        if(CMAKE_COMPILER_IS_GNUCC)
                set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
-               INCLUDE (CheckCSourceCompiles) 
+               include(CheckCSourceCompiles)
                # Setup 64bit and 64bit windows systems
                CHECK_C_SOURCE_COMPILES("
                        #ifndef __MINGW64__
@@ -1135,7 +1136,7 @@ elseif(WIN32)
                        endif()
 
                        set_lib_path(PYTHON "python")
-                       STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
+                       string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
                        # Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
                        set(PYTHON_LIBRARY ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.lib)
                        # set(PYTHON_LIBRARY ${PYTHON}/lib/python${_PYTHON_VERSION_NO_DOTS}.lib) #CACHE FILEPATH
@@ -1377,7 +1378,7 @@ elseif(WIN32)
                        set(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO}/include)
                        set(OPENIMAGEIO_LIBRARIES OpenImageIO)
                        set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
-                       set(OPENIMAGEIO_DEFINITIONS)
+                       set(OPENIMAGEIO_DEFINITIONS "")
                endif()
                
                if(WITH_LLVM)
@@ -1630,7 +1631,7 @@ elseif(APPLE)
                set(TIFF_LIBPATH ${TIFF}/lib)
        endif()
 
-       if (WITH_INPUT_NDOF)
+       if(WITH_INPUT_NDOF)
                # linker needs "-weak_framework 3DconnexionClient"
        endif()
 
@@ -1638,7 +1639,7 @@ elseif(APPLE)
                set(BOOST ${LIBDIR}/boost)
                set(BOOST_INCLUDE_DIR ${BOOST}/include)
                set(BOOST_LIBRARIES boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt boost_wave-mt)
-               if (WITH_INTERNATIONAL)
+               if(WITH_INTERNATIONAL)
                        list(APPEND BOOST_LIBRARIES boost_locale-mt)
                        set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -liconv") # boost_locale needs it !
                endif()
@@ -1930,12 +1931,12 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
 
        # gcc 4.2 gives annoying warnings on every file with this
-       if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
+       if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
                ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_UNINITIALIZED -Wuninitialized)
        endif()
 
        # versions before gcc4.6 give many BLI_math warnings
-       if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.6")
+       if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.6")
                ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_REDUNDANT_DECLS       -Wredundant-decls)
                ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_REDUNDANT_DECLS -Wredundant-decls)
        endif()
@@ -1956,7 +1957,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
        ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
 
        # gcc 4.2 gives annoying warnings on every file with this
-       if (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
+       if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
                ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNINITIALIZED -Wuninitialized)
        endif()
 
index cf8d7d6..724c5ea 100644 (file)
@@ -33,6 +33,8 @@ set(INC_SYS
 
 set(SRC
        wcwidth.c
+
+       wcwidth.h
 )
 
 blender_add_lib(extern_wcwidth "${SRC}" "${INC}" "${INC_SYS}")
index a323e55..bea3075 100644 (file)
 #
 # ***** END GPL LICENSE BLOCK *****
 
-SET(INC
+set(INC
        .
        ../../extern/bullet2/src
 )
 
+set(INC_SYS
+
+)
+
 set(SRC
        rb_bullet_api.cpp
        
index 7583b17..559a1cb 100644 (file)
@@ -2026,14 +2026,14 @@ static bNodeSocket *make_socket_template(bNodeTree *ntree, int in_out,
         * but reconstructing own_index in writefile.c would require parsing the identifier string.
         */
 
-#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406))
+#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) || defined(__clang__)
 #  pragma GCC diagnostic push
 #  pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
 
        sock->own_index = own_index;
 
-#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406))
+#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) || defined(__clang__)
 #  pragma GCC diagnostic pop
 #endif
 
index ba897a8..4b058a4 100644 (file)
@@ -660,6 +660,6 @@ list(APPEND INC
        ${CMAKE_CURRENT_BINARY_DIR}/operations
 )
 data_to_c(${CMAKE_CURRENT_SOURCE_DIR}/operations/COM_OpenCLKernels.cl
-                 ${CMAKE_CURRENT_BINARY_DIR}/operations/COM_OpenCLKernels.cl.h SRC)
+          ${CMAKE_CURRENT_BINARY_DIR}/operations/COM_OpenCLKernels.cl.h SRC)
 
 blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}")
index 0903dd5..c825691 100644 (file)
@@ -139,7 +139,7 @@ static int knifeproject_exec(bContext *C, wmOperator *op)
                /* select only tagged faces */
                BM_mesh_elem_hflag_disable_all(em->bm, BM_VERT | BM_EDGE | BM_FACE, BM_ELEM_SELECT, false);
 
-               /* note essential, but switch out of vertex mode since the
+               /* not essential, but switch out of vertex mode since the
                 * selected regions wont be nicely isolated after flushing.
                 * note: call after de-select to avoid selection flushing */
                EDBM_selectmode_disable(scene, em, SCE_SELECT_VERTEX, SCE_SELECT_EDGE);
index 947ee24..2fdefac 100644 (file)
@@ -3029,7 +3029,7 @@ static int edbm_select_ungrouped_exec(bContext *C, wmOperator *op)
        BMVert *eve;
        BMIter iter;
 
-       if (!em->selectmode == SCE_SELECT_VERTEX) {
+       if ((em->selectmode & SCE_SELECT_VERTEX) == 0) {
                BKE_report(op->reports, RPT_ERROR, "Does not work out of vertex selection mode");
                return OPERATOR_CANCELLED;
        }
index 4d38760..9f2e0b7 100644 (file)
@@ -114,18 +114,18 @@ static void node_add_menu_class(bContext *C, uiLayout *layout, void *arg_nodecla
                                continue;
                        
                        switch (ntree->type) {
-                       case NTREE_COMPOSIT:
-                               ngroup_type = "CompositorNodeTree";
-                               node_type = "CompositorNodeGroup";
-                               break;
-                       case NTREE_SHADER:
-                               ngroup_type = "ShaderNodeTree";
-                               node_type = "ShaderNodeGroup";
-                               break;
-                       case NTREE_TEXTURE:
-                               ngroup_type = "TextureNodeTree";
-                               node_type = "TextureNodeGroup";
-                               break;
+                               case NTREE_COMPOSIT:
+                                       ngroup_type = "CompositorNodeTree";
+                                       node_type = "CompositorNodeGroup";
+                                       break;
+                               case NTREE_SHADER:
+                                       ngroup_type = "ShaderNodeTree";
+                                       node_type = "ShaderNodeGroup";
+                                       break;
+                               case NTREE_TEXTURE:
+                                       ngroup_type = "TextureNodeTree";
+                                       node_type = "TextureNodeGroup";
+                                       break;
                        }
                        
                        ptr = uiItemFullO(layout, "NODE_OT_group_make", "New Group", ntype->ui_icon, NULL, WM_OP_INVOKE_DEFAULT, UI_ITEM_O_RETURN_PROPS);
index 106a2e0..8307a6a 100644 (file)
@@ -163,7 +163,7 @@ if(WITH_INTERNATIONAL)
 endif()
 
 if(APPLE)
-    # SSE math is enabled by default on x86_64
+       # SSE math is enabled by default on x86_64
        if(CMAKE_OSX_ARCHITECTURES MATCHES "i386")
                set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfpmath=sse")
                set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mfpmath=sse")
index e4d3794..60d262d 100644 (file)
@@ -472,7 +472,7 @@ elseif(WIN32)
        if(WITH_PYTHON)
                set_lib_path(PYLIB "python")
 
-               STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
+               string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
 
                install(
                        FILES ${PYLIB}/lib/python${_PYTHON_VERSION_NO_DOTS}.dll