From 3336d8d8eede5fbf0ca7f9023101006eab963a53 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Feb 2026 08:58:37 +0000 Subject: [PATCH] Address code review feedback: improve array formatting and extract size constant Co-authored-by: squassina <8495707+squassina@users.noreply.github.com> --- src/animation/common.h | 5 +++-- src/config/preset.h | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/animation/common.h b/src/animation/common.h index ea12a3f9..9ff27df4 100644 --- a/src/animation/common.h +++ b/src/animation/common.h @@ -47,10 +47,11 @@ void init_baked_points(void) { {OPAFADEIN, &baked_points_opafadein}, {OPAFADEOUT, &baked_points_opafadeout}, }; + const size_t num_animation_types = + sizeof(animation_types) / sizeof(animation_types[0]); /* Allocate and calculate baked points for all animation types */ - for (size_t j = 0; j < sizeof(animation_types) / sizeof(animation_types[0]); - j++) { + for (size_t j = 0; j < num_animation_types; j++) { *animation_types[j].points = calloc(BAKED_POINTS_COUNT, sizeof(struct dvec2)); for (int32_t i = 0; i < BAKED_POINTS_COUNT; i++) { diff --git a/src/config/preset.h b/src/config/preset.h index 8522748f..353af572 100644 --- a/src/config/preset.h +++ b/src/config/preset.h @@ -32,20 +32,20 @@ uint32_t animation_duration_open = 400; // Animation open speed uint32_t animation_duration_tag = 300; // Animation tag speed uint32_t animation_duration_close = 300; // Animation close speed uint32_t animation_duration_focus = 0; // Animation focus opacity speed -double animation_curve_move[4] = {0.46, 1.0, 0.29, - 0.99}; // Animation curve for move -double animation_curve_open[4] = {0.46, 1.0, 0.29, - 0.99}; // Animation curve for open -double animation_curve_tag[4] = {0.46, 1.0, 0.29, - 0.99}; // Animation curve for tag -double animation_curve_close[4] = {0.46, 1.0, 0.29, - 0.99}; // Animation curve for close -double animation_curve_focus[4] = {0.46, 1.0, 0.29, - 0.99}; // Animation curve for focus -double animation_curve_opafadein[4] = { - 0.46, 1.0, 0.29, 0.99}; // Animation curve for opacity fade in -double animation_curve_opafadeout[4] = { - 0.5, 0.5, 0.5, 0.5}; // Animation curve for opacity fade out +// Animation curve for move +double animation_curve_move[4] = {0.46, 1.0, 0.29, 0.99}; +// Animation curve for open +double animation_curve_open[4] = {0.46, 1.0, 0.29, 0.99}; +// Animation curve for tag +double animation_curve_tag[4] = {0.46, 1.0, 0.29, 0.99}; +// Animation curve for close +double animation_curve_close[4] = {0.46, 1.0, 0.29, 0.99}; +// Animation curve for focus +double animation_curve_focus[4] = {0.46, 1.0, 0.29, 0.99}; +// Animation curve for opacity fade in +double animation_curve_opafadein[4] = {0.46, 1.0, 0.29, 0.99}; +// Animation curve for opacity fade out +double animation_curve_opafadeout[4] = {0.5, 0.5, 0.5, 0.5}; /* appearance */ uint32_t axis_bind_apply_timeout =