diff options
54 files changed, 342 insertions, 200 deletions
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt index 9f7eb3c2c50..885133f970c 100644 --- a/build_files/build_environment/CMakeLists.txt +++ b/build_files/build_environment/CMakeLists.txt @@ -78,7 +78,7 @@ include(cmake/openvdb.cmake) include(cmake/python.cmake) include(cmake/python_site_packages.cmake) include(cmake/numpy.cmake) -if (WITH_WEBP) +if(WITH_WEBP) include(cmake/webp.cmake) endif() if(WIN32) diff --git a/build_files/build_environment/cmake/alembic.cmake b/build_files/build_environment/cmake/alembic.cmake index a49047ec102..cf2cefa2e7a 100644 --- a/build_files/build_environment/cmake/alembic.cmake +++ b/build_files/build_environment/cmake/alembic.cmake @@ -72,4 +72,9 @@ ExternalProject_Add(external_alembic INSTALL_DIR ${LIBDIR}/alembic ) -add_dependencies(external_alembic external_boost external_zlib external_ilmbase) +add_dependencies( + external_alembic + external_boost + external_zlib + external_ilmbase +) diff --git a/build_files/build_environment/cmake/blendthumb.cmake b/build_files/build_environment/cmake/blendthumb.cmake index 624869971c6..b3064016403 100644 --- a/build_files/build_environment/cmake/blendthumb.cmake +++ b/build_files/build_environment/cmake/blendthumb.cmake @@ -47,7 +47,10 @@ if(BUILD_MODE STREQUAL Release) CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb32 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib32/include -DZLIB_LIBS=${LIBDIR}/zlib32/lib/zlibstatic.lib INSTALL_DIR ${LIBDIR}/blendthumb32 ) - add_dependencies(external_blendthumb_32 external_zlib_32) + add_dependencies( + external_blendthumb_32 + external_zlib_32 + ) ExternalProject_Add(external_blendthumb_64 CMAKE_GENERATOR ${GENERATOR_64} @@ -56,6 +59,9 @@ if(BUILD_MODE STREQUAL Release) CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/blendThumb64 ${DEFAULT_CMAKE_FLAGS} -DZLIB_INCLUDE=${LIBDIR}/zlib64/include -DZLIB_LIBS=${LIBDIR}/zlib64/lib/zlibstatic.lib INSTALL_DIR ${LIBDIR}/blendthumb64 ) - add_dependencies(external_blendthumb_64 external_zlib_64) + add_dependencies( + external_blendthumb_64 + external_zlib_64 + ) endif() endif() diff --git a/build_files/build_environment/cmake/blosc.cmake b/build_files/build_environment/cmake/blosc.cmake index 68df525b802..606fe8c61cc 100644 --- a/build_files/build_environment/cmake/blosc.cmake +++ b/build_files/build_environment/cmake/blosc.cmake @@ -37,7 +37,13 @@ ExternalProject_Add(external_blosc INSTALL_DIR ${LIBDIR}/blosc ) -add_dependencies(external_blosc external_zlib) +add_dependencies( + external_blosc + external_zlib +) if(WIN32) - add_dependencies(external_blosc external_pthreads) + add_dependencies( + external_blosc + external_pthreads + ) endif() diff --git a/build_files/build_environment/cmake/boost.cmake b/build_files/build_environment/cmake/boost.cmake index d98df30a38f..2c6bf195e07 100644 --- a/build_files/build_environment/cmake/boost.cmake +++ b/build_files/build_environment/cmake/boost.cmake @@ -103,5 +103,8 @@ ExternalProject_Add(external_boost ) if(WIN32) - add_dependencies(external_boost Make_Python_Environment) + add_dependencies( + external_boost + Make_Python_Environment + ) endif() diff --git a/build_files/build_environment/cmake/clang.cmake b/build_files/build_environment/cmake/clang.cmake index 2c7f271b5fc..9a2705bc8be 100644 --- a/build_files/build_environment/cmake/clang.cmake +++ b/build_files/build_environment/cmake/clang.cmake @@ -32,15 +32,15 @@ ExternalProject_Add(external_clang INSTALL_DIR ${LIBDIR}/clang ) -if (MSVC) - if (BUILD_MODE STREQUAL Release) - set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/ ) +if(MSVC) + if(BUILD_MODE STREQUAL Release) + set(CLANG_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/ ${HARVEST_TARGET}/llvm/) else() set(CLANG_HARVEST_COMMAND - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/include/ ${HARVEST_TARGET}/llvm/debug/include/ - ) + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/clang/include/ ${HARVEST_TARGET}/llvm/debug/include/ + ) endif() ExternalProject_Add_Step(external_clang after_install COMMAND ${CLANG_HARVEST_COMMAND} @@ -48,4 +48,7 @@ if (MSVC) ) endif() -add_dependencies(external_clang ll) +add_dependencies( + external_clang + ll +) diff --git a/build_files/build_environment/cmake/ffmpeg.cmake b/build_files/build_environment/cmake/ffmpeg.cmake index 2a45849acf5..bd49621bf26 100644 --- a/build_files/build_environment/cmake/ffmpeg.cmake +++ b/build_files/build_environment/cmake/ffmpeg.cmake @@ -30,13 +30,14 @@ if(WIN32) --enable-w32threads --disable-pthreads --enable-libopenjpeg - ) + ) else() set(FFMPEG_EXTRA_FLAGS ${FFMPEG_EXTRA_FLAGS} --enable-static --disable-shared - --enable-libopenjpeg) + --enable-libopenjpeg + ) endif() if(APPLE) @@ -102,18 +103,34 @@ ExternalProject_Add(external_ffmpeg --disable-indev=jack --disable-indev=alsa --disable-outdev=alsa - PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/ffmpeg/src/external_ffmpeg < ${PATCH_DIR}/ffmpeg.diff - BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS} - INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ffmpeg ${DEFAULT_CMAKE_FLAGS} - INSTALL_DIR ${LIBDIR}/ffmpeg + PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/ffmpeg/src/external_ffmpeg < ${PATCH_DIR}/ffmpeg.diff + BUILD_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make -j${MAKE_THREADS} + INSTALL_COMMAND ${CONFIGURE_ENV_NO_PERL} && cd ${BUILD_DIR}/ffmpeg/src/external_ffmpeg/ && make install + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ffmpeg ${DEFAULT_CMAKE_FLAGS} + INSTALL_DIR ${LIBDIR}/ffmpeg ) if(MSVC) set_target_properties(external_ffmpeg PROPERTIES FOLDER Mingw) -endif(MSVC) +endif() -add_dependencies(external_ffmpeg external_zlib external_faad external_openjpeg external_xvidcore external_x264 external_schroedinger external_vpx external_theora external_vorbis external_ogg external_lame) +add_dependencies( + external_ffmpeg + external_zlib + external_faad + external_openjpeg + external_xvidcore + external_x264 + external_schroedinger + external_vpx + external_theora + external_vorbis + external_ogg + external_lame +) if(WIN32) - add_dependencies(external_ffmpeg external_zlib_mingw) + add_dependencies( + external_ffmpeg + external_zlib_mingw + ) endif() diff --git a/build_files/build_environment/cmake/fftw.cmake b/build_files/build_environment/cmake/fftw.cmake index e6e6165199c..3044e28078d 100644 --- a/build_files/build_environment/cmake/fftw.cmake +++ b/build_files/build_environment/cmake/fftw.cmake @@ -37,4 +37,4 @@ ExternalProject_Add(external_fftw3 if(MSVC) set_target_properties(external_fftw3 PROPERTIES FOLDER Mingw) -endif(MSVC) +endif() diff --git a/build_files/build_environment/cmake/flac.cmake b/build_files/build_environment/cmake/flac.cmake index 74d222632d0..f5ef5809b40 100644 --- a/build_files/build_environment/cmake/flac.cmake +++ b/build_files/build_environment/cmake/flac.cmake @@ -29,4 +29,4 @@ ExternalProject_Add(external_flac if(MSVC) set_target_properties(external_flac PROPERTIES FOLDER Mingw) -endif(MSVC) +endif() diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake index a430c4b33bf..f23939a7ba6 100644 --- a/build_files/build_environment/cmake/harvest.cmake +++ b/build_files/build_environment/cmake/harvest.cmake @@ -26,7 +26,6 @@ endif() message("HARVEST_TARGET = ${HARVEST_TARGET}") if(WIN32) - if(BUILD_MODE STREQUAL Release) add_custom_target(Harvest_Release_Results # Zlib Rename the lib file and copy the include/bin folders @@ -117,8 +116,8 @@ if(BUILD_MODE STREQUAL Release) # webp, straight up copy ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/webp ${HARVEST_TARGET}/webp DEPENDS -) -endif(BUILD_MODE STREQUAL Release) + ) +endif() if(BUILD_MODE STREQUAL Debug) add_custom_target(Harvest_Debug_Results @@ -169,8 +168,8 @@ if(BUILD_MODE STREQUAL Debug) # python ${CMAKE_COMMAND} -E copy ${LIBDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz ${HARVEST_TARGET}/Release/python${PYTHON_SHORT_VERSION_NO_DOTS}_d.tar.gz DEPENDS Package_Python -) -endif(BUILD_MODE STREQUAL Debug) + ) +endif() else(WIN32) @@ -276,4 +275,4 @@ harvest(x264/lib ffmpeg/lib "*.a") harvest(xml2/lib opencollada/lib "*.a") harvest(xvidcore/lib ffmpeg/lib "*.a") -endif(WIN32) +endif() diff --git a/build_files/build_environment/cmake/hdf5.cmake b/build_files/build_environment/cmake/hdf5.cmake index 09d40d0605f..63ad14761da 100644 --- a/build_files/build_environment/cmake/hdf5.cmake +++ b/build_files/build_environment/cmake/hdf5.cmake @@ -32,11 +32,11 @@ if(WIN32) endif() ExternalProject_Add(external_hdf5 - URL ${HDF5_URI} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - URL_HASH MD5=${HDF5_HASH} - PREFIX ${BUILD_DIR}/hdf5 - PATCH_COMMAND ${HDF5_PATCH} - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hdf5 ${HDF5_EXTRA_ARGS} - INSTALL_DIR ${LIBDIR}/hdf5 + URL ${HDF5_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH MD5=${HDF5_HASH} + PREFIX ${BUILD_DIR}/hdf5 + PATCH_COMMAND ${HDF5_PATCH} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hdf5 ${HDF5_EXTRA_ARGS} + INSTALL_DIR ${LIBDIR}/hdf5 ) diff --git a/build_files/build_environment/cmake/llvm.cmake b/build_files/build_environment/cmake/llvm.cmake index f04fe609cb3..60f94b3a499 100644 --- a/build_files/build_environment/cmake/llvm.cmake +++ b/build_files/build_environment/cmake/llvm.cmake @@ -43,15 +43,15 @@ ExternalProject_Add(ll INSTALL_DIR ${LIBDIR}/llvm ) -if (MSVC) - if (BUILD_MODE STREQUAL Release) +if(MSVC) + if(BUILD_MODE STREQUAL Release) set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ ) else() set(LLVM_HARVEST_COMMAND - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ && - ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include/ ${HARVEST_TARGET}/llvm/debug/include/ - ) + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/bin/ ${HARVEST_TARGET}/llvm/debug/bin/ && + ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include/ ${HARVEST_TARGET}/llvm/debug/include/ + ) endif() ExternalProject_Add_Step(ll after_install COMMAND ${LLVM_HARVEST_COMMAND} diff --git a/build_files/build_environment/cmake/numpy.cmake b/build_files/build_environment/cmake/numpy.cmake index 107947dabd3..3579042981f 100644 --- a/build_files/build_environment/cmake/numpy.cmake +++ b/build_files/build_environment/cmake/numpy.cmake @@ -25,7 +25,7 @@ if(MSVC) set(NUMPY_DIR_POSTFIX) set(NUMPY_ARCHIVE_POSTFIX) set(NUMPY_BUILD_OPTION) - endif(BUILD_MODE STREQUAL Debug) + endif() endif() set(NUMPY_POSTFIX) @@ -54,4 +54,7 @@ ExternalProject_Add(external_numpy INSTALL_COMMAND ${NUMPY_INSTALL} ) -add_dependencies(external_numpy Make_Python_Environment) +add_dependencies( + external_numpy + Make_Python_Environment +) diff --git a/build_files/build_environment/cmake/opencollada.cmake b/build_files/build_environment/cmake/opencollada.cmake index 9b2a2d9dc4d..3872b08ced2 100644 --- a/build_files/build_environment/cmake/opencollada.cmake +++ b/build_files/build_environment/cmake/opencollada.cmake @@ -33,5 +33,8 @@ ExternalProject_Add(external_opencollada ) if(UNIX AND NOT APPLE) - add_dependencies(external_opencollada external_xml2) + add_dependencies( + external_opencollada + external_xml2 + ) endif() diff --git a/build_files/build_environment/cmake/opencolorio.cmake b/build_files/build_environment/cmake/opencolorio.cmake index 14fb62af672..d33c03eaa8d 100644 --- a/build_files/build_environment/cmake/opencolorio.cmake +++ b/build_files/build_environment/cmake/opencolorio.cmake @@ -67,4 +67,7 @@ if(NOT WIN32) add_custom_target(external_opencolorio_extra ALL DEPENDS external_opencolorio ${LIBDIR}/opencolorio/lib/libtinyxml.a) endif() -add_dependencies(external_opencolorio external_boost) +add_dependencies( + external_opencolorio + external_boost +) diff --git a/build_files/build_environment/cmake/openexr.cmake b/build_files/build_environment/cmake/openexr.cmake index 53a1bc4c146..36283951750 100644 --- a/build_files/build_environment/cmake/openexr.cmake +++ b/build_files/build_environment/cmake/openexr.cmake @@ -38,4 +38,8 @@ ExternalProject_Add(external_openexr INSTALL_DIR ${LIBDIR}/openexr ) -add_dependencies(external_openexr external_zlib external_ilmbase) +add_dependencies( + external_openexr + external_zlib + external_ilmbase +) diff --git a/build_files/build_environment/cmake/openimageio.cmake b/build_files/build_environment/cmake/openimageio.cmake index 96b221388da..07f6b3cdbef 100644 --- a/build_files/build_environment/cmake/openimageio.cmake +++ b/build_files/build_environment/cmake/openimageio.cmake @@ -39,21 +39,25 @@ else() set(OIIO_SIMD_FLAGS) endif() -if (WITH_WEBP) - set(WEBP_ARGS -DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include - -DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} ) +if(WITH_WEBP) + set(WEBP_ARGS + -DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include + -DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} + ) set(WEBP_DEP external_webp) -endif() +endif() -if (MSVC) -set(OPENJPEG_FLAGS -DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc - -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION} - -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT} - -DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT} - ) +if(MSVC) + set(OPENJPEG_FLAGS + -DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc + -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION} + -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT} + -DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT} + ) else() -set(OPENJPEG_FLAGS -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} - -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY} + set(OPENJPEG_FLAGS + -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION} + -DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY} ) endif() @@ -120,13 +124,28 @@ ExternalProject_Add(external_openimageio DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH MD5=${OPENIMAGEIO_HASH} PREFIX ${BUILD_DIR}/openimageio - PATCH_COMMAND ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/src/include < ${PATCH_DIR}/openimageio_gdi.diff && - ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio_staticexr.diff + PATCH_COMMAND + ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/src/include < ${PATCH_DIR}/openimageio_gdi.diff && + ${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio_staticexr.diff CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS} INSTALL_DIR ${LIBDIR}/openimageio ) -add_dependencies(external_openimageio external_png external_zlib external_ilmbase external_openexr external_jpeg external_boost external_tiff external_opencolorio external_openjpeg${OPENJPEG_POSTFIX} ${WEBP_DEP}) +add_dependencies( + external_openimageio + external_png external_zlib + external_ilmbase + external_openexr + external_jpeg + external_boost + external_tiff + external_opencolorio + external_openjpeg${OPENJPEG_POSTFIX} + ${WEBP_DEP} +) if(NOT WIN32) - add_dependencies(external_openimageio external_opencolorio_extra) + add_dependencies( + external_openimageio + external_opencolorio_extra + ) endif() diff --git a/build_files/build_environment/cmake/openjpeg.cmake b/build_files/build_environment/cmake/openjpeg.cmake index 406badf31fe..16ac387ff54 100644 --- a/build_files/build_environment/cmake/openjpeg.cmake +++ b/build_files/build_environment/cmake/openjpeg.cmake @@ -39,19 +39,19 @@ ExternalProject_Add(external_openjpeg ) #on windows ffmpeg wants a mingw build, while oiio needs a msvc build -if (MSVC) +if(MSVC) set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS}) -ExternalProject_Add(external_openjpeg_msvc - URL ${OPENJPEG_URI} - DOWNLOAD_DIR ${DOWNLOAD_DIR} - URL_HASH SHA256=${OPENJPEG_HASH} - PREFIX ${BUILD_DIR}/openjpeg_msvc - CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF - INSTALL_DIR ${LIBDIR}/openjpeg_msvc -) + ExternalProject_Add(external_openjpeg_msvc + URL ${OPENJPEG_URI} + DOWNLOAD_DIR ${DOWNLOAD_DIR} + URL_HASH SHA256=${OPENJPEG_HASH} + PREFIX ${BUILD_DIR}/openjpeg_msvc + CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF + INSTALL_DIR ${LIBDIR}/openjpeg_msvc + ) endif() - set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT}) +set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT}) if(MSVC) set_target_properties(external_openjpeg PROPERTIES FOLDER Mingw) -endif(MSVC) +endif() diff --git a/build_files/build_environment/cmake/opensubdiv.cmake b/build_files/build_environment/cmake/opensubdiv.cmake index 5a3a4d142fa..ca3a6983b22 100644 --- a/build_files/build_environment/cmake/opensubdiv.cmake +++ b/build_files/build_environment/cmake/opensubdiv.cmake @@ -68,4 +68,10 @@ ExternalProject_Add(external_opensubdiv INSTALL_DIR ${LIBDIR}/opensubdiv ) -add_dependencies(external_opensubdiv external_glew external_glfw external_clew external_cuew) +add_dependencies( + external_opensubdiv + external_glew + external_glfw + external_clew + external_cuew +) diff --git a/build_files/build_environment/cmake/openvdb.cmake b/build_files/build_environment/cmake/openvdb.cmake index a71598c1a3b..26791012688 100644 --- a/build_files/build_environment/cmake/openvdb.cmake +++ b/build_files/build_environment/cmake/openvdb.cmake @@ -61,11 +61,20 @@ ExternalProject_Add(openvdb DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH MD5=${OPENVDB_HASH} PREFIX ${BUILD_DIR}/openvdb - PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_openvdb.txt ${BUILD_DIR}/openvdb/src/openvdb/CMakeLists.txt && - ${CMAKE_COMMAND} -E copy_directory ${PATCH_DIR}/cmake/ ${BUILD_DIR}/openvdb/src/openvdb/cmake/ && - ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb_vc2013.diff + PATCH_COMMAND COMMAND + ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_openvdb.txt ${BUILD_DIR}/openvdb/src/openvdb/CMakeLists.txt && + ${CMAKE_COMMAND} -E copy_directory ${PATCH_DIR}/cmake/ ${BUILD_DIR}/openvdb/src/openvdb/cmake/ && + ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/openvdb/src/openvdb < ${PATCH_DIR}/openvdb_vc2013.diff CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openvdb ${DEFAULT_CMAKE_FLAGS} ${OPENVDB_EXTRA_ARGS} INSTALL_DIR ${LIBDIR}/openvdb ) -add_dependencies(openvdb external_tbb external_boost external_ilmbase external_openexr external_zlib external_blosc) +add_dependencies( + openvdb + external_tbb + external_boost + external_ilmbase + external_openexr + external_zlib + external_blosc +) diff --git a/build_files/build_environment/cmake/options.cmake b/build_files/build_environment/cmake/options.cmake index 9979a682614..2dcf653db43 100644 --- a/build_files/build_environment/cmake/options.cmake +++ b/build_files/build_environment/cmake/options.cmake @@ -26,13 +26,13 @@ if(NOT BUILD_MODE) set(BUILD_MODE "Release") message(STATUS "Build type not specified: defaulting to a release build.") endif() -Message("BuildMode = ${BUILD_MODE}") +message("BuildMode = ${BUILD_MODE}") if(BUILD_MODE STREQUAL "Debug") set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Debug) -ELSE(BUILD_MODE STREQUAL "Debug") +else(BUILD_MODE STREQUAL "Debug") set(LIBDIR ${CMAKE_CURRENT_BINARY_DIR}/Release) -ENDIF(BUILD_MODE STREQUAL "Debug") +endif() option(DOWNLOAD_DIR "Path for downloaded files" ${CMAKE_CURRENT_SOURCE_DIR}/downloads) file(TO_CMAKE_PATH ${DOWNLOAD_DIR} DOWNLOAD_DIR) @@ -116,10 +116,11 @@ else() set(LIBPREFIX "lib") if(APPLE) -# Let's get the current Xcode dir, to support xcode-select - execute_process( + # Let's get the current Xcode dir, to support xcode-select + execute_process( COMMAND xcode-select --print-path - OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE + ) set(OSX_ARCHITECTURES x86_64) set(OSX_DEPLOYMENT_TARGET 10.9) set(OSX_SDK_VERSION 10.12) @@ -130,9 +131,9 @@ else() set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}") set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin13.0.0) # OS X 10.9 set(PLATFORM_CMAKE_FLAGS - -DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET} - -DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT} + -DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES} + -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET} + -DCMAKE_OSX_SYSROOT:PATH=${OSX_SYSROOT} ) else() set(PLATFORM_CFLAGS "-fPIC") diff --git a/build_files/build_environment/cmake/osl.cmake b/build_files/build_environment/cmake/osl.cmake index 5ddb981c604..ad4d0ee6038 100644 --- a/build_files/build_environment/cmake/osl.cmake +++ b/build_files/build_environment/cmake/osl.cmake @@ -78,10 +78,21 @@ ExternalProject_Add(external_osl LIST_SEPARATOR ^^ URL_HASH MD5=${OSL_HASH} PREFIX ${BUILD_DIR}/osl - PATCH_COMMAND ${PATCH_CMD} -p 3 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff && - ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl_simd_oiio.diff + PATCH_COMMAND + ${PATCH_CMD} -p 3 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl.diff && + ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/osl/src/external_osl < ${PATCH_DIR}/osl_simd_oiio.diff CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/osl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} ${DEFAULT_CMAKE_FLAGS} ${OSL_EXTRA_ARGS} INSTALL_DIR ${LIBDIR}/osl ) -add_dependencies(external_osl external_boost ll external_clang external_ilmbase external_openexr external_zlib external_flexbison external_openimageio) +add_dependencies( + external_osl + external_boost + ll + external_clang + external_ilmbase + external_openexr + external_zlib + external_flexbison + external_openimageio +) diff --git a/build_files/build_environment/cmake/png.cmake b/build_files/build_environment/cmake/png.cmake index 8d6fee871f9..803438cbd2a 100644 --- a/build_files/build_environment/cmake/png.cmake +++ b/build_files/build_environment/cmake/png.cmake @@ -31,7 +31,10 @@ ExternalProject_Add(external_png INSTALL_DIR ${LIBDIR}/png ) -add_dependencies(external_png external_zlib) +add_dependencies( + external_png + external_zlib +) if(BUILD_MODE STREQUAL Debug) ExternalProject_Add_Step(external_png after_install diff --git a/build_files/build_environment/cmake/pthreads.cmake b/build_files/build_environment/cmake/pthreads.cmake index f4301b95f3a..c93f0866aa9 100644 --- a/build_files/build_environment/cmake/pthreads.cmake +++ b/build_files/build_environment/cmake/pthreads.cmake @@ -35,11 +35,12 @@ if(WIN32) CONFIGURE_COMMAND echo . PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff BUILD_COMMAND ${PTHREADS_BUILD} - INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2.dll ${LIBDIR}/pthreads/lib/pthreadVC2.dll && - ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC2${LIBEXT} && - ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h && - ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h && - ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h + INSTALL_COMMAND COMMAND + ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2.dll ${LIBDIR}/pthreads/lib/pthreadVC2.dll && + ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC2${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC2${LIBEXT} && + ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h && + ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h && + ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h INSTALL_DIR ${LIBDIR}/pthreads ) endif() diff --git a/build_files/build_environment/cmake/python.cmake b/build_files/build_environment/cmake/python.cmake index 98d9d4ae63e..693ab1896ba 100644 --- a/build_files/build_environment/cmake/python.cmake +++ b/build_files/build_environment/cmake/python.cmake @@ -44,20 +44,22 @@ if(WIN32) DOWNLOAD_DIR ${DOWNLOAD_DIR} URL_HASH MD5=${PYTHON_HASH} PREFIX ${BUILD_DIR}/python - PATCH_COMMAND echo mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" && - mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" && - ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python.diff && - ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/pc < ${PATCH_DIR}/pyshell.diff + PATCH_COMMAND + echo mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" && + mklink /D "${PYTHON_EXTERNALS_FOLDER_DOS}" "${DOWNLOADS_EXTERNALS_FOLDER_DOS}" && + ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python < ${PATCH_DIR}/python.diff && + ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/python/src/external_python/pc < ${PATCH_DIR}/pyshell.diff CONFIGURE_COMMAND "" BUILD_COMMAND cd ${BUILD_DIR}/python/src/external_python/pcbuild/ && set IncludeTkinter=false && call build.bat -e -p ${PYTHON_ARCH} -c ${BUILD_MODE} -k ${PYTHON_COMPILER_STRING} - INSTALL_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll && - ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib && - ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp && - ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION} && - ${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION}/pyconfig.h + INSTALL_COMMAND COMMAND + ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.dll && + ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.lib && + ${CMAKE_COMMAND} -E copy ${PYTHON_OUTPUTDIR}/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp ${LIBDIR}/python/lib/python${PYTHON_SHORT_VERSION_NO_DOTS}${PYTHON_POSTFIX}.exp && + ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/include ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION} && + ${CMAKE_COMMAND} -E copy "${BUILD_DIR}/python/src/external_python/PC/pyconfig.h" ${LIBDIR}/python/include/Python${PYTHON_SHORT_VERSION}/pyconfig.h ) - Message("PythinRedist = ${BUILD_DIR}/python/src/external_python/redist") - Message("POutput = ${PYTHON_OUTPUTDIR}") + message("PythinRedist = ${BUILD_DIR}/python/src/external_python/redist") + message("POutput = ${PYTHON_OUTPUTDIR}") else() if(APPLE) # we need to manually add homebrew headers to get ssl module building @@ -135,4 +137,4 @@ if(MSVC) COMMAND ${PYTHON_DISTUTIL_PATCH} ) add_custom_target(Make_Python_Environment ALL DEPENDS ${BUILD_DIR}/python/src/external_python/run/python${PYTHON_POSTFIX}.exe Package_Python) -endif(MSVC) +endif() diff --git a/build_files/build_environment/cmake/python_site_packages.cmake b/build_files/build_environment/cmake/python_site_packages.cmake index 530bae4c958..0619bc3f887 100644 --- a/build_files/build_environment/cmake/python_site_packages.cmake +++ b/build_files/build_environment/cmake/python_site_packages.cmake @@ -17,14 +17,14 @@ # ***** END GPL LICENSE BLOCK ***** if(WIN32) set(HARVEST_CMD cmd /C FOR /d /r ${BUILD_DIR}/python/src/external_python/run/lib/site-packages %d IN (__pycache__) DO @IF EXIST "%d" rd /s /q "%d" && - ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/idna ${HARVEST_TARGET}/Release/site-packages/idna && - ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/chardet ${HARVEST_TARGET}/Release/site-packages/chardet && - ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/urllib3 ${HARVEST_TARGET}/Release/site-packages/urllib3 && - ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/certifi ${HARVEST_TARGET}/Release/site-packages/certifi && - ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/requests ${HARVEST_TARGET}/Release/site-packages/requests - ) + ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/idna ${HARVEST_TARGET}/Release/site-packages/idna && + ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/chardet ${HARVEST_TARGET}/Release/site-packages/chardet && + ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/urllib3 ${HARVEST_TARGET}/Release/site-packages/urllib3 && + ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/certifi ${HARVEST_TARGET}/Release/site-packages/certifi && + ${CMAKE_COMMAND} -E copy_directory ${BUILD_DIR}/python/src/external_python/run/lib/site-packages/requests ${HARVEST_TARGET}/Release/site-packages/requests + ) else() - set(HARVEST_CMD echo .) + set(HARVEST_CMD echo .) endif() ExternalProject_Add(external_python_site_packages @@ -35,4 +35,7 @@ ExternalProject_Add(external_python_site_packages INSTALL_COMMAND ${PYTHON_BINARY} -m pip install idna==${IDNA_VERSION} chardet==${CHARDET_VERSION} urllib3==${URLLIB3_VERSION} certifi==${CERTIFI_VERSION} requests==${REQUESTS_VERSION} --no-binary :all: && ${HARVEST_CMD} ) -add_dependencies(external_python_site_packages Make_Python_Environment) +add_dependencies( + external_python_site_packages + Make_Python_Environment +) diff --git a/build_files/build_environment/cmake/schroedinger.cmake b/build_files/build_environment/cmake/schroedinger.cmake index 54a20db5b5e..80bf84b06d7 100644 --- a/build_files/build_environment/cmake/schroedinger.cmake +++ b/build_files/build_environment/cmake/schroedinger.cmake @@ -38,7 +38,10 @@ ExternalProject_Add(external_schroedinger INSTALL_DIR ${LIBDIR}/schroedinger ) -add_dependencies(external_schroedinger external_orc) +add_dependencies( + external_schroedinger + external_orc +) if(MSVC) set_target_properties(external_schroedinger PROPERTIES FOLDER Mingw) diff --git a/build_files/build_environment/cmake/sndfile.cmake b/build_files/build_environment/cmake/sndfile.cmake index ce10f07c133..282033d4905 100644 --- a/build_files/build_environment/cmake/sndfile.cmake +++ b/build_files/build_environment/cmake/sndfile.cmake @@ -49,7 +49,14 @@ if(MSVC) set_target_properties(external_sndfile PROPERTIES FOLDER Mingw) endif() -add_dependencies(external_sndfile external_ogg external_vorbis) +add_dependencies( + external_sndfile + external_ogg + external_vorbis +) if(UNIX) - add_dependencies(external_sndfile external_flac) + add_dependencies( + external_sndfile + external_flac + ) endif() diff --git a/build_files/build_environment/cmake/theora.cmake b/build_files/build_environment/cmake/theora.cmake index 03aad42f2db..4fa2f4815fa 100644 --- a/build_files/build_environment/cmake/theora.cmake +++ b/build_files/build_environment/cmake/theora.cmake @@ -33,7 +33,11 @@ ExternalProject_Add(external_theora INSTALL_DIR ${LIBDIR}/theora ) -add_dependencies(external_theora external_vorbis external_ogg) +add_dependencies( + external_theora + external_vorbis + external_ogg +) if(MSVC) set_target_properties(external_theora PROPERTIES FOLDER Mingw) diff --git a/build_files/build_environment/cmake/tiff.cmake b/build_files/build_environment/cmake/tiff.cmake index 2c01341eb21..0f22daf05b1 100644 --- a/build_files/build_environment/cmake/tiff.cmake +++ b/build_files/build_environment/cmake/tiff.cmake @@ -34,7 +34,10 @@ ExternalProject_Add(external_tiff INSTALL_DIR ${LIBDIR}/tiff ) -add_dependencies(external_tiff external_zlib) +add_dependencies( + external_tiff + external_zlib +) if(BUILD_MODE STREQUAL Debug) ExternalProject_Add_Step(external_tiff after_install diff --git a/build_files/build_environment/cmake/vorbis.cmake b/build_files/build_environment/cmake/vorbis.cmake index d16c7c6a1bc..ee3c5a9c87f 100644 --- a/build_files/build_environment/cmake/vorbis.cmake +++ b/build_files/build_environment/cmake/vorbis.cmake @@ -31,7 +31,10 @@ ExternalProject_Add(external_vorbis INSTALL_DIR ${LIBDIR}/vorbis ) -add_dependencies(external_vorbis external_ogg) +add_dependencies( + external_vorbis + external_ogg +) if(MSVC) set_target_properties(external_vorbis PROPERTIES FOLDER Mingw) diff --git a/build_files/build_environment/patches/cmake/modules/SelectLibraryConfigurations.cmake b/build_files/build_environment/patches/cmake/modules/SelectLibraryConfigurations.cmake index 51b4dda0653..47234ced74a 100644 --- a/build_files/build_environment/patches/cmake/modules/SelectLibraryConfigurations.cmake +++ b/build_files/build_environment/patches/cmake/modules/SelectLibraryConfigurations.cmake @@ -49,7 +49,7 @@ macro( select_library_configurations basename ) # if only the debug version was found, set the release value to be the # debug value. _set_library_name( ${basename} DEBUG RELEASE ) - if (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE ) + if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE ) # if the generator supports configuration types or CMAKE_BUILD_TYPE # is set, then set optimized and debug options. if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index eac4dc81582..f320597ef2d 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -151,7 +151,7 @@ void id_sort_by_name(struct ListBase *lb, struct ID *id); void BKE_id_expand_local(struct Main *bmain, struct ID *id); void BKE_id_copy_ensure_local(struct Main *bmain, const struct ID *old_id, struct ID *new_id); -bool new_id(struct ListBase *lb, struct ID *id, const char *name); +bool new_id(struct ListBase *lb, struct ID *id, const char *name) ATTR_NONNULL(1, 2); void id_clear_lib_data(struct Main *bmain, struct ID *id); void id_clear_lib_data_ex(struct Main *bmain, struct ID *id, const bool id_in_mainlist); diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 88a15d1fe3b..ba9ccf94303 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -3591,8 +3591,8 @@ static bool tridiagonal_solve_with_limits(float *a, float *b, float *c, float *d * This function computes the handles of a series of auto bezier points * on the basis of 'no acceleration discontinuities' at the points. * The first and last bezier points are considered 'fixed' (their handles are not touched) - * The result is the smoothest possible trajectory going through intemediate points. - * The difficulty is that the handles depends on their neighbours. + * The result is the smoothest possible trajectory going through intermediate points. + * The difficulty is that the handles depends on their neighbors. * * The exact solution is found by solving a tridiagonal matrix equation formed * by the continuity and boundary conditions. Although theoretically handle position diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 667352b6ddb..cb045f7bae2 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1806,10 +1806,6 @@ bool new_id(ListBase *lb, ID *id, const char *tname) if (ID_IS_LINKED_DATABLOCK(id)) return false; - /* if no libdata given, look up based on ID */ - if (lb == NULL) - lb = which_libbase(G.main, GS(id->name)); - /* if no name given, use name of current ID * else make a copy (tname args can be const) */ if (tname == NULL) @@ -1964,7 +1960,7 @@ static void library_make_local_copying_check(ID *id, GSet *loop_tags, MainIDRela * * Current version uses regular id_make_local callback, with advanced pre-processing step to detect all cases of * IDs currently indirectly used, but which will be used by local data only once this function is finished. - * This allows to avoid any uneeded duplication of IDs, and hence all time lost afterwards to remove + * This allows to avoid any unneeded duplication of IDs, and hence all time lost afterwards to remove * orphaned linked data-blocks... */ void BKE_library_make_local( @@ -2353,7 +2349,6 @@ void BLI_libblock_ensure_unique_name(Main *bmain, const char *name) ListBase *lb; ID *idtest; - lb = which_libbase(bmain, GS(name)); if (lb == NULL) return; diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index e397dcf7667..e3706f7aedf 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -380,7 +380,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call if (bmain != NULL && bmain->relations != NULL && (flag & IDWALK_READONLY)) { /* Note that this is minor optimization, even in worst cases (like id being an object with lots of * drivers and constraints and modifiers, or material etc. with huge node tree), - * but we might as well use it (Main->relations is always assumed valid, it's responsability of code + * but we might as well use it (Main->relations is always assumed valid, it's responsibility of code * creating it to free it, especially if/when it starts modifying Main database). */ MainIDRelationsEntry *entry = BLI_ghash_lookup(bmain->relations->id_user_to_used, id); for (; entry != NULL; entry = entry->next) { diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 3ff4885f7fc..beecb063a20 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1325,7 +1325,7 @@ void ntreeUserDecrefID(bNodeTree *ntree) /* *************** Node Preview *********** */ /* XXX this should be removed eventually ... - * Currently BKE functions are modelled closely on previous code, + * Currently BKE functions are modeled closely on previous code, * using BKE_node_preview_init_tree to set up previews for a whole node tree in advance. * This should be left more to the individual node tree implementations. */ diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 187891e7210..e77edb21798 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -1172,7 +1172,7 @@ static void pbvh_bmesh_split_edge( * * - faces wind anticlockwise in this example. * - original edge is ``(v1, v2)`` - * - oroginal face is ``(v1, v2, v3)`` + * - original face is ``(v1, v2, v3)`` * * <pre> * + v3(v_opp) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2e4ff1c96a6..ccf2dc1f4c4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -884,7 +884,7 @@ BHead *blo_nextbhead(FileData *fd, BHead *thisblock) return(bhead); } -/* Warning! Caller's responsability to ensure given bhead **is** and ID one! */ +/* Warning! Caller's responsibility to ensure given bhead **is** and ID one! */ const char *bhead_id_name(const FileData *fd, const BHead *bhead) { return (const char *)POINTER_OFFSET(bhead, sizeof(*bhead) + fd->id_name_offs); diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 4f48dafd211..8e0e905cf88 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -120,7 +120,7 @@ static BMOpDefine bmo_smooth_vert_def = { }; /* - * Vertext Smooth Laplacian. + * Vertex Smooth Laplacian. * * Smooths vertices by using Laplacian smoothing propose by. * Desbrun, et al. Implicit Fairing of Irregular Meshes using Diffusion and Curvature Flow. diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 0d166b874cb..234355c8581 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -985,7 +985,9 @@ void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const bool do_str } } -static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *buf, const size_t buf_len) +static bool ui_but_event_operator_string( + const bContext *C, uiBut *but, + char *buf, const size_t buf_len) { MenuType *mt; bool found = false; @@ -993,7 +995,10 @@ static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *bu if (but->optype) { IDProperty *prop = (but->opptr) ? but->opptr->data : NULL; - if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, true, buf_len, buf)) { + if (WM_key_event_operator_string( + C, but->optype->idname, but->opcontext, prop, true, + buf, buf_len)) + { found = true; } } @@ -1008,8 +1013,9 @@ static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *bu IDP_AssignString(prop_menu_name, mt->idname, sizeof(mt->idname)); - if (WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, - true, buf_len, buf)) + if (WM_key_event_operator_string( + C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, true, + buf, buf_len)) { found = true; } @@ -1021,8 +1027,10 @@ static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *bu return found; } -static bool ui_but_event_property_operator_string(const bContext *C, uiBut *but, char *buf, const size_t buf_len) -{ +static bool ui_but_event_property_operator_string( + const bContext *C, uiBut *but, + char *buf, const size_t buf_len) +{ /* context toggle operator names to check... */ const char *ctx_toggle_opnames[] = { "WM_OT_context_toggle", @@ -1116,8 +1124,9 @@ static bool ui_but_event_property_operator_string(const bContext *C, uiBut *but, /* check each until one works... */ for (i = 0; (i < num_ops) && (ctx_toggle_opnames[i]); i++) { - if (WM_key_event_operator_string(C, ctx_toggle_opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false, - buf_len, buf)) + if (WM_key_event_operator_string( + C, ctx_toggle_opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false, + buf, buf_len)) { found = true; break; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 84252c03742..2947365fc5d 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1288,7 +1288,7 @@ static bool ui_drag_toggle_set_xy_xy( } } if (changed) { - /* apply now, not on release (or if handlers are cancelled for whatever reason) */ + /* apply now, not on release (or if handlers are canceled for whatever reason) */ ui_apply_but_funcs_after(C); } @@ -6542,8 +6542,9 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int UNUSED(event)) IDProperty *prop = (but->opptr) ? but->opptr->data : NULL; /* complex code to change name of button */ - if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, true, - sizeof(shortcut_str), shortcut_str)) + if (WM_key_event_operator_string( + C, but->optype->idname, but->opcontext, prop, true, + shortcut_str, sizeof(shortcut_str))) { ui_but_add_shortcut(but, shortcut_str, true); } @@ -8031,7 +8032,7 @@ static void button_activate_exit( ui_but_update(but); /* adds empty mousemove in queue for re-init handler, in case mouse is - * still over a button. we cannot just check for this ourselfs because + * still over a button. We cannot just check for this ourselves because * at this point the mouse may be over a button in another region */ if (mousemove) WM_event_add_mousemove(C); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 23ac1c5027d..d43b7511977 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -710,7 +710,7 @@ static uiBut *ui_item_with_label(uiLayout *layout, uiBlock *block, const char *n if (RNA_struct_is_a(ptr->type, &RNA_KeyMapItem)) { char buf[128]; - WM_keymap_item_to_string(ptr->data, false, sizeof(buf), buf); + WM_keymap_item_to_string(ptr->data, false, buf, sizeof(buf)); but = uiDefButR_prop(block, UI_BTYPE_HOTKEY_EVENT, 0, buf, x, y, w, h, ptr, prop, 0, 0, 0, -1, -1, NULL); UI_but_func_set(but, ui_keymap_but_cb, but, NULL); @@ -2017,8 +2017,9 @@ void uiItemMenuEnumO_ptr( (ot->prop && ot->invoke)) { char keybuf[128]; - if (WM_key_event_operator_string(C, ot->idname, layout->root->opcontext, NULL, false, - sizeof(keybuf), keybuf)) + if (WM_key_event_operator_string( + C, ot->idname, layout->root->opcontext, NULL, false, + keybuf, sizeof(keybuf))) { ui_but_add_shortcut(but, keybuf, false); } diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index e3d90ceb7a2..70e0f07ea6c 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -337,7 +337,7 @@ static uiTooltipData *ui_tooltip_data_from_keymap(bContext *C, wmKeyMap *keymap) .color_id = UI_TIP_LC_NORMAL, }); bool found = false; - if (WM_keymap_item_to_string(kmi, false, sizeof(buf), buf)) { + if (WM_keymap_item_to_string(kmi, false, buf, sizeof(buf))) { found = true; } field->text = BLI_sprintfN(TIP_("Shortcut: %s"), found ? buf : "None"); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index b52c4c3afb1..ae2c691b9d8 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -3615,8 +3615,9 @@ static void operator_search_cb(const bContext *C, void *UNUSED(arg), const char /* check for hotkey */ if (len < sizeof(name) - 6) { - if (WM_key_event_operator_string(C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, true, - sizeof(name) - len - 1, &name[len + 1])) + if (WM_key_event_operator_string( + C, ot->idname, WM_OP_EXEC_DEFAULT, NULL, true, + &name[len + 1], sizeof(name) - len - 1)) { name[len] = UI_SEP_CHAR; } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 40309b701a4..494cf3459df 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4370,7 +4370,7 @@ static void headerTranslation(TransInfo *t, const float vec[3], char str[UI_MAX_ const char *str_dir = (snode->insert_ofs_dir == SNODE_INSERTOFS_DIR_RIGHT) ? IFACE_("right") : IFACE_("left"); char str_km[64]; - WM_modalkeymap_items_to_string(t->keymap, TFM_MODAL_INSERTOFS_TOGGLE_DIR, true, sizeof(str_km), str_km); + WM_modalkeymap_items_to_string(t->keymap, TFM_MODAL_INSERTOFS_TOGGLE_DIR, true, str_km, sizeof(str_km)); ofs += BLI_snprintf(str, UI_MAX_DRAW_STR, IFACE_("Auto-offset set to %s - press %s to toggle direction | %s"), str_dir, str_km, str_old); @@ -4586,7 +4586,7 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2])) if (t->keymap) { wmKeyMapItem *kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_RESIZE); if (kmi) { - ofs += WM_keymap_item_to_string(kmi, false, sizeof(str) - ofs, str + ofs); + ofs += WM_keymap_item_to_string(kmi, false, str + ofs, sizeof(str) - ofs); } } BLI_snprintf(str + ofs, sizeof(str) - ofs, IFACE_(" or Alt) Even Thickness %s"), @@ -8030,7 +8030,7 @@ static void headerSeqSlide(TransInfo *t, const float val[2], char str[UI_MAX_DRA if (t->keymap) { wmKeyMapItem *kmi = WM_modalkeymap_find_propvalue(t->keymap, TFM_MODAL_TRANSLATE); if (kmi) { - ofs += WM_keymap_item_to_string(kmi, false, UI_MAX_DRAW_STR - ofs, str + ofs); + ofs += WM_keymap_item_to_string(kmi, false, str + ofs, UI_MAX_DRAW_STR - ofs); } } ofs += BLI_snprintf(str + ofs, UI_MAX_DRAW_STR - ofs, IFACE_(" or Alt) Expand to fit %s"), diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 9f1fdcfe551..b77847d6206 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -2038,7 +2038,7 @@ int GPU_scene_object_lights(SceneLayer *sl, float viewmat[4][4], int ortho) GPU_basic_shader_light_set(count, NULL); /* view direction for specular is not computed correct by default in - * opengl, so we set the settings ourselfs */ + * opengl, so we set the settings ourselves */ GPU_basic_shader_light_set_viewer(!ortho); int count = 0; diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 6e436b8ff32..e53533df782 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -676,7 +676,7 @@ static void rna_def_keyingset_info(BlenderRNA *brna) /* Regarding why we don't use rna_def_common_keying_flags() here: * - Using it would keep this case in sync with the other places - * where these options are exposed (which are optimised for being + * where these options are exposed (which are optimized for being * used in the UI). * - Unlike all the other places, this case is used for defining * new "built in" Keying Sets via the Python API. In that case, diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.h b/source/blender/render/intern/raytrace/rayobject_rtbuild.h index 83042ef3d7e..061d76e3a3e 100644 --- a/source/blender/render/intern/raytrace/rayobject_rtbuild.h +++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.h @@ -42,7 +42,7 @@ extern "C" { /* * Ray Tree Builder * this structs helps building any type of tree - * it contains several methods to organiza/split nodes + * it contains several methods to organize/split nodes * allowing to create a given tree on the fly. * * Idea is that other trees BVH, BIH can use this code to diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index 4f96e40d9ff..8a94472aaf5 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -68,7 +68,7 @@ wmKeyMapItem *WM_keymap_add_menu_pie(struct wmKeyMap *keymap, const char *idname int val, int modifier, int keymodifier); bool WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi); -int WM_keymap_item_to_string(wmKeyMapItem *kmi, const bool compact, const int len, char *r_str); +int WM_keymap_item_to_string(wmKeyMapItem *kmi, const bool compact, char *result, const int result_len); wmKeyMap *WM_keymap_list_find(ListBase *lb, const char *idname, int spaceid, int regionid); wmKeyMap *WM_keymap_find(struct wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid); @@ -83,12 +83,14 @@ int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2); /* Modal Keymap */ int WM_modalkeymap_items_to_string( - struct wmKeyMap *km, const int propvalue, const bool compact, const int len, char *r_str); + struct wmKeyMap *km, const int propvalue, const bool compact, + char *result, const int result_len); int WM_modalkeymap_operator_items_to_string( - struct wmOperatorType *ot, const int propvalue, const bool compact, const int len, char *r_str); + struct wmOperatorType *ot, const int propvalue, const bool compact, + char *result, const int result_len); char *WM_modalkeymap_operator_items_to_string_buf( struct wmOperatorType *ot, const int propvalue, const bool compact, - const int max_len, int *r_available_len, char **r_str); + const int max_len, int *r_available_len, char **r_result); wmKeyMap *WM_modalkeymap_add(struct wmKeyConfig *keyconf, const char *idname, const struct EnumPropertyItem *items); wmKeyMap *WM_modalkeymap_get(struct wmKeyConfig *keyconf, const char *idname); @@ -109,14 +111,16 @@ int WM_keymap_map_type_get(struct wmKeyMapItem *kmi); const char *WM_key_event_string(const short type, const bool compact); int WM_keymap_item_raw_to_string( const short shift, const short ctrl, const short alt, const short oskey, const short keymodifier, - const short val, const short type, const bool compact, const int len, char *r_str); + const short val, const short type, const bool compact, + char *result, const int result_len); wmKeyMapItem *WM_key_event_operator( const struct bContext *C, const char *opname, int opcontext, struct IDProperty *properties, const bool is_hotkey, struct wmKeyMap **r_keymap); -char *WM_key_event_operator_string( +char *WM_key_event_operator_string( const struct bContext *C, const char *opname, int opcontext, - struct IDProperty *properties, const bool is_strict, int len, char *r_str); + struct IDProperty *properties, const bool is_strict, + char *result, const int result_len); const char *WM_bool_as_string(bool test); diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index 5580d3217a5..528b9e2b3d9 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -379,7 +379,7 @@ static void wm_jobs_test_suspend_stop(wmWindowManager *wm, wmJob *test) } } - /* possible suspend ourselfs, waiting for other jobs, or de-suspend */ + /* Possible suspend ourselves, waiting for other jobs, or de-suspend. */ test->suspended = suspend; // if (suspend) printf("job suspended: %s\n", test->name); } diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 8dab50a6f29..910b7eadf4c 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -940,7 +940,7 @@ const char *WM_key_event_string(const short type, const bool compact) int WM_keymap_item_raw_to_string( const short shift, const short ctrl, const short alt, const short oskey, const short keymodifier, const short val, const short type, const bool compact, - const int len, char *r_str) + char *result, const int result_len) { #define ADD_SEP if (p != buf) *p++ = ' '; (void)0 @@ -1000,20 +1000,23 @@ int WM_keymap_item_raw_to_string( BLI_assert(p - buf < sizeof(buf)); /* We need utf8 here, otherwise we may 'cut' some unicode chars like arrows... */ - return BLI_strncpy_utf8_rlen(r_str, buf, len); + return BLI_strncpy_utf8_rlen(result, buf, result_len); #undef ADD_SEP } -int WM_keymap_item_to_string(wmKeyMapItem *kmi, const bool compact, const int len, char *r_str) +int WM_keymap_item_to_string( + wmKeyMapItem *kmi, const bool compact, + char *result, const int result_len) { return WM_keymap_item_raw_to_string( - kmi->shift, kmi->ctrl, kmi->alt, kmi->oskey, kmi->keymodifier, kmi->val, kmi->type, - compact, len, r_str); + kmi->shift, kmi->ctrl, kmi->alt, kmi->oskey, kmi->keymodifier, kmi->val, kmi->type, + compact, result, result_len); } int WM_modalkeymap_items_to_string( - wmKeyMap *km, const int propvalue, const bool compact, const int len, char *r_str) + wmKeyMap *km, const int propvalue, const bool compact, + char *result, const int result_len) { int totlen = 0; bool add_sep = false; @@ -1023,17 +1026,17 @@ int WM_modalkeymap_items_to_string( /* Find all shortcuts related to that propvalue! */ for (kmi = WM_modalkeymap_find_propvalue(km, propvalue); - kmi && totlen < (len - 2); + kmi && totlen < (result_len - 2); kmi = wm_modalkeymap_find_propvalue_iter(km, kmi, propvalue)) { if (add_sep) { - r_str[totlen++] = '/'; - r_str[totlen] = '\0'; + result[totlen++] = '/'; + result[totlen] = '\0'; } else { add_sep = true; } - totlen += WM_keymap_item_to_string(kmi, compact, len - totlen, &r_str[totlen]); + totlen += WM_keymap_item_to_string(kmi, compact, &result[totlen], result_len - totlen); } } @@ -1041,25 +1044,26 @@ int WM_modalkeymap_items_to_string( } int WM_modalkeymap_operator_items_to_string( - wmOperatorType *ot, const int propvalue, const bool compact, const int len, char *r_str) + wmOperatorType *ot, const int propvalue, const bool compact, + char *result, const int result_len) { - return WM_modalkeymap_items_to_string(ot->modalkeymap, propvalue, compact, len, r_str); + return WM_modalkeymap_items_to_string(ot->modalkeymap, propvalue, compact, result, result_len); } char *WM_modalkeymap_operator_items_to_string_buf( wmOperatorType *ot, const int propvalue, const bool compact, - const int max_len, int *r_available_len, char **r_str) + const int max_len, int *r_available_len, char **r_result) { - char *ret = *r_str; + char *ret = *r_result; if (*r_available_len > 1) { int used_len = WM_modalkeymap_operator_items_to_string( - ot, propvalue, compact, min_ii(*r_available_len, max_len), ret) + 1; + ot, propvalue, compact, ret, min_ii(*r_available_len, max_len)) + 1; *r_available_len -= used_len; - *r_str += used_len; + *r_result += used_len; if (*r_available_len == 0) { - (*r_str)--; /* So that *str keeps pointing on a valid char, we'll stay on it anyway. */ + (*r_result)--; /* So that *result keeps pointing on a valid char, we'll stay on it anyway. */ } } else { @@ -1126,7 +1130,7 @@ static wmKeyMapItem *wm_keymap_item_find_handlers( if (IDP_EqualsProperties_ex(properties, properties_default, is_strict)) { char kmi_str[128]; - WM_keymap_item_to_string(kmi, false, sizeof(kmi_str), kmi_str); + WM_keymap_item_to_string(kmi, false, kmi_str, sizeof(kmi_str)); /* Note gievn properties could come from other things than menu entry... */ printf("%s: Some set values in menu entry match default op values, " "this might not be desired!\n", opname); @@ -1276,7 +1280,7 @@ static wmKeyMapItem *wm_keymap_item_find( kmi = wm_keymap_item_find_props(C, opname, opcontext, properties_default, is_strict, is_hotkey, &km); if (kmi) { char kmi_str[128]; - WM_keymap_item_to_string(kmi, false, sizeof(kmi_str), kmi_str); + WM_keymap_item_to_string(kmi, false, kmi_str, sizeof(kmi_str)); printf("%s: Some set values in keymap entry match default op values, " "this might not be desired!\n", opname); printf("\tkm: '%s', kmi: '%s'\n", km->idname, kmi_str); @@ -1302,13 +1306,14 @@ static wmKeyMapItem *wm_keymap_item_find( char *WM_key_event_operator_string( const bContext *C, const char *opname, int opcontext, - IDProperty *properties, const bool is_strict, int len, char *r_str) + IDProperty *properties, const bool is_strict, + char *result, const int result_len) { wmKeyMapItem *kmi = wm_keymap_item_find(C, opname, opcontext, properties, false, is_strict, NULL); - + if (kmi) { - WM_keymap_item_to_string(kmi, false, len, r_str); - return r_str; + WM_keymap_item_to_string(kmi, false, result, result_len); + return result; } return NULL; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 8600bc63cb7..6b858c49a1e 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1461,7 +1461,7 @@ static void dialog_exec_cb(bContext *C, void *arg1, void *arg2) wmOpPopUp *data = arg1; uiBlock *block = arg2; - /* Explicitly set UI_RETURN_OK flag, otherwise the menu might be cancelled + /* Explicitly set UI_RETURN_OK flag, otherwise the menu might be canceled * in case WM_operator_call_ex exits/reloads the current file (T49199). */ UI_popup_menu_retval_set(block, UI_RETURN_OK, true); diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index 7e217122561..c14517f1662 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -72,7 +72,7 @@ typedef struct wmEventHandler { struct wmManipulatorMap *manipulator_map; } wmEventHandler; -/* custom types for handlers, for signalling, freeing */ +/* custom types for handlers, for signaling, freeing */ enum { WM_HANDLER_DEFAULT, WM_HANDLER_FILESELECT @@ -99,4 +99,3 @@ void wm_drags_check_ops(bContext *C, const wmEvent *event); void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect); #endif /* __WM_EVENT_SYSTEM_H__ */ - |