Functions: add asserts to check indices
This commit is contained in:
@@ -393,39 +393,46 @@ inline Params::Params(const LazyFunction &fn,
|
||||
|
||||
inline void *Params::try_get_input_data_ptr(const int index) const
|
||||
{
|
||||
BLI_assert(index >= 0 && index < fn_.inputs().size());
|
||||
return this->try_get_input_data_ptr_impl(index);
|
||||
}
|
||||
|
||||
inline void *Params::try_get_input_data_ptr_or_request(const int index)
|
||||
{
|
||||
BLI_assert(index >= 0 && index < fn_.inputs().size());
|
||||
this->assert_valid_thread();
|
||||
return this->try_get_input_data_ptr_or_request_impl(index);
|
||||
}
|
||||
|
||||
inline void *Params::get_output_data_ptr(const int index)
|
||||
{
|
||||
BLI_assert(index >= 0 && index < fn_.outputs().size());
|
||||
this->assert_valid_thread();
|
||||
return this->get_output_data_ptr_impl(index);
|
||||
}
|
||||
|
||||
inline void Params::output_set(const int index)
|
||||
{
|
||||
BLI_assert(index >= 0 && index < fn_.outputs().size());
|
||||
this->assert_valid_thread();
|
||||
this->output_set_impl(index);
|
||||
}
|
||||
|
||||
inline bool Params::output_was_set(const int index) const
|
||||
{
|
||||
BLI_assert(index >= 0 && index < fn_.outputs().size());
|
||||
return this->output_was_set_impl(index);
|
||||
}
|
||||
|
||||
inline ValueUsage Params::get_output_usage(const int index) const
|
||||
{
|
||||
BLI_assert(index >= 0 && index < fn_.outputs().size());
|
||||
return this->get_output_usage_impl(index);
|
||||
}
|
||||
|
||||
inline void Params::set_input_unused(const int index)
|
||||
{
|
||||
BLI_assert(index >= 0 && index < fn_.inputs().size());
|
||||
this->assert_valid_thread();
|
||||
this->set_input_unused_impl(index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user