Cleanup: use const arguments & remove redundant check

This commit is contained in:
Campbell Barton
2024-04-25 12:02:15 +10:00
parent 08b3db500f
commit bc7e7b80fc
4 changed files with 20 additions and 20 deletions
+11 -9
View File
@@ -1964,16 +1964,17 @@ static bool nla_combine_quaternion_get_inverted_strip_values(const float lower_v
/* ---------------------- */
/* Assert necs and necs->channel is nonNull. */
static void nlaevalchan_assert_nonNull(NlaEvalChannelSnapshot *necs)
static void nlaevalchan_assert_nonNull(const NlaEvalChannelSnapshot *necs)
{
UNUSED_VARS_NDEBUG(necs);
BLI_assert(necs != nullptr && necs->channel != nullptr);
}
/* Assert that the channels given can be blended or combined together. */
static void nlaevalchan_assert_blendOrcombine_compatible(NlaEvalChannelSnapshot *lower_necs,
NlaEvalChannelSnapshot *upper_necs,
NlaEvalChannelSnapshot *blended_necs)
static void nlaevalchan_assert_blendOrcombine_compatible(
const NlaEvalChannelSnapshot *lower_necs,
const NlaEvalChannelSnapshot *upper_necs,
const NlaEvalChannelSnapshot *blended_necs)
{
UNUSED_VARS_NDEBUG(lower_necs, upper_necs, blended_necs);
BLI_assert(!ELEM(nullptr, lower_necs, blended_necs));
@@ -2011,7 +2012,7 @@ static void nlaevalchan_assert_blendOrcombine_compatible_quaternion(
BLI_assert(lower_necs->length == 4);
}
static void nlaevalchan_copy_values(NlaEvalChannelSnapshot *dst, NlaEvalChannelSnapshot *src)
static void nlaevalchan_copy_values(NlaEvalChannelSnapshot *dst, const NlaEvalChannelSnapshot *src)
{
memcpy(dst->values, src->values, src->length * sizeof(float));
}
@@ -2020,10 +2021,11 @@ static void nlaevalchan_copy_values(NlaEvalChannelSnapshot *dst, NlaEvalChannelS
* Copies from lower necs to blended necs if upper necs is nullptr or has zero influence.
* \return true if copied.
*/
static bool nlaevalchan_blendOrcombine_try_copy_from_lower(NlaEvalChannelSnapshot *lower_necs,
NlaEvalChannelSnapshot *upper_necs,
const float upper_influence,
NlaEvalChannelSnapshot *r_blended_necs)
static bool nlaevalchan_blendOrcombine_try_copy_from_lower(
const NlaEvalChannelSnapshot *lower_necs,
const NlaEvalChannelSnapshot *upper_necs,
const float upper_influence,
NlaEvalChannelSnapshot *r_blended_necs)
{
const bool has_influence = !IS_EQF(upper_influence, 0.0f);
if (upper_necs != nullptr && has_influence) {
@@ -1128,7 +1128,7 @@ static ExprPyLike_Parsed *driver_compile_simple_expr_impl(ChannelDriver *driver)
return BLI_expr_pylike_parse(driver->expression, names, names_len + VAR_INDEX_CUSTOM);
}
static bool driver_check_simple_expr_depends_on_time(ExprPyLike_Parsed *expr)
static bool driver_check_simple_expr_depends_on_time(const ExprPyLike_Parsed *expr)
{
/* Check if the 'frame' parameter is actually used. */
return BLI_expr_pylike_is_using_param(expr, VAR_INDEX_FRAME);
@@ -224,14 +224,12 @@ static StripDrawContext strip_draw_context_get(TimelineDrawContext *ctx, Sequenc
strip_ctx.missing_media = media_presence_is_missing(scene, seq);
if (seq->type == SEQ_TYPE_META) {
const ListBase *seqbase = &seq->seqbase;
if (seqbase != nullptr) {
LISTBASE_FOREACH (const Sequence *, sub, seqbase) {
if (!SEQ_sequence_has_valid_data(sub)) {
strip_ctx.missing_data_block = true;
}
if (media_presence_is_missing(scene, sub)) {
strip_ctx.missing_media = true;
}
LISTBASE_FOREACH (const Sequence *, sub, seqbase) {
if (!SEQ_sequence_has_valid_data(sub)) {
strip_ctx.missing_data_block = true;
}
if (media_presence_is_missing(scene, sub)) {
strip_ctx.missing_media = true;
}
}
}
+2 -2
View File
@@ -349,8 +349,8 @@ int main(int argc,
#ifdef BUILD_DATE
{
time_t temp_time = build_commit_timestamp;
tm *tm = gmtime(&temp_time);
const time_t temp_time = build_commit_timestamp;
const tm *tm = gmtime(&temp_time);
if (LIKELY(tm)) {
strftime(build_commit_date, sizeof(build_commit_date), "%Y-%m-%d", tm);
strftime(build_commit_time, sizeof(build_commit_time), "%H:%M", tm);