Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-13 05:52:58 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-13 05:52:58 +0400
commitab48f2108bc8ff1dfcc34e2f395debac97be7826 (patch)
tree61cfadffe9a608647265528c9b047bf4d485915e /build_files/cmake/macros.cmake
parent4cb6d5d214529749bbeeb2a63018b2d54ffa3417 (diff)
- cmake macro list_insert_after/list_insert_before now error when the item passed is not found in the list.
- BKE_pose_copy_data() check for target pointer is no longer valid and infact comparing against un-initialized memory in some cases.
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r--build_files/cmake/macros.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 97ce84142e9..317fcf0f120 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -27,7 +27,10 @@ macro(list_insert_after
list_id item_check item_add
)
set(_index)
- list(FIND ${list_id} "${item_check}" _index)
+ list(FIND "${list_id}" "${item_check}" _index)
+ if("${_index}" MATCHES "-1")
+ message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
+ endif()
math(EXPR _index "${_index} + 1")
list(INSERT ${list_id} "${_index}" ${item_add})
unset(_index)
@@ -37,7 +40,10 @@ macro(list_insert_before
list_id item_check item_add
)
set(_index)
- list(FIND ${list_id} "${item_check}" _index)
+ list(FIND "${list_id}" "${item_check}" _index)
+ if("${_index}" MATCHES "-1")
+ message(FATAL_ERROR "'${list_id}' doesn't contain '${item_check}'")
+ endif()
list(INSERT ${list_id} "${_index}" ${item_add})
unset(_index)
endmacro()